@fun-xyz/fiat-contract 0.12.0 → 0.14.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
@@ -8,6 +8,7 @@ Four things, zero runtime logic beyond validation:
8
8
  | File | What it is |
9
9
  | --- | --- |
10
10
  | `src/types.ts` | `FlowState` · `Transition` · `FailureReason` · `Surface` · `Instructions` · `FormDescriptor` · `OrderStatus` · `FiatStepResponse` |
11
+ | `src/codes.ts` | Shared country, currency, US subdivision, and payment-method vocabularies |
11
12
  | `src/schemas.ts` | zod mirrors of every type — the single runtime validator |
12
13
  | `src/table.ts` | the transition table **as data**: per state, its legal transition set, the states any call from it may return, and `terminal: boolean` |
13
14
  | `src/assert.ts` + `src/fixtures/` | `assertFiatStepResponse` · `assertLegalEmission` · `assertLegalReturn` · `walkTable` · fixture loader + 18 recorded step responses (inlined as data — no filesystem, so React Native can bundle it) |
@@ -82,6 +83,8 @@ this package is [ENG-5268](https://linear.app/funxyz/issue/ENG-5268).
82
83
  legitimately deferred for provider auth or activation. Transitions echo that opaque reference in
83
84
  `params`; clients submit it unchanged. `Quote.quoteRef` remains required whenever a real `Quote`
84
85
  is present, and PAY must never be exposed without real current economics.
86
+ 15. **KYC may precede pricing.** Provider auth or activation may legitimately defer pricing, so a
87
+ KYC state may omit `quote`. A real `Quote` still requires `quoteRef`, and PAY is never quote-less.
85
88
 
86
89
  ## KYC SDK hints, results, and client delivery
87
90
 
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "0.12.0";
2
+ var version = "0.14.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-PHLBEDMK.mjs.map
517
+ //# sourceMappingURL=chunk-BQELSEYH.mjs.map
package/dist/codes.d.ts CHANGED
@@ -3,6 +3,9 @@
3
3
  * (circulating fiat only, no precious-metal/SDR codes); `paymentMethod` is fun-backend/provider
4
4
  * vocabulary, not a standard. `COUNTRY_CURRENCY_LIST` is the source of truth; everything below derives from it.
5
5
  */
6
+ /** ISO 3166-2:US subdivision codes for the 50 states, DC, and five inhabited territories. */
7
+ export declare const US_STATE_CODES: readonly ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DE", "DC", "FL", "GA", "HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD", "MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ", "NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC", "SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY", "AS", "GU", "MP", "PR", "VI"];
8
+ export type UsStateCode = (typeof US_STATE_CODES)[number];
6
9
  declare const COUNTRY_CURRENCY_LIST: readonly [{
7
10
  readonly country: "AD";
8
11
  readonly countryName: "Andorra";
package/dist/index.js CHANGED
@@ -95,6 +95,8 @@ __export(index_exports, {
95
95
  TxSchema: () => TxSchema,
96
96
  UNOFFERED_ENDPOINTS: () => UNOFFERED_ENDPOINTS,
97
97
  UNREACHABLE_STATES: () => UNREACHABLE_STATES,
98
+ US_STATE_CODES: () => US_STATE_CODES,
99
+ UsStateCodeSchema: () => UsStateCodeSchema,
98
100
  assertAllFixtures: () => assertAllFixtures,
99
101
  assertFiatStepResponse: () => assertFiatStepResponse,
100
102
  assertFixture: () => assertFixture,
@@ -116,6 +118,64 @@ __export(index_exports, {
116
118
  module.exports = __toCommonJS(index_exports);
117
119
 
118
120
  // src/codes.ts
121
+ var US_STATE_CODES = [
122
+ "AL",
123
+ "AK",
124
+ "AZ",
125
+ "AR",
126
+ "CA",
127
+ "CO",
128
+ "CT",
129
+ "DE",
130
+ "DC",
131
+ "FL",
132
+ "GA",
133
+ "HI",
134
+ "ID",
135
+ "IL",
136
+ "IN",
137
+ "IA",
138
+ "KS",
139
+ "KY",
140
+ "LA",
141
+ "ME",
142
+ "MD",
143
+ "MA",
144
+ "MI",
145
+ "MN",
146
+ "MS",
147
+ "MO",
148
+ "MT",
149
+ "NE",
150
+ "NV",
151
+ "NH",
152
+ "NJ",
153
+ "NM",
154
+ "NY",
155
+ "NC",
156
+ "ND",
157
+ "OH",
158
+ "OK",
159
+ "OR",
160
+ "PA",
161
+ "RI",
162
+ "SC",
163
+ "SD",
164
+ "TN",
165
+ "TX",
166
+ "UT",
167
+ "VT",
168
+ "VA",
169
+ "WA",
170
+ "WV",
171
+ "WI",
172
+ "WY",
173
+ "AS",
174
+ "GU",
175
+ "MP",
176
+ "PR",
177
+ "VI"
178
+ ];
119
179
  var COUNTRY_CURRENCY_LIST = [
120
180
  { country: "AD", countryName: "Andorra", currency: "EUR", currencyName: "Euro" },
121
181
  { country: "AE", countryName: "United Arab Emirates", currency: "AED", currencyName: "UAE Dirham" },
@@ -396,6 +456,7 @@ var HTTP_VERBS = ["GET", "POST"];
396
456
  var ENDPOINT_PATTERN = /^(GET|POST) \/fiat\/[^\s]*$/;
397
457
  var $endpoint = import_zod.z.string().regex(ENDPOINT_PATTERN, 'endpoint must read "<GET|POST> /fiat/\u2026"');
398
458
  var FiatEndpointSchema = $endpoint;
459
+ var UsStateCodeSchema = import_zod.z.enum(US_STATE_CODES);
399
460
  var $provider = import_zod.z.enum([
400
461
  "TRANSAK",
401
462
  "SWAPPED",
@@ -555,6 +616,7 @@ var STANDARD_KYC_FIELD_IDS = [
555
616
  "RESIDENTIAL_ADDRESS_POSTAL_CODE",
556
617
  "RESIDENTIAL_ADDRESS_COUNTRY",
557
618
  "TAX_IDENTIFIER",
619
+ "US_SSN_LAST_FOUR",
558
620
  "TAX_RESIDENCE_COUNTRY",
559
621
  "EMPLOYMENT_STATUS",
560
622
  "OCCUPATION_INDUSTRY",
@@ -777,7 +839,7 @@ var SessionAuthStateSchema = $sessionAuthState;
777
839
  var $kycCaptureState = obj({
778
840
  kind: import_zod.z.literal("KYC"),
779
841
  phase: import_zod.z.literal("CAPTURE"),
780
- quote: $quote,
842
+ quote: $quote.optional(),
781
843
  surface: $surface,
782
844
  error: $failureReason.optional()
783
845
  });
@@ -785,7 +847,7 @@ var KycCaptureStateSchema = $kycCaptureState;
785
847
  var $kycInputRequiredState = obj({
786
848
  kind: import_zod.z.literal("KYC"),
787
849
  phase: import_zod.z.literal("INPUT_REQUIRED"),
788
- quote: $quote,
850
+ quote: $quote.optional(),
789
851
  form: $formDescriptor,
790
852
  error: $failureReason.optional()
791
853
  });
@@ -793,7 +855,7 @@ var KycInputRequiredStateSchema = $kycInputRequiredState;
793
855
  var $kycNoActionRequiredState = obj({
794
856
  kind: import_zod.z.literal("KYC"),
795
857
  phase: import_zod.z.literal("NO_ACTION_REQUIRED"),
796
- quote: $quote,
858
+ quote: $quote.optional(),
797
859
  reason: import_zod.z.enum(["IN_REVIEW", "ON_HOLD", "REJECTED"]),
798
860
  retryAfter: import_zod.z.string().optional(),
799
861
  failureReason: $failureReason.optional(),
@@ -875,6 +937,10 @@ var $providerBoundStepResponse = obj({
875
937
  provider: $provider,
876
938
  transitions: import_zod.z.array($transition),
877
939
  routingSessionRef: import_zod.z.string().optional(),
940
+ providerAuthToken: obj({
941
+ clientSecret: import_zod.z.string(),
942
+ expiresAt: import_zod.z.string()
943
+ }).optional(),
878
944
  orderId: import_zod.z.string().optional()
879
945
  });
880
946
  var $blockedStepResponse = obj({
@@ -882,13 +948,17 @@ var $blockedStepResponse = obj({
882
948
  provider: $provider.optional(),
883
949
  transitions: import_zod.z.array($transition),
884
950
  routingSessionRef: import_zod.z.string().optional(),
951
+ providerAuthToken: obj({
952
+ clientSecret: import_zod.z.string(),
953
+ expiresAt: import_zod.z.string()
954
+ }).optional(),
885
955
  orderId: import_zod.z.string().optional()
886
956
  });
887
957
  var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $blockedStepResponse]);
888
958
  var FiatStepResponseSchema = $stepResponse;
889
959
 
890
960
  // package.json
891
- var version = "0.12.0";
961
+ var version = "0.14.0";
892
962
 
893
963
  // src/table.ts
894
964
  var TABLE_VERSION = version;
package/dist/index.mjs CHANGED
@@ -12,9 +12,67 @@ import {
12
12
  tableEntry,
13
13
  unofferedEndpoints,
14
14
  unreachableStates
15
- } from "./chunk-PHLBEDMK.mjs";
15
+ } from "./chunk-BQELSEYH.mjs";
16
16
 
17
17
  // src/codes.ts
18
+ var US_STATE_CODES = [
19
+ "AL",
20
+ "AK",
21
+ "AZ",
22
+ "AR",
23
+ "CA",
24
+ "CO",
25
+ "CT",
26
+ "DE",
27
+ "DC",
28
+ "FL",
29
+ "GA",
30
+ "HI",
31
+ "ID",
32
+ "IL",
33
+ "IN",
34
+ "IA",
35
+ "KS",
36
+ "KY",
37
+ "LA",
38
+ "ME",
39
+ "MD",
40
+ "MA",
41
+ "MI",
42
+ "MN",
43
+ "MS",
44
+ "MO",
45
+ "MT",
46
+ "NE",
47
+ "NV",
48
+ "NH",
49
+ "NJ",
50
+ "NM",
51
+ "NY",
52
+ "NC",
53
+ "ND",
54
+ "OH",
55
+ "OK",
56
+ "OR",
57
+ "PA",
58
+ "RI",
59
+ "SC",
60
+ "SD",
61
+ "TN",
62
+ "TX",
63
+ "UT",
64
+ "VT",
65
+ "VA",
66
+ "WA",
67
+ "WV",
68
+ "WI",
69
+ "WY",
70
+ "AS",
71
+ "GU",
72
+ "MP",
73
+ "PR",
74
+ "VI"
75
+ ];
18
76
  var COUNTRY_CURRENCY_LIST = [
19
77
  { country: "AD", countryName: "Andorra", currency: "EUR", currencyName: "Euro" },
20
78
  { country: "AE", countryName: "United Arab Emirates", currency: "AED", currencyName: "UAE Dirham" },
@@ -295,6 +353,7 @@ var HTTP_VERBS = ["GET", "POST"];
295
353
  var ENDPOINT_PATTERN = /^(GET|POST) \/fiat\/[^\s]*$/;
296
354
  var $endpoint = z.string().regex(ENDPOINT_PATTERN, 'endpoint must read "<GET|POST> /fiat/\u2026"');
297
355
  var FiatEndpointSchema = $endpoint;
356
+ var UsStateCodeSchema = z.enum(US_STATE_CODES);
298
357
  var $provider = z.enum([
299
358
  "TRANSAK",
300
359
  "SWAPPED",
@@ -454,6 +513,7 @@ var STANDARD_KYC_FIELD_IDS = [
454
513
  "RESIDENTIAL_ADDRESS_POSTAL_CODE",
455
514
  "RESIDENTIAL_ADDRESS_COUNTRY",
456
515
  "TAX_IDENTIFIER",
516
+ "US_SSN_LAST_FOUR",
457
517
  "TAX_RESIDENCE_COUNTRY",
458
518
  "EMPLOYMENT_STATUS",
459
519
  "OCCUPATION_INDUSTRY",
@@ -676,7 +736,7 @@ var SessionAuthStateSchema = $sessionAuthState;
676
736
  var $kycCaptureState = obj({
677
737
  kind: z.literal("KYC"),
678
738
  phase: z.literal("CAPTURE"),
679
- quote: $quote,
739
+ quote: $quote.optional(),
680
740
  surface: $surface,
681
741
  error: $failureReason.optional()
682
742
  });
@@ -684,7 +744,7 @@ var KycCaptureStateSchema = $kycCaptureState;
684
744
  var $kycInputRequiredState = obj({
685
745
  kind: z.literal("KYC"),
686
746
  phase: z.literal("INPUT_REQUIRED"),
687
- quote: $quote,
747
+ quote: $quote.optional(),
688
748
  form: $formDescriptor,
689
749
  error: $failureReason.optional()
690
750
  });
@@ -692,7 +752,7 @@ var KycInputRequiredStateSchema = $kycInputRequiredState;
692
752
  var $kycNoActionRequiredState = obj({
693
753
  kind: z.literal("KYC"),
694
754
  phase: z.literal("NO_ACTION_REQUIRED"),
695
- quote: $quote,
755
+ quote: $quote.optional(),
696
756
  reason: z.enum(["IN_REVIEW", "ON_HOLD", "REJECTED"]),
697
757
  retryAfter: z.string().optional(),
698
758
  failureReason: $failureReason.optional(),
@@ -774,6 +834,10 @@ var $providerBoundStepResponse = obj({
774
834
  provider: $provider,
775
835
  transitions: z.array($transition),
776
836
  routingSessionRef: z.string().optional(),
837
+ providerAuthToken: obj({
838
+ clientSecret: z.string(),
839
+ expiresAt: z.string()
840
+ }).optional(),
777
841
  orderId: z.string().optional()
778
842
  });
779
843
  var $blockedStepResponse = obj({
@@ -781,6 +845,10 @@ var $blockedStepResponse = obj({
781
845
  provider: $provider.optional(),
782
846
  transitions: z.array($transition),
783
847
  routingSessionRef: z.string().optional(),
848
+ providerAuthToken: obj({
849
+ clientSecret: z.string(),
850
+ expiresAt: z.string()
851
+ }).optional(),
784
852
  orderId: z.string().optional()
785
853
  });
786
854
  var $stepResponse = z.union([$providerBoundStepResponse, $blockedStepResponse]);
@@ -1922,6 +1990,8 @@ export {
1922
1990
  TxSchema,
1923
1991
  UNOFFERED_ENDPOINTS,
1924
1992
  UNREACHABLE_STATES,
1993
+ US_STATE_CODES,
1994
+ UsStateCodeSchema,
1925
1995
  assertAllFixtures,
1926
1996
  assertFiatStepResponse,
1927
1997
  assertFixture,
package/dist/schemas.d.ts CHANGED
@@ -27,12 +27,14 @@
27
27
  * They are module-private, so none of it reaches the published declarations.
28
28
  */
29
29
  import { z } from 'zod';
30
+ import type { UsStateCode } from './codes';
30
31
  import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatAmount, FiatEndpoint, FiatProvider, FiatStepResponse, FieldSpec, FlowState, FormDescriptor, FormField, FormFieldType, InstructionField, Instructions, Instrument, JsonValue, KYCProvider, OrderRef, OrderStatus, OrderSummary, PollSpec, Quote, QuoteLimitRange, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, Surface, PreferredIdentityDocument, ClientExecutedDelivery, KycSdkResultReport, SurfaceKind, SurfaceProvider, TermsAcceptance, Transition, TransitionInputs, TransitionParams, Tx } from './types';
31
32
  export declare const JsonSchema: z.ZodType<JsonValue>;
32
33
  export declare const HTTP_VERBS: readonly ["GET", "POST"];
33
34
  /** `"POST /fiat/session/verify"`, `"GET /fiat/orders/o_31c"` — the verb rides the string. */
34
35
  export declare const ENDPOINT_PATTERN: RegExp;
35
36
  export declare const FiatEndpointSchema: z.ZodType<FiatEndpoint>;
37
+ export declare const UsStateCodeSchema: z.ZodType<UsStateCode>;
36
38
  export declare const FiatProviderSchema: z.ZodType<FiatProvider>;
37
39
  export declare const KYCProviderSchema: z.ZodType<KYCProvider>;
38
40
  export declare const SurfaceProviderSchema: z.ZodType<SurfaceProvider>;
@@ -53,7 +55,7 @@ export declare const TxSchema: z.ZodType<Tx>;
53
55
  export declare const RefundSchema: z.ZodType<Refund>;
54
56
  export declare const SurfaceKindSchema: z.ZodType<SurfaceKind>;
55
57
  export declare const PreferredIdentityDocumentSchema: z.ZodType<PreferredIdentityDocument>;
56
- export declare const STANDARD_KYC_FIELD_IDS: readonly ["LEGAL_FIRST_NAME", "LEGAL_MIDDLE_NAME", "LEGAL_LAST_NAME", "DATE_OF_BIRTH", "COUNTRY_OF_BIRTH", "CITY_OF_BIRTH", "NATIONALITY", "EMAIL_ADDRESS", "EMAIL_OWNERSHIP_VERIFICATION", "PHONE_NUMBER", "PHONE_OWNERSHIP_VERIFICATION", "RESIDENTIAL_ADDRESS_LINE_1", "RESIDENTIAL_ADDRESS_LINE_2", "RESIDENTIAL_ADDRESS_CITY", "RESIDENTIAL_ADDRESS_REGION", "RESIDENTIAL_ADDRESS_POSTAL_CODE", "RESIDENTIAL_ADDRESS_COUNTRY", "TAX_IDENTIFIER", "TAX_RESIDENCE_COUNTRY", "EMPLOYMENT_STATUS", "OCCUPATION_INDUSTRY", "OCCUPATION_TITLE", "SOURCE_OF_FUNDS_DECLARATION", "SOURCE_OF_INCOME_DECLARATION", "SOURCE_OF_WEALTH_DECLARATION", "PURPOSE_OF_SERVICE", "PURPOSE_OF_TRANSACTION", "CUSTOMER_CATEGORY"];
58
+ export declare const STANDARD_KYC_FIELD_IDS: readonly ["LEGAL_FIRST_NAME", "LEGAL_MIDDLE_NAME", "LEGAL_LAST_NAME", "DATE_OF_BIRTH", "COUNTRY_OF_BIRTH", "CITY_OF_BIRTH", "NATIONALITY", "EMAIL_ADDRESS", "EMAIL_OWNERSHIP_VERIFICATION", "PHONE_NUMBER", "PHONE_OWNERSHIP_VERIFICATION", "RESIDENTIAL_ADDRESS_LINE_1", "RESIDENTIAL_ADDRESS_LINE_2", "RESIDENTIAL_ADDRESS_CITY", "RESIDENTIAL_ADDRESS_REGION", "RESIDENTIAL_ADDRESS_POSTAL_CODE", "RESIDENTIAL_ADDRESS_COUNTRY", "TAX_IDENTIFIER", "US_SSN_LAST_FOUR", "TAX_RESIDENCE_COUNTRY", "EMPLOYMENT_STATUS", "OCCUPATION_INDUSTRY", "OCCUPATION_TITLE", "SOURCE_OF_FUNDS_DECLARATION", "SOURCE_OF_INCOME_DECLARATION", "SOURCE_OF_WEALTH_DECLARATION", "PURPOSE_OF_SERVICE", "PURPOSE_OF_TRANSACTION", "CUSTOMER_CATEGORY"];
57
59
  export declare const KYC_ACKNOWLEDGEMENT_FIELD_IDS: readonly ["RISK_ACKNOWLEDGEMENT", "COOLING_OFF_ACKNOWLEDGEMENT", "TERMS_ACCEPTANCE"];
58
60
  export declare const ClientExecutedDeliverySchema: z.ZodType<ClientExecutedDelivery>;
59
61
  export declare const SurfaceSchema: z.ZodType<Surface>;
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.12.0";
39
+ var version = "0.14.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-PHLBEDMK.mjs";
14
+ } from "./chunk-BQELSEYH.mjs";
15
15
  export {
16
16
  DOCUMENTED_ENDPOINTS,
17
17
  STATE_KEYS,
package/dist/types.d.ts CHANGED
@@ -265,7 +265,7 @@ export interface PreferredIdentityDocument {
265
265
  country: string;
266
266
  }
267
267
  /** Canonical KYC values a declarative form or current-session delivery may name. */
268
- export type StandardKycFieldId = 'LEGAL_FIRST_NAME' | 'LEGAL_MIDDLE_NAME' | 'LEGAL_LAST_NAME' | 'DATE_OF_BIRTH' | 'COUNTRY_OF_BIRTH' | 'CITY_OF_BIRTH' | 'NATIONALITY' | 'EMAIL_ADDRESS' | 'EMAIL_OWNERSHIP_VERIFICATION' | 'PHONE_NUMBER' | 'PHONE_OWNERSHIP_VERIFICATION' | 'RESIDENTIAL_ADDRESS_LINE_1' | 'RESIDENTIAL_ADDRESS_LINE_2' | 'RESIDENTIAL_ADDRESS_CITY' | 'RESIDENTIAL_ADDRESS_REGION' | 'RESIDENTIAL_ADDRESS_POSTAL_CODE' | 'RESIDENTIAL_ADDRESS_COUNTRY' | 'TAX_IDENTIFIER' | 'TAX_RESIDENCE_COUNTRY' | 'EMPLOYMENT_STATUS' | 'OCCUPATION_INDUSTRY' | 'OCCUPATION_TITLE' | 'SOURCE_OF_FUNDS_DECLARATION' | 'SOURCE_OF_INCOME_DECLARATION' | 'SOURCE_OF_WEALTH_DECLARATION' | 'PURPOSE_OF_SERVICE' | 'PURPOSE_OF_TRANSACTION' | 'CUSTOMER_CATEGORY';
268
+ export type StandardKycFieldId = 'LEGAL_FIRST_NAME' | 'LEGAL_MIDDLE_NAME' | 'LEGAL_LAST_NAME' | 'DATE_OF_BIRTH' | 'COUNTRY_OF_BIRTH' | 'CITY_OF_BIRTH' | 'NATIONALITY' | 'EMAIL_ADDRESS' | 'EMAIL_OWNERSHIP_VERIFICATION' | 'PHONE_NUMBER' | 'PHONE_OWNERSHIP_VERIFICATION' | 'RESIDENTIAL_ADDRESS_LINE_1' | 'RESIDENTIAL_ADDRESS_LINE_2' | 'RESIDENTIAL_ADDRESS_CITY' | 'RESIDENTIAL_ADDRESS_REGION' | 'RESIDENTIAL_ADDRESS_POSTAL_CODE' | 'RESIDENTIAL_ADDRESS_COUNTRY' | 'TAX_IDENTIFIER' | 'US_SSN_LAST_FOUR' | 'TAX_RESIDENCE_COUNTRY' | 'EMPLOYMENT_STATUS' | 'OCCUPATION_INDUSTRY' | 'OCCUPATION_TITLE' | 'SOURCE_OF_FUNDS_DECLARATION' | 'SOURCE_OF_INCOME_DECLARATION' | 'SOURCE_OF_WEALTH_DECLARATION' | 'PURPOSE_OF_SERVICE' | 'PURPOSE_OF_TRANSACTION' | 'CUSTOMER_CATEGORY';
269
269
  export type KycAcknowledgementFieldId = 'RISK_ACKNOWLEDGEMENT' | 'COOLING_OFF_ACKNOWLEDGEMENT' | 'TERMS_ACCEPTANCE';
270
270
  export type QuestionnaireKycFieldId = `QUESTIONNAIRE_RESPONSE:${string}:${string}`;
271
271
  export type KycFieldId = StandardKycFieldId | KycAcknowledgementFieldId | QuestionnaireKycFieldId;
@@ -544,23 +544,26 @@ export type FlowState =
544
544
  surface?: Surface;
545
545
  error?: FailureReason;
546
546
  }
547
- /** Pre-order KYC states carry the routed quote so the entry screen can keep price visible. */
547
+ /**
548
+ * Pre-order KYC normally carries the routed quote so the entry screen can keep price visible.
549
+ * `quote` may be absent when provider auth or activation gates pricing.
550
+ */
548
551
  | {
549
552
  kind: 'KYC';
550
553
  phase: 'CAPTURE';
551
- quote: Quote;
554
+ quote?: Quote;
552
555
  surface: Surface;
553
556
  error?: FailureReason;
554
557
  } | {
555
558
  kind: 'KYC';
556
559
  phase: 'INPUT_REQUIRED';
557
- quote: Quote;
560
+ quote?: Quote;
558
561
  form: FormDescriptor;
559
562
  error?: FailureReason;
560
563
  } | {
561
564
  kind: 'KYC';
562
565
  phase: 'NO_ACTION_REQUIRED';
563
- quote: Quote;
566
+ quote?: Quote;
564
567
  /**
565
568
  * Note the deliberate name collision (Charles's nit, review 2026-08-14): `ON_HOLD` appears
566
569
  * here as a KYC reason *and* in `OrderStatus`. They are different things and both names come
@@ -649,6 +652,14 @@ type FiatStepResponseBase = {
649
652
  * the committed provider path independently from the quote binding.
650
653
  */
651
654
  routingSessionRef?: string;
655
+ /**
656
+ * Short-lived provider credential the client redeems for a silent sign-in before it renders the
657
+ * state. Absent means no silent path; the interactive `SESSION_AUTH` flow still applies.
658
+ */
659
+ providerAuthToken?: {
660
+ clientSecret: string;
661
+ expiresAt: string;
662
+ };
652
663
  /** TODO(open-decision): `orderId` placement — see `PAYMENT{INSTRUCT}.orderId` above. */
653
664
  orderId?: string;
654
665
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fun-xyz/fiat-contract",
3
- "version": "0.12.0",
3
+ "version": "0.14.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": {