@fun-xyz/fiat-contract 0.14.0 → 0.16.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 CHANGED
@@ -85,6 +85,9 @@ this package is [ENG-5268](https://linear.app/funxyz/issue/ENG-5268).
85
85
  is present, and PAY must never be exposed without real current economics.
86
86
  15. **KYC may precede pricing.** Provider auth or activation may legitimately defer pricing, so a
87
87
  KYC state may omit `quote`. A real `Quote` still requires `quoteRef`, and PAY is never quote-less.
88
+ 16. **Correction text never decides retry.** A correctable provider rejection returns
89
+ `KYC{CAPTURE}` and may carry `correctionReason` for display. Clients decide that retry is allowed
90
+ from the state and its transitions; provider-authored text is never a branch key.
88
91
 
89
92
  ## KYC SDK hints, results, and client delivery
90
93
 
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.14.0";
2
+ var version = "0.16.0";
3
3
 
4
4
  // src/table.ts
5
5
  var TABLE_VERSION = version;
@@ -514,4 +514,4 @@ export {
514
514
  tableEntry,
515
515
  isTerminal
516
516
  };
517
- //# sourceMappingURL=chunk-BQELSEYH.mjs.map
517
+ //# sourceMappingURL=chunk-PEJOU52N.mjs.map
package/dist/index.js CHANGED
@@ -841,6 +841,7 @@ var $kycCaptureState = obj({
841
841
  phase: import_zod.z.literal("CAPTURE"),
842
842
  quote: $quote.optional(),
843
843
  surface: $surface,
844
+ correctionReason: import_zod.z.string().min(1).max(1024).optional(),
844
845
  error: $failureReason.optional()
845
846
  });
846
847
  var KycCaptureStateSchema = $kycCaptureState;
@@ -941,7 +942,8 @@ var $providerBoundStepResponse = obj({
941
942
  clientSecret: import_zod.z.string(),
942
943
  expiresAt: import_zod.z.string()
943
944
  }).optional(),
944
- orderId: import_zod.z.string().optional()
945
+ orderId: import_zod.z.string().optional(),
946
+ refreshLimits: import_zod.z.literal(true).optional()
945
947
  });
946
948
  var $blockedStepResponse = obj({
947
949
  state: $blockedState,
@@ -952,13 +954,14 @@ var $blockedStepResponse = obj({
952
954
  clientSecret: import_zod.z.string(),
953
955
  expiresAt: import_zod.z.string()
954
956
  }).optional(),
955
- orderId: import_zod.z.string().optional()
957
+ orderId: import_zod.z.string().optional(),
958
+ refreshLimits: import_zod.z.literal(true).optional()
956
959
  });
957
960
  var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $blockedStepResponse]);
958
961
  var FiatStepResponseSchema = $stepResponse;
959
962
 
960
963
  // package.json
961
- var version = "0.14.0";
964
+ var version = "0.16.0";
962
965
 
963
966
  // src/table.ts
964
967
  var TABLE_VERSION = version;
@@ -1788,7 +1791,8 @@ var FIXTURE_DATA = {
1788
1791
  }
1789
1792
  },
1790
1793
  "expiresAt": "\u2026"
1791
- }
1794
+ },
1795
+ "correctionReason": "The image is too blurry. Upload a clearer photo of this document."
1792
1796
  },
1793
1797
  "provider": "TRANSAK",
1794
1798
  "transitions": [
@@ -2252,7 +2256,10 @@ var FIXTURES = [
2252
2256
  docRef: "Fiat KYC \xB7 embedded Sumsub WebSDK",
2253
2257
  screen: 8,
2254
2258
  stateKey: "KYC/CAPTURE",
2255
- notes: ["The client mounts the Sumsub adapter; no URL or iframe is emitted."]
2259
+ notes: [
2260
+ "The client mounts the Sumsub adapter; no URL or iframe is emitted.",
2261
+ "A retry may carry provider-authored correctionReason display text; clients never branch on it."
2262
+ ]
2256
2263
  },
2257
2264
  {
2258
2265
  id: "screen-09-kyc-in-review",
package/dist/index.mjs CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  tableEntry,
13
13
  unofferedEndpoints,
14
14
  unreachableStates
15
- } from "./chunk-BQELSEYH.mjs";
15
+ } from "./chunk-PEJOU52N.mjs";
16
16
 
17
17
  // src/codes.ts
18
18
  var US_STATE_CODES = [
@@ -738,6 +738,7 @@ var $kycCaptureState = obj({
738
738
  phase: z.literal("CAPTURE"),
739
739
  quote: $quote.optional(),
740
740
  surface: $surface,
741
+ correctionReason: z.string().min(1).max(1024).optional(),
741
742
  error: $failureReason.optional()
742
743
  });
743
744
  var KycCaptureStateSchema = $kycCaptureState;
@@ -838,7 +839,8 @@ var $providerBoundStepResponse = obj({
838
839
  clientSecret: z.string(),
839
840
  expiresAt: z.string()
840
841
  }).optional(),
841
- orderId: z.string().optional()
842
+ orderId: z.string().optional(),
843
+ refreshLimits: z.literal(true).optional()
842
844
  });
843
845
  var $blockedStepResponse = obj({
844
846
  state: $blockedState,
@@ -849,7 +851,8 @@ var $blockedStepResponse = obj({
849
851
  clientSecret: z.string(),
850
852
  expiresAt: z.string()
851
853
  }).optional(),
852
- orderId: z.string().optional()
854
+ orderId: z.string().optional(),
855
+ refreshLimits: z.literal(true).optional()
853
856
  });
854
857
  var $stepResponse = z.union([$providerBoundStepResponse, $blockedStepResponse]);
855
858
  var FiatStepResponseSchema = $stepResponse;
@@ -1183,7 +1186,8 @@ var FIXTURE_DATA = {
1183
1186
  }
1184
1187
  },
1185
1188
  "expiresAt": "\u2026"
1186
- }
1189
+ },
1190
+ "correctionReason": "The image is too blurry. Upload a clearer photo of this document."
1187
1191
  },
1188
1192
  "provider": "TRANSAK",
1189
1193
  "transitions": [
@@ -1647,7 +1651,10 @@ var FIXTURES = [
1647
1651
  docRef: "Fiat KYC \xB7 embedded Sumsub WebSDK",
1648
1652
  screen: 8,
1649
1653
  stateKey: "KYC/CAPTURE",
1650
- notes: ["The client mounts the Sumsub adapter; no URL or iframe is emitted."]
1654
+ notes: [
1655
+ "The client mounts the Sumsub adapter; no URL or iframe is emitted.",
1656
+ "A retry may carry provider-authored correctionReason display text; clients never branch on it."
1657
+ ]
1651
1658
  },
1652
1659
  {
1653
1660
  id: "screen-09-kyc-in-review",
package/dist/table.js CHANGED
@@ -36,7 +36,7 @@ __export(table_exports, {
36
36
  module.exports = __toCommonJS(table_exports);
37
37
 
38
38
  // package.json
39
- var version = "0.14.0";
39
+ var version = "0.16.0";
40
40
 
41
41
  // src/table.ts
42
42
  var TABLE_VERSION = version;
package/dist/table.mjs CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  tableEntry,
12
12
  unofferedEndpoints,
13
13
  unreachableStates
14
- } from "./chunk-BQELSEYH.mjs";
14
+ } from "./chunk-PEJOU52N.mjs";
15
15
  export {
16
16
  DOCUMENTED_ENDPOINTS,
17
17
  STATE_KEYS,
package/dist/types.d.ts CHANGED
@@ -553,6 +553,11 @@ export type FlowState =
553
553
  phase: 'CAPTURE';
554
554
  quote?: Quote;
555
555
  surface: Surface;
556
+ /**
557
+ * Provider-authored guidance for correcting the previous verification attempt. Display-only:
558
+ * clients must use the state and transitions, never this text, to decide whether retry is allowed.
559
+ */
560
+ correctionReason?: string;
556
561
  error?: FailureReason;
557
562
  } | {
558
563
  kind: 'KYC';
@@ -662,6 +667,15 @@ type FiatStepResponseBase = {
662
667
  };
663
668
  /** TODO(open-decision): `orderId` placement — see `PAYMENT{INSTRUCT}.orderId` above. */
664
669
  orderId?: string;
670
+ /**
671
+ * Best-effort: what this response did may have changed what the buyer can spend, so a cached
672
+ * discovery ceiling is no longer trusted. Absent is not a promise that nothing changed, only
673
+ * that this response is not reporting one, so a client must still tolerate a stale ceiling.
674
+ *
675
+ * Never `false`. A widened or dropped ceiling costs one discovery call; one left too low
676
+ * refuses a purchase the backend would have served, so the uncertain direction is to send it.
677
+ */
678
+ refreshLimits?: true;
665
679
  };
666
680
  /**
667
681
  * Provider is absent only when routing ended before a provider could be selected. A BLOCKED response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fun-xyz/fiat-contract",
3
- "version": "0.14.0",
3
+ "version": "0.16.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": {