/* * 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 "./sdk-validation-error.js"; import { WalletConfigPriceType, WalletConfigPriceType$inboundSchema, WalletConfigPriceType$outboundSchema, } from "./wallet-config-price-type.js"; export type WalletConfig = { /** * AllowedPriceTypes is a list of price types that are allowed for the wallet * * @remarks * nil means all price types are allowed */ allowedPriceTypes?: Array | undefined; }; /** @internal */ export const WalletConfig$inboundSchema: z.ZodMiniType = z.pipe( z.object({ allowed_price_types: types.optional( z.array(WalletConfigPriceType$inboundSchema), ), }), z.transform((v) => { return remap$(v, { "allowed_price_types": "allowedPriceTypes", }); }), ); /** @internal */ export type WalletConfig$Outbound = { allowed_price_types?: Array | undefined; }; /** @internal */ export const WalletConfig$outboundSchema: z.ZodMiniType< WalletConfig$Outbound, WalletConfig > = z.pipe( z.object({ allowedPriceTypes: z.optional( z.array(WalletConfigPriceType$outboundSchema), ), }), z.transform((v) => { return remap$(v, { allowedPriceTypes: "allowed_price_types", }); }), ); export function walletConfigToJSON(walletConfig: WalletConfig): string { return JSON.stringify(WalletConfig$outboundSchema.parse(walletConfig)); } export function walletConfigFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WalletConfig$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WalletConfig' from JSON`, ); }