/* * 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 { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export const ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind = { Mint: "mint", Burn: "burn", Transfer: "transfer", } as const; export type ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind = ClosedEnum; export type ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest = { ledgerCanisterId: string; offset?: number | undefined; limit?: number | undefined; maxBlockIndex?: number | undefined; includeKind?: | Array | undefined; /** * Available values : index, -index, amount, -amount, timestamp, -timestamp, kind, -kind */ sortBy?: Array | undefined; }; /** @internal */ export const ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$inboundSchema: z.ZodNativeEnum< typeof ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind > = z.nativeEnum(ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind); /** @internal */ export const ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$outboundSchema: z.ZodNativeEnum< typeof ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind > = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$inboundSchema; /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$ { /** @deprecated use `ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$inboundSchema` instead. */ export const inboundSchema = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$inboundSchema; /** @deprecated use `ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$outboundSchema` instead. */ export const outboundSchema = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$outboundSchema; } /** @internal */ export const ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$inboundSchema: z.ZodType< ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest, z.ZodTypeDef, unknown > = z.object({ ledger_canister_id: z.string(), offset: z.number().int().default(0), limit: z.number().int().default(20), max_block_index: z.number().int().optional(), include_kind: z.array( ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$inboundSchema, ).optional(), sort_by: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { "ledger_canister_id": "ledgerCanisterId", "max_block_index": "maxBlockIndex", "include_kind": "includeKind", "sort_by": "sortBy", }); }); /** @internal */ export type ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$Outbound = { ledger_canister_id: string; offset: number; limit: number; max_block_index?: number | undefined; include_kind?: Array | undefined; sort_by?: Array | undefined; }; /** @internal */ export const ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$outboundSchema: z.ZodType< ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$Outbound, z.ZodTypeDef, ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest > = z.object({ ledgerCanisterId: z.string(), offset: z.number().int().default(0), limit: z.number().int().default(20), maxBlockIndex: z.number().int().optional(), includeKind: z.array( ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetIncludeKind$outboundSchema, ).optional(), sortBy: z.array(z.string()).optional(), }).transform((v) => { return remap$(v, { ledgerCanisterId: "ledger_canister_id", maxBlockIndex: "max_block_index", includeKind: "include_kind", sortBy: "sort_by", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$ { /** @deprecated use `ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$inboundSchema` instead. */ export const inboundSchema = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$inboundSchema; /** @deprecated use `ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$outboundSchema` instead. */ export const outboundSchema = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$outboundSchema; /** @deprecated use `ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$Outbound` instead. */ export type Outbound = ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$Outbound; } export function listBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequestToJSON( listBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest: ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest, ): string { return JSON.stringify( ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$outboundSchema.parse( listBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest, ), ); } export function listBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequestFromJSON( jsonString: string, ): SafeParseResult< ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest, SDKValidationError > { return safeParse( jsonString, (x) => ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest$inboundSchema .parse(JSON.parse(x)), `Failed to parse 'ListBlocksApiV1LedgersLedgerCanisterIdBlocksGetRequest' from JSON`, ); }