/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import * as openEnums from "../types/enums.js"; import { OpenEnum } from "../types/enums.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; export const Scheme = { Exact: "exact", Upto: "upto", } as const; export type Scheme = OpenEnum; export type PaymentRequirements = { scheme: Scheme; network: string; /** * Non-negative integer amount in USDC atomic units. */ amount: string; asset: string; payTo: string; maxTimeoutSeconds: number; extra?: { [k: string]: any } | null | undefined; }; /** @internal */ export const Scheme$inboundSchema: z.ZodMiniType = openEnums .inboundSchema(Scheme); /** @internal */ export const PaymentRequirements$inboundSchema: z.ZodMiniType< PaymentRequirements, unknown > = z.object({ scheme: Scheme$inboundSchema, network: types.string(), amount: types.string(), asset: types.string(), payTo: types.string(), maxTimeoutSeconds: types.number(), extra: z.optional(z.nullable(z.record(z.string(), z.any()))), }); export function paymentRequirementsFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentRequirements$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentRequirements' from JSON`, ); }