Skip to content

Conversation

pxrl
Copy link
Collaborator

@pxrl pxrl commented Jul 28, 2025

Initial WIP to demonstrate a possible way forward.

@@ -5,7 +5,7 @@ import { BigNumber } from "../utils";

const AddressValidator = define<string>("AddressValidator", (v) => ethersUtils.isAddress(String(v)));
const HexValidator = define<string>("HexValidator", (v) => ethersUtils.isHexString(String(v)));
const BigNumberValidator = define<BigNumber>("BigNumberValidator", (v) => BigNumber.isBigNumber(v));
export const BigNumberValidator = define<BigNumber>("BigNumberValidator", (v) => BigNumber.isBigNumber(v));

const V3DepositSchema = object({
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

todo: Refactor to share some definitions with V3DepositSchema. It's unfortunately not composable because it defines all possible fields, but it has the advantage of being more granular in its validation. I would propose to refactor such that it is defined as a product of smaller, composable types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant