@fun-xyz/fiat-contract 0.43.0 → 0.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-6O7Z7WYW.mjs → chunk-FXHH22VB.mjs} +2 -7
- package/dist/index.js +63 -27
- package/dist/index.mjs +62 -21
- package/dist/providers/moonpay.d.ts +38 -5
- package/dist/providers/moonpay.schemas.d.ts +5 -1
- package/dist/routing.d.ts +7 -1
- package/dist/schemas.d.ts +2 -3
- package/dist/table.d.ts +1 -1
- package/dist/table.js +2 -7
- package/dist/table.mjs +1 -1
- package/dist/types.d.ts +12 -41
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.45.0";
|
|
3
3
|
|
|
4
4
|
// src/table.ts
|
|
5
5
|
var TABLE_VERSION = version;
|
|
@@ -112,7 +112,7 @@ var TRANSITION_TABLE = {
|
|
|
112
112
|
"Not in the FE doc, so no screen number: the client renders it on its contact and OTP screens.",
|
|
113
113
|
"Every FUN_AUTH error is category USER_ERROR with a code from FUN_AUTH_ERROR_CODES. A wrong code re-enters CODE with BAD_CODE and a lower attemptsRemaining; TOO_MANY_ATTEMPTS and CODE_EXPIRED drop the challenge and offer resend; OTP_DISPATCH_THROTTLED re-enters with resendAvailableAtMs set.",
|
|
114
114
|
"resend carries the verificationRef the client holds, even one the server has dropped (expired, too many attempts); the server starts a fresh challenge for the same email while it still remembers the challenge (its code expiry plus a short grace); once it is forgotten the answer is IDENTIFIER with CODE_EXPIRED.",
|
|
115
|
-
"POST /fiat/auth/refresh
|
|
115
|
+
"POST /fiat/auth/refresh and /revoke are called by the SDK session store, never offered as transitions."
|
|
116
116
|
]
|
|
117
117
|
},
|
|
118
118
|
SESSION_AUTH: {
|
|
@@ -478,7 +478,6 @@ var DOCUMENTED_ENDPOINTS = [
|
|
|
478
478
|
"POST /fiat/auth/verify",
|
|
479
479
|
"POST /fiat/auth/refresh",
|
|
480
480
|
"POST /fiat/auth/revoke",
|
|
481
|
-
"POST /fiat/auth/recipient",
|
|
482
481
|
"POST /fiat/payment-session",
|
|
483
482
|
"POST /fiat/session",
|
|
484
483
|
"POST /fiat/session/verify",
|
|
@@ -510,10 +509,6 @@ var UNOFFERED_ENDPOINTS = [
|
|
|
510
509
|
endpoint: "POST /fiat/auth/revoke",
|
|
511
510
|
reason: "SDK session store, not a transition."
|
|
512
511
|
},
|
|
513
|
-
{
|
|
514
|
-
endpoint: "POST /fiat/auth/recipient",
|
|
515
|
-
reason: "SDK session store at beginDeposit, not a transition."
|
|
516
|
-
},
|
|
517
512
|
{
|
|
518
513
|
endpoint: "POST /fiat/kyc/document",
|
|
519
514
|
reason: "FILE fields use it for a direct provider/vendor upload handshake and completion report; the harness owns that auxiliary path and it is not a transition (see KYC/INPUT_REQUIRED notes)."
|
package/dist/index.js
CHANGED
|
@@ -73,8 +73,6 @@ __export(index_exports, {
|
|
|
73
73
|
FailureReasonSchema: () => FailureReasonSchema,
|
|
74
74
|
FeeLineSchema: () => FeeLineSchema,
|
|
75
75
|
FiatAmountSchema: () => FiatAmountSchema,
|
|
76
|
-
FiatAuthRecipientRequestSchema: () => FiatAuthRecipientRequestSchema,
|
|
77
|
-
FiatAuthRecipientResponseSchema: () => FiatAuthRecipientResponseSchema,
|
|
78
76
|
FiatAuthRefreshRequestSchema: () => FiatAuthRefreshRequestSchema,
|
|
79
77
|
FiatAuthRefreshResponseSchema: () => FiatAuthRefreshResponseSchema,
|
|
80
78
|
FiatAuthRevokeRequestSchema: () => FiatAuthRevokeRequestSchema,
|
|
@@ -83,6 +81,7 @@ __export(index_exports, {
|
|
|
83
81
|
FiatCurrencyCode: () => FiatCurrencyCode,
|
|
84
82
|
FiatEndpointSchema: () => FiatEndpointSchema,
|
|
85
83
|
FiatGeoSchema: () => FiatGeoSchema,
|
|
84
|
+
FiatHandoffPathSchema: () => FiatHandoffPathSchema,
|
|
86
85
|
FiatNextRequestSchema: () => FiatNextRequestSchema,
|
|
87
86
|
FiatProviderSchema: () => FiatProviderSchema,
|
|
88
87
|
FiatRoutingQuoteErrorBodySchema: () => FiatRoutingQuoteErrorBodySchema,
|
|
@@ -124,9 +123,11 @@ __export(index_exports, {
|
|
|
124
123
|
MoonPayConnectRequestSchema: () => MoonPayConnectRequestSchema,
|
|
125
124
|
MoonPayConsentNextActionSchema: () => MoonPayConsentNextActionSchema,
|
|
126
125
|
MoonPayConsentRequestSchema: () => MoonPayConsentRequestSchema,
|
|
126
|
+
MoonPayDeclineRequestSchema: () => MoonPayDeclineRequestSchema,
|
|
127
127
|
MoonPayDoneSchema: () => MoonPayDoneSchema,
|
|
128
128
|
MoonPayErrorBodySchema: () => MoonPayErrorBodySchema,
|
|
129
129
|
MoonPayFaultSchema: () => MoonPayFaultSchema,
|
|
130
|
+
MoonPayGuestDeclineReasonSchema: () => MoonPayGuestDeclineReasonSchema,
|
|
130
131
|
MoonPayKycNextActionSchema: () => MoonPayKycNextActionSchema,
|
|
131
132
|
MoonPayKycRequestSchema: () => MoonPayKycRequestSchema,
|
|
132
133
|
MoonPayNextActionSchema: () => MoonPayNextActionSchema,
|
|
@@ -136,6 +137,8 @@ __export(index_exports, {
|
|
|
136
137
|
MoonPayOrderPendingNextActionSchema: () => MoonPayOrderPendingNextActionSchema,
|
|
137
138
|
MoonPayOrderRequestSchema: () => MoonPayOrderRequestSchema,
|
|
138
139
|
MoonPayOrderResponseSchema: () => MoonPayOrderResponseSchema,
|
|
140
|
+
MoonPayPathSchema: () => MoonPayPathSchema,
|
|
141
|
+
MoonPayPayNextActionSchema: () => MoonPayPayNextActionSchema,
|
|
139
142
|
MoonPayPrepareCaptureNextActionSchema: () => MoonPayPrepareCaptureNextActionSchema,
|
|
140
143
|
MoonPayPrepareCaptureRequestSchema: () => MoonPayPrepareCaptureRequestSchema,
|
|
141
144
|
MoonPayQuoteInputSchema: () => MoonPayQuoteInputSchema,
|
|
@@ -566,6 +569,10 @@ var $provider = import_zod.z.enum([
|
|
|
566
569
|
"CROSSMINT"
|
|
567
570
|
]);
|
|
568
571
|
var FiatProviderSchema = $provider;
|
|
572
|
+
var HANDOFF_PATHS = ["MOONPAY/guest_checkout"];
|
|
573
|
+
var $handoffPath = import_zod.z.enum(HANDOFF_PATHS);
|
|
574
|
+
var FiatHandoffPathSchema = $handoffPath;
|
|
575
|
+
var $handoffPathName = import_zod.z.literal("guest_checkout");
|
|
569
576
|
var $kycProvider = import_zod.z.enum(["SUMSUB"]);
|
|
570
577
|
var KYCProviderSchema = $kycProvider;
|
|
571
578
|
var $surfaceProvider = import_zod.z.enum([...$provider.options, ...$kycProvider.options]);
|
|
@@ -1221,7 +1228,8 @@ var $routingQuoteTermsShape = {
|
|
|
1221
1228
|
),
|
|
1222
1229
|
prepareSessionAuth: import_zod.z.boolean().optional(),
|
|
1223
1230
|
routingOverrides: obj({ providers: import_zod.z.array($routingProvider) }).optional(),
|
|
1224
|
-
destinationAsset: $destinationAsset.optional()
|
|
1231
|
+
destinationAsset: $destinationAsset.optional(),
|
|
1232
|
+
handoffPaths: import_zod.z.array($handoffPath).refine(hasUniqueIds, "each handoff path is listed once").optional()
|
|
1225
1233
|
};
|
|
1226
1234
|
var $routingQuoteTerms = obj($routingQuoteTermsShape);
|
|
1227
1235
|
var FiatRoutingQuoteTermsSchema = $routingQuoteTerms;
|
|
@@ -1289,16 +1297,6 @@ var $authRefreshResponse = obj({ session: $fiatSession });
|
|
|
1289
1297
|
var FiatAuthRefreshResponseSchema = $authRefreshResponse;
|
|
1290
1298
|
var $authRevokeRequest = obj({ refreshHandle: $nonBlank });
|
|
1291
1299
|
var FiatAuthRevokeRequestSchema = $authRevokeRequest;
|
|
1292
|
-
var $authRecipientRequest = import_zod.z.discriminatedUnion("vm", [
|
|
1293
|
-
obj({ refreshHandle: $nonBlank, vm: import_zod.z.literal("EVM"), chainId: import_zod.z.number().int().positive(), depositAddress: $evmAddress }),
|
|
1294
|
-
obj({ refreshHandle: $nonBlank, vm: import_zod.z.literal("SOLANA"), depositAddress: $solanaAddress })
|
|
1295
|
-
]);
|
|
1296
|
-
var FiatAuthRecipientRequestSchema = $authRecipientRequest;
|
|
1297
|
-
var $authRecipientResponse = obj({
|
|
1298
|
-
boundAtMs: import_zod.z.number().int().nonnegative(),
|
|
1299
|
-
expiresAtMs: import_zod.z.number().int().nonnegative()
|
|
1300
|
-
});
|
|
1301
|
-
var FiatAuthRecipientResponseSchema = $authRecipientResponse;
|
|
1302
1300
|
var $stepResponseBase = {
|
|
1303
1301
|
transitions: import_zod.z.array($transition),
|
|
1304
1302
|
routingSessionRef: import_zod.z.string().optional(),
|
|
@@ -1314,7 +1312,7 @@ var $providerBoundStepResponse = obj({
|
|
|
1314
1312
|
state: $providerBoundFlowState,
|
|
1315
1313
|
provider: $provider,
|
|
1316
1314
|
preparedPayment: $preparedPayment.optional(),
|
|
1317
|
-
handoff: obj({ provider: $provider }).optional()
|
|
1315
|
+
handoff: obj({ provider: $provider, path: $handoffPathName.optional() }).optional()
|
|
1318
1316
|
}).superRefine((response, context) => {
|
|
1319
1317
|
if (response.preparedPayment !== void 0 && response.preparedPayment.surface.provider !== response.provider) {
|
|
1320
1318
|
context.addIssue({
|
|
@@ -1330,6 +1328,13 @@ var $providerBoundStepResponse = obj({
|
|
|
1330
1328
|
message: "handoff.provider must match the response provider"
|
|
1331
1329
|
});
|
|
1332
1330
|
}
|
|
1331
|
+
if (response.handoff?.path !== void 0 && !HANDOFF_PATHS.includes(`${response.handoff.provider}/${response.handoff.path}`)) {
|
|
1332
|
+
context.addIssue({
|
|
1333
|
+
code: "custom",
|
|
1334
|
+
path: ["handoff", "path"],
|
|
1335
|
+
message: "handoff.path must name a handoff path of handoff.provider"
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1333
1338
|
if (response.handoff !== void 0 && response.state.kind !== "QUOTE") {
|
|
1334
1339
|
context.addIssue({
|
|
1335
1340
|
code: "custom",
|
|
@@ -1380,7 +1385,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $funAuthStep
|
|
|
1380
1385
|
var FiatStepResponseSchema = $stepResponse;
|
|
1381
1386
|
|
|
1382
1387
|
// package.json
|
|
1383
|
-
var version = "0.
|
|
1388
|
+
var version = "0.45.0";
|
|
1384
1389
|
|
|
1385
1390
|
// src/table.ts
|
|
1386
1391
|
var TABLE_VERSION = version;
|
|
@@ -1493,7 +1498,7 @@ var TRANSITION_TABLE = {
|
|
|
1493
1498
|
"Not in the FE doc, so no screen number: the client renders it on its contact and OTP screens.",
|
|
1494
1499
|
"Every FUN_AUTH error is category USER_ERROR with a code from FUN_AUTH_ERROR_CODES. A wrong code re-enters CODE with BAD_CODE and a lower attemptsRemaining; TOO_MANY_ATTEMPTS and CODE_EXPIRED drop the challenge and offer resend; OTP_DISPATCH_THROTTLED re-enters with resendAvailableAtMs set.",
|
|
1495
1500
|
"resend carries the verificationRef the client holds, even one the server has dropped (expired, too many attempts); the server starts a fresh challenge for the same email while it still remembers the challenge (its code expiry plus a short grace); once it is forgotten the answer is IDENTIFIER with CODE_EXPIRED.",
|
|
1496
|
-
"POST /fiat/auth/refresh
|
|
1501
|
+
"POST /fiat/auth/refresh and /revoke are called by the SDK session store, never offered as transitions."
|
|
1497
1502
|
]
|
|
1498
1503
|
},
|
|
1499
1504
|
SESSION_AUTH: {
|
|
@@ -1859,7 +1864,6 @@ var DOCUMENTED_ENDPOINTS = [
|
|
|
1859
1864
|
"POST /fiat/auth/verify",
|
|
1860
1865
|
"POST /fiat/auth/refresh",
|
|
1861
1866
|
"POST /fiat/auth/revoke",
|
|
1862
|
-
"POST /fiat/auth/recipient",
|
|
1863
1867
|
"POST /fiat/payment-session",
|
|
1864
1868
|
"POST /fiat/session",
|
|
1865
1869
|
"POST /fiat/session/verify",
|
|
@@ -1891,10 +1895,6 @@ var UNOFFERED_ENDPOINTS = [
|
|
|
1891
1895
|
endpoint: "POST /fiat/auth/revoke",
|
|
1892
1896
|
reason: "SDK session store, not a transition."
|
|
1893
1897
|
},
|
|
1894
|
-
{
|
|
1895
|
-
endpoint: "POST /fiat/auth/recipient",
|
|
1896
|
-
reason: "SDK session store at beginDeposit, not a transition."
|
|
1897
|
-
},
|
|
1898
1898
|
{
|
|
1899
1899
|
endpoint: "POST /fiat/kyc/document",
|
|
1900
1900
|
reason: "FILE fields use it for a direct provider/vendor upload handshake and completion report; the harness owns that auxiliary path and it is not a transition (see KYC/INPUT_REQUIRED notes)."
|
|
@@ -3389,7 +3389,14 @@ var $checkout = obj2({
|
|
|
3389
3389
|
var MoonPayCheckoutSchema = $checkout;
|
|
3390
3390
|
var $credentials = obj2({ customerId: $nonEmpty, accessToken: $nonEmpty });
|
|
3391
3391
|
var MoonPaySdkCredentialsSchema = $credentials;
|
|
3392
|
-
var $
|
|
3392
|
+
var $path = import_zod2.z.literal("guest_checkout");
|
|
3393
|
+
var MoonPayPathSchema = $path;
|
|
3394
|
+
var $context = {
|
|
3395
|
+
checkout: $checkout,
|
|
3396
|
+
credentials: $credentials.optional(),
|
|
3397
|
+
destinationAsset: DestinationAssetSchema.optional(),
|
|
3398
|
+
path: $path.optional()
|
|
3399
|
+
};
|
|
3393
3400
|
var $requestContext = obj2($context);
|
|
3394
3401
|
var MoonPayRequestContextSchema = $requestContext;
|
|
3395
3402
|
var $quoteInput = obj2({
|
|
@@ -3407,6 +3414,9 @@ var $consentFields = {
|
|
|
3407
3414
|
};
|
|
3408
3415
|
var $sessionFields = { action: import_zod2.z.literal("session") };
|
|
3409
3416
|
var $connectFields = { action: import_zod2.z.literal("connect"), customerId: $nonEmpty, accessToken: $nonEmpty };
|
|
3417
|
+
var $guestDeclineReason = import_zod2.z.enum(["NOT_OFFERED", "MISMATCH", "OVER_LIMIT"]);
|
|
3418
|
+
var MoonPayGuestDeclineReasonSchema = $guestDeclineReason;
|
|
3419
|
+
var $declineFields = { action: import_zod2.z.literal("decline"), reason: $guestDeclineReason };
|
|
3410
3420
|
var $kycFields = {
|
|
3411
3421
|
action: import_zod2.z.literal("kyc"),
|
|
3412
3422
|
credentials: $credentials,
|
|
@@ -3419,6 +3429,7 @@ var $observeRequest = obj2({ ...$context, ...$observeFields });
|
|
|
3419
3429
|
var $consentRequest = obj2({ ...$context, ...$consentFields });
|
|
3420
3430
|
var $sessionRequest = obj2({ ...$context, ...$sessionFields });
|
|
3421
3431
|
var $connectRequest = obj2({ ...$context, ...$connectFields });
|
|
3432
|
+
var $declineRequest = obj2({ ...$context, ...$declineFields });
|
|
3422
3433
|
var $kycRequest = obj2({ ...$context, ...$kycFields });
|
|
3423
3434
|
var $prepareCaptureRequest = obj2({ ...$context, ...$prepareCaptureFields });
|
|
3424
3435
|
var $captureRequest = obj2({ ...$context, ...$captureFields });
|
|
@@ -3427,11 +3438,22 @@ var MoonPayObserveRequestSchema = $observeRequest;
|
|
|
3427
3438
|
var MoonPayConsentRequestSchema = $consentRequest;
|
|
3428
3439
|
var MoonPaySessionRequestSchema = $sessionRequest;
|
|
3429
3440
|
var MoonPayConnectRequestSchema = $connectRequest;
|
|
3441
|
+
var MoonPayDeclineRequestSchema = $declineRequest;
|
|
3430
3442
|
var MoonPayKycRequestSchema = $kycRequest;
|
|
3431
3443
|
var MoonPayPrepareCaptureRequestSchema = $prepareCaptureRequest;
|
|
3432
3444
|
var MoonPayCaptureRequestSchema = $captureRequest;
|
|
3433
3445
|
var MoonPayOrderRequestSchema = $orderRequest;
|
|
3434
|
-
var $request = import_zod2.z.discriminatedUnion("action", [
|
|
3446
|
+
var $request = import_zod2.z.discriminatedUnion("action", [
|
|
3447
|
+
$observeRequest,
|
|
3448
|
+
$consentRequest,
|
|
3449
|
+
$sessionRequest,
|
|
3450
|
+
$connectRequest,
|
|
3451
|
+
$declineRequest,
|
|
3452
|
+
$kycRequest,
|
|
3453
|
+
$prepareCaptureRequest,
|
|
3454
|
+
$captureRequest,
|
|
3455
|
+
$orderRequest
|
|
3456
|
+
]);
|
|
3435
3457
|
var MoonPayRequestSchema = $request;
|
|
3436
3458
|
var $envelope = { provider: import_zod2.z.literal("MOONPAY"), geo: FiatGeoSchema, ...$context };
|
|
3437
3459
|
var $nextRequest2 = import_zod2.z.discriminatedUnion("action", [
|
|
@@ -3439,6 +3461,7 @@ var $nextRequest2 = import_zod2.z.discriminatedUnion("action", [
|
|
|
3439
3461
|
obj2({ ...$envelope, ...$consentFields }),
|
|
3440
3462
|
obj2({ ...$envelope, ...$sessionFields }),
|
|
3441
3463
|
obj2({ ...$envelope, ...$connectFields }),
|
|
3464
|
+
obj2({ ...$envelope, ...$declineFields }),
|
|
3442
3465
|
obj2({ ...$envelope, ...$kycFields }),
|
|
3443
3466
|
obj2({ ...$envelope, ...$prepareCaptureFields }),
|
|
3444
3467
|
obj2({ ...$envelope, ...$captureFields }),
|
|
@@ -3455,6 +3478,7 @@ var $connectNextAction = obj2({
|
|
|
3455
3478
|
quoteInput: $quoteInput,
|
|
3456
3479
|
resetConnection: import_zod2.z.literal(true).optional()
|
|
3457
3480
|
});
|
|
3481
|
+
var $payNextAction = obj2({ next: import_zod2.z.literal("pay"), sessionToken: $nonEmpty, orderId: $nonEmpty, quoteInput: $quoteInput });
|
|
3458
3482
|
var CAPTURE_DOCUMENTS = ["IDENTITY_DOCUMENT", "SELFIE", "PROOF_OF_ADDRESS", "PROOF_OF_INCOME"];
|
|
3459
3483
|
var $captureDocument = import_zod2.z.enum(CAPTURE_DOCUMENTS);
|
|
3460
3484
|
var $reaskRequirement = import_zod2.z.union([KycFieldIdSchema, $captureDocument]);
|
|
@@ -3514,6 +3538,7 @@ var checkCapture = (nextAction, context) => {
|
|
|
3514
3538
|
var MoonPayConsentNextActionSchema = $consentShape.superRefine(checkConsent);
|
|
3515
3539
|
var MoonPaySessionNextActionSchema = $sessionNextAction;
|
|
3516
3540
|
var MoonPayConnectNextActionSchema = $connectNextAction;
|
|
3541
|
+
var MoonPayPayNextActionSchema = $payNextAction;
|
|
3517
3542
|
var MoonPayKycNextActionSchema = $kycShape.superRefine(checkKyc);
|
|
3518
3543
|
var MoonPayPrepareCaptureNextActionSchema = $prepareCaptureNextAction;
|
|
3519
3544
|
var MoonPayCaptureDocumentSchema = $captureDocument;
|
|
@@ -3529,7 +3554,17 @@ var checkNextAction = (response, context) => {
|
|
|
3529
3554
|
if (response.next === "kyc") checkKyc(response, context);
|
|
3530
3555
|
if (response.next === "capture") checkCapture(response, context);
|
|
3531
3556
|
};
|
|
3532
|
-
var $nextActionOptions = [
|
|
3557
|
+
var $nextActionOptions = [
|
|
3558
|
+
$consentShape,
|
|
3559
|
+
$sessionNextAction,
|
|
3560
|
+
$connectNextAction,
|
|
3561
|
+
$payNextAction,
|
|
3562
|
+
$kycShape,
|
|
3563
|
+
$prepareCaptureNextAction,
|
|
3564
|
+
$captureShape,
|
|
3565
|
+
$waitNextAction,
|
|
3566
|
+
$orderNextAction
|
|
3567
|
+
];
|
|
3533
3568
|
var $nextAction = import_zod2.z.discriminatedUnion("next", [...$nextActionOptions]).superRefine(checkNextAction);
|
|
3534
3569
|
var MoonPayNextActionSchema = $nextAction;
|
|
3535
3570
|
var $done = obj2({ next: import_zod2.z.literal("done"), order: FiatStepResponseSchema });
|
|
@@ -3553,6 +3588,7 @@ var MoonPayResponseSchemaFor = {
|
|
|
3553
3588
|
consent: MoonPayStepResponseSchema,
|
|
3554
3589
|
session: MoonPayStepResponseSchema,
|
|
3555
3590
|
connect: MoonPayStepResponseSchema,
|
|
3591
|
+
decline: MoonPayStepResponseSchema,
|
|
3556
3592
|
kyc: MoonPayStepResponseSchema,
|
|
3557
3593
|
prepareCapture: MoonPayStepResponseSchema,
|
|
3558
3594
|
capture: MoonPayStepResponseSchema,
|
|
@@ -3667,7 +3703,7 @@ var $kycShape2 = obj3({
|
|
|
3667
3703
|
});
|
|
3668
3704
|
var $waitNextAction2 = obj3({ next: import_zod3.z.literal("wait"), retryAfterMs: $retryAfterMs });
|
|
3669
3705
|
var $placeOrderNextAction = obj3({ next: import_zod3.z.literal("placeOrder"), price: $price, orderId: $nonEmpty2 });
|
|
3670
|
-
var $
|
|
3706
|
+
var $payNextAction2 = obj3({
|
|
3671
3707
|
next: import_zod3.z.literal("pay"),
|
|
3672
3708
|
orderId: $nonEmpty2,
|
|
3673
3709
|
price: $price,
|
|
@@ -3704,7 +3740,7 @@ var CoinbaseOtpNextActionSchema = $otpNextAction;
|
|
|
3704
3740
|
var CoinbaseKycNextActionSchema = $kycShape2.superRefine(checkKyc2);
|
|
3705
3741
|
var CoinbaseWaitNextActionSchema = $waitNextAction2;
|
|
3706
3742
|
var CoinbasePlaceOrderNextActionSchema = $placeOrderNextAction;
|
|
3707
|
-
var CoinbasePayNextActionSchema = $
|
|
3743
|
+
var CoinbasePayNextActionSchema = $payNextAction2;
|
|
3708
3744
|
var CoinbaseOrderPendingNextActionSchema = $orderPendingNextAction2;
|
|
3709
3745
|
var checkNextAction2 = (response, context) => {
|
|
3710
3746
|
if (response.next === "consent") checkConsent2(response, context);
|
|
@@ -3717,7 +3753,7 @@ var $nextActionOptions2 = [
|
|
|
3717
3753
|
$kycShape2,
|
|
3718
3754
|
$waitNextAction2,
|
|
3719
3755
|
$placeOrderNextAction,
|
|
3720
|
-
$
|
|
3756
|
+
$payNextAction2,
|
|
3721
3757
|
$orderPendingNextAction2
|
|
3722
3758
|
];
|
|
3723
3759
|
var $nextAction2 = import_zod3.z.discriminatedUnion("next", [...$nextActionOptions2]).superRefine(checkNextAction2);
|
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
tableEntry,
|
|
14
14
|
unofferedEndpoints,
|
|
15
15
|
unreachableStates
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-FXHH22VB.mjs";
|
|
17
17
|
import {
|
|
18
18
|
MOONPAY_ENDPOINTS
|
|
19
19
|
} from "./chunk-TIEGTTFY.mjs";
|
|
@@ -382,6 +382,10 @@ var $provider = z.enum([
|
|
|
382
382
|
"CROSSMINT"
|
|
383
383
|
]);
|
|
384
384
|
var FiatProviderSchema = $provider;
|
|
385
|
+
var HANDOFF_PATHS = ["MOONPAY/guest_checkout"];
|
|
386
|
+
var $handoffPath = z.enum(HANDOFF_PATHS);
|
|
387
|
+
var FiatHandoffPathSchema = $handoffPath;
|
|
388
|
+
var $handoffPathName = z.literal("guest_checkout");
|
|
385
389
|
var $kycProvider = z.enum(["SUMSUB"]);
|
|
386
390
|
var KYCProviderSchema = $kycProvider;
|
|
387
391
|
var $surfaceProvider = z.enum([...$provider.options, ...$kycProvider.options]);
|
|
@@ -1037,7 +1041,8 @@ var $routingQuoteTermsShape = {
|
|
|
1037
1041
|
),
|
|
1038
1042
|
prepareSessionAuth: z.boolean().optional(),
|
|
1039
1043
|
routingOverrides: obj({ providers: z.array($routingProvider) }).optional(),
|
|
1040
|
-
destinationAsset: $destinationAsset.optional()
|
|
1044
|
+
destinationAsset: $destinationAsset.optional(),
|
|
1045
|
+
handoffPaths: z.array($handoffPath).refine(hasUniqueIds, "each handoff path is listed once").optional()
|
|
1041
1046
|
};
|
|
1042
1047
|
var $routingQuoteTerms = obj($routingQuoteTermsShape);
|
|
1043
1048
|
var FiatRoutingQuoteTermsSchema = $routingQuoteTerms;
|
|
@@ -1105,16 +1110,6 @@ var $authRefreshResponse = obj({ session: $fiatSession });
|
|
|
1105
1110
|
var FiatAuthRefreshResponseSchema = $authRefreshResponse;
|
|
1106
1111
|
var $authRevokeRequest = obj({ refreshHandle: $nonBlank });
|
|
1107
1112
|
var FiatAuthRevokeRequestSchema = $authRevokeRequest;
|
|
1108
|
-
var $authRecipientRequest = z.discriminatedUnion("vm", [
|
|
1109
|
-
obj({ refreshHandle: $nonBlank, vm: z.literal("EVM"), chainId: z.number().int().positive(), depositAddress: $evmAddress }),
|
|
1110
|
-
obj({ refreshHandle: $nonBlank, vm: z.literal("SOLANA"), depositAddress: $solanaAddress })
|
|
1111
|
-
]);
|
|
1112
|
-
var FiatAuthRecipientRequestSchema = $authRecipientRequest;
|
|
1113
|
-
var $authRecipientResponse = obj({
|
|
1114
|
-
boundAtMs: z.number().int().nonnegative(),
|
|
1115
|
-
expiresAtMs: z.number().int().nonnegative()
|
|
1116
|
-
});
|
|
1117
|
-
var FiatAuthRecipientResponseSchema = $authRecipientResponse;
|
|
1118
1113
|
var $stepResponseBase = {
|
|
1119
1114
|
transitions: z.array($transition),
|
|
1120
1115
|
routingSessionRef: z.string().optional(),
|
|
@@ -1130,7 +1125,7 @@ var $providerBoundStepResponse = obj({
|
|
|
1130
1125
|
state: $providerBoundFlowState,
|
|
1131
1126
|
provider: $provider,
|
|
1132
1127
|
preparedPayment: $preparedPayment.optional(),
|
|
1133
|
-
handoff: obj({ provider: $provider }).optional()
|
|
1128
|
+
handoff: obj({ provider: $provider, path: $handoffPathName.optional() }).optional()
|
|
1134
1129
|
}).superRefine((response, context) => {
|
|
1135
1130
|
if (response.preparedPayment !== void 0 && response.preparedPayment.surface.provider !== response.provider) {
|
|
1136
1131
|
context.addIssue({
|
|
@@ -1146,6 +1141,13 @@ var $providerBoundStepResponse = obj({
|
|
|
1146
1141
|
message: "handoff.provider must match the response provider"
|
|
1147
1142
|
});
|
|
1148
1143
|
}
|
|
1144
|
+
if (response.handoff?.path !== void 0 && !HANDOFF_PATHS.includes(`${response.handoff.provider}/${response.handoff.path}`)) {
|
|
1145
|
+
context.addIssue({
|
|
1146
|
+
code: "custom",
|
|
1147
|
+
path: ["handoff", "path"],
|
|
1148
|
+
message: "handoff.path must name a handoff path of handoff.provider"
|
|
1149
|
+
});
|
|
1150
|
+
}
|
|
1149
1151
|
if (response.handoff !== void 0 && response.state.kind !== "QUOTE") {
|
|
1150
1152
|
context.addIssue({
|
|
1151
1153
|
code: "custom",
|
|
@@ -2532,7 +2534,14 @@ var $checkout = obj2({
|
|
|
2532
2534
|
var MoonPayCheckoutSchema = $checkout;
|
|
2533
2535
|
var $credentials = obj2({ customerId: $nonEmpty, accessToken: $nonEmpty });
|
|
2534
2536
|
var MoonPaySdkCredentialsSchema = $credentials;
|
|
2535
|
-
var $
|
|
2537
|
+
var $path = z2.literal("guest_checkout");
|
|
2538
|
+
var MoonPayPathSchema = $path;
|
|
2539
|
+
var $context = {
|
|
2540
|
+
checkout: $checkout,
|
|
2541
|
+
credentials: $credentials.optional(),
|
|
2542
|
+
destinationAsset: DestinationAssetSchema.optional(),
|
|
2543
|
+
path: $path.optional()
|
|
2544
|
+
};
|
|
2536
2545
|
var $requestContext = obj2($context);
|
|
2537
2546
|
var MoonPayRequestContextSchema = $requestContext;
|
|
2538
2547
|
var $quoteInput = obj2({
|
|
@@ -2550,6 +2559,9 @@ var $consentFields = {
|
|
|
2550
2559
|
};
|
|
2551
2560
|
var $sessionFields = { action: z2.literal("session") };
|
|
2552
2561
|
var $connectFields = { action: z2.literal("connect"), customerId: $nonEmpty, accessToken: $nonEmpty };
|
|
2562
|
+
var $guestDeclineReason = z2.enum(["NOT_OFFERED", "MISMATCH", "OVER_LIMIT"]);
|
|
2563
|
+
var MoonPayGuestDeclineReasonSchema = $guestDeclineReason;
|
|
2564
|
+
var $declineFields = { action: z2.literal("decline"), reason: $guestDeclineReason };
|
|
2553
2565
|
var $kycFields = {
|
|
2554
2566
|
action: z2.literal("kyc"),
|
|
2555
2567
|
credentials: $credentials,
|
|
@@ -2562,6 +2574,7 @@ var $observeRequest = obj2({ ...$context, ...$observeFields });
|
|
|
2562
2574
|
var $consentRequest = obj2({ ...$context, ...$consentFields });
|
|
2563
2575
|
var $sessionRequest = obj2({ ...$context, ...$sessionFields });
|
|
2564
2576
|
var $connectRequest = obj2({ ...$context, ...$connectFields });
|
|
2577
|
+
var $declineRequest = obj2({ ...$context, ...$declineFields });
|
|
2565
2578
|
var $kycRequest = obj2({ ...$context, ...$kycFields });
|
|
2566
2579
|
var $prepareCaptureRequest = obj2({ ...$context, ...$prepareCaptureFields });
|
|
2567
2580
|
var $captureRequest = obj2({ ...$context, ...$captureFields });
|
|
@@ -2570,11 +2583,22 @@ var MoonPayObserveRequestSchema = $observeRequest;
|
|
|
2570
2583
|
var MoonPayConsentRequestSchema = $consentRequest;
|
|
2571
2584
|
var MoonPaySessionRequestSchema = $sessionRequest;
|
|
2572
2585
|
var MoonPayConnectRequestSchema = $connectRequest;
|
|
2586
|
+
var MoonPayDeclineRequestSchema = $declineRequest;
|
|
2573
2587
|
var MoonPayKycRequestSchema = $kycRequest;
|
|
2574
2588
|
var MoonPayPrepareCaptureRequestSchema = $prepareCaptureRequest;
|
|
2575
2589
|
var MoonPayCaptureRequestSchema = $captureRequest;
|
|
2576
2590
|
var MoonPayOrderRequestSchema = $orderRequest;
|
|
2577
|
-
var $request = z2.discriminatedUnion("action", [
|
|
2591
|
+
var $request = z2.discriminatedUnion("action", [
|
|
2592
|
+
$observeRequest,
|
|
2593
|
+
$consentRequest,
|
|
2594
|
+
$sessionRequest,
|
|
2595
|
+
$connectRequest,
|
|
2596
|
+
$declineRequest,
|
|
2597
|
+
$kycRequest,
|
|
2598
|
+
$prepareCaptureRequest,
|
|
2599
|
+
$captureRequest,
|
|
2600
|
+
$orderRequest
|
|
2601
|
+
]);
|
|
2578
2602
|
var MoonPayRequestSchema = $request;
|
|
2579
2603
|
var $envelope = { provider: z2.literal("MOONPAY"), geo: FiatGeoSchema, ...$context };
|
|
2580
2604
|
var $nextRequest2 = z2.discriminatedUnion("action", [
|
|
@@ -2582,6 +2606,7 @@ var $nextRequest2 = z2.discriminatedUnion("action", [
|
|
|
2582
2606
|
obj2({ ...$envelope, ...$consentFields }),
|
|
2583
2607
|
obj2({ ...$envelope, ...$sessionFields }),
|
|
2584
2608
|
obj2({ ...$envelope, ...$connectFields }),
|
|
2609
|
+
obj2({ ...$envelope, ...$declineFields }),
|
|
2585
2610
|
obj2({ ...$envelope, ...$kycFields }),
|
|
2586
2611
|
obj2({ ...$envelope, ...$prepareCaptureFields }),
|
|
2587
2612
|
obj2({ ...$envelope, ...$captureFields }),
|
|
@@ -2598,6 +2623,7 @@ var $connectNextAction = obj2({
|
|
|
2598
2623
|
quoteInput: $quoteInput,
|
|
2599
2624
|
resetConnection: z2.literal(true).optional()
|
|
2600
2625
|
});
|
|
2626
|
+
var $payNextAction = obj2({ next: z2.literal("pay"), sessionToken: $nonEmpty, orderId: $nonEmpty, quoteInput: $quoteInput });
|
|
2601
2627
|
var CAPTURE_DOCUMENTS = ["IDENTITY_DOCUMENT", "SELFIE", "PROOF_OF_ADDRESS", "PROOF_OF_INCOME"];
|
|
2602
2628
|
var $captureDocument = z2.enum(CAPTURE_DOCUMENTS);
|
|
2603
2629
|
var $reaskRequirement = z2.union([KycFieldIdSchema, $captureDocument]);
|
|
@@ -2657,6 +2683,7 @@ var checkCapture = (nextAction, context) => {
|
|
|
2657
2683
|
var MoonPayConsentNextActionSchema = $consentShape.superRefine(checkConsent);
|
|
2658
2684
|
var MoonPaySessionNextActionSchema = $sessionNextAction;
|
|
2659
2685
|
var MoonPayConnectNextActionSchema = $connectNextAction;
|
|
2686
|
+
var MoonPayPayNextActionSchema = $payNextAction;
|
|
2660
2687
|
var MoonPayKycNextActionSchema = $kycShape.superRefine(checkKyc);
|
|
2661
2688
|
var MoonPayPrepareCaptureNextActionSchema = $prepareCaptureNextAction;
|
|
2662
2689
|
var MoonPayCaptureDocumentSchema = $captureDocument;
|
|
@@ -2672,7 +2699,17 @@ var checkNextAction = (response, context) => {
|
|
|
2672
2699
|
if (response.next === "kyc") checkKyc(response, context);
|
|
2673
2700
|
if (response.next === "capture") checkCapture(response, context);
|
|
2674
2701
|
};
|
|
2675
|
-
var $nextActionOptions = [
|
|
2702
|
+
var $nextActionOptions = [
|
|
2703
|
+
$consentShape,
|
|
2704
|
+
$sessionNextAction,
|
|
2705
|
+
$connectNextAction,
|
|
2706
|
+
$payNextAction,
|
|
2707
|
+
$kycShape,
|
|
2708
|
+
$prepareCaptureNextAction,
|
|
2709
|
+
$captureShape,
|
|
2710
|
+
$waitNextAction,
|
|
2711
|
+
$orderNextAction
|
|
2712
|
+
];
|
|
2676
2713
|
var $nextAction = z2.discriminatedUnion("next", [...$nextActionOptions]).superRefine(checkNextAction);
|
|
2677
2714
|
var MoonPayNextActionSchema = $nextAction;
|
|
2678
2715
|
var $done = obj2({ next: z2.literal("done"), order: FiatStepResponseSchema });
|
|
@@ -2696,6 +2733,7 @@ var MoonPayResponseSchemaFor = {
|
|
|
2696
2733
|
consent: MoonPayStepResponseSchema,
|
|
2697
2734
|
session: MoonPayStepResponseSchema,
|
|
2698
2735
|
connect: MoonPayStepResponseSchema,
|
|
2736
|
+
decline: MoonPayStepResponseSchema,
|
|
2699
2737
|
kyc: MoonPayStepResponseSchema,
|
|
2700
2738
|
prepareCapture: MoonPayStepResponseSchema,
|
|
2701
2739
|
capture: MoonPayStepResponseSchema,
|
|
@@ -2797,7 +2835,7 @@ var $kycShape2 = obj3({
|
|
|
2797
2835
|
});
|
|
2798
2836
|
var $waitNextAction2 = obj3({ next: z3.literal("wait"), retryAfterMs: $retryAfterMs });
|
|
2799
2837
|
var $placeOrderNextAction = obj3({ next: z3.literal("placeOrder"), price: $price, orderId: $nonEmpty2 });
|
|
2800
|
-
var $
|
|
2838
|
+
var $payNextAction2 = obj3({
|
|
2801
2839
|
next: z3.literal("pay"),
|
|
2802
2840
|
orderId: $nonEmpty2,
|
|
2803
2841
|
price: $price,
|
|
@@ -2834,7 +2872,7 @@ var CoinbaseOtpNextActionSchema = $otpNextAction;
|
|
|
2834
2872
|
var CoinbaseKycNextActionSchema = $kycShape2.superRefine(checkKyc2);
|
|
2835
2873
|
var CoinbaseWaitNextActionSchema = $waitNextAction2;
|
|
2836
2874
|
var CoinbasePlaceOrderNextActionSchema = $placeOrderNextAction;
|
|
2837
|
-
var CoinbasePayNextActionSchema = $
|
|
2875
|
+
var CoinbasePayNextActionSchema = $payNextAction2;
|
|
2838
2876
|
var CoinbaseOrderPendingNextActionSchema = $orderPendingNextAction2;
|
|
2839
2877
|
var checkNextAction2 = (response, context) => {
|
|
2840
2878
|
if (response.next === "consent") checkConsent2(response, context);
|
|
@@ -2847,7 +2885,7 @@ var $nextActionOptions2 = [
|
|
|
2847
2885
|
$kycShape2,
|
|
2848
2886
|
$waitNextAction2,
|
|
2849
2887
|
$placeOrderNextAction,
|
|
2850
|
-
$
|
|
2888
|
+
$payNextAction2,
|
|
2851
2889
|
$orderPendingNextAction2
|
|
2852
2890
|
];
|
|
2853
2891
|
var $nextAction2 = z3.discriminatedUnion("next", [...$nextActionOptions2]).superRefine(checkNextAction2);
|
|
@@ -2949,8 +2987,6 @@ export {
|
|
|
2949
2987
|
FailureReasonSchema,
|
|
2950
2988
|
FeeLineSchema,
|
|
2951
2989
|
FiatAmountSchema,
|
|
2952
|
-
FiatAuthRecipientRequestSchema,
|
|
2953
|
-
FiatAuthRecipientResponseSchema,
|
|
2954
2990
|
FiatAuthRefreshRequestSchema,
|
|
2955
2991
|
FiatAuthRefreshResponseSchema,
|
|
2956
2992
|
FiatAuthRevokeRequestSchema,
|
|
@@ -2959,6 +2995,7 @@ export {
|
|
|
2959
2995
|
FiatCurrencyCode,
|
|
2960
2996
|
FiatEndpointSchema,
|
|
2961
2997
|
FiatGeoSchema,
|
|
2998
|
+
FiatHandoffPathSchema,
|
|
2962
2999
|
FiatNextRequestSchema,
|
|
2963
3000
|
FiatProviderSchema,
|
|
2964
3001
|
FiatRoutingQuoteErrorBodySchema,
|
|
@@ -3000,9 +3037,11 @@ export {
|
|
|
3000
3037
|
MoonPayConnectRequestSchema,
|
|
3001
3038
|
MoonPayConsentNextActionSchema,
|
|
3002
3039
|
MoonPayConsentRequestSchema,
|
|
3040
|
+
MoonPayDeclineRequestSchema,
|
|
3003
3041
|
MoonPayDoneSchema,
|
|
3004
3042
|
MoonPayErrorBodySchema,
|
|
3005
3043
|
MoonPayFaultSchema,
|
|
3044
|
+
MoonPayGuestDeclineReasonSchema,
|
|
3006
3045
|
MoonPayKycNextActionSchema,
|
|
3007
3046
|
MoonPayKycRequestSchema,
|
|
3008
3047
|
MoonPayNextActionSchema,
|
|
@@ -3012,6 +3051,8 @@ export {
|
|
|
3012
3051
|
MoonPayOrderPendingNextActionSchema,
|
|
3013
3052
|
MoonPayOrderRequestSchema,
|
|
3014
3053
|
MoonPayOrderResponseSchema,
|
|
3054
|
+
MoonPayPathSchema,
|
|
3055
|
+
MoonPayPayNextActionSchema,
|
|
3015
3056
|
MoonPayPrepareCaptureNextActionSchema,
|
|
3016
3057
|
MoonPayPrepareCaptureRequestSchema,
|
|
3017
3058
|
MoonPayQuoteInputSchema,
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* `orderPending` answers only `order` and has no request either: the client follows its order body's `delivery`
|
|
9
9
|
* transition when it offers one, and otherwise sends the same `order` after it.
|
|
10
10
|
*
|
|
11
|
+
* Guest checkout is the routing path `MOONPAY/guest_checkout`. A quote whose `handoff.path` is `guest_checkout`
|
|
12
|
+
* runs this flow with `path: 'guest_checkout'` on every request: `session` answers `pay`, and after `pay` the
|
|
13
|
+
* client sends `order`, or `decline` when the device cannot pay as a guest. `decline` is request-only, like
|
|
14
|
+
* `observe`, and is answered `refused NOT_ELIGIBLE / REQUOTE`; the requote then leaves the guest path out.
|
|
15
|
+
*
|
|
11
16
|
* The body is `MoonPayNextRequest`: `provider`, the shared `geo`, the context (`checkout`, and
|
|
12
17
|
* `credentials` after `connect`), and the action's result. Identity and the deposit wallet always
|
|
13
18
|
* come from the verified partner assertion, never from a request body.
|
|
@@ -26,7 +31,7 @@ import type { FiatAmount, DestinationAsset, FiatGeo, FiatStepResponse, FormField
|
|
|
26
31
|
export declare const MOONPAY_ENDPOINTS: {
|
|
27
32
|
readonly next: "POST /fiat/next";
|
|
28
33
|
};
|
|
29
|
-
export type MoonPayAction = 'observe' | 'consent' | 'session' | 'connect' | 'kyc' | 'prepareCapture' | 'capture' | 'wait' | 'order';
|
|
34
|
+
export type MoonPayAction = 'observe' | 'consent' | 'session' | 'connect' | 'pay' | 'decline' | 'kyc' | 'prepareCapture' | 'capture' | 'wait' | 'order';
|
|
30
35
|
/** The checkout terms. The client holds them and sends them on every request. */
|
|
31
36
|
export interface MoonPayCheckout {
|
|
32
37
|
amount: FiatAmount;
|
|
@@ -45,13 +50,17 @@ export interface MoonPaySdkCredentials {
|
|
|
45
50
|
/**
|
|
46
51
|
* On every request, not part of the result. `credentials` is present after `connect`.
|
|
47
52
|
* `destinationAsset` is the asset the user receives at the end; `checkout.destination` stays the quote's
|
|
48
|
-
* asset, which MoonPay delivers.
|
|
53
|
+
* asset, which MoonPay delivers. `path` is `guest_checkout` when the quote's `handoff.path` was; absent is the
|
|
54
|
+
* normal flow.
|
|
49
55
|
*/
|
|
50
56
|
export type MoonPayRequestContext = {
|
|
51
57
|
checkout: MoonPayCheckout;
|
|
52
58
|
credentials?: MoonPaySdkCredentials;
|
|
53
59
|
destinationAsset?: DestinationAsset;
|
|
60
|
+
path?: MoonPayPath;
|
|
54
61
|
};
|
|
62
|
+
/** A MoonPay routing path other than the normal flow, named by the quote's `handoff.path`. */
|
|
63
|
+
export type MoonPayPath = 'guest_checkout';
|
|
55
64
|
/**
|
|
56
65
|
* The parameters for the device `client.getQuote`, not a quote. The backend builds them because the
|
|
57
66
|
* wallet must be the verified one and MoonPay's currency codes differ by environment.
|
|
@@ -117,6 +126,29 @@ export type MoonPayConnectRequest = {
|
|
|
117
126
|
customerId: string;
|
|
118
127
|
accessToken: string;
|
|
119
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* The guest path's answer to `session`. Run the hidden connection check with `sessionToken`. When it returns
|
|
131
|
+
* `connectionRequired` with `capabilities.guestCheckout` and no `mismatch`, get the device quote from
|
|
132
|
+
* `quoteInput`. When that quote is executable with no `challenge`, mount Apple Pay with
|
|
133
|
+
* `externalTransactionId = orderId`, then send `order`. Otherwise send `decline`. Every `pay` answer carries a new
|
|
134
|
+
* `orderId`, so after a retried `session` the device must use the `orderId` of the latest `pay`.
|
|
135
|
+
*/
|
|
136
|
+
export type MoonPayPayNextAction = {
|
|
137
|
+
next: 'pay';
|
|
138
|
+
sessionToken: string;
|
|
139
|
+
orderId: string;
|
|
140
|
+
quoteInput: MoonPayQuoteInput;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Why the device cannot pay as a guest. `NOT_OFFERED`: the check did not offer guest checkout. `MISMATCH`: the
|
|
144
|
+
* check named a `mismatch`. `OVER_LIMIT`: the device quote was not executable or carried a `challenge`.
|
|
145
|
+
*/
|
|
146
|
+
export type MoonPayGuestDeclineReason = 'NOT_OFFERED' | 'MISMATCH' | 'OVER_LIMIT';
|
|
147
|
+
/** Request-only, after `pay`, before any charge. Answered `refused NOT_ELIGIBLE / REQUOTE`. */
|
|
148
|
+
export type MoonPayDeclineRequest = {
|
|
149
|
+
action: 'decline';
|
|
150
|
+
reason: MoonPayGuestDeclineReason;
|
|
151
|
+
};
|
|
120
152
|
/** Another MoonPay customer already holds the value; only a different one goes through. */
|
|
121
153
|
export type MoonPayFieldErrorCode = 'PHONE_IN_USE' | 'TAX_ID_IN_USE';
|
|
122
154
|
/**
|
|
@@ -234,7 +266,7 @@ export type MoonPayOrderPendingNextAction = {
|
|
|
234
266
|
retryAfterMs: number;
|
|
235
267
|
order: FiatStepResponse | null;
|
|
236
268
|
};
|
|
237
|
-
export type MoonPayRequest = MoonPayRequestContext & (MoonPayObserveRequest | MoonPayConsentRequest | MoonPaySessionRequest | MoonPayConnectRequest | MoonPayKycRequest | MoonPayPrepareCaptureRequest | MoonPayCaptureRequest | MoonPayOrderRequest);
|
|
269
|
+
export type MoonPayRequest = MoonPayRequestContext & (MoonPayObserveRequest | MoonPayConsentRequest | MoonPaySessionRequest | MoonPayConnectRequest | MoonPayDeclineRequest | MoonPayKycRequest | MoonPayPrepareCaptureRequest | MoonPayCaptureRequest | MoonPayOrderRequest);
|
|
238
270
|
/** The wire body. The orchestrator reads `provider` and `geo`; MoonPay's action schemas read the rest. */
|
|
239
271
|
export type MoonPayNextRequest = {
|
|
240
272
|
provider: 'MOONPAY';
|
|
@@ -252,7 +284,7 @@ export type MoonPayStepRefusal = 'NOT_ELIGIBLE' | 'DOCUMENTS_REQUIRED' | 'FINAL_
|
|
|
252
284
|
* assertion's. `UNRECORDABLE`: a charge no retry can record, held for refund review.
|
|
253
285
|
*/
|
|
254
286
|
export type MoonPayOrderRefusal = 'CUSTOMER_MISMATCH' | 'WALLET_MISMATCH' | 'UNRECORDABLE';
|
|
255
|
-
export type MoonPayNextAction = MoonPayConsentNextAction | MoonPaySessionNextAction | MoonPayConnectNextAction | MoonPayKycNextAction | MoonPayPrepareCaptureNextAction | MoonPayCaptureNextAction | MoonPayWaitNextAction | MoonPayOrderNextAction;
|
|
287
|
+
export type MoonPayNextAction = MoonPayConsentNextAction | MoonPaySessionNextAction | MoonPayConnectNextAction | MoonPayPayNextAction | MoonPayKycNextAction | MoonPayPrepareCaptureNextAction | MoonPayCaptureNextAction | MoonPayWaitNextAction | MoonPayOrderNextAction;
|
|
256
288
|
/**
|
|
257
289
|
* The order is terminal. `order` is its body, which the shared order screen renders. Nothing is left to
|
|
258
290
|
* send to `/fiat/next`. A converted order's `SETTLED` body offers the `delivery` transition: follow it.
|
|
@@ -267,7 +299,7 @@ export type MoonPayRefused<R, V> = {
|
|
|
267
299
|
reason: R;
|
|
268
300
|
recovery: V;
|
|
269
301
|
};
|
|
270
|
-
/** The answer to `observe`, `consent`, `session`, `connect`, `kyc`, `prepareCapture` and `capture`. */
|
|
302
|
+
/** The answer to `observe`, `consent`, `session`, `connect`, `decline`, `kyc`, `prepareCapture` and `capture`. */
|
|
271
303
|
export type MoonPayStepResponse = MoonPayNextAction | MoonPayRefused<MoonPayStepRefusal, 'REQUOTE' | 'NONE'>;
|
|
272
304
|
/**
|
|
273
305
|
* The answer to `order`. `done` once the order is terminal. A failed charge is recorded too: `done` with
|
|
@@ -284,6 +316,7 @@ export type MoonPayResponseFor = {
|
|
|
284
316
|
consent: MoonPayStepResponse;
|
|
285
317
|
session: MoonPayStepResponse;
|
|
286
318
|
connect: MoonPayStepResponse;
|
|
319
|
+
decline: MoonPayStepResponse;
|
|
287
320
|
kyc: MoonPayStepResponse;
|
|
288
321
|
prepareCapture: MoonPayStepResponse;
|
|
289
322
|
capture: MoonPayStepResponse;
|
|
@@ -3,15 +3,18 @@
|
|
|
3
3
|
* exported from the package root, never from `./moonpay`, so the production entry stays free of zod.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import type { MoonPayCaptureDocument, MoonPayCaptureNextAction, MoonPayCaptureRequest, MoonPayCheckout, MoonPayConnectNextAction, MoonPayConnectRequest, MoonPayConsentNextAction, MoonPayConsentRequest, MoonPayDone, MoonPayErrorBody, MoonPayFault, MoonPayKycNextAction, MoonPayKycRequest, MoonPayNextRequest, MoonPayObserveRequest, MoonPayOrderNextAction, MoonPayOrderPendingNextAction, MoonPayOrderRequest, MoonPayOrderResponse, MoonPayPrepareCaptureNextAction, MoonPayPrepareCaptureRequest, MoonPayReask, MoonPayReaskReason, MoonPayReaskRequirement, MoonPayNextAction, MoonPayQuoteInput, MoonPayRequest, MoonPayRequestContext, MoonPayResponseFor, MoonPaySdkCredentials, MoonPaySessionNextAction, MoonPaySessionRequest, MoonPayStepResponse, MoonPayWaitNextAction } from './moonpay';
|
|
6
|
+
import type { MoonPayCaptureDocument, MoonPayCaptureNextAction, MoonPayCaptureRequest, MoonPayCheckout, MoonPayConnectNextAction, MoonPayConnectRequest, MoonPayConsentNextAction, MoonPayConsentRequest, MoonPayDeclineRequest, MoonPayDone, MoonPayErrorBody, MoonPayFault, MoonPayGuestDeclineReason, MoonPayKycNextAction, MoonPayKycRequest, MoonPayNextRequest, MoonPayObserveRequest, MoonPayOrderNextAction, MoonPayOrderPendingNextAction, MoonPayOrderRequest, MoonPayOrderResponse, MoonPayPath, MoonPayPayNextAction, MoonPayPrepareCaptureNextAction, MoonPayPrepareCaptureRequest, MoonPayReask, MoonPayReaskReason, MoonPayReaskRequirement, MoonPayNextAction, MoonPayQuoteInput, MoonPayRequest, MoonPayRequestContext, MoonPayResponseFor, MoonPaySdkCredentials, MoonPaySessionNextAction, MoonPaySessionRequest, MoonPayStepResponse, MoonPayWaitNextAction } from './moonpay';
|
|
7
7
|
export declare const MoonPayCheckoutSchema: z.ZodType<MoonPayCheckout>;
|
|
8
8
|
export declare const MoonPaySdkCredentialsSchema: z.ZodType<MoonPaySdkCredentials>;
|
|
9
|
+
export declare const MoonPayPathSchema: z.ZodType<MoonPayPath>;
|
|
9
10
|
export declare const MoonPayRequestContextSchema: z.ZodType<MoonPayRequestContext>;
|
|
10
11
|
export declare const MoonPayQuoteInputSchema: z.ZodType<MoonPayQuoteInput>;
|
|
12
|
+
export declare const MoonPayGuestDeclineReasonSchema: z.ZodType<MoonPayGuestDeclineReason>;
|
|
11
13
|
export declare const MoonPayObserveRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayObserveRequest>;
|
|
12
14
|
export declare const MoonPayConsentRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayConsentRequest>;
|
|
13
15
|
export declare const MoonPaySessionRequestSchema: z.ZodType<MoonPayRequestContext & MoonPaySessionRequest>;
|
|
14
16
|
export declare const MoonPayConnectRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayConnectRequest>;
|
|
17
|
+
export declare const MoonPayDeclineRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayDeclineRequest>;
|
|
15
18
|
export declare const MoonPayKycRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayKycRequest>;
|
|
16
19
|
export declare const MoonPayPrepareCaptureRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayPrepareCaptureRequest>;
|
|
17
20
|
export declare const MoonPayCaptureRequestSchema: z.ZodType<MoonPayRequestContext & MoonPayCaptureRequest>;
|
|
@@ -21,6 +24,7 @@ export declare const MoonPayNextRequestSchema: z.ZodType<MoonPayNextRequest>;
|
|
|
21
24
|
export declare const MoonPayConsentNextActionSchema: z.ZodType<MoonPayConsentNextAction>;
|
|
22
25
|
export declare const MoonPaySessionNextActionSchema: z.ZodType<MoonPaySessionNextAction>;
|
|
23
26
|
export declare const MoonPayConnectNextActionSchema: z.ZodType<MoonPayConnectNextAction>;
|
|
27
|
+
export declare const MoonPayPayNextActionSchema: z.ZodType<MoonPayPayNextAction>;
|
|
24
28
|
export declare const MoonPayKycNextActionSchema: z.ZodType<MoonPayKycNextAction>;
|
|
25
29
|
export declare const MoonPayPrepareCaptureNextActionSchema: z.ZodType<MoonPayPrepareCaptureNextAction>;
|
|
26
30
|
export declare const MoonPayCaptureDocumentSchema: z.ZodType<MoonPayCaptureDocument>;
|
package/dist/routing.d.ts
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
* an extra key or a blank string fails them, so send only the declared fields.
|
|
22
22
|
*/
|
|
23
23
|
import type { CountryCode, FiatCurrencyCode, PaymentMethodCategory } from './codes';
|
|
24
|
-
import type { FiatAmount, DestinationAsset, FiatProvider, QuoteLimitRange } from './types';
|
|
24
|
+
import type { FiatAmount, DestinationAsset, FiatHandoffPath, FiatProvider, QuoteLimitRange } from './types';
|
|
25
25
|
export declare const ROUTING_ENDPOINTS: {
|
|
26
26
|
readonly table: "POST /fiat/routing/table";
|
|
27
27
|
/** Temporary: `POST /fiat/next` replaces it for each provider that moves there. */
|
|
@@ -146,6 +146,12 @@ export interface FiatRoutingQuoteTerms {
|
|
|
146
146
|
* from the partner's configured asset. Optional so an older client still parses.
|
|
147
147
|
*/
|
|
148
148
|
destinationAsset?: DestinationAsset;
|
|
149
|
+
/**
|
|
150
|
+
* Provider paths this client can run, each at most once. Routing considers such a path only when it is
|
|
151
|
+
* listed, and a quote that picks one carries `handoff.path`. Leave a path out of the requote after its
|
|
152
|
+
* flow answers `refused` with `REQUOTE`, so routing can still pick the provider's other paths.
|
|
153
|
+
*/
|
|
154
|
+
handoffPaths?: FiatHandoffPath[];
|
|
149
155
|
}
|
|
150
156
|
/**
|
|
151
157
|
* `POST /fiat/routing/quote`: the terms plus which providers to price, in one of two forms.
|
package/dist/schemas.d.ts
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*/
|
|
29
29
|
import { z } from 'zod';
|
|
30
30
|
import type { UsStateCode } from './codes';
|
|
31
|
-
import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatAmount, FiatEndpoint,
|
|
31
|
+
import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatAmount, FiatEndpoint, FiatHandoffPath, FiatProvider, FiatAuthRefreshRequest, FiatAuthRefreshResponse, FiatAuthRevokeRequest, FiatAuthStartRequest, FiatAuthVerifyRequest, FiatSession, FiatStepResponse, FieldSpec, FlowState, FormDescriptor, FormField, FormFieldType, InstructionField, Instructions, Instrument, JsonValue, KYCProvider, KycReviewDuration, OrderRef, OrderStatus, OrderSummary, PollSpec, PreparedPayment, PaymentSurface, Quote, QuoteLimitRange, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, Surface, PreferredIdentityDocument, KycFieldId, ClientExecutedDelivery, KycSdkResultReport, SurfaceKind, SurfaceProvider, TermsAcceptance, Transition, TransitionInputs, TransitionParams, Tx, DestinationAsset, FiatGeo, FiatNextRequest } from './types';
|
|
32
32
|
import type { FiatTermsErrorBody, FiatTermsRequest, FiatTermsResponse, TermsDocument, TermsDocumentAcceptance } from './terms';
|
|
33
33
|
import type { FiatRoutingQuoteErrorBody, FiatRoutingQuoteRequest, FiatRoutingQuoteTerms, FiatRoutingTableErrorBody, FiatRoutingTableRequest, FiatRoutingTableResponse } from './routing';
|
|
34
34
|
export declare const JsonSchema: z.ZodType<JsonValue>;
|
|
@@ -38,6 +38,7 @@ export declare const ENDPOINT_PATTERN: RegExp;
|
|
|
38
38
|
export declare const FiatEndpointSchema: z.ZodType<FiatEndpoint>;
|
|
39
39
|
export declare const UsStateCodeSchema: z.ZodType<UsStateCode>;
|
|
40
40
|
export declare const FiatProviderSchema: z.ZodType<FiatProvider>;
|
|
41
|
+
export declare const FiatHandoffPathSchema: z.ZodType<FiatHandoffPath>;
|
|
41
42
|
export declare const KYCProviderSchema: z.ZodType<KYCProvider>;
|
|
42
43
|
export declare const SurfaceProviderSchema: z.ZodType<SurfaceProvider>;
|
|
43
44
|
export declare const OrderStatusSchema: z.ZodType<OrderStatus>;
|
|
@@ -128,7 +129,5 @@ export declare const FiatAuthVerifyRequestSchema: z.ZodType<FiatAuthVerifyReques
|
|
|
128
129
|
export declare const FiatAuthRefreshRequestSchema: z.ZodType<FiatAuthRefreshRequest>;
|
|
129
130
|
export declare const FiatAuthRefreshResponseSchema: z.ZodType<FiatAuthRefreshResponse>;
|
|
130
131
|
export declare const FiatAuthRevokeRequestSchema: z.ZodType<FiatAuthRevokeRequest>;
|
|
131
|
-
export declare const FiatAuthRecipientRequestSchema: z.ZodType<FiatAuthRecipientRequest>;
|
|
132
|
-
export declare const FiatAuthRecipientResponseSchema: z.ZodType<FiatAuthRecipientResponse>;
|
|
133
132
|
export declare const FiatStepResponseSchema: z.ZodType<FiatStepResponse>;
|
|
134
133
|
export {};
|
package/dist/table.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ export declare const STATE_KEYS: StateKey[];
|
|
|
97
97
|
* session-minting call for that rail. The `/fiat/auth/*` routes come from the Fun identity design
|
|
98
98
|
* that specifies `FUN_AUTH`.
|
|
99
99
|
*/
|
|
100
|
-
export declare const DOCUMENTED_ENDPOINTS: readonly ["GET /fiat/payment-methods", "POST /fiat/quote", "POST /fiat/auth", "POST /fiat/auth/verify", "POST /fiat/auth/refresh", "POST /fiat/auth/revoke", "POST /fiat/
|
|
100
|
+
export declare const DOCUMENTED_ENDPOINTS: readonly ["GET /fiat/payment-methods", "POST /fiat/quote", "POST /fiat/auth", "POST /fiat/auth/verify", "POST /fiat/auth/refresh", "POST /fiat/auth/revoke", "POST /fiat/payment-session", "POST /fiat/session", "POST /fiat/session/verify", "GET /fiat/quotes/:quoteRef", "POST /fiat/kyc/form", "POST /fiat/kyc/capture", "POST /fiat/kyc/sdk-token", "POST /fiat/kyc/document", "POST /fiat/instruments", "POST /fiat/orders", "GET /fiat/orders/:id", "GET /fiat/delivery/:deliveryId", "GET /fiat/orders/:id/instructions", "POST /fiat/orders/:id/confirm-payment", "POST /fiat/orders/:id/reference", "POST /fiat/orders/:id/cancel", "POST /fiat/orders/:id/surface-result"];
|
|
101
101
|
/**
|
|
102
102
|
* Documented endpoints no flow state offers, and why. Declared so an endpoint nothing can reach is
|
|
103
103
|
* visible instead of silent — the table test asserts the unoffered set equals exactly these.
|
package/dist/table.js
CHANGED
|
@@ -37,7 +37,7 @@ __export(table_exports, {
|
|
|
37
37
|
module.exports = __toCommonJS(table_exports);
|
|
38
38
|
|
|
39
39
|
// package.json
|
|
40
|
-
var version = "0.
|
|
40
|
+
var version = "0.45.0";
|
|
41
41
|
|
|
42
42
|
// src/table.ts
|
|
43
43
|
var TABLE_VERSION = version;
|
|
@@ -150,7 +150,7 @@ var TRANSITION_TABLE = {
|
|
|
150
150
|
"Not in the FE doc, so no screen number: the client renders it on its contact and OTP screens.",
|
|
151
151
|
"Every FUN_AUTH error is category USER_ERROR with a code from FUN_AUTH_ERROR_CODES. A wrong code re-enters CODE with BAD_CODE and a lower attemptsRemaining; TOO_MANY_ATTEMPTS and CODE_EXPIRED drop the challenge and offer resend; OTP_DISPATCH_THROTTLED re-enters with resendAvailableAtMs set.",
|
|
152
152
|
"resend carries the verificationRef the client holds, even one the server has dropped (expired, too many attempts); the server starts a fresh challenge for the same email while it still remembers the challenge (its code expiry plus a short grace); once it is forgotten the answer is IDENTIFIER with CODE_EXPIRED.",
|
|
153
|
-
"POST /fiat/auth/refresh
|
|
153
|
+
"POST /fiat/auth/refresh and /revoke are called by the SDK session store, never offered as transitions."
|
|
154
154
|
]
|
|
155
155
|
},
|
|
156
156
|
SESSION_AUTH: {
|
|
@@ -516,7 +516,6 @@ var DOCUMENTED_ENDPOINTS = [
|
|
|
516
516
|
"POST /fiat/auth/verify",
|
|
517
517
|
"POST /fiat/auth/refresh",
|
|
518
518
|
"POST /fiat/auth/revoke",
|
|
519
|
-
"POST /fiat/auth/recipient",
|
|
520
519
|
"POST /fiat/payment-session",
|
|
521
520
|
"POST /fiat/session",
|
|
522
521
|
"POST /fiat/session/verify",
|
|
@@ -548,10 +547,6 @@ var UNOFFERED_ENDPOINTS = [
|
|
|
548
547
|
endpoint: "POST /fiat/auth/revoke",
|
|
549
548
|
reason: "SDK session store, not a transition."
|
|
550
549
|
},
|
|
551
|
-
{
|
|
552
|
-
endpoint: "POST /fiat/auth/recipient",
|
|
553
|
-
reason: "SDK session store at beginDeposit, not a transition."
|
|
554
|
-
},
|
|
555
550
|
{
|
|
556
551
|
endpoint: "POST /fiat/kyc/document",
|
|
557
552
|
reason: "FILE fields use it for a direct provider/vendor upload handshake and completion report; the harness owns that auxiliary path and it is not a transition (see KYC/INPUT_REQUIRED notes)."
|
package/dist/table.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export type HttpVerb = 'GET' | 'POST';
|
|
|
56
56
|
* cannot express "no slash", so `GET /fiat/orders/${string}` also admits sub-paths. Precision at
|
|
57
57
|
* that level is the table's job (`allowedTransitions` + `endpointMatches`), not the type's.
|
|
58
58
|
*/
|
|
59
|
-
export type FiatEndpoint = 'GET /fiat/payment-methods' | 'POST /fiat/quote' | 'POST /fiat/auth' | 'POST /fiat/auth/verify' | 'POST /fiat/auth/refresh' | 'POST /fiat/auth/revoke' | 'POST /fiat/
|
|
59
|
+
export type FiatEndpoint = 'GET /fiat/payment-methods' | 'POST /fiat/quote' | 'POST /fiat/auth' | 'POST /fiat/auth/verify' | 'POST /fiat/auth/refresh' | 'POST /fiat/auth/revoke' | 'POST /fiat/payment-session' | 'POST /fiat/session' | 'POST /fiat/session/verify' | `GET /fiat/quotes/${string}` | 'POST /fiat/kyc/form' | 'POST /fiat/kyc/capture' | 'POST /fiat/kyc/sdk-token' | 'POST /fiat/kyc/document' | 'POST /fiat/instruments' | 'POST /fiat/orders' | `GET /fiat/orders/${string}` | `GET /fiat/delivery/${string}` | `GET /fiat/orders/${string}/instructions` | `POST /fiat/orders/${string}/confirm-payment` | `POST /fiat/orders/${string}/reference` | `POST /fiat/orders/${string}/cancel` | `POST /fiat/orders/${string}/surface-result`;
|
|
60
60
|
/**
|
|
61
61
|
* Routing metadata, not sequencing policy. Reserved values may be emitted only after their adapter
|
|
62
62
|
* and conformance fixture land.
|
|
@@ -587,45 +587,6 @@ export type FiatAuthRefreshResponse = {
|
|
|
587
587
|
export type FiatAuthRevokeRequest = {
|
|
588
588
|
refreshHandle: string;
|
|
589
589
|
};
|
|
590
|
-
/**
|
|
591
|
-
* Body of `POST /fiat/auth/recipient`, sent with `Authorization: Bearer <accessToken>`. Binds the
|
|
592
|
-
* recipient of the deposit in progress for the partner the API key names. The backend records the
|
|
593
|
-
* binding for this login session; the session and its handle are unchanged. `refreshHandle` is the
|
|
594
|
-
* write credential, not a rotation: it must belong to the same login as the Bearer. The SDK calls it
|
|
595
|
-
* at `beginDeposit`, once a session is held, and may bind a new address for every deposit.
|
|
596
|
-
*
|
|
597
|
-
* Split by VM, as `DestinationAsset` is. The recipient is a destination-side value, so the backend
|
|
598
|
-
* checks the binding against the chain the delivery lands on: the quote's `destinationAsset` when
|
|
599
|
-
* there is one, else the rail. Solana carries no chain id for the same reason `DestinationAsset` does
|
|
600
|
-
* not: the backend maps each VM to its own chain ids in one place. `depositAddress` must be a wallet
|
|
601
|
-
* on that chain, and the chain must be a destination registered for the partner.
|
|
602
|
-
*
|
|
603
|
-
* Address form. EVM: any case accepted; a mixed-case address must pass its EIP-55 checksum, and the
|
|
604
|
-
* backend stores and reports the checksummed form. Solana: base58 as given.
|
|
605
|
-
*
|
|
606
|
-
* Errors: 401 when the bearer is expired or not a Fun session, or the handle is not this login's or
|
|
607
|
-
* has ended. The SDK refreshes once and retries; a 401 on the refresh itself means sign in again.
|
|
608
|
-
* 400 with `CHAIN_NOT_SERVED` or `RECIPIENT_NOT_A_WALLET`.
|
|
609
|
-
*/
|
|
610
|
-
export type FiatAuthRecipientRequest = {
|
|
611
|
-
refreshHandle: string;
|
|
612
|
-
} & ({
|
|
613
|
-
vm: 'EVM';
|
|
614
|
-
chainId: number;
|
|
615
|
-
depositAddress: `0x${string}`;
|
|
616
|
-
} | {
|
|
617
|
-
vm: 'SOLANA';
|
|
618
|
-
depositAddress: string;
|
|
619
|
-
});
|
|
620
|
-
/**
|
|
621
|
-
* 200 body of `POST /fiat/auth/recipient`. The session and its handle are unchanged. `expiresAtMs`
|
|
622
|
-
* (server clock, ms) is when the binding stops being honoured, 24 h after `boundAtMs`; the SDK binds
|
|
623
|
-
* again after that, or on a `NO_WALLET` or `RECIPIENT_CHAIN_MISMATCH` refusal.
|
|
624
|
-
*/
|
|
625
|
-
export type FiatAuthRecipientResponse = {
|
|
626
|
-
boundAtMs: number;
|
|
627
|
-
expiresAtMs: number;
|
|
628
|
-
};
|
|
629
590
|
/**
|
|
630
591
|
* The expected length of a provider's KYC review. `BRIEF`: the client stays on its current screen,
|
|
631
592
|
* polling, for up to `holdMs` (at most 600000), then shows the in-review screen. `EXTENDED`: the
|
|
@@ -870,12 +831,22 @@ export type FiatStepResponse = (FiatStepResponseBase & {
|
|
|
870
831
|
/**
|
|
871
832
|
* The provider runs its own flow from here (`POST /fiat/next`). Present
|
|
872
833
|
* only on a `QUOTE`, when the request's `handoffs` named this provider; the response then
|
|
873
|
-
* carries no transitions.
|
|
834
|
+
* carries no transitions. `path` names a provider path the request offered in `handoffPaths`
|
|
835
|
+
* (`guest_checkout` for `MOONPAY/guest_checkout`); the client sends it on every `/fiat/next` request.
|
|
874
836
|
*/
|
|
875
837
|
handoff?: {
|
|
876
838
|
provider: FiatProvider;
|
|
839
|
+
path?: FiatHandoffPathName;
|
|
877
840
|
};
|
|
878
841
|
});
|
|
842
|
+
/**
|
|
843
|
+
* A provider path the client can run, offered on the quote request in `handoffPaths`. Routing considers
|
|
844
|
+
* a path listed here only when the request offers it, so leaving it out of a requote excludes that path
|
|
845
|
+
* alone and keeps its provider's other paths.
|
|
846
|
+
*/
|
|
847
|
+
export type FiatHandoffPath = 'MOONPAY/guest_checkout';
|
|
848
|
+
/** The path part of a `FiatHandoffPath`, as `handoff.path` names it. */
|
|
849
|
+
export type FiatHandoffPathName = FiatHandoffPath extends `${string}/${infer Path}` ? Path : never;
|
|
879
850
|
/**
|
|
880
851
|
* The asset the user receives at the end of the purchase. The client always sends it. The backend
|
|
881
852
|
* compares it with the partner's configured asset and adds a conversion only when they differ,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.45.0",
|
|
4
4
|
"description": "Published conformance contract for Fun's headless fiat onramp: FlowState/Transition types, zod schemas, the transition table as data, recorded fixtures, assertion helpers.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|