@macalinao/zod-solana
Version:
Zod schemas for Solana types with @solana/kit integration
12 lines (11 loc) • 394 B
JavaScript
import { U64_MAX } from "./constants.js";
import * as z from "zod";
//#region src/u64-schema.ts
/**
* A Zod schema for u64 values.
* Validates that a bigint is between 0 and 2^64-1 (inclusive).
*/
const u64Schema = z.bigint().min(0n, "Value must be at least 0").max(U64_MAX, `Value must be at most ${String(U64_MAX)}`);
//#endregion
export { u64Schema };
//# sourceMappingURL=u64-schema.js.map