/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v4-mini"; import { remap as remap$ } from "../lib/primitives.js"; 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 { LineItem, LineItem$inboundSchema } from "./line-item.js"; export type ReceiptBody = { subject?: string | undefined; lineItems?: Array | undefined; /** * Non-negative integer amount in USDC atomic units. */ providerAmountWei?: string | undefined; /** * Non-negative integer amount in USDC atomic units. */ platformFeeWei?: string | undefined; /** * Non-negative integer amount in USDC atomic units. */ finalAmountWei?: string | undefined; txHash?: string | undefined; network?: string | undefined; settledAt?: number | undefined; [additionalProperties: string]: unknown; }; /** @internal */ export const ReceiptBody$inboundSchema: z.ZodMiniType = z .pipe( z.catchall( z.object({ subject: types.optional(types.string()), line_items: types.optional(z.array(LineItem$inboundSchema)), provider_amount_wei: types.optional(types.string()), platform_fee_wei: types.optional(types.string()), final_amount_wei: types.optional(types.string()), tx_hash: types.optional(types.string()), network: types.optional(types.string()), settled_at: types.optional(types.number()), }), z.any(), ), z.transform((v) => { return remap$(v, { "line_items": "lineItems", "provider_amount_wei": "providerAmountWei", "platform_fee_wei": "platformFeeWei", "final_amount_wei": "finalAmountWei", "tx_hash": "txHash", "settled_at": "settledAt", }); }), ); export function receiptBodyFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ReceiptBody$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ReceiptBody' from JSON`, ); }