@fun-xyz/fiat-contract 0.51.0 → 0.53.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/README.md +6 -0
- package/dist/{chunk-ICIHTCZN.mjs → chunk-QXPR2MW6.mjs} +1 -1
- package/dist/index.js +11 -3
- package/dist/index.mjs +11 -3
- package/dist/providers/moonpay.d.ts +4 -1
- package/dist/providers/stripe.d.ts +10 -1
- package/dist/providers/stripe.schemas.d.ts +2 -1
- package/dist/table.js +1 -1
- package/dist/table.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,3 +8,9 @@ The backend requires explicit client selection and its own enablement switch. A
|
|
|
8
8
|
Send `provider: "MOONPAY_GUEST"` on every next request, with no `path` or customer credentials.
|
|
9
9
|
After a guest refusal with `REQUOTE`, omit `MOONPAY_GUEST` from the next selection so `MOONPAY` remains available.
|
|
10
10
|
The separate `./moonpay-guest` entry exports its wire types; schemas are exported from the root.
|
|
11
|
+
|
|
12
|
+
## MoonPay connect preparation
|
|
13
|
+
|
|
14
|
+
Regular MoonPay's `connect` next action may carry an optional nonempty, unclaimed `orderId`. A client may use it to prepare a hidden, inert payment surface beside the connection check. This is not authorization to pay: wait for an accepted `order` response before revealing the surface. For that first order, the client may retain its prepared id even if the response carries a different id. Without the field, retain the existing behavior and wait for `order` before creating the payment surface.
|
|
15
|
+
|
|
16
|
+
Publish this additive contract before backend emission and update backend/frontend dependency pins. Older strict contract schemas reject the field; optionality preserves acceptance of older backend responses, not compatibility with old strict validators receiving the new field.
|
package/dist/index.js
CHANGED
|
@@ -214,6 +214,7 @@ __export(index_exports, {
|
|
|
214
214
|
StripeErrorBodySchema: () => StripeErrorBodySchema,
|
|
215
215
|
StripeFaultSchema: () => StripeFaultSchema,
|
|
216
216
|
StripeIdentifiersNextActionSchema: () => StripeIdentifiersNextActionSchema,
|
|
217
|
+
StripeIdentityReaskSchema: () => StripeIdentityReaskSchema,
|
|
217
218
|
StripeKycNextActionSchema: () => StripeKycNextActionSchema,
|
|
218
219
|
StripeKycRequestSchema: () => StripeKycRequestSchema,
|
|
219
220
|
StripeLinkAuthTokenSchema: () => StripeLinkAuthTokenSchema,
|
|
@@ -1490,7 +1491,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $funAuthStep
|
|
|
1490
1491
|
var FiatStepResponseSchema = $stepResponse;
|
|
1491
1492
|
|
|
1492
1493
|
// package.json
|
|
1493
|
-
var version = "0.
|
|
1494
|
+
var version = "0.53.0";
|
|
1494
1495
|
|
|
1495
1496
|
// src/table.ts
|
|
1496
1497
|
var TABLE_VERSION = version;
|
|
@@ -3584,7 +3585,8 @@ var $connectNextAction = obj2({
|
|
|
3584
3585
|
next: import_zod2.z.literal("connect"),
|
|
3585
3586
|
sessionToken: $nonEmpty,
|
|
3586
3587
|
quoteInput: $quoteInput,
|
|
3587
|
-
resetConnection: import_zod2.z.literal(true).optional()
|
|
3588
|
+
resetConnection: import_zod2.z.literal(true).optional(),
|
|
3589
|
+
orderId: $nonEmpty.optional()
|
|
3588
3590
|
});
|
|
3589
3591
|
var $phoneNextAction = obj2({ next: import_zod2.z.literal("phone"), error: import_zod2.z.literal("CODE_EXPIRED").nullable() });
|
|
3590
3592
|
var $phoneCodeNextAction = obj2({
|
|
@@ -4039,7 +4041,13 @@ var kycShape = obj4({
|
|
|
4039
4041
|
});
|
|
4040
4042
|
var identifiersNextAction = obj4({ next: import_zod4.z.literal("identifiers"), linkAuthToken: linkAuthToken.nullable() });
|
|
4041
4043
|
var attestationNextAction = obj4({ next: import_zod4.z.literal("attestation"), linkAuthToken: linkAuthToken.nullable() });
|
|
4042
|
-
var
|
|
4044
|
+
var identityReask = obj4({ reason: import_zod4.z.enum(["REJECTED"]).nullable() });
|
|
4045
|
+
var StripeIdentityReaskSchema = identityReask;
|
|
4046
|
+
var verifyIdentityNextAction = obj4({
|
|
4047
|
+
next: import_zod4.z.literal("verifyIdentity"),
|
|
4048
|
+
linkAuthToken: linkAuthToken.nullable(),
|
|
4049
|
+
reask: identityReask.nullable().optional()
|
|
4050
|
+
});
|
|
4043
4051
|
var waitNextAction = obj4({ next: import_zod4.z.literal("wait"), retryAfterMs });
|
|
4044
4052
|
var placeOrderNextAction = obj4({
|
|
4045
4053
|
next: import_zod4.z.literal("placeOrder"),
|
package/dist/index.mjs
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
tableEntry,
|
|
17
17
|
unofferedEndpoints,
|
|
18
18
|
unreachableStates
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QXPR2MW6.mjs";
|
|
20
20
|
import {
|
|
21
21
|
MOONPAY_ENDPOINTS
|
|
22
22
|
} from "./chunk-TIEGTTFY.mjs";
|
|
@@ -2673,7 +2673,8 @@ var $connectNextAction = obj2({
|
|
|
2673
2673
|
next: z2.literal("connect"),
|
|
2674
2674
|
sessionToken: $nonEmpty,
|
|
2675
2675
|
quoteInput: $quoteInput,
|
|
2676
|
-
resetConnection: z2.literal(true).optional()
|
|
2676
|
+
resetConnection: z2.literal(true).optional(),
|
|
2677
|
+
orderId: $nonEmpty.optional()
|
|
2677
2678
|
});
|
|
2678
2679
|
var $phoneNextAction = obj2({ next: z2.literal("phone"), error: z2.literal("CODE_EXPIRED").nullable() });
|
|
2679
2680
|
var $phoneCodeNextAction = obj2({
|
|
@@ -3110,7 +3111,13 @@ var kycShape = obj4({
|
|
|
3110
3111
|
});
|
|
3111
3112
|
var identifiersNextAction = obj4({ next: z4.literal("identifiers"), linkAuthToken: linkAuthToken.nullable() });
|
|
3112
3113
|
var attestationNextAction = obj4({ next: z4.literal("attestation"), linkAuthToken: linkAuthToken.nullable() });
|
|
3113
|
-
var
|
|
3114
|
+
var identityReask = obj4({ reason: z4.enum(["REJECTED"]).nullable() });
|
|
3115
|
+
var StripeIdentityReaskSchema = identityReask;
|
|
3116
|
+
var verifyIdentityNextAction = obj4({
|
|
3117
|
+
next: z4.literal("verifyIdentity"),
|
|
3118
|
+
linkAuthToken: linkAuthToken.nullable(),
|
|
3119
|
+
reask: identityReask.nullable().optional()
|
|
3120
|
+
});
|
|
3114
3121
|
var waitNextAction = obj4({ next: z4.literal("wait"), retryAfterMs });
|
|
3115
3122
|
var placeOrderNextAction = obj4({
|
|
3116
3123
|
next: z4.literal("placeOrder"),
|
|
@@ -3487,6 +3494,7 @@ export {
|
|
|
3487
3494
|
StripeErrorBodySchema,
|
|
3488
3495
|
StripeFaultSchema,
|
|
3489
3496
|
StripeIdentifiersNextActionSchema,
|
|
3497
|
+
StripeIdentityReaskSchema,
|
|
3490
3498
|
StripeKycNextActionSchema,
|
|
3491
3499
|
StripeKycRequestSchema,
|
|
3492
3500
|
StripeLinkAuthTokenSchema,
|
|
@@ -108,13 +108,16 @@ export type MoonPaySessionRequest = {
|
|
|
108
108
|
/**
|
|
109
109
|
* Run MoonPay's connection check with `sessionToken`, the token `session` minted; it asks for an OTP
|
|
110
110
|
* only if the hidden check fails. `resetConnection`: the device's connection is another buyer's, so
|
|
111
|
-
* reset it first.
|
|
111
|
+
* reset it first. Optional `orderId` is unclaimed and lets the client prepare an inert payment surface
|
|
112
|
+
* while connecting. It does not authorize payment. After accepting an `order` response, the client
|
|
113
|
+
* may retain this prepared id for its first order even if the response carries a different id.
|
|
112
114
|
*/
|
|
113
115
|
export type MoonPayConnectNextAction = {
|
|
114
116
|
next: 'connect';
|
|
115
117
|
sessionToken: string;
|
|
116
118
|
quoteInput: MoonPayQuoteInput;
|
|
117
119
|
resetConnection?: true;
|
|
120
|
+
orderId?: string;
|
|
118
121
|
};
|
|
119
122
|
export type MoonPayConnectRequest = {
|
|
120
123
|
action: 'connect';
|
|
@@ -145,10 +145,19 @@ export type StripeAttestationNextAction = {
|
|
|
145
145
|
next: 'attestation';
|
|
146
146
|
linkAuthToken: StripeLinkAuthToken | null;
|
|
147
147
|
};
|
|
148
|
-
/**
|
|
148
|
+
/** Why Stripe's ID check is asked again. `REJECTED`: Stripe did not accept the ID the buyer gave. */
|
|
149
|
+
export type StripeIdentityReask = {
|
|
150
|
+
reason: StripeReaskReason | null;
|
|
151
|
+
};
|
|
152
|
+
/**
|
|
153
|
+
* Sign in with `linkAuthToken`, run the SDK's `verifyIdentity`, then send `observe`. `reask` is set when the buyer
|
|
154
|
+
* already gave an ID that Stripe did not accept; an older backend leaves it out. Without it, a `verifyIdentity` right
|
|
155
|
+
* after the buyer finished the check means Stripe is still reviewing that ID: Stripe shows no document until it decides.
|
|
156
|
+
*/
|
|
149
157
|
export type StripeVerifyIdentityNextAction = {
|
|
150
158
|
next: 'verifyIdentity';
|
|
151
159
|
linkAuthToken: StripeLinkAuthToken | null;
|
|
160
|
+
reask?: StripeIdentityReask | null;
|
|
152
161
|
};
|
|
153
162
|
/** Stripe is reviewing, or a sign-in is settling. No request of its own: send `observe` after the delay. */
|
|
154
163
|
export type StripeWaitNextAction = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* exported from the package root, never from `./stripe`, so the production entry stays free of zod.
|
|
4
4
|
*/
|
|
5
5
|
import { z } from 'zod';
|
|
6
|
-
import type { StripeAttestationNextAction, StripeAuthorizeNextAction, StripeAuthorizeRequest, StripeCheckout, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSecretNextAction, StripeConsentNextAction, StripeConsentRequest, StripeDone, StripeErrorBody, StripeFault, StripeIdentifiersNextAction, StripeKycNextAction, StripeKycRequest, StripeLinkAuthToken, StripeNextAction, StripeNextRequest, StripeObserveRequest, StripeOrderPendingNextAction, StripeOrderRequest, StripeOrderResponse, StripePayNextAction, StripePaySheet, StripePlaceOrderNextAction, StripePlaceOrderRequest, StripePrice, StripeReask, StripeRefused, StripeRequest, StripeRequestContext, StripeResponseFor, StripeSessionNextAction, StripeSessionRequest, StripeStepResponse, StripeVerifyIdentityNextAction, StripeWaitNextAction } from './stripe';
|
|
6
|
+
import type { StripeAttestationNextAction, StripeAuthorizeNextAction, StripeAuthorizeRequest, StripeCheckout, StripeCheckoutRequest, StripeCheckoutResponse, StripeCheckoutSecretNextAction, StripeConsentNextAction, StripeConsentRequest, StripeDone, StripeErrorBody, StripeFault, StripeIdentifiersNextAction, StripeKycNextAction, StripeKycRequest, StripeLinkAuthToken, StripeNextAction, StripeNextRequest, StripeObserveRequest, StripeOrderPendingNextAction, StripeOrderRequest, StripeOrderResponse, StripePayNextAction, StripePaySheet, StripePlaceOrderNextAction, StripePlaceOrderRequest, StripePrice, StripeReask, StripeIdentityReask, StripeRefused, StripeRequest, StripeRequestContext, StripeResponseFor, StripeSessionNextAction, StripeSessionRequest, StripeStepResponse, StripeVerifyIdentityNextAction, StripeWaitNextAction } from './stripe';
|
|
7
7
|
export declare const StripeCheckoutSchema: z.ZodType<StripeCheckout>;
|
|
8
8
|
export declare const StripeRequestContextSchema: z.ZodType<StripeRequestContext>;
|
|
9
9
|
export declare const StripeObserveRequestSchema: z.ZodType<StripeRequestContext & StripeObserveRequest>;
|
|
@@ -20,6 +20,7 @@ export declare const StripePriceSchema: z.ZodType<StripePrice>;
|
|
|
20
20
|
export declare const StripePaySheetSchema: z.ZodType<StripePaySheet>;
|
|
21
21
|
export declare const StripeLinkAuthTokenSchema: z.ZodType<StripeLinkAuthToken>;
|
|
22
22
|
export declare const StripeReaskSchema: z.ZodType<StripeReask>;
|
|
23
|
+
export declare const StripeIdentityReaskSchema: z.ZodType<StripeIdentityReask>;
|
|
23
24
|
export declare const StripeConsentNextActionSchema: z.ZodType<StripeConsentNextAction>;
|
|
24
25
|
export declare const StripeSessionNextActionSchema: z.ZodType<StripeSessionNextAction>;
|
|
25
26
|
export declare const StripeAuthorizeNextActionSchema: z.ZodType<StripeAuthorizeNextAction>;
|
package/dist/table.js
CHANGED
package/dist/table.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.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": {
|