/* * 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"; export type CreateWallet = { /** * Name of the wallet. */ name: string; /** * Description of the wallet. */ description?: string | undefined; /** * Free-form key-value pair list. Useful for storing information that is not captured elsewhere. */ metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const CreateWallet$inboundSchema: z.ZodType< CreateWallet, z.ZodTypeDef, unknown > = z.object({ name: z.string(), description: z.string().optional(), metadata: z.record(z.string()).optional(), }); /** @internal */ export type CreateWallet$Outbound = { name: string; description?: string | undefined; metadata?: { [k: string]: string } | undefined; }; /** @internal */ export const CreateWallet$outboundSchema: z.ZodType< CreateWallet$Outbound, z.ZodTypeDef, CreateWallet > = z.object({ name: z.string(), description: z.string().optional(), metadata: z.record(z.string()).optional(), }); export function createWalletToJSON(createWallet: CreateWallet): string { return JSON.stringify(CreateWallet$outboundSchema.parse(createWallet)); } export function createWalletFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => CreateWallet$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'CreateWallet' from JSON`, ); }