UNPKG

@macalinao/zod-solana

Version:

Zod schemas for Solana types with @solana/kit integration

12 lines (11 loc) 429 B
import { U32_MAX } from "./constants.js"; import * as z from "zod"; //#region src/u32-schema.ts /** * A Zod schema for u32 values. * Validates that a number is between 0 and 4294967295 (inclusive). */ const u32Schema = z.number().int("Value must be an integer").min(0, "Value must be at least 0").max(U32_MAX, `Value must be at most ${String(U32_MAX)}`); //#endregion export { u32Schema }; //# sourceMappingURL=u32-schema.js.map