@fun-xyz/fiat-contract 0.62.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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.62.0";
2
+ var version = "0.63.0";
3
3
 
4
4
  // src/table.ts
5
5
  var TABLE_VERSION = version;
package/dist/index.js CHANGED
@@ -227,7 +227,6 @@ __export(index_exports, {
227
227
  SessionAuthStateSchema: () => SessionAuthStateSchema,
228
228
  StatusHistoryEntrySchema: () => StatusHistoryEntrySchema,
229
229
  StripeAccountEmailNextActionSchema: () => StripeAccountEmailNextActionSchema,
230
- StripeAccountEmailRequestSchema: () => StripeAccountEmailRequestSchema,
231
230
  StripeAttestationNextActionSchema: () => StripeAttestationNextActionSchema,
232
231
  StripeAuthorizeNextActionSchema: () => StripeAuthorizeNextActionSchema,
233
232
  StripeAuthorizeRequestSchema: () => StripeAuthorizeRequestSchema,
@@ -1520,7 +1519,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $funAuthStep
1520
1519
  var FiatStepResponseSchema = $stepResponse;
1521
1520
 
1522
1521
  // package.json
1523
- var version = "0.62.0";
1522
+ var version = "0.63.0";
1524
1523
 
1525
1524
  // src/table.ts
1526
1525
  var TABLE_VERSION = version;
@@ -3978,7 +3977,11 @@ var checkout = obj4({
3978
3977
  paymentMethod: import_zod4.z.literal("apple_pay")
3979
3978
  });
3980
3979
  var StripeCheckoutSchema = checkout;
3981
- var contextFields2 = { checkout, destinationAsset: DestinationAssetSchema.optional() };
3980
+ var contextFields2 = {
3981
+ checkout,
3982
+ destinationAsset: DestinationAssetSchema.optional(),
3983
+ accountEmail: nonEmpty.pipe(import_zod4.z.string().max(254)).optional()
3984
+ };
3982
3985
  var requestContext = obj4(contextFields2);
3983
3986
  var StripeRequestContextSchema = requestContext;
3984
3987
  var mintedOrderId = import_zod4.z.string().regex(/^sto_[A-Za-z0-9_-]{22}$/, "must be an order id a placeOrder answer minted");
@@ -3990,7 +3993,6 @@ var consentFields2 = {
3990
3993
  ...heldOrder
3991
3994
  };
3992
3995
  var sessionFields = { action: import_zod4.z.literal("session"), ...heldOrder };
3993
- var accountEmailFields = { action: import_zod4.z.literal("accountEmail"), email: nonEmpty.pipe(import_zod4.z.string().max(254)), ...heldOrder };
3994
3996
  var authorizeConsentedFields = {
3995
3997
  action: import_zod4.z.literal("authorize"),
3996
3998
  linkAuthIntentId: nonEmpty,
@@ -4007,7 +4009,6 @@ var orderFields2 = { action: import_zod4.z.literal("order"), orderId: mintedOrde
4007
4009
  var observeRequest = obj4({ ...contextFields2, ...observeFields2 });
4008
4010
  var consentRequest = obj4({ ...contextFields2, ...consentFields2 });
4009
4011
  var sessionRequest = obj4({ ...contextFields2, ...sessionFields });
4010
- var accountEmailRequest = obj4({ ...contextFields2, ...accountEmailFields });
4011
4012
  var authorizeRequest = import_zod4.z.union([obj4({ ...contextFields2, ...authorizeConsentedFields }), obj4({ ...contextFields2, ...authorizeDeclinedFields })]);
4012
4013
  var kycRequest = obj4({ ...contextFields2, ...kycFields2 });
4013
4014
  var placeOrderRequest = obj4({ ...contextFields2, ...placeOrderFields2 });
@@ -4016,20 +4017,18 @@ var orderRequest = obj4({ ...contextFields2, ...orderFields2 });
4016
4017
  var StripeObserveRequestSchema = observeRequest;
4017
4018
  var StripeConsentRequestSchema = consentRequest;
4018
4019
  var StripeSessionRequestSchema = sessionRequest;
4019
- var StripeAccountEmailRequestSchema = accountEmailRequest;
4020
4020
  var StripeAuthorizeRequestSchema = authorizeRequest;
4021
4021
  var StripeKycRequestSchema = kycRequest;
4022
4022
  var StripePlaceOrderRequestSchema = placeOrderRequest;
4023
4023
  var StripeCheckoutRequestSchema = checkoutRequest;
4024
4024
  var StripeOrderRequestSchema = orderRequest;
4025
- var request = import_zod4.z.union([observeRequest, consentRequest, sessionRequest, accountEmailRequest, authorizeRequest, kycRequest, placeOrderRequest, checkoutRequest, orderRequest]);
4025
+ var request = import_zod4.z.union([observeRequest, consentRequest, sessionRequest, authorizeRequest, kycRequest, placeOrderRequest, checkoutRequest, orderRequest]);
4026
4026
  var StripeRequestSchema = request;
4027
4027
  var envelope2 = { provider: import_zod4.z.literal("STRIPE"), geo: FiatGeoSchema, ...contextFields2 };
4028
4028
  var nextRequest = import_zod4.z.union([
4029
4029
  obj4({ ...envelope2, ...observeFields2 }),
4030
4030
  obj4({ ...envelope2, ...consentFields2 }),
4031
4031
  obj4({ ...envelope2, ...sessionFields }),
4032
- obj4({ ...envelope2, ...accountEmailFields }),
4033
4032
  obj4({ ...envelope2, ...authorizeConsentedFields }),
4034
4033
  obj4({ ...envelope2, ...authorizeDeclinedFields }),
4035
4034
  obj4({ ...envelope2, ...kycFields2 }),
@@ -4206,7 +4205,6 @@ var StripeResponseSchemaFor = {
4206
4205
  observe: StripeStepResponseSchema,
4207
4206
  consent: StripeStepResponseSchema,
4208
4207
  session: StripeStepResponseSchema,
4209
- accountEmail: StripeStepResponseSchema,
4210
4208
  authorize: StripeStepResponseSchema,
4211
4209
  kyc: StripeStepResponseSchema,
4212
4210
  placeOrder: StripeStepResponseSchema,
package/dist/index.mjs CHANGED
@@ -23,7 +23,7 @@ import {
23
23
  tableEntry,
24
24
  unofferedEndpoints,
25
25
  unreachableStates
26
- } from "./chunk-5RXN5OY3.mjs";
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 = { checkout, destinationAsset: DestinationAssetSchema.optional() };
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");
@@ -3037,7 +3041,6 @@ var consentFields2 = {
3037
3041
  ...heldOrder
3038
3042
  };
3039
3043
  var sessionFields = { action: z4.literal("session"), ...heldOrder };
3040
- var accountEmailFields = { action: z4.literal("accountEmail"), email: nonEmpty.pipe(z4.string().max(254)), ...heldOrder };
3041
3044
  var authorizeConsentedFields = {
3042
3045
  action: z4.literal("authorize"),
3043
3046
  linkAuthIntentId: nonEmpty,
@@ -3054,7 +3057,6 @@ var orderFields2 = { action: z4.literal("order"), orderId: mintedOrderId };
3054
3057
  var observeRequest = obj4({ ...contextFields2, ...observeFields2 });
3055
3058
  var consentRequest = obj4({ ...contextFields2, ...consentFields2 });
3056
3059
  var sessionRequest = obj4({ ...contextFields2, ...sessionFields });
3057
- var accountEmailRequest = obj4({ ...contextFields2, ...accountEmailFields });
3058
3060
  var authorizeRequest = z4.union([obj4({ ...contextFields2, ...authorizeConsentedFields }), obj4({ ...contextFields2, ...authorizeDeclinedFields })]);
3059
3061
  var kycRequest = obj4({ ...contextFields2, ...kycFields2 });
3060
3062
  var placeOrderRequest = obj4({ ...contextFields2, ...placeOrderFields2 });
@@ -3063,20 +3065,18 @@ var orderRequest = obj4({ ...contextFields2, ...orderFields2 });
3063
3065
  var StripeObserveRequestSchema = observeRequest;
3064
3066
  var StripeConsentRequestSchema = consentRequest;
3065
3067
  var StripeSessionRequestSchema = sessionRequest;
3066
- var StripeAccountEmailRequestSchema = accountEmailRequest;
3067
3068
  var StripeAuthorizeRequestSchema = authorizeRequest;
3068
3069
  var StripeKycRequestSchema = kycRequest;
3069
3070
  var StripePlaceOrderRequestSchema = placeOrderRequest;
3070
3071
  var StripeCheckoutRequestSchema = checkoutRequest;
3071
3072
  var StripeOrderRequestSchema = orderRequest;
3072
- var request = z4.union([observeRequest, consentRequest, sessionRequest, accountEmailRequest, authorizeRequest, kycRequest, placeOrderRequest, checkoutRequest, orderRequest]);
3073
+ var request = z4.union([observeRequest, consentRequest, sessionRequest, authorizeRequest, kycRequest, placeOrderRequest, checkoutRequest, orderRequest]);
3073
3074
  var StripeRequestSchema = request;
3074
3075
  var envelope2 = { provider: z4.literal("STRIPE"), geo: FiatGeoSchema, ...contextFields2 };
3075
3076
  var nextRequest = z4.union([
3076
3077
  obj4({ ...envelope2, ...observeFields2 }),
3077
3078
  obj4({ ...envelope2, ...consentFields2 }),
3078
3079
  obj4({ ...envelope2, ...sessionFields }),
3079
- obj4({ ...envelope2, ...accountEmailFields }),
3080
3080
  obj4({ ...envelope2, ...authorizeConsentedFields }),
3081
3081
  obj4({ ...envelope2, ...authorizeDeclinedFields }),
3082
3082
  obj4({ ...envelope2, ...kycFields2 }),
@@ -3253,7 +3253,6 @@ var StripeResponseSchemaFor = {
3253
3253
  observe: StripeStepResponseSchema,
3254
3254
  consent: StripeStepResponseSchema,
3255
3255
  session: StripeStepResponseSchema,
3256
- accountEmail: StripeStepResponseSchema,
3257
3256
  authorize: StripeStepResponseSchema,
3258
3257
  kyc: StripeStepResponseSchema,
3259
3258
  placeOrder: StripeStepResponseSchema,
@@ -3660,7 +3659,6 @@ export {
3660
3659
  SessionAuthStateSchema,
3661
3660
  StatusHistoryEntrySchema,
3662
3661
  StripeAccountEmailNextActionSchema,
3663
- StripeAccountEmailRequestSchema,
3664
3662
  StripeAttestationNextActionSchema,
3665
3663
  StripeAuthorizeNextActionSchema,
3666
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. Only `accountEmail` carries an email the buyer typed.
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
@@ -80,25 +86,17 @@ export type StripeAccountEmailField = {
80
86
  };
81
87
  /**
82
88
  * The assertion's verified email cannot open or register a Link account for this buyer, such as an Apple private
83
- * relay address. Ask the buyer for the email their Link account is under with `field`, then send `accountEmail`. The
84
- * `session` after it signs in under that email, and an `ACCOUNT` round's `verifiedEmail` is that email. `error` is why
85
- * the backend did not accept the last email, or `null` on a first ask. The backend sends this next action only to a
86
- * client that declares the `account_email` client capability.
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.
87
94
  */
88
95
  export type StripeAccountEmailNextAction = {
89
96
  next: 'accountEmail';
90
97
  field: StripeAccountEmailField;
91
98
  error: string | null;
92
99
  };
93
- /**
94
- * The email the buyer typed. The backend holds it for this login. An email it does not accept answers `accountEmail`
95
- * with `error`. Sent when no `accountEmail` is asked, it writes nothing and answers the current next action. Too many
96
- * different emails for one buyer is a `RATE_LIMITED` fault.
97
- */
98
- export type StripeAccountEmailRequest = {
99
- action: 'accountEmail';
100
- email: string;
101
- } & StripeHeldOrder;
102
100
  /** Run the SDK's `authorize(linkAuthIntentId)` before `expiresAt` (ISO-8601), then send `authorize` with its outcome. */
103
101
  export type StripeAuthorizeNextAction = {
104
102
  next: 'authorize';
@@ -281,7 +279,7 @@ export type StripeOrderPendingNextAction = {
281
279
  poll?: OrderPoll;
282
280
  order: FiatStepResponse | null;
283
281
  };
284
- export type StripeRequest = StripeRequestContext & (StripeObserveRequest | StripeConsentRequest | StripeSessionRequest | StripeAccountEmailRequest | StripeAuthorizeRequest | StripeKycRequest | StripePlaceOrderRequest | StripeCheckoutRequest | StripeOrderRequest);
282
+ export type StripeRequest = StripeRequestContext & (StripeObserveRequest | StripeConsentRequest | StripeSessionRequest | StripeAuthorizeRequest | StripeKycRequest | StripePlaceOrderRequest | StripeCheckoutRequest | StripeOrderRequest);
285
283
  /**
286
284
  * Every `action` a Stripe request names. `wait`, `identifiers`, `attestation` and `verifyIdentity` are next actions the
287
285
  * client answers with `observe`.
@@ -335,7 +333,6 @@ export type StripeResponseFor = {
335
333
  observe: StripeStepResponse;
336
334
  consent: StripeStepResponse;
337
335
  session: StripeStepResponse;
338
- accountEmail: StripeStepResponse;
339
336
  authorize: StripeStepResponse;
340
337
  kyc: StripeStepResponse;
341
338
  placeOrder: StripeStepResponse;
@@ -3,13 +3,12 @@
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 { StripeAccountEmailNextAction, StripeAccountEmailRequest, 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>;
10
10
  export declare const StripeConsentRequestSchema: z.ZodType<StripeRequestContext & StripeConsentRequest>;
11
11
  export declare const StripeSessionRequestSchema: z.ZodType<StripeRequestContext & StripeSessionRequest>;
12
- export declare const StripeAccountEmailRequestSchema: z.ZodType<StripeRequestContext & StripeAccountEmailRequest>;
13
12
  export declare const StripeAuthorizeRequestSchema: z.ZodType<StripeRequestContext & StripeAuthorizeRequest>;
14
13
  export declare const StripeKycRequestSchema: z.ZodType<StripeRequestContext & StripeKycRequest>;
15
14
  export declare const StripePlaceOrderRequestSchema: z.ZodType<StripeRequestContext & StripePlaceOrderRequest>;
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.62.0";
40
+ var version = "0.63.0";
41
41
 
42
42
  // src/table.ts
43
43
  var TABLE_VERSION = version;
package/dist/table.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  tableEntry,
13
13
  unofferedEndpoints,
14
14
  unreachableStates
15
- } from "./chunk-5RXN5OY3.mjs";
15
+ } from "./chunk-XFMJO2QX.mjs";
16
16
  export {
17
17
  DOCUMENTED_ENDPOINTS,
18
18
  FUN_AUTH_ERROR_CODES,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fun-xyz/fiat-contract",
3
- "version": "0.62.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": {