/* * 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 { SDKValidationError } from "./errors/sdkvalidationerror.js"; import { Transaction, Transaction$inboundSchema, Transaction$Outbound, Transaction$outboundSchema, } from "./transaction.js"; export type ListTransactionsResponse = { data: Array; maxTransactionIndex: number; totalTransactions: number; }; /** @internal */ export const ListTransactionsResponse$inboundSchema: z.ZodType< ListTransactionsResponse, z.ZodTypeDef, unknown > = z.object({ data: z.array(Transaction$inboundSchema), max_transaction_index: z.number().int(), total_transactions: z.number().int(), }).transform((v) => { return remap$(v, { "max_transaction_index": "maxTransactionIndex", "total_transactions": "totalTransactions", }); }); /** @internal */ export type ListTransactionsResponse$Outbound = { data: Array; max_transaction_index: number; total_transactions: number; }; /** @internal */ export const ListTransactionsResponse$outboundSchema: z.ZodType< ListTransactionsResponse$Outbound, z.ZodTypeDef, ListTransactionsResponse > = z.object({ data: z.array(Transaction$outboundSchema), maxTransactionIndex: z.number().int(), totalTransactions: z.number().int(), }).transform((v) => { return remap$(v, { maxTransactionIndex: "max_transaction_index", totalTransactions: "total_transactions", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace ListTransactionsResponse$ { /** @deprecated use `ListTransactionsResponse$inboundSchema` instead. */ export const inboundSchema = ListTransactionsResponse$inboundSchema; /** @deprecated use `ListTransactionsResponse$outboundSchema` instead. */ export const outboundSchema = ListTransactionsResponse$outboundSchema; /** @deprecated use `ListTransactionsResponse$Outbound` instead. */ export type Outbound = ListTransactionsResponse$Outbound; } export function listTransactionsResponseToJSON( listTransactionsResponse: ListTransactionsResponse, ): string { return JSON.stringify( ListTransactionsResponse$outboundSchema.parse(listTransactionsResponse), ); } export function listTransactionsResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => ListTransactionsResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'ListTransactionsResponse' from JSON`, ); }