/* * 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 { AppSchemasLedgersLedgerIcrc1MetadataMintingAccount, AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$inboundSchema, AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$Outbound, AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$outboundSchema, } from "./appschemasledgersledgericrc1metadatamintingaccount.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AppSchemasLedgersLedgerIcrc1Metadata = { icrc1Fee: string; icrc1Name: string; icrc1Logo?: string | undefined; icrc1Symbol: string; icrc1Decimals: string; icrc1TotalSupply: string; icrc1MaxMemoLength?: string | undefined; icrc1MintingAccount: AppSchemasLedgersLedgerIcrc1MetadataMintingAccount; }; /** @internal */ export const AppSchemasLedgersLedgerIcrc1Metadata$inboundSchema: z.ZodType< AppSchemasLedgersLedgerIcrc1Metadata, 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: AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$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 AppSchemasLedgersLedgerIcrc1Metadata$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: AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$Outbound; }; /** @internal */ export const AppSchemasLedgersLedgerIcrc1Metadata$outboundSchema: z.ZodType< AppSchemasLedgersLedgerIcrc1Metadata$Outbound, z.ZodTypeDef, AppSchemasLedgersLedgerIcrc1Metadata > = 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: AppSchemasLedgersLedgerIcrc1MetadataMintingAccount$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 AppSchemasLedgersLedgerIcrc1Metadata$ { /** @deprecated use `AppSchemasLedgersLedgerIcrc1Metadata$inboundSchema` instead. */ export const inboundSchema = AppSchemasLedgersLedgerIcrc1Metadata$inboundSchema; /** @deprecated use `AppSchemasLedgersLedgerIcrc1Metadata$outboundSchema` instead. */ export const outboundSchema = AppSchemasLedgersLedgerIcrc1Metadata$outboundSchema; /** @deprecated use `AppSchemasLedgersLedgerIcrc1Metadata$Outbound` instead. */ export type Outbound = AppSchemasLedgersLedgerIcrc1Metadata$Outbound; } export function appSchemasLedgersLedgerIcrc1MetadataToJSON( appSchemasLedgersLedgerIcrc1Metadata: AppSchemasLedgersLedgerIcrc1Metadata, ): string { return JSON.stringify( AppSchemasLedgersLedgerIcrc1Metadata$outboundSchema.parse( appSchemasLedgersLedgerIcrc1Metadata, ), ); } export function appSchemasLedgersLedgerIcrc1MetadataFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppSchemasLedgersLedgerIcrc1Metadata$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppSchemasLedgersLedgerIcrc1Metadata' from JSON`, ); }