@fiatconnect/fiatconnect-types
Advanced tools
Comparing version 12.0.1 to 13.0.0
@@ -19,23 +19,5 @@ import { z } from 'zod'; | ||
export declare const transferStatusSchema: z.ZodNativeEnum<typeof TransferStatus>; | ||
export declare enum TransferInStatusPreTx { | ||
TransferStarted = "TransferStarted", | ||
TransferFiatFundsDebited = "TransferFiatFundsDebited", | ||
TransferReceivedFiatFunds = "TransferReceivedFiatFunds", | ||
TransferFailed = "TransferFailed" | ||
} | ||
export declare const transferInStatusPreTxSchema: z.ZodNativeEnum<typeof TransferInStatusPreTx>; | ||
export declare enum TransferInStatusPostTx { | ||
TransferSendingCryptoFunds = "TransferSendingCryptoFunds", | ||
TransferComplete = "TransferComplete" | ||
} | ||
export declare const transferInStatusPostTxSchema: z.ZodNativeEnum<typeof TransferInStatusPostTx>; | ||
export declare enum TransferOutStatus { | ||
TransferStarted = "TransferStarted", | ||
TransferAmlFailed = "TransferAmlFailed", | ||
TransferReadyForUserToSendCryptoFunds = "TransferReadyForUserToSendCryptoFunds", | ||
TransferReceivedCryptoFunds = "TransferReceivedCryptoFunds", | ||
TransferComplete = "TransferComplete", | ||
TransferFailed = "TransferFailed" | ||
} | ||
export declare const transferOutStatusSchema: z.ZodNativeEnum<typeof TransferOutStatus>; | ||
export declare const transferInStatusPreTxSchema: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferFiatFundsDebited, TransferStatus.TransferReceivedFiatFunds, TransferStatus.TransferFailed]>; | ||
export declare const transferInStatusPostTxSchema: z.ZodEnum<[TransferStatus.TransferSendingCryptoFunds, TransferStatus.TransferComplete]>; | ||
export declare const transferOutStatusSchema: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferAmlFailed, TransferStatus.TransferReadyForUserToSendCryptoFunds, TransferStatus.TransferReceivedCryptoFunds, TransferStatus.TransferComplete, TransferStatus.TransferFailed]>; | ||
export declare const transferRequestBodySchema: z.ZodObject<{ | ||
@@ -75,3 +57,3 @@ fiatAccountId: z.ZodString; | ||
export declare const transferInStatusResponseSchema: z.ZodUnion<[z.ZodObject<{ | ||
status: z.ZodNativeEnum<typeof TransferInStatusPreTx>; | ||
status: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferFiatFundsDebited, TransferStatus.TransferReceivedFiatFunds, TransferStatus.TransferFailed]>; | ||
transferType: z.ZodLiteral<TransferType.TransferIn>; | ||
@@ -87,3 +69,3 @@ fiatType: z.ZodNativeEnum<typeof import("./common").FiatType>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferInStatusPreTx; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferFiatFundsDebited | TransferStatus.TransferReceivedFiatFunds | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -99,3 +81,3 @@ transferId: string; | ||
}, { | ||
status: TransferInStatusPreTx; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferFiatFundsDebited | TransferStatus.TransferReceivedFiatFunds | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -120,6 +102,6 @@ transferId: string; | ||
fee: z.ZodOptional<z.ZodString>; | ||
status: z.ZodNativeEnum<typeof TransferInStatusPostTx>; | ||
status: z.ZodEnum<[TransferStatus.TransferSendingCryptoFunds, TransferStatus.TransferComplete]>; | ||
txHash: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferInStatusPostTx; | ||
status: TransferStatus.TransferSendingCryptoFunds | TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -136,3 +118,3 @@ transferId: string; | ||
}, { | ||
status: TransferInStatusPostTx; | ||
status: TransferStatus.TransferSendingCryptoFunds | TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -159,5 +141,5 @@ transferId: string; | ||
transferType: z.ZodLiteral<TransferType.TransferOut>; | ||
status: z.ZodNativeEnum<typeof TransferOutStatus>; | ||
status: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferAmlFailed, TransferStatus.TransferReadyForUserToSendCryptoFunds, TransferStatus.TransferReceivedCryptoFunds, TransferStatus.TransferComplete, TransferStatus.TransferFailed]>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferOutStatus; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferAmlFailed | TransferStatus.TransferReadyForUserToSendCryptoFunds | TransferStatus.TransferReceivedCryptoFunds | TransferStatus.TransferComplete | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -173,3 +155,3 @@ transferId: string; | ||
}, { | ||
status: TransferOutStatus; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferAmlFailed | TransferStatus.TransferReadyForUserToSendCryptoFunds | TransferStatus.TransferReceivedCryptoFunds | TransferStatus.TransferComplete | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -186,3 +168,3 @@ transferId: string; | ||
export declare const transferStatusResponseSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{ | ||
status: z.ZodNativeEnum<typeof TransferInStatusPreTx>; | ||
status: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferFiatFundsDebited, TransferStatus.TransferReceivedFiatFunds, TransferStatus.TransferFailed]>; | ||
transferType: z.ZodLiteral<TransferType.TransferIn>; | ||
@@ -198,3 +180,3 @@ fiatType: z.ZodNativeEnum<typeof import("./common").FiatType>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferInStatusPreTx; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferFiatFundsDebited | TransferStatus.TransferReceivedFiatFunds | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -210,3 +192,3 @@ transferId: string; | ||
}, { | ||
status: TransferInStatusPreTx; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferFiatFundsDebited | TransferStatus.TransferReceivedFiatFunds | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -231,6 +213,6 @@ transferId: string; | ||
fee: z.ZodOptional<z.ZodString>; | ||
status: z.ZodNativeEnum<typeof TransferInStatusPostTx>; | ||
status: z.ZodEnum<[TransferStatus.TransferSendingCryptoFunds, TransferStatus.TransferComplete]>; | ||
txHash: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferInStatusPostTx; | ||
status: TransferStatus.TransferSendingCryptoFunds | TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -247,3 +229,3 @@ transferId: string; | ||
}, { | ||
status: TransferInStatusPostTx; | ||
status: TransferStatus.TransferSendingCryptoFunds | TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -269,5 +251,5 @@ transferId: string; | ||
transferType: z.ZodLiteral<TransferType.TransferOut>; | ||
status: z.ZodNativeEnum<typeof TransferOutStatus>; | ||
status: z.ZodEnum<[TransferStatus.TransferStarted, TransferStatus.TransferAmlFailed, TransferStatus.TransferReadyForUserToSendCryptoFunds, TransferStatus.TransferReceivedCryptoFunds, TransferStatus.TransferComplete, TransferStatus.TransferFailed]>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: TransferOutStatus; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferAmlFailed | TransferStatus.TransferReadyForUserToSendCryptoFunds | TransferStatus.TransferReceivedCryptoFunds | TransferStatus.TransferComplete | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -283,3 +265,3 @@ transferId: string; | ||
}, { | ||
status: TransferOutStatus; | ||
status: TransferStatus.TransferStarted | TransferStatus.TransferAmlFailed | TransferStatus.TransferReadyForUserToSendCryptoFunds | TransferStatus.TransferReceivedCryptoFunds | TransferStatus.TransferComplete | TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -286,0 +268,0 @@ transferId: string; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.transferStatusResponseSchema = exports.transferOutStatusResponseSchema = exports.transferInStatusResponseSchema = exports.transferStatusRequestParamsSchema = exports.transferResponseSchema = exports.transferRequestBodySchema = exports.transferOutStatusSchema = exports.TransferOutStatus = exports.transferInStatusPostTxSchema = exports.TransferInStatusPostTx = exports.transferInStatusPreTxSchema = exports.TransferInStatusPreTx = exports.transferStatusSchema = exports.TransferStatus = exports.transferTypeSchema = exports.TransferType = void 0; | ||
exports.transferStatusResponseSchema = exports.transferOutStatusResponseSchema = exports.transferInStatusResponseSchema = exports.transferStatusRequestParamsSchema = exports.transferResponseSchema = exports.transferRequestBodySchema = exports.transferOutStatusSchema = exports.transferInStatusPostTxSchema = exports.transferInStatusPreTxSchema = exports.transferStatusSchema = exports.TransferStatus = exports.transferTypeSchema = exports.TransferType = void 0; | ||
const zod_1 = require("zod"); | ||
@@ -30,3 +30,3 @@ const fiat_account_1 = require("./fiat-account"); | ||
}); | ||
// These enums are first segmented between transfers in and transfers out | ||
// Transfer status schemas are first segmented between transfers in and transfers out | ||
// since they both allow a slightly different set of statuses. | ||
@@ -37,30 +37,21 @@ // Transfer in statuses are further segmented, since once a transfer in | ||
// us to encode those semantics into Zod schemas. | ||
var TransferInStatusPreTx; | ||
(function (TransferInStatusPreTx) { | ||
TransferInStatusPreTx["TransferStarted"] = "TransferStarted"; | ||
TransferInStatusPreTx["TransferFiatFundsDebited"] = "TransferFiatFundsDebited"; | ||
TransferInStatusPreTx["TransferReceivedFiatFunds"] = "TransferReceivedFiatFunds"; | ||
TransferInStatusPreTx["TransferFailed"] = "TransferFailed"; | ||
})(TransferInStatusPreTx = exports.TransferInStatusPreTx || (exports.TransferInStatusPreTx = {})); | ||
exports.transferInStatusPreTxSchema = zod_1.z.nativeEnum(TransferInStatusPreTx, { | ||
exports.transferInStatusPreTxSchema = zod_1.z.enum([ | ||
TransferStatus.TransferStarted, | ||
TransferStatus.TransferFiatFundsDebited, | ||
TransferStatus.TransferReceivedFiatFunds, | ||
TransferStatus.TransferFailed, | ||
], { | ||
description: 'transferInStatusPreTxSchema', | ||
}); | ||
var TransferInStatusPostTx; | ||
(function (TransferInStatusPostTx) { | ||
TransferInStatusPostTx["TransferSendingCryptoFunds"] = "TransferSendingCryptoFunds"; | ||
TransferInStatusPostTx["TransferComplete"] = "TransferComplete"; | ||
})(TransferInStatusPostTx = exports.TransferInStatusPostTx || (exports.TransferInStatusPostTx = {})); | ||
exports.transferInStatusPostTxSchema = zod_1.z.nativeEnum(TransferInStatusPostTx, { | ||
exports.transferInStatusPostTxSchema = zod_1.z.enum([TransferStatus.TransferSendingCryptoFunds, TransferStatus.TransferComplete], { | ||
description: 'transferInStatusPostTxSchema', | ||
}); | ||
var TransferOutStatus; | ||
(function (TransferOutStatus) { | ||
TransferOutStatus["TransferStarted"] = "TransferStarted"; | ||
TransferOutStatus["TransferAmlFailed"] = "TransferAmlFailed"; | ||
TransferOutStatus["TransferReadyForUserToSendCryptoFunds"] = "TransferReadyForUserToSendCryptoFunds"; | ||
TransferOutStatus["TransferReceivedCryptoFunds"] = "TransferReceivedCryptoFunds"; | ||
TransferOutStatus["TransferComplete"] = "TransferComplete"; | ||
TransferOutStatus["TransferFailed"] = "TransferFailed"; | ||
})(TransferOutStatus = exports.TransferOutStatus || (exports.TransferOutStatus = {})); | ||
exports.transferOutStatusSchema = zod_1.z.nativeEnum(TransferOutStatus, { | ||
exports.transferOutStatusSchema = zod_1.z.enum([ | ||
TransferStatus.TransferStarted, | ||
TransferStatus.TransferAmlFailed, | ||
TransferStatus.TransferReadyForUserToSendCryptoFunds, | ||
TransferStatus.TransferReceivedCryptoFunds, | ||
TransferStatus.TransferComplete, | ||
TransferStatus.TransferFailed, | ||
], { | ||
description: 'transferOutStatusSchema', | ||
@@ -67,0 +58,0 @@ }); |
@@ -26,3 +26,3 @@ import { z } from 'zod'; | ||
payload: z.ZodUnion<[z.ZodObject<{ | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferInStatusPreTx>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferStarted, import("./transfer").TransferStatus.TransferFiatFundsDebited, import("./transfer").TransferStatus.TransferReceivedFiatFunds, import("./transfer").TransferStatus.TransferFailed]>; | ||
transferType: z.ZodLiteral<import("./transfer").TransferType.TransferIn>; | ||
@@ -38,3 +38,3 @@ fiatType: z.ZodNativeEnum<typeof import("./common").FiatType>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferInStatusPreTx; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -50,3 +50,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferInStatusPreTx; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -71,6 +71,6 @@ transferId: string; | ||
fee: z.ZodOptional<z.ZodString>; | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferInStatusPostTx>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferSendingCryptoFunds, import("./transfer").TransferStatus.TransferComplete]>; | ||
txHash: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -87,3 +87,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -102,4 +102,4 @@ transferId: string; | ||
eventType: WebhookEventType.TransferInStatusEvent; | ||
payload: ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
payload: { | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -115,3 +115,3 @@ transferId: string; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -127,30 +127,7 @@ transferId: string; | ||
fee?: string | undefined; | ||
}) & ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
fee?: string | undefined; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
txHash: string; | ||
fee?: string | undefined; | ||
} | undefined); | ||
}; | ||
}, { | ||
eventType: WebhookEventType.TransferInStatusEvent; | ||
payload: ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
payload: { | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -166,3 +143,3 @@ transferId: string; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -178,26 +155,3 @@ transferId: string; | ||
fee?: string | undefined; | ||
}) & ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
fee?: string | undefined; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
txHash: string; | ||
fee?: string | undefined; | ||
} | undefined); | ||
}; | ||
}>>; | ||
@@ -232,5 +186,5 @@ export type WebhookRequestBodyTransferIn = z.infer<typeof webhookRequestBodyTransferInSchema>; | ||
transferType: z.ZodLiteral<import("./transfer").TransferType.TransferOut>; | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferOutStatus>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferStarted, import("./transfer").TransferStatus.TransferAmlFailed, import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds, import("./transfer").TransferStatus.TransferReceivedCryptoFunds, import("./transfer").TransferStatus.TransferComplete, import("./transfer").TransferStatus.TransferFailed]>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -246,3 +200,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -261,3 +215,3 @@ transferId: string; | ||
payload: { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -276,3 +230,3 @@ transferId: string; | ||
payload: { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -349,3 +303,3 @@ transferId: string; | ||
payload: z.ZodUnion<[z.ZodObject<{ | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferInStatusPreTx>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferStarted, import("./transfer").TransferStatus.TransferFiatFundsDebited, import("./transfer").TransferStatus.TransferReceivedFiatFunds, import("./transfer").TransferStatus.TransferFailed]>; | ||
transferType: z.ZodLiteral<import("./transfer").TransferType.TransferIn>; | ||
@@ -361,3 +315,3 @@ fiatType: z.ZodNativeEnum<typeof import("./common").FiatType>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferInStatusPreTx; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -373,3 +327,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferInStatusPreTx; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -394,6 +348,6 @@ transferId: string; | ||
fee: z.ZodOptional<z.ZodString>; | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferInStatusPostTx>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferSendingCryptoFunds, import("./transfer").TransferStatus.TransferComplete]>; | ||
txHash: z.ZodString; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -410,3 +364,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -425,4 +379,4 @@ transferId: string; | ||
eventType: WebhookEventType.TransferInStatusEvent; | ||
payload: ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
payload: { | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -438,3 +392,3 @@ transferId: string; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -450,30 +404,7 @@ transferId: string; | ||
fee?: string | undefined; | ||
}) & ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
fee?: string | undefined; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
txHash: string; | ||
fee?: string | undefined; | ||
} | undefined); | ||
}; | ||
}, { | ||
eventType: WebhookEventType.TransferInStatusEvent; | ||
payload: ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
payload: { | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferFiatFundsDebited | import("./transfer").TransferStatus.TransferReceivedFiatFunds | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -489,3 +420,3 @@ transferId: string; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
status: import("./transfer").TransferStatus.TransferSendingCryptoFunds | import("./transfer").TransferStatus.TransferComplete; | ||
fiatAccountId: string; | ||
@@ -501,26 +432,3 @@ transferId: string; | ||
fee?: string | undefined; | ||
}) & ({ | ||
status: import("./transfer").TransferInStatusPreTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
fee?: string | undefined; | ||
} | { | ||
status: import("./transfer").TransferInStatusPostTx; | ||
fiatAccountId: string; | ||
transferId: string; | ||
transferAddress: string; | ||
transferType: import("./transfer").TransferType.TransferIn; | ||
fiatType: import("./common").FiatType; | ||
cryptoType: import("./common").CryptoType; | ||
amountProvided: string; | ||
amountReceived: string; | ||
txHash: string; | ||
fee?: string | undefined; | ||
} | undefined); | ||
}; | ||
}>>, z.ZodIntersection<z.ZodObject<{ | ||
@@ -553,5 +461,5 @@ provider: z.ZodString; | ||
transferType: z.ZodLiteral<import("./transfer").TransferType.TransferOut>; | ||
status: z.ZodNativeEnum<typeof import("./transfer").TransferOutStatus>; | ||
status: z.ZodEnum<[import("./transfer").TransferStatus.TransferStarted, import("./transfer").TransferStatus.TransferAmlFailed, import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds, import("./transfer").TransferStatus.TransferReceivedCryptoFunds, import("./transfer").TransferStatus.TransferComplete, import("./transfer").TransferStatus.TransferFailed]>; | ||
}, "strip", z.ZodTypeAny, { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -567,3 +475,3 @@ transferId: string; | ||
}, { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -582,3 +490,3 @@ transferId: string; | ||
payload: { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -597,3 +505,3 @@ transferId: string; | ||
payload: { | ||
status: import("./transfer").TransferOutStatus; | ||
status: import("./transfer").TransferStatus.TransferStarted | import("./transfer").TransferStatus.TransferAmlFailed | import("./transfer").TransferStatus.TransferReadyForUserToSendCryptoFunds | import("./transfer").TransferStatus.TransferReceivedCryptoFunds | import("./transfer").TransferStatus.TransferComplete | import("./transfer").TransferStatus.TransferFailed; | ||
fiatAccountId: string; | ||
@@ -600,0 +508,0 @@ transferId: string; |
{ | ||
"name": "@fiatconnect/fiatconnect-types", | ||
"version": "12.0.1", | ||
"version": "13.0.0", | ||
"description": "Types used in the FiatConnect specification. Offered as standalone module for payment providers and wallets to both use for FiatConnect APIs and integrations.", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -9,2 +9,3 @@ import { z } from 'zod' | ||
} | ||
export const transferTypeSchema = z.nativeEnum(TransferType, { | ||
@@ -25,2 +26,3 @@ description: 'transferTypeSchema', | ||
} | ||
export const transferStatusSchema = z.nativeEnum(TransferStatus, { | ||
@@ -30,3 +32,3 @@ description: 'transferStatusSchema', | ||
// These enums are first segmented between transfers in and transfers out | ||
// Transfer status schemas are first segmented between transfers in and transfers out | ||
// since they both allow a slightly different set of statuses. | ||
@@ -37,19 +39,18 @@ // Transfer in statuses are further segmented, since once a transfer in | ||
// us to encode those semantics into Zod schemas. | ||
export enum TransferInStatusPreTx { | ||
TransferStarted = TransferStatus.TransferStarted, | ||
TransferFiatFundsDebited = TransferStatus.TransferFiatFundsDebited, | ||
TransferReceivedFiatFunds = TransferStatus.TransferReceivedFiatFunds, | ||
TransferFailed = TransferStatus.TransferFailed, | ||
} | ||
export const transferInStatusPreTxSchema = z.nativeEnum(TransferInStatusPreTx, { | ||
description: 'transferInStatusPreTxSchema', | ||
}) | ||
export enum TransferInStatusPostTx { | ||
TransferSendingCryptoFunds = TransferStatus.TransferSendingCryptoFunds, | ||
TransferComplete = TransferStatus.TransferComplete, | ||
} | ||
export const transferInStatusPostTxSchema = z.nativeEnum( | ||
TransferInStatusPostTx, | ||
export const transferInStatusPreTxSchema = z.enum( | ||
[ | ||
TransferStatus.TransferStarted, | ||
TransferStatus.TransferFiatFundsDebited, | ||
TransferStatus.TransferReceivedFiatFunds, | ||
TransferStatus.TransferFailed, | ||
], | ||
{ | ||
description: 'transferInStatusPreTxSchema', | ||
}, | ||
) | ||
export const transferInStatusPostTxSchema = z.enum( | ||
[TransferStatus.TransferSendingCryptoFunds, TransferStatus.TransferComplete], | ||
{ | ||
description: 'transferInStatusPostTxSchema', | ||
@@ -59,13 +60,15 @@ }, | ||
export enum TransferOutStatus { | ||
TransferStarted = TransferStatus.TransferStarted, | ||
TransferAmlFailed = TransferStatus.TransferAmlFailed, | ||
TransferReadyForUserToSendCryptoFunds = TransferStatus.TransferReadyForUserToSendCryptoFunds, | ||
TransferReceivedCryptoFunds = TransferStatus.TransferReceivedCryptoFunds, | ||
TransferComplete = TransferStatus.TransferComplete, | ||
TransferFailed = TransferStatus.TransferFailed, | ||
} | ||
export const transferOutStatusSchema = z.nativeEnum(TransferOutStatus, { | ||
description: 'transferOutStatusSchema', | ||
}) | ||
export const transferOutStatusSchema = z.enum( | ||
[ | ||
TransferStatus.TransferStarted, | ||
TransferStatus.TransferAmlFailed, | ||
TransferStatus.TransferReadyForUserToSendCryptoFunds, | ||
TransferStatus.TransferReceivedCryptoFunds, | ||
TransferStatus.TransferComplete, | ||
TransferStatus.TransferFailed, | ||
], | ||
{ | ||
description: 'transferOutStatusSchema', | ||
}, | ||
) | ||
@@ -72,0 +75,0 @@ /* |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
196760
4360