@fun-xyz/fiat-contract 0.61.0 → 0.63.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/index.js
CHANGED
|
@@ -226,6 +226,7 @@ __export(index_exports, {
|
|
|
226
226
|
SelectOptionSchema: () => SelectOptionSchema,
|
|
227
227
|
SessionAuthStateSchema: () => SessionAuthStateSchema,
|
|
228
228
|
StatusHistoryEntrySchema: () => StatusHistoryEntrySchema,
|
|
229
|
+
StripeAccountEmailNextActionSchema: () => StripeAccountEmailNextActionSchema,
|
|
229
230
|
StripeAttestationNextActionSchema: () => StripeAttestationNextActionSchema,
|
|
230
231
|
StripeAuthorizeNextActionSchema: () => StripeAuthorizeNextActionSchema,
|
|
231
232
|
StripeAuthorizeRequestSchema: () => StripeAuthorizeRequestSchema,
|
|
@@ -1518,7 +1519,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $funAuthStep
|
|
|
1518
1519
|
var FiatStepResponseSchema = $stepResponse;
|
|
1519
1520
|
|
|
1520
1521
|
// package.json
|
|
1521
|
-
var version = "0.
|
|
1522
|
+
var version = "0.63.0";
|
|
1522
1523
|
|
|
1523
1524
|
// src/table.ts
|
|
1524
1525
|
var TABLE_VERSION = version;
|
|
@@ -3976,7 +3977,11 @@ var checkout = obj4({
|
|
|
3976
3977
|
paymentMethod: import_zod4.z.literal("apple_pay")
|
|
3977
3978
|
});
|
|
3978
3979
|
var StripeCheckoutSchema = checkout;
|
|
3979
|
-
var contextFields2 = {
|
|
3980
|
+
var contextFields2 = {
|
|
3981
|
+
checkout,
|
|
3982
|
+
destinationAsset: DestinationAssetSchema.optional(),
|
|
3983
|
+
accountEmail: nonEmpty.pipe(import_zod4.z.string().max(254)).optional()
|
|
3984
|
+
};
|
|
3980
3985
|
var requestContext = obj4(contextFields2);
|
|
3981
3986
|
var StripeRequestContextSchema = requestContext;
|
|
3982
3987
|
var mintedOrderId = import_zod4.z.string().regex(/^sto_[A-Za-z0-9_-]{22}$/, "must be an order id a placeOrder answer minted");
|
|
@@ -4053,6 +4058,11 @@ var reask = obj4({
|
|
|
4053
4058
|
var StripeReaskSchema = reask;
|
|
4054
4059
|
var consentShape = obj4({ next: import_zod4.z.literal("consent"), documents: import_zod4.z.array(TermsDocumentSchema).min(1) });
|
|
4055
4060
|
var sessionNextAction = obj4({ next: import_zod4.z.literal("session") });
|
|
4061
|
+
var accountEmailNextAction = obj4({
|
|
4062
|
+
next: import_zod4.z.literal("accountEmail"),
|
|
4063
|
+
field: obj4({ type: import_zod4.z.literal("TEXT"), regex: nonEmpty, maxLength: import_zod4.z.number().int().positive(), labelFallback: nonEmpty }),
|
|
4064
|
+
error: nonEmpty.nullable()
|
|
4065
|
+
});
|
|
4056
4066
|
var authorizeNextAction = obj4({ next: import_zod4.z.literal("authorize"), linkAuthIntentId: nonEmpty, expiresAt: instant });
|
|
4057
4067
|
var kycShape = obj4({
|
|
4058
4068
|
next: import_zod4.z.literal("kyc"),
|
|
@@ -4130,6 +4140,7 @@ var checkPlaceOrder = (nextAction, context2) => {
|
|
|
4130
4140
|
};
|
|
4131
4141
|
var StripeConsentNextActionSchema = consentShape.superRefine(checkConsent3);
|
|
4132
4142
|
var StripeSessionNextActionSchema = sessionNextAction;
|
|
4143
|
+
var StripeAccountEmailNextActionSchema = accountEmailNextAction;
|
|
4133
4144
|
var StripeAuthorizeNextActionSchema = authorizeNextAction;
|
|
4134
4145
|
var StripeKycNextActionSchema = kycShape.superRefine(checkKyc3);
|
|
4135
4146
|
var StripeIdentifiersNextActionSchema = identifiersNextAction;
|
|
@@ -4149,6 +4160,7 @@ var checkNextAction3 = (response, context2) => {
|
|
|
4149
4160
|
var nextActionOptions = [
|
|
4150
4161
|
consentShape,
|
|
4151
4162
|
sessionNextAction,
|
|
4163
|
+
accountEmailNextAction,
|
|
4152
4164
|
authorizeNextAction,
|
|
4153
4165
|
kycShape,
|
|
4154
4166
|
identifiersNextAction,
|
package/dist/index.mjs
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
tableEntry,
|
|
24
24
|
unofferedEndpoints,
|
|
25
25
|
unreachableStates
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-XFMJO2QX.mjs";
|
|
27
27
|
import {
|
|
28
28
|
MOONPAY_ENDPOINTS
|
|
29
29
|
} from "./chunk-TIEGTTFY.mjs";
|
|
@@ -3025,7 +3025,11 @@ var checkout = obj4({
|
|
|
3025
3025
|
paymentMethod: z4.literal("apple_pay")
|
|
3026
3026
|
});
|
|
3027
3027
|
var StripeCheckoutSchema = checkout;
|
|
3028
|
-
var contextFields2 = {
|
|
3028
|
+
var contextFields2 = {
|
|
3029
|
+
checkout,
|
|
3030
|
+
destinationAsset: DestinationAssetSchema.optional(),
|
|
3031
|
+
accountEmail: nonEmpty.pipe(z4.string().max(254)).optional()
|
|
3032
|
+
};
|
|
3029
3033
|
var requestContext = obj4(contextFields2);
|
|
3030
3034
|
var StripeRequestContextSchema = requestContext;
|
|
3031
3035
|
var mintedOrderId = z4.string().regex(/^sto_[A-Za-z0-9_-]{22}$/, "must be an order id a placeOrder answer minted");
|
|
@@ -3102,6 +3106,11 @@ var reask = obj4({
|
|
|
3102
3106
|
var StripeReaskSchema = reask;
|
|
3103
3107
|
var consentShape = obj4({ next: z4.literal("consent"), documents: z4.array(TermsDocumentSchema).min(1) });
|
|
3104
3108
|
var sessionNextAction = obj4({ next: z4.literal("session") });
|
|
3109
|
+
var accountEmailNextAction = obj4({
|
|
3110
|
+
next: z4.literal("accountEmail"),
|
|
3111
|
+
field: obj4({ type: z4.literal("TEXT"), regex: nonEmpty, maxLength: z4.number().int().positive(), labelFallback: nonEmpty }),
|
|
3112
|
+
error: nonEmpty.nullable()
|
|
3113
|
+
});
|
|
3105
3114
|
var authorizeNextAction = obj4({ next: z4.literal("authorize"), linkAuthIntentId: nonEmpty, expiresAt: instant });
|
|
3106
3115
|
var kycShape = obj4({
|
|
3107
3116
|
next: z4.literal("kyc"),
|
|
@@ -3179,6 +3188,7 @@ var checkPlaceOrder = (nextAction, context2) => {
|
|
|
3179
3188
|
};
|
|
3180
3189
|
var StripeConsentNextActionSchema = consentShape.superRefine(checkConsent3);
|
|
3181
3190
|
var StripeSessionNextActionSchema = sessionNextAction;
|
|
3191
|
+
var StripeAccountEmailNextActionSchema = accountEmailNextAction;
|
|
3182
3192
|
var StripeAuthorizeNextActionSchema = authorizeNextAction;
|
|
3183
3193
|
var StripeKycNextActionSchema = kycShape.superRefine(checkKyc3);
|
|
3184
3194
|
var StripeIdentifiersNextActionSchema = identifiersNextAction;
|
|
@@ -3198,6 +3208,7 @@ var checkNextAction3 = (response, context2) => {
|
|
|
3198
3208
|
var nextActionOptions = [
|
|
3199
3209
|
consentShape,
|
|
3200
3210
|
sessionNextAction,
|
|
3211
|
+
accountEmailNextAction,
|
|
3201
3212
|
authorizeNextAction,
|
|
3202
3213
|
kycShape,
|
|
3203
3214
|
identifiersNextAction,
|
|
@@ -3647,6 +3658,7 @@ export {
|
|
|
3647
3658
|
SelectOptionSchema,
|
|
3648
3659
|
SessionAuthStateSchema,
|
|
3649
3660
|
StatusHistoryEntrySchema,
|
|
3661
|
+
StripeAccountEmailNextActionSchema,
|
|
3650
3662
|
StripeAttestationNextActionSchema,
|
|
3651
3663
|
StripeAuthorizeNextActionSchema,
|
|
3652
3664
|
StripeAuthorizeRequestSchema,
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
* A response names the next action in `next`; the client's request names it in `action`. `observe` answers the
|
|
5
5
|
* current next action. `wait`, `identifiers`, `attestation` and `verifyIdentity` have no request: send `observe` after
|
|
6
6
|
* them. `orderPending` is answered by `order`. Identity, the verified email and the deposit wallet come from the
|
|
7
|
-
* verified partner assertion, never from a request body.
|
|
7
|
+
* verified partner assertion, never from a request body. Only the context's `accountEmail` carries an email the buyer
|
|
8
|
+
* typed.
|
|
8
9
|
*
|
|
9
10
|
* A retry sends the same request and gets the current response. A fault is a 4xx/5xx whose body is
|
|
10
11
|
* `StripeErrorBody`; anything the buyer can act on is a 200.
|
|
@@ -39,9 +40,14 @@ export interface StripeCheckout {
|
|
|
39
40
|
* On every request. `destinationAsset` is the asset the user receives at the end, as on every `FiatNextRequest`;
|
|
40
41
|
* `checkout.destination` stays the asset Stripe delivers.
|
|
41
42
|
*/
|
|
43
|
+
/**
|
|
44
|
+
* `accountEmail`: the email the buyer typed after an `accountEmail` next action. Send it on every later request of the
|
|
45
|
+
* checkout, since the backend does not store it. For a buyer the backend did not ask, it ignores the email.
|
|
46
|
+
*/
|
|
42
47
|
export type StripeRequestContext = {
|
|
43
48
|
checkout: StripeCheckout;
|
|
44
49
|
destinationAsset?: DestinationAsset;
|
|
50
|
+
accountEmail?: string;
|
|
45
51
|
};
|
|
46
52
|
/**
|
|
47
53
|
* The last id a `placeOrder` answer minted, on every step request once the client holds one: a step-up after
|
|
@@ -71,6 +77,26 @@ export type StripeSessionNextAction = {
|
|
|
71
77
|
export type StripeSessionRequest = {
|
|
72
78
|
action: 'session';
|
|
73
79
|
} & StripeHeldOrder;
|
|
80
|
+
/** The email input an `accountEmail` next action shows. Check the typed email with `regex` and `maxLength` before you send it. */
|
|
81
|
+
export type StripeAccountEmailField = {
|
|
82
|
+
type: 'TEXT';
|
|
83
|
+
regex: string;
|
|
84
|
+
maxLength: number;
|
|
85
|
+
labelFallback: string;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* The assertion's verified email cannot open or register a Link account for this buyer, such as an Apple private
|
|
89
|
+
* relay address. Ask the buyer for the email their Link account is under with `field`. Then send `session` with the
|
|
90
|
+
* email in the context's `accountEmail`, and keep it on every later request. `session` signs in under that email, and an
|
|
91
|
+
* `ACCOUNT` round's `verifiedEmail` is that email. `error` is why the backend did not accept the last email, or `null`
|
|
92
|
+
* on a first ask. Too many different emails for one buyer is a `RATE_LIMITED` fault at `session`. The backend sends
|
|
93
|
+
* this next action only to a client that declares the `account_email` client capability.
|
|
94
|
+
*/
|
|
95
|
+
export type StripeAccountEmailNextAction = {
|
|
96
|
+
next: 'accountEmail';
|
|
97
|
+
field: StripeAccountEmailField;
|
|
98
|
+
error: string | null;
|
|
99
|
+
};
|
|
74
100
|
/** Run the SDK's `authorize(linkAuthIntentId)` before `expiresAt` (ISO-8601), then send `authorize` with its outcome. */
|
|
75
101
|
export type StripeAuthorizeNextAction = {
|
|
76
102
|
next: 'authorize';
|
|
@@ -265,7 +291,7 @@ export type StripeNextRequest = {
|
|
|
265
291
|
geo: FiatGeo;
|
|
266
292
|
} & StripeRequest;
|
|
267
293
|
/** Every next action but `checkoutSecret`, which only `checkout` answers. */
|
|
268
|
-
export type StripeNextAction = StripeConsentNextAction | StripeSessionNextAction | StripeAuthorizeNextAction | StripeKycNextAction | StripeIdentifiersNextAction | StripeAttestationNextAction | StripeVerifyIdentityNextAction | StripeWaitNextAction | StripePlaceOrderNextAction | StripePayNextAction | StripeOrderPendingNextAction;
|
|
294
|
+
export type StripeNextAction = StripeConsentNextAction | StripeSessionNextAction | StripeAccountEmailNextAction | StripeAuthorizeNextAction | StripeKycNextAction | StripeIdentifiersNextAction | StripeAttestationNextAction | StripeVerifyIdentityNextAction | StripeWaitNextAction | StripePlaceOrderNextAction | StripePayNextAction | StripeOrderPendingNextAction;
|
|
269
295
|
/** The order is terminal. `order` is its body, which the shared order screen renders. */
|
|
270
296
|
export type StripeDone = {
|
|
271
297
|
next: 'done';
|
|
@@ -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, StripeIdentityReask, StripeRefused, StripeRequest, StripeRequestContext, StripeResponseFor, StripeSessionNextAction, StripeSessionRequest, StripeStepResponse, StripeVerifyIdentityNextAction, StripeWaitNextAction } from './stripe';
|
|
6
|
+
import type { StripeAccountEmailNextAction, 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>;
|
|
@@ -23,6 +23,7 @@ export declare const StripeReaskSchema: z.ZodType<StripeReask>;
|
|
|
23
23
|
export declare const StripeIdentityReaskSchema: z.ZodType<StripeIdentityReask>;
|
|
24
24
|
export declare const StripeConsentNextActionSchema: z.ZodType<StripeConsentNextAction>;
|
|
25
25
|
export declare const StripeSessionNextActionSchema: z.ZodType<StripeSessionNextAction>;
|
|
26
|
+
export declare const StripeAccountEmailNextActionSchema: z.ZodType<StripeAccountEmailNextAction>;
|
|
26
27
|
export declare const StripeAuthorizeNextActionSchema: z.ZodType<StripeAuthorizeNextAction>;
|
|
27
28
|
export declare const StripeKycNextActionSchema: z.ZodType<StripeKycNextAction>;
|
|
28
29
|
export declare const StripeIdentifiersNextActionSchema: z.ZodType<StripeIdentifiersNextAction>;
|
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.63.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": {
|
|
@@ -108,9 +108,12 @@
|
|
|
108
108
|
"@types/node": "^20.19.0",
|
|
109
109
|
"esbuild": "^0.25.0",
|
|
110
110
|
"typescript": "^5.9.3",
|
|
111
|
-
"vitest": "^3.2.
|
|
111
|
+
"vitest": "^3.2.7",
|
|
112
112
|
"zod": "^4.4.3"
|
|
113
113
|
},
|
|
114
|
+
"overrides": {
|
|
115
|
+
"tinypool": "^2.2.0"
|
|
116
|
+
},
|
|
114
117
|
"module": "./dist/index.mjs",
|
|
115
118
|
"sideEffects": false,
|
|
116
119
|
"typesVersions": {
|