/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod"; import { remap as remap$ } from "../lib/primitives.js"; import { safeParse } from "../lib/schemas.js"; import { Result as SafeParseResult } from "../types/fp.js"; import { AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount, AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$inboundSchema, AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$Outbound, AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$outboundSchema, } from "./appschemasv2ledgersledgericrc1metadatamintingaccount.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AppSchemasV2LedgersLedgerIcrc1Metadata = { icrc1Fee: string; icrc1Name: string; icrc1Logo?: string | undefined; icrc1Symbol: string; icrc1Decimals: string; icrc1TotalSupply: string; icrc1MaxMemoLength?: string | undefined; icrc1MintingAccount: AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount; }; /** @internal */ export const AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema: z.ZodType< AppSchemasV2LedgersLedgerIcrc1Metadata, z.ZodTypeDef, unknown > = z.object({ icrc1_fee: z.string(), icrc1_name: z.string(), icrc1_logo: z.string().optional(), icrc1_symbol: z.string(), icrc1_decimals: z.string(), icrc1_total_supply: z.string(), icrc1_max_memo_length: z.string().optional(), icrc1_minting_account: AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$inboundSchema, }).transform((v) => { return remap$(v, { "icrc1_fee": "icrc1Fee", "icrc1_name": "icrc1Name", "icrc1_logo": "icrc1Logo", "icrc1_symbol": "icrc1Symbol", "icrc1_decimals": "icrc1Decimals", "icrc1_total_supply": "icrc1TotalSupply", "icrc1_max_memo_length": "icrc1MaxMemoLength", "icrc1_minting_account": "icrc1MintingAccount", }); }); /** @internal */ export type AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound = { icrc1_fee: string; icrc1_name: string; icrc1_logo?: string | undefined; icrc1_symbol: string; icrc1_decimals: string; icrc1_total_supply: string; icrc1_max_memo_length?: string | undefined; icrc1_minting_account: AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$Outbound; }; /** @internal */ export const AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema: z.ZodType< AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound, z.ZodTypeDef, AppSchemasV2LedgersLedgerIcrc1Metadata > = z.object({ icrc1Fee: z.string(), icrc1Name: z.string(), icrc1Logo: z.string().optional(), icrc1Symbol: z.string(), icrc1Decimals: z.string(), icrc1TotalSupply: z.string(), icrc1MaxMemoLength: z.string().optional(), icrc1MintingAccount: AppSchemasV2LedgersLedgerIcrc1MetadataMintingAccount$outboundSchema, }).transform((v) => { return remap$(v, { icrc1Fee: "icrc1_fee", icrc1Name: "icrc1_name", icrc1Logo: "icrc1_logo", icrc1Symbol: "icrc1_symbol", icrc1Decimals: "icrc1_decimals", icrc1TotalSupply: "icrc1_total_supply", icrc1MaxMemoLength: "icrc1_max_memo_length", icrc1MintingAccount: "icrc1_minting_account", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AppSchemasV2LedgersLedgerIcrc1Metadata$ { /** @deprecated use `AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema` instead. */ export const inboundSchema = AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema; /** @deprecated use `AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema` instead. */ export const outboundSchema = AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema; /** @deprecated use `AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound` instead. */ export type Outbound = AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound; } export function appSchemasV2LedgersLedgerIcrc1MetadataToJSON( appSchemasV2LedgersLedgerIcrc1Metadata: AppSchemasV2LedgersLedgerIcrc1Metadata, ): string { return JSON.stringify( AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema.parse( appSchemasV2LedgersLedgerIcrc1Metadata, ), ); } export function appSchemasV2LedgersLedgerIcrc1MetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppSchemasV2LedgersLedgerIcrc1Metadata' from JSON`, ); }