/* * 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 { AppSchemasV2LedgersLedgerCkerc20Contract, AppSchemasV2LedgersLedgerCkerc20Contract$inboundSchema, AppSchemasV2LedgersLedgerCkerc20Contract$Outbound, AppSchemasV2LedgersLedgerCkerc20Contract$outboundSchema, } from "./appschemasv2ledgersledgerckerc20contract.js"; import { AppSchemasV2LedgersLedgerIcrc1Metadata, AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema, AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound, AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema, } from "./appschemasv2ledgersledgericrc1metadata.js"; import { SDKValidationError } from "./errors/sdkvalidationerror.js"; export type AppSchemasV2LedgersLedger = { ledgerCanisterId: string; network: string; tokenType: string; snsRootCanisterId?: string | undefined; ckerc20OrchestratorId?: string | undefined; ckerc20Contract?: AppSchemasV2LedgersLedgerCkerc20Contract | undefined; icrc1Metadata: AppSchemasV2LedgersLedgerIcrc1Metadata; uniqueOwnersCount?: number | undefined; totalTransactionsCountOverPast7d?: number | undefined; totalVolumeOverPast7d?: string | undefined; totalSupply7d?: Array> | undefined; enabled?: boolean | undefined; }; /** @internal */ export const AppSchemasV2LedgersLedger$inboundSchema: z.ZodType< AppSchemasV2LedgersLedger, z.ZodTypeDef, unknown > = z.object({ ledger_canister_id: z.string(), network: z.string(), token_type: z.string(), sns_root_canister_id: z.string().optional(), ckerc20_orchestrator_id: z.string().optional(), ckerc20_contract: AppSchemasV2LedgersLedgerCkerc20Contract$inboundSchema .optional(), icrc1_metadata: AppSchemasV2LedgersLedgerIcrc1Metadata$inboundSchema, unique_owners_count: z.number().int().optional(), total_transactions_count_over_past_7d: z.number().int().optional(), total_volume_over_past_7d: z.string().optional(), total_supply_7d: z.array(z.array(z.number().int())).optional(), enabled: z.boolean().optional(), }).transform((v) => { return remap$(v, { "ledger_canister_id": "ledgerCanisterId", "token_type": "tokenType", "sns_root_canister_id": "snsRootCanisterId", "ckerc20_orchestrator_id": "ckerc20OrchestratorId", "ckerc20_contract": "ckerc20Contract", "icrc1_metadata": "icrc1Metadata", "unique_owners_count": "uniqueOwnersCount", "total_transactions_count_over_past_7d": "totalTransactionsCountOverPast7d", "total_volume_over_past_7d": "totalVolumeOverPast7d", "total_supply_7d": "totalSupply7d", }); }); /** @internal */ export type AppSchemasV2LedgersLedger$Outbound = { ledger_canister_id: string; network: string; token_type: string; sns_root_canister_id?: string | undefined; ckerc20_orchestrator_id?: string | undefined; ckerc20_contract?: | AppSchemasV2LedgersLedgerCkerc20Contract$Outbound | undefined; icrc1_metadata: AppSchemasV2LedgersLedgerIcrc1Metadata$Outbound; unique_owners_count?: number | undefined; total_transactions_count_over_past_7d?: number | undefined; total_volume_over_past_7d?: string | undefined; total_supply_7d?: Array> | undefined; enabled?: boolean | undefined; }; /** @internal */ export const AppSchemasV2LedgersLedger$outboundSchema: z.ZodType< AppSchemasV2LedgersLedger$Outbound, z.ZodTypeDef, AppSchemasV2LedgersLedger > = z.object({ ledgerCanisterId: z.string(), network: z.string(), tokenType: z.string(), snsRootCanisterId: z.string().optional(), ckerc20OrchestratorId: z.string().optional(), ckerc20Contract: AppSchemasV2LedgersLedgerCkerc20Contract$outboundSchema .optional(), icrc1Metadata: AppSchemasV2LedgersLedgerIcrc1Metadata$outboundSchema, uniqueOwnersCount: z.number().int().optional(), totalTransactionsCountOverPast7d: z.number().int().optional(), totalVolumeOverPast7d: z.string().optional(), totalSupply7d: z.array(z.array(z.number().int())).optional(), enabled: z.boolean().optional(), }).transform((v) => { return remap$(v, { ledgerCanisterId: "ledger_canister_id", tokenType: "token_type", snsRootCanisterId: "sns_root_canister_id", ckerc20OrchestratorId: "ckerc20_orchestrator_id", ckerc20Contract: "ckerc20_contract", icrc1Metadata: "icrc1_metadata", uniqueOwnersCount: "unique_owners_count", totalTransactionsCountOverPast7d: "total_transactions_count_over_past_7d", totalVolumeOverPast7d: "total_volume_over_past_7d", totalSupply7d: "total_supply_7d", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AppSchemasV2LedgersLedger$ { /** @deprecated use `AppSchemasV2LedgersLedger$inboundSchema` instead. */ export const inboundSchema = AppSchemasV2LedgersLedger$inboundSchema; /** @deprecated use `AppSchemasV2LedgersLedger$outboundSchema` instead. */ export const outboundSchema = AppSchemasV2LedgersLedger$outboundSchema; /** @deprecated use `AppSchemasV2LedgersLedger$Outbound` instead. */ export type Outbound = AppSchemasV2LedgersLedger$Outbound; } export function appSchemasV2LedgersLedgerToJSON( appSchemasV2LedgersLedger: AppSchemasV2LedgersLedger, ): string { return JSON.stringify( AppSchemasV2LedgersLedger$outboundSchema.parse(appSchemasV2LedgersLedger), ); } export function appSchemasV2LedgersLedgerFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AppSchemasV2LedgersLedger$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AppSchemasV2LedgersLedger' from JSON`, ); }