/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { AmountDecimal, AmountDecimal$inboundSchema, AmountDecimal$Outbound, AmountDecimal$outboundSchema, } from "./amountdecimal.js"; /** * A detailed breakdown of platform fees. This field is deprecated and will be removed in a future release. Use accountFees. * * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. */ export type PlatformFees = { /** * Fees associated with wallet services. */ walletFee: AmountDecimal; /** * Fees for PCI compliance. */ merchantPCIFee: AmountDecimal; /** * Total platform fees. */ total: AmountDecimal; }; /** @internal */ export const PlatformFees$inboundSchema: z.ZodType< PlatformFees, z.ZodTypeDef, unknown > = z.object({ walletFee: AmountDecimal$inboundSchema, merchantPCIFee: AmountDecimal$inboundSchema, total: AmountDecimal$inboundSchema, }); /** @internal */ export type PlatformFees$Outbound = { walletFee: AmountDecimal$Outbound; merchantPCIFee: AmountDecimal$Outbound; total: AmountDecimal$Outbound; }; /** @internal */ export const PlatformFees$outboundSchema: z.ZodType< PlatformFees$Outbound, z.ZodTypeDef, PlatformFees > = z.object({ walletFee: AmountDecimal$outboundSchema, merchantPCIFee: AmountDecimal$outboundSchema, total: AmountDecimal$outboundSchema, }); export function platformFeesToJSON(platformFees: PlatformFees): string { return JSON.stringify(PlatformFees$outboundSchema.parse(platformFees)); } export function platformFeesFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => PlatformFees$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'PlatformFees' from JSON`, ); }