@fun-xyz/fiat-contract 0.44.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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.44.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, /revoke and /recipient are called by the SDK session store, never offered as transitions."
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,
@@ -1299,16 +1297,6 @@ var $authRefreshResponse = obj({ session: $fiatSession });
1299
1297
  var FiatAuthRefreshResponseSchema = $authRefreshResponse;
1300
1298
  var $authRevokeRequest = obj({ refreshHandle: $nonBlank });
1301
1299
  var FiatAuthRevokeRequestSchema = $authRevokeRequest;
1302
- var $authRecipientRequest = import_zod.z.discriminatedUnion("vm", [
1303
- obj({ refreshHandle: $nonBlank, vm: import_zod.z.literal("EVM"), chainId: import_zod.z.number().int().positive(), depositAddress: $evmAddress }),
1304
- obj({ refreshHandle: $nonBlank, vm: import_zod.z.literal("SOLANA"), depositAddress: $solanaAddress })
1305
- ]);
1306
- var FiatAuthRecipientRequestSchema = $authRecipientRequest;
1307
- var $authRecipientResponse = obj({
1308
- boundAtMs: import_zod.z.number().int().nonnegative(),
1309
- expiresAtMs: import_zod.z.number().int().nonnegative()
1310
- });
1311
- var FiatAuthRecipientResponseSchema = $authRecipientResponse;
1312
1300
  var $stepResponseBase = {
1313
1301
  transitions: import_zod.z.array($transition),
1314
1302
  routingSessionRef: import_zod.z.string().optional(),
@@ -1397,7 +1385,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $funAuthStep
1397
1385
  var FiatStepResponseSchema = $stepResponse;
1398
1386
 
1399
1387
  // package.json
1400
- var version = "0.44.0";
1388
+ var version = "0.45.0";
1401
1389
 
1402
1390
  // src/table.ts
1403
1391
  var TABLE_VERSION = version;
@@ -1510,7 +1498,7 @@ var TRANSITION_TABLE = {
1510
1498
  "Not in the FE doc, so no screen number: the client renders it on its contact and OTP screens.",
1511
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.",
1512
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.",
1513
- "POST /fiat/auth/refresh, /revoke and /recipient are called by the SDK session store, never offered as transitions."
1501
+ "POST /fiat/auth/refresh and /revoke are called by the SDK session store, never offered as transitions."
1514
1502
  ]
1515
1503
  },
1516
1504
  SESSION_AUTH: {
@@ -1876,7 +1864,6 @@ var DOCUMENTED_ENDPOINTS = [
1876
1864
  "POST /fiat/auth/verify",
1877
1865
  "POST /fiat/auth/refresh",
1878
1866
  "POST /fiat/auth/revoke",
1879
- "POST /fiat/auth/recipient",
1880
1867
  "POST /fiat/payment-session",
1881
1868
  "POST /fiat/session",
1882
1869
  "POST /fiat/session/verify",
@@ -1908,10 +1895,6 @@ var UNOFFERED_ENDPOINTS = [
1908
1895
  endpoint: "POST /fiat/auth/revoke",
1909
1896
  reason: "SDK session store, not a transition."
1910
1897
  },
1911
- {
1912
- endpoint: "POST /fiat/auth/recipient",
1913
- reason: "SDK session store at beginDeposit, not a transition."
1914
- },
1915
1898
  {
1916
1899
  endpoint: "POST /fiat/kyc/document",
1917
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)."
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ import {
13
13
  tableEntry,
14
14
  unofferedEndpoints,
15
15
  unreachableStates
16
- } from "./chunk-XENZL32Y.mjs";
16
+ } from "./chunk-FXHH22VB.mjs";
17
17
  import {
18
18
  MOONPAY_ENDPOINTS
19
19
  } from "./chunk-TIEGTTFY.mjs";
@@ -1110,16 +1110,6 @@ var $authRefreshResponse = obj({ session: $fiatSession });
1110
1110
  var FiatAuthRefreshResponseSchema = $authRefreshResponse;
1111
1111
  var $authRevokeRequest = obj({ refreshHandle: $nonBlank });
1112
1112
  var FiatAuthRevokeRequestSchema = $authRevokeRequest;
1113
- var $authRecipientRequest = z.discriminatedUnion("vm", [
1114
- obj({ refreshHandle: $nonBlank, vm: z.literal("EVM"), chainId: z.number().int().positive(), depositAddress: $evmAddress }),
1115
- obj({ refreshHandle: $nonBlank, vm: z.literal("SOLANA"), depositAddress: $solanaAddress })
1116
- ]);
1117
- var FiatAuthRecipientRequestSchema = $authRecipientRequest;
1118
- var $authRecipientResponse = obj({
1119
- boundAtMs: z.number().int().nonnegative(),
1120
- expiresAtMs: z.number().int().nonnegative()
1121
- });
1122
- var FiatAuthRecipientResponseSchema = $authRecipientResponse;
1123
1113
  var $stepResponseBase = {
1124
1114
  transitions: z.array($transition),
1125
1115
  routingSessionRef: z.string().optional(),
@@ -2997,8 +2987,6 @@ export {
2997
2987
  FailureReasonSchema,
2998
2988
  FeeLineSchema,
2999
2989
  FiatAmountSchema,
3000
- FiatAuthRecipientRequestSchema,
3001
- FiatAuthRecipientResponseSchema,
3002
2990
  FiatAuthRefreshRequestSchema,
3003
2991
  FiatAuthRefreshResponseSchema,
3004
2992
  FiatAuthRevokeRequestSchema,
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, FiatHandoffPath, FiatProvider, FiatAuthRecipientRequest, FiatAuthRecipientResponse, 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';
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>;
@@ -129,7 +129,5 @@ export declare const FiatAuthVerifyRequestSchema: z.ZodType<FiatAuthVerifyReques
129
129
  export declare const FiatAuthRefreshRequestSchema: z.ZodType<FiatAuthRefreshRequest>;
130
130
  export declare const FiatAuthRefreshResponseSchema: z.ZodType<FiatAuthRefreshResponse>;
131
131
  export declare const FiatAuthRevokeRequestSchema: z.ZodType<FiatAuthRevokeRequest>;
132
- export declare const FiatAuthRecipientRequestSchema: z.ZodType<FiatAuthRecipientRequest>;
133
- export declare const FiatAuthRecipientResponseSchema: z.ZodType<FiatAuthRecipientResponse>;
134
132
  export declare const FiatStepResponseSchema: z.ZodType<FiatStepResponse>;
135
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/auth/recipient", "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"];
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.44.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, /revoke and /recipient are called by the SDK session store, never offered as transitions."
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
@@ -12,7 +12,7 @@ import {
12
12
  tableEntry,
13
13
  unofferedEndpoints,
14
14
  unreachableStates
15
- } from "./chunk-XENZL32Y.mjs";
15
+ } from "./chunk-FXHH22VB.mjs";
16
16
  export {
17
17
  DOCUMENTED_ENDPOINTS,
18
18
  FUN_AUTH_ERROR_CODES,
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/auth/recipient' | '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`;
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fun-xyz/fiat-contract",
3
- "version": "0.44.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": {