/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { PaymentRequirements, PaymentRequirements$Outbound, PaymentRequirements$outboundSchema, } from "./payment-requirements.js"; import { ResourceProperties, ResourceProperties$Outbound, ResourceProperties$outboundSchema, } from "./resource-properties.js"; export type PaymentPayload = { x402Version: 2; accepted: PaymentRequirements; /** * Scheme-specific signed authorization payload. */ payload: any; resource?: ResourceProperties | undefined; extensions?: { [k: string]: any } | null | undefined; }; /** @internal */ export type PaymentPayload$Outbound = { x402Version: 2; accepted: PaymentRequirements$Outbound; payload: any; resource?: ResourceProperties$Outbound | undefined; extensions?: { [k: string]: any } | null | undefined; }; /** @internal */ export const PaymentPayload$outboundSchema: z.ZodMiniType< PaymentPayload$Outbound, PaymentPayload > = z.object({ x402Version: z.literal(2), accepted: PaymentRequirements$outboundSchema, payload: z.any(), resource: z.optional(ResourceProperties$outboundSchema), extensions: z.optional(z.nullable(z.record(z.string(), z.any()))), }); export function paymentPayloadToJSON(paymentPayload: PaymentPayload): string { return JSON.stringify(PaymentPayload$outboundSchema.parse(paymentPayload)); }