/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import * as types from "../types/primitives.js"; import { SDKValidationError } from "./errors/sdk-validation-error.js"; import { PaymentIntentStatus, PaymentIntentStatus$inboundSchema, } from "./payment-intent-status.js"; export type PaymentSettleResponse = { paymentIntentId: string; network: string; /** * Non-negative integer amount in USDC atomic units. */ maxAmountWei: string; /** * Non-negative integer amount in USDC atomic units. */ finalAmountWei: string; status: PaymentIntentStatus; meterSubject?: string | undefined; lineItems?: Array<{ [k: string]: any }> | undefined; /** * Non-negative integer amount in USDC atomic units. */ providerAmountWei?: string | undefined; /** * Non-negative integer amount in USDC atomic units. */ platformFeeWei?: string | undefined; txHash?: string | undefined; confirmedAt?: number | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const PaymentSettleResponse$inboundSchema: z.ZodMiniType< PaymentSettleResponse, unknown > = z.catchall( z.object({ paymentIntentId: types.string(), network: types.string(), maxAmountWei: types.string(), finalAmountWei: types.string(), status: PaymentIntentStatus$inboundSchema, meterSubject: types.optional(types.string()), lineItems: types.optional(z.array(z.record(z.string(), z.any()))), providerAmountWei: types.optional(types.string()), platformFeeWei: types.optional(types.string()), txHash: types.optional(types.string()), confirmedAt: types.optional(types.number()), }), z.any(), ); export function paymentSettleResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PaymentSettleResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PaymentSettleResponse' from JSON`, ); }