I'm parsing input in TypeScript using zod, and attempting to replace the following interface with a zod type:
interface args {
quantity: number;
hugeNum: BigNumber;
}
Declaring this with zod, I get:
const numConstraints = z.number().min(1);
const parsedPriceType = z.bigint().optional();
const zArgs = z.object({
quantity: numConstraints,
parsedPrice?: parsedPriceType,
});
export type myArgs = z.infer<typeof zArgs>;
However, compiling this I get the following error:
Types of property 'parsedPrice' are incompatible.
Type 'BigNumber' is not assignable to type 'bigint'.
Is there a BigNumber
equivalent in zod that I can use? Or is this a lost cause?