/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { WalletAvailableBalance, WalletAvailableBalance$inboundSchema, WalletAvailableBalance$Outbound, WalletAvailableBalance$outboundSchema, } from "./walletavailablebalance.js"; import { WalletTransactionStatus, WalletTransactionStatus$inboundSchema, WalletTransactionStatus$outboundSchema, } from "./wallettransactionstatus.js"; export type WebhookDataWalletTransactionUpdated = { accountID: string; walletID: string; transactionID: string; status: WalletTransactionStatus; availableBalance?: WalletAvailableBalance | undefined; }; /** @internal */ export const WebhookDataWalletTransactionUpdated$inboundSchema: z.ZodType< WebhookDataWalletTransactionUpdated, z.ZodTypeDef, unknown > = z.object({ accountID: z.string(), walletID: z.string(), transactionID: z.string(), status: WalletTransactionStatus$inboundSchema, availableBalance: WalletAvailableBalance$inboundSchema.optional(), }); /** @internal */ export type WebhookDataWalletTransactionUpdated$Outbound = { accountID: string; walletID: string; transactionID: string; status: string; availableBalance?: WalletAvailableBalance$Outbound | undefined; }; /** @internal */ export const WebhookDataWalletTransactionUpdated$outboundSchema: z.ZodType< WebhookDataWalletTransactionUpdated$Outbound, z.ZodTypeDef, WebhookDataWalletTransactionUpdated > = z.object({ accountID: z.string(), walletID: z.string(), transactionID: z.string(), status: WalletTransactionStatus$outboundSchema, availableBalance: WalletAvailableBalance$outboundSchema.optional(), }); export function webhookDataWalletTransactionUpdatedToJSON( webhookDataWalletTransactionUpdated: WebhookDataWalletTransactionUpdated, ): string { return JSON.stringify( WebhookDataWalletTransactionUpdated$outboundSchema.parse( webhookDataWalletTransactionUpdated, ), ); } export function webhookDataWalletTransactionUpdatedFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => WebhookDataWalletTransactionUpdated$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'WebhookDataWalletTransactionUpdated' from JSON`, ); }