@fun-xyz/fiat-contract 0.9.0 → 0.10.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 +3 -2
- package/dist/{chunk-5QGVY5Z4.mjs → chunk-BAGIBS54.mjs} +2 -2
- package/dist/index.js +34 -5
- package/dist/index.mjs +34 -5
- package/dist/schemas.d.ts +2 -1
- package/dist/table.js +1 -1
- package/dist/table.mjs +1 -1
- package/dist/types.d.ts +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -59,8 +59,9 @@ this package is [ENG-5268](https://linear.app/funxyz/issue/ENG-5268).
|
|
|
59
59
|
6. **Surface kind names the renderer; provider selects the adapter.** Sumsub capture is
|
|
60
60
|
`{ kind: 'KYC_SDK', provider: 'SUMSUB' }`. It is not `URL_EMBED`: the client mounts an SDK,
|
|
61
61
|
not a URL or iframe.
|
|
62
|
-
7. **Quote-screen bounds are explicit exact-money strings.** `QUOTE.limits` carries the
|
|
63
|
-
|
|
62
|
+
7. **Quote-screen bounds are explicit exact-money strings.** `QUOTE.limits` carries the bounding
|
|
63
|
+
minimum/maximum plus the exact `serviceableRanges` when a routing set has gaps; clients do not
|
|
64
|
+
infer capacity from provider metadata or floating point.
|
|
64
65
|
8. **Provider auth is capability-shaped.** SMS uses `SMS_OTP`; provider-owned auth uses
|
|
65
66
|
`PROVIDER_RENDERED` with an optional `AUTH_COMPONENT` surface rather than provider-specific channels.
|
|
66
67
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.10.0";
|
|
3
3
|
|
|
4
4
|
// src/table.ts
|
|
5
5
|
var TABLE_VERSION = version;
|
|
@@ -500,4 +500,4 @@ export {
|
|
|
500
500
|
tableEntry,
|
|
501
501
|
isTerminal
|
|
502
502
|
};
|
|
503
|
-
//# sourceMappingURL=chunk-
|
|
503
|
+
//# sourceMappingURL=chunk-BAGIBS54.mjs.map
|
package/dist/index.js
CHANGED
|
@@ -66,6 +66,7 @@ __export(index_exports, {
|
|
|
66
66
|
PaymentInstructStateSchema: () => PaymentInstructStateSchema,
|
|
67
67
|
PendingOrderStateSchema: () => PendingOrderStateSchema,
|
|
68
68
|
PollSpecSchema: () => PollSpecSchema,
|
|
69
|
+
QuoteLimitRangeSchema: () => QuoteLimitRangeSchema,
|
|
69
70
|
QuoteLimitsSchema: () => QuoteLimitsSchema,
|
|
70
71
|
QuoteSchema: () => QuoteSchema,
|
|
71
72
|
QuoteStateSchema: () => QuoteStateSchema,
|
|
@@ -464,7 +465,13 @@ var $quote = obj({
|
|
|
464
465
|
expiresAt: import_zod.z.string()
|
|
465
466
|
});
|
|
466
467
|
var QuoteSchema = $quote;
|
|
467
|
-
var $
|
|
468
|
+
var $quoteLimitRange = obj({ min: import_zod.z.string(), max: import_zod.z.string() });
|
|
469
|
+
var QuoteLimitRangeSchema = $quoteLimitRange;
|
|
470
|
+
var $quoteLimits = obj({
|
|
471
|
+
min: import_zod.z.string(),
|
|
472
|
+
max: import_zod.z.string(),
|
|
473
|
+
serviceableRanges: import_zod.z.array($quoteLimitRange).min(1).optional()
|
|
474
|
+
});
|
|
468
475
|
var QuoteLimitsSchema = $quoteLimits;
|
|
469
476
|
var $instrument = obj({ brandLabel: import_zod.z.string(), last4: import_zod.z.string() });
|
|
470
477
|
var InstrumentSchema = $instrument;
|
|
@@ -772,7 +779,7 @@ var $stepResponse = obj({
|
|
|
772
779
|
var FiatStepResponseSchema = $stepResponse;
|
|
773
780
|
|
|
774
781
|
// package.json
|
|
775
|
-
var version = "0.
|
|
782
|
+
var version = "0.10.0";
|
|
776
783
|
|
|
777
784
|
// src/table.ts
|
|
778
785
|
var TABLE_VERSION = version;
|
|
@@ -1266,7 +1273,17 @@ var FIXTURE_DATA = {
|
|
|
1266
1273
|
"kind": "QUOTE",
|
|
1267
1274
|
"limits": {
|
|
1268
1275
|
"min": "1.00",
|
|
1269
|
-
"max": "3000.00"
|
|
1276
|
+
"max": "3000.00",
|
|
1277
|
+
"serviceableRanges": [
|
|
1278
|
+
{
|
|
1279
|
+
"min": "1.00",
|
|
1280
|
+
"max": "500.00"
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
"min": "1000.00",
|
|
1284
|
+
"max": "3000.00"
|
|
1285
|
+
}
|
|
1286
|
+
]
|
|
1270
1287
|
},
|
|
1271
1288
|
"quote": {
|
|
1272
1289
|
"quoteRef": "q_8f2",
|
|
@@ -1314,7 +1331,13 @@ var FIXTURE_DATA = {
|
|
|
1314
1331
|
"kind": "QUOTE",
|
|
1315
1332
|
"limits": {
|
|
1316
1333
|
"min": "1.00",
|
|
1317
|
-
"max": "3000.00"
|
|
1334
|
+
"max": "3000.00",
|
|
1335
|
+
"serviceableRanges": [
|
|
1336
|
+
{
|
|
1337
|
+
"min": "1.00",
|
|
1338
|
+
"max": "3000.00"
|
|
1339
|
+
}
|
|
1340
|
+
]
|
|
1318
1341
|
},
|
|
1319
1342
|
"quote": {
|
|
1320
1343
|
"quoteRef": "q_8f2",
|
|
@@ -1829,7 +1852,13 @@ var FIXTURE_DATA = {
|
|
|
1829
1852
|
"kind": "QUOTE",
|
|
1830
1853
|
"limits": {
|
|
1831
1854
|
"min": "1.00",
|
|
1832
|
-
"max": "3000.00"
|
|
1855
|
+
"max": "3000.00",
|
|
1856
|
+
"serviceableRanges": [
|
|
1857
|
+
{
|
|
1858
|
+
"min": "1.00",
|
|
1859
|
+
"max": "3000.00"
|
|
1860
|
+
}
|
|
1861
|
+
]
|
|
1833
1862
|
},
|
|
1834
1863
|
"quote": {
|
|
1835
1864
|
"quoteRef": "q_8f2",
|
package/dist/index.mjs
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
tableEntry,
|
|
13
13
|
unofferedEndpoints,
|
|
14
14
|
unreachableStates
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-BAGIBS54.mjs";
|
|
16
16
|
|
|
17
17
|
// src/codes.ts
|
|
18
18
|
var COUNTRY_CURRENCY_LIST = [
|
|
@@ -370,7 +370,13 @@ var $quote = obj({
|
|
|
370
370
|
expiresAt: z.string()
|
|
371
371
|
});
|
|
372
372
|
var QuoteSchema = $quote;
|
|
373
|
-
var $
|
|
373
|
+
var $quoteLimitRange = obj({ min: z.string(), max: z.string() });
|
|
374
|
+
var QuoteLimitRangeSchema = $quoteLimitRange;
|
|
375
|
+
var $quoteLimits = obj({
|
|
376
|
+
min: z.string(),
|
|
377
|
+
max: z.string(),
|
|
378
|
+
serviceableRanges: z.array($quoteLimitRange).min(1).optional()
|
|
379
|
+
});
|
|
374
380
|
var QuoteLimitsSchema = $quoteLimits;
|
|
375
381
|
var $instrument = obj({ brandLabel: z.string(), last4: z.string() });
|
|
376
382
|
var InstrumentSchema = $instrument;
|
|
@@ -684,7 +690,17 @@ var FIXTURE_DATA = {
|
|
|
684
690
|
"kind": "QUOTE",
|
|
685
691
|
"limits": {
|
|
686
692
|
"min": "1.00",
|
|
687
|
-
"max": "3000.00"
|
|
693
|
+
"max": "3000.00",
|
|
694
|
+
"serviceableRanges": [
|
|
695
|
+
{
|
|
696
|
+
"min": "1.00",
|
|
697
|
+
"max": "500.00"
|
|
698
|
+
},
|
|
699
|
+
{
|
|
700
|
+
"min": "1000.00",
|
|
701
|
+
"max": "3000.00"
|
|
702
|
+
}
|
|
703
|
+
]
|
|
688
704
|
},
|
|
689
705
|
"quote": {
|
|
690
706
|
"quoteRef": "q_8f2",
|
|
@@ -732,7 +748,13 @@ var FIXTURE_DATA = {
|
|
|
732
748
|
"kind": "QUOTE",
|
|
733
749
|
"limits": {
|
|
734
750
|
"min": "1.00",
|
|
735
|
-
"max": "3000.00"
|
|
751
|
+
"max": "3000.00",
|
|
752
|
+
"serviceableRanges": [
|
|
753
|
+
{
|
|
754
|
+
"min": "1.00",
|
|
755
|
+
"max": "3000.00"
|
|
756
|
+
}
|
|
757
|
+
]
|
|
736
758
|
},
|
|
737
759
|
"quote": {
|
|
738
760
|
"quoteRef": "q_8f2",
|
|
@@ -1247,7 +1269,13 @@ var FIXTURE_DATA = {
|
|
|
1247
1269
|
"kind": "QUOTE",
|
|
1248
1270
|
"limits": {
|
|
1249
1271
|
"min": "1.00",
|
|
1250
|
-
"max": "3000.00"
|
|
1272
|
+
"max": "3000.00",
|
|
1273
|
+
"serviceableRanges": [
|
|
1274
|
+
{
|
|
1275
|
+
"min": "1.00",
|
|
1276
|
+
"max": "3000.00"
|
|
1277
|
+
}
|
|
1278
|
+
]
|
|
1251
1279
|
},
|
|
1252
1280
|
"quote": {
|
|
1253
1281
|
"quoteRef": "q_8f2",
|
|
@@ -1736,6 +1764,7 @@ export {
|
|
|
1736
1764
|
PaymentInstructStateSchema,
|
|
1737
1765
|
PendingOrderStateSchema,
|
|
1738
1766
|
PollSpecSchema,
|
|
1767
|
+
QuoteLimitRangeSchema,
|
|
1739
1768
|
QuoteLimitsSchema,
|
|
1740
1769
|
QuoteSchema,
|
|
1741
1770
|
QuoteStateSchema,
|
package/dist/schemas.d.ts
CHANGED
|
@@ -27,7 +27,7 @@
|
|
|
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 { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatEndpoint, FieldSpec, FlowState, FormDescriptor, FormField, FormFieldType, Instructions, InstructionField, Instrument, JsonValue, FiatAmount, OrderRef, OrderStatus, OrderSummary, PollSpec, FiatProvider, Quote, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, FiatStepResponse, Surface, SurfaceKind, SurfaceProvider, KYCProvider, Transition, TransitionInputs, TransitionParams, Tx } from './types';
|
|
30
|
+
import type { BlockedReason, CryptoAmount, FailureReason, FeeLine, FiatEndpoint, FieldSpec, FlowState, FormDescriptor, FormField, FormFieldType, Instructions, InstructionField, Instrument, JsonValue, FiatAmount, OrderRef, OrderStatus, OrderSummary, PollSpec, FiatProvider, Quote, QuoteLimitRange, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, FiatStepResponse, Surface, SurfaceKind, SurfaceProvider, KYCProvider, Transition, TransitionInputs, TransitionParams, Tx } from './types';
|
|
31
31
|
export declare const JsonSchema: z.ZodType<JsonValue>;
|
|
32
32
|
export declare const HTTP_VERBS: readonly ["GET", "POST"];
|
|
33
33
|
/** `"POST /fiat/session/verify"`, `"GET /fiat/orders/o_31c"` — the verb rides the string. */
|
|
@@ -43,6 +43,7 @@ export declare const FiatAmountSchema: z.ZodType<FiatAmount>;
|
|
|
43
43
|
export declare const CryptoAmountSchema: z.ZodType<CryptoAmount>;
|
|
44
44
|
export declare const FeeLineSchema: z.ZodType<FeeLine>;
|
|
45
45
|
export declare const QuoteSchema: z.ZodType<Quote>;
|
|
46
|
+
export declare const QuoteLimitRangeSchema: z.ZodType<QuoteLimitRange>;
|
|
46
47
|
export declare const QuoteLimitsSchema: z.ZodType<QuoteLimits>;
|
|
47
48
|
export declare const InstrumentSchema: z.ZodType<Instrument>;
|
|
48
49
|
export declare const OrderRefSchema: z.ZodType<OrderRef>;
|
package/dist/table.js
CHANGED
package/dist/table.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -151,10 +151,23 @@ export interface Quote {
|
|
|
151
151
|
paymentMethod: PaymentMethodCategory;
|
|
152
152
|
expiresAt: string;
|
|
153
153
|
}
|
|
154
|
-
/**
|
|
154
|
+
/** One inclusive amount interval the current routing set can actually serve. */
|
|
155
|
+
export interface QuoteLimitRange {
|
|
156
|
+
min: string;
|
|
157
|
+
max: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Input bounds for the quote screen. Decimal strings in the quote currency.
|
|
161
|
+
*
|
|
162
|
+
* `min`/`max` remain the bounding envelope for clients on contract <=0.9. A routing set can have
|
|
163
|
+
* gaps (one path serves a low interval and another a higher interval), so new emitters also carry
|
|
164
|
+
* the exact sorted, non-overlapping intervals in `serviceableRanges`. The field is optional only so
|
|
165
|
+
* an upgraded client can cold-render an older recorded response during a rolling deployment.
|
|
166
|
+
*/
|
|
155
167
|
export interface QuoteLimits {
|
|
156
168
|
min: string;
|
|
157
169
|
max: string;
|
|
170
|
+
serviceableRanges?: QuoteLimitRange[];
|
|
158
171
|
}
|
|
159
172
|
/** Deferred to the credit-card iteration (FE doc port ledger) — optional wherever it appears. */
|
|
160
173
|
export interface Instrument {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.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": {
|