@fun-xyz/fiat-contract 0.24.0 → 0.27.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 +28 -15
- package/dist/{chunk-5UEPWL7B.mjs → chunk-7ZIZANFX.mjs} +1 -1
- package/dist/{chunk-IPOPANXS.mjs → chunk-K573F2ON.mjs} +2 -2
- package/dist/{chunk-T5JAYOWY.mjs → chunk-W5HOOK34.mjs} +1 -1
- package/dist/index.js +30 -6
- package/dist/index.mjs +32 -8
- package/dist/providers/moonpay.d.ts +4 -3
- package/dist/providers/moonpay.mjs +1 -1
- package/dist/routing.d.ts +28 -9
- package/dist/routing.mjs +1 -1
- package/dist/schemas.d.ts +2 -1
- package/dist/table.js +1 -1
- package/dist/table.mjs +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -133,31 +133,43 @@ cause is unknown. Refetch the table at `expiresAt`, on `refreshLimits: true`, an
|
|
|
133
133
|
a `REQUOTE`. The schemas hold the table's invariants: each method once, sorted, non-overlapping
|
|
134
134
|
intervals, at least one provider each and none twice, and a reason only on an empty method.
|
|
135
135
|
|
|
136
|
-
`ROUTING_ENDPOINTS.quote` (`POST /fiat/routing/quote`) takes the `POST /fiat/quote` body
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
136
|
+
`ROUTING_ENDPOINTS.quote` (`POST /fiat/routing/quote`) takes the `POST /fiat/quote` body
|
|
137
|
+
(`FiatRoutingQuoteTerms`), plus one of two forms:
|
|
138
|
+
|
|
139
|
+
- `providers`: the interval's providers, best first. The backend prices them in order, falls
|
|
140
|
+
through on the refusals marked "next provider" below, and answers the first that prices or the
|
|
141
|
+
last provider's refusal.
|
|
142
|
+
- `provider`: one provider only. The client falls through itself.
|
|
143
|
+
|
|
144
|
+
Routing quotes may include `routingOverrides: { providers: [...] }` with the host’s full allowlist.
|
|
145
|
+
The selected `provider` or ordered `providers` must be a subset. The server preserves the allowlist
|
|
146
|
+
through later KYC rerouting; the amount-specific candidate list alone does not restrict rediscovery.
|
|
147
|
+
Omitting the field preserves existing behavior. An empty allowlist permits no quote candidate.
|
|
148
|
+
|
|
149
|
+
It answers the same `FiatStepResponse`, whose `provider` names the one that priced. A refusal is a
|
|
150
|
+
`FiatRoutingQuoteErrorBody`, and it decides whether the next provider may still price:
|
|
140
151
|
|
|
141
152
|
| Status | `errorCode` | Then |
|
|
142
153
|
| --- | --- | --- |
|
|
143
|
-
| 404 | `FiatNoRouteError`, `reason` `NO_CANDIDATE`, `PROVIDER_DECLINED`, `PROVIDER_OUTAGE` or `KYC_REJECTED` |
|
|
144
|
-
| 400 | `FiatNoRouteError`, `reason: USER_LIMIT`, `code: LIMITS_EXCEEDED`, `recovery: REQUOTE` |
|
|
145
|
-
| 400 | `FiatAmountBelowMinimumError` (`minFiatAmount`) or `FiatAmountAboveMaximumError` (`maxFiatAmount`) |
|
|
154
|
+
| 404 | `FiatNoRouteError`, `reason` `NO_CANDIDATE`, `PROVIDER_DECLINED`, `PROVIDER_OUTAGE` or `KYC_REJECTED` | next provider |
|
|
155
|
+
| 400 | `FiatNoRouteError`, `reason: USER_LIMIT`, `code: LIMITS_EXCEEDED`, `recovery: REQUOTE` | next provider |
|
|
156
|
+
| 400 | `FiatAmountBelowMinimumError` (`minFiatAmount`) or `FiatAmountAboveMaximumError` (`maxFiatAmount`) | next provider |
|
|
146
157
|
| 400 | `InvalidParameterError`: a bad request, an asset Fun cannot deliver, or no verified email | stop |
|
|
147
158
|
| 401, 5xx | any other: a missing or invalid identity assertion, or a server error | stop |
|
|
148
159
|
|
|
149
|
-
Every fall-through refusal is
|
|
150
|
-
|
|
151
|
-
|
|
160
|
+
Every fall-through refusal is that provider's alone, because each attempt prices only one provider:
|
|
161
|
+
`KYC_REJECTED` there means that provider refused the buyer's identity, not every provider. With no
|
|
162
|
+
provider left in the interval, refetch the table. The table route refuses with a
|
|
152
163
|
`FiatRoutingTableErrorBody`: a 429 `TooManyRequestsError` with `retryAfterSeconds` when the
|
|
153
164
|
per-login budget is spent, or a 400 or 5xx as above. The quote route has no rate limit of its own.
|
|
154
165
|
|
|
155
166
|
Both routes take geo under the `POST /fiat/quote` rules: a known `CountryCode`, a `UsStateCode`
|
|
156
167
|
region for a US buyer, and an empty `region` or `ip` read as absent. The quote route's `geo` is the
|
|
157
168
|
Fun geo endpoint's response forwarded as is. The request schemas are strict like every schema here,
|
|
158
|
-
so a client sends only the declared keys and no blank strings. `provider`
|
|
159
|
-
providers the backend routes (`RoutingProvider`)
|
|
160
|
-
replaces it for each provider that
|
|
169
|
+
so a client sends only the declared keys and no blank strings. `provider` and each `providers`
|
|
170
|
+
entry are one of the five providers the backend routes (`RoutingProvider`), `providers` with no
|
|
171
|
+
duplicates. The quote route is temporary: `POST /fiat/next` replaces it for each provider that
|
|
172
|
+
moves there.
|
|
161
173
|
|
|
162
174
|
**MoonPay (`./moonpay`).** MoonPay runs on the shared `POST /fiat/next` (`MOONPAY_ENDPOINTS.next`).
|
|
163
175
|
Every `/next` body is a `FiatNextRequest`: `provider`, `geo` (a `FiatGeo`, the geo endpoint's
|
|
@@ -196,8 +208,9 @@ A first-time buyer goes `observe` → `consent` → `connect` → `kyc` → `wai
|
|
|
196
208
|
`test/fixtures/moonpay-next/`.
|
|
197
209
|
|
|
198
210
|
A fault is a 4xx or 5xx with a `MoonPayErrorBody`: the shared `errorCode`, `errorMsg` and `reqId`,
|
|
199
|
-
plus `reason`
|
|
200
|
-
|
|
211
|
+
plus `reason` and `recovery`. The reasons are `SESSION_BUDGET_SPENT`, `RATE_LIMITED`,
|
|
212
|
+
`PROVIDER_UNAVAILABLE` (MoonPay is down), `KYC_PROVIDER_UNAVAILABLE` (Sumsub is down),
|
|
213
|
+
`SERVICE_UNAVAILABLE` (one of Fun's own stores is down) and `INVALID_REQUEST`. The recoveries are
|
|
201
214
|
`RETRY` (send the same request again), `REQUOTE`, or `NONE`. A field error is a `kyc`
|
|
202
215
|
prompt, not a fault. The zod schemas (`MoonPay*Schema`, `FiatGeoSchema`, `FiatNextRequestSchema`,
|
|
203
216
|
`TermsDocumentSchema`, `FiatTerms*Schema`) are exported from the root only.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// package.json
|
|
2
|
-
var version = "0.
|
|
2
|
+
var version = "0.27.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-
|
|
517
|
+
//# sourceMappingURL=chunk-K573F2ON.mjs.map
|
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ __export(index_exports, {
|
|
|
47
47
|
FiatProviderSchema: () => FiatProviderSchema,
|
|
48
48
|
FiatRoutingQuoteErrorBodySchema: () => FiatRoutingQuoteErrorBodySchema,
|
|
49
49
|
FiatRoutingQuoteRequestSchema: () => FiatRoutingQuoteRequestSchema,
|
|
50
|
+
FiatRoutingQuoteTermsSchema: () => FiatRoutingQuoteTermsSchema,
|
|
50
51
|
FiatRoutingTableErrorBodySchema: () => FiatRoutingTableErrorBodySchema,
|
|
51
52
|
FiatRoutingTableQuerySchema: () => FiatRoutingTableQuerySchema,
|
|
52
53
|
FiatRoutingTableResponseSchema: () => FiatRoutingTableResponseSchema,
|
|
@@ -1088,8 +1089,7 @@ var $routingTableResponse = obj({
|
|
|
1088
1089
|
methods: import_zod.z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once")
|
|
1089
1090
|
});
|
|
1090
1091
|
var FiatRoutingTableResponseSchema = $routingTableResponse;
|
|
1091
|
-
var $
|
|
1092
|
-
provider: $routingProvider,
|
|
1092
|
+
var $routingQuoteTermsShape = {
|
|
1093
1093
|
fiatCurrency: import_zod.z.enum(FIAT_CURRENCY_CODES),
|
|
1094
1094
|
fiatAmount: $decimalAmount.refine((amount) => Number(amount) > 0, "must be positive"),
|
|
1095
1095
|
cryptoCurrencyCode: $nonBlank,
|
|
@@ -1099,8 +1099,25 @@ var $routingQuoteRequest = obj({
|
|
|
1099
1099
|
(geo) => hasUsRegion(geo.alpha2, geo.region),
|
|
1100
1100
|
{ message: US_REGION_REQUIRED, path: ["region"] }
|
|
1101
1101
|
),
|
|
1102
|
-
prepareSessionAuth: import_zod.z.boolean().optional()
|
|
1103
|
-
})
|
|
1102
|
+
prepareSessionAuth: import_zod.z.boolean().optional(),
|
|
1103
|
+
routingOverrides: obj({ providers: import_zod.z.array($routingProvider) }).optional()
|
|
1104
|
+
};
|
|
1105
|
+
var $routingQuoteTerms = obj($routingQuoteTermsShape);
|
|
1106
|
+
var FiatRoutingQuoteTermsSchema = $routingQuoteTerms;
|
|
1107
|
+
var $routingQuoteRequest = import_zod.z.union([
|
|
1108
|
+
obj({
|
|
1109
|
+
...$routingQuoteTermsShape,
|
|
1110
|
+
providers: import_zod.z.array($routingProvider).min(1).refine((providers) => hasUniqueIds(providers), "each provider is listed once")
|
|
1111
|
+
}),
|
|
1112
|
+
obj({ ...$routingQuoteTermsShape, provider: $routingProvider })
|
|
1113
|
+
]).refine(
|
|
1114
|
+
(request) => {
|
|
1115
|
+
const allowed = request.routingOverrides?.providers;
|
|
1116
|
+
const selected = "providers" in request ? request.providers : [request.provider];
|
|
1117
|
+
return allowed === void 0 || selected.every((provider) => allowed.includes(provider));
|
|
1118
|
+
},
|
|
1119
|
+
{ message: "requested providers must be allowed by routingOverrides", path: ["routingOverrides"] }
|
|
1120
|
+
);
|
|
1104
1121
|
var FiatRoutingQuoteRequestSchema = $routingQuoteRequest;
|
|
1105
1122
|
var $routingServiceableRange = obj({ min: $money, max: $money, userMax: $money.nullable().optional() });
|
|
1106
1123
|
var $noRouteFields = {
|
|
@@ -1200,7 +1217,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $blockedStep
|
|
|
1200
1217
|
var FiatStepResponseSchema = $stepResponse;
|
|
1201
1218
|
|
|
1202
1219
|
// package.json
|
|
1203
|
-
var version = "0.
|
|
1220
|
+
var version = "0.27.0";
|
|
1204
1221
|
|
|
1205
1222
|
// src/table.ts
|
|
1206
1223
|
var TABLE_VERSION = version;
|
|
@@ -2938,7 +2955,14 @@ var MoonPayResponseSchemaFor = {
|
|
|
2938
2955
|
order: MoonPayOrderResponseSchema
|
|
2939
2956
|
};
|
|
2940
2957
|
var $faultFields = {
|
|
2941
|
-
reason: import_zod2.z.enum([
|
|
2958
|
+
reason: import_zod2.z.enum([
|
|
2959
|
+
"SESSION_BUDGET_SPENT",
|
|
2960
|
+
"RATE_LIMITED",
|
|
2961
|
+
"PROVIDER_UNAVAILABLE",
|
|
2962
|
+
"KYC_PROVIDER_UNAVAILABLE",
|
|
2963
|
+
"SERVICE_UNAVAILABLE",
|
|
2964
|
+
"INVALID_REQUEST"
|
|
2965
|
+
]),
|
|
2942
2966
|
recovery: import_zod2.z.enum(["RETRY", "REQUOTE", "NONE"])
|
|
2943
2967
|
};
|
|
2944
2968
|
var $fault = obj2($faultFields);
|
package/dist/index.mjs
CHANGED
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
tableEntry,
|
|
13
13
|
unofferedEndpoints,
|
|
14
14
|
unreachableStates
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K573F2ON.mjs";
|
|
16
16
|
import {
|
|
17
17
|
MOONPAY_ENDPOINTS
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-W5HOOK34.mjs";
|
|
19
19
|
import {
|
|
20
20
|
FIAT_TERMS_ENDPOINT,
|
|
21
21
|
FUN_KYC_CONSENT_DOCUMENTS,
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from "./chunk-CRNKRIKR.mjs";
|
|
25
25
|
import {
|
|
26
26
|
ROUTING_ENDPOINTS
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7ZIZANFX.mjs";
|
|
28
28
|
|
|
29
29
|
// src/codes.ts
|
|
30
30
|
var US_STATE_CODES = [
|
|
@@ -953,8 +953,7 @@ var $routingTableResponse = obj({
|
|
|
953
953
|
methods: z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once")
|
|
954
954
|
});
|
|
955
955
|
var FiatRoutingTableResponseSchema = $routingTableResponse;
|
|
956
|
-
var $
|
|
957
|
-
provider: $routingProvider,
|
|
956
|
+
var $routingQuoteTermsShape = {
|
|
958
957
|
fiatCurrency: z.enum(FIAT_CURRENCY_CODES),
|
|
959
958
|
fiatAmount: $decimalAmount.refine((amount) => Number(amount) > 0, "must be positive"),
|
|
960
959
|
cryptoCurrencyCode: $nonBlank,
|
|
@@ -964,8 +963,25 @@ var $routingQuoteRequest = obj({
|
|
|
964
963
|
(geo) => hasUsRegion(geo.alpha2, geo.region),
|
|
965
964
|
{ message: US_REGION_REQUIRED, path: ["region"] }
|
|
966
965
|
),
|
|
967
|
-
prepareSessionAuth: z.boolean().optional()
|
|
968
|
-
})
|
|
966
|
+
prepareSessionAuth: z.boolean().optional(),
|
|
967
|
+
routingOverrides: obj({ providers: z.array($routingProvider) }).optional()
|
|
968
|
+
};
|
|
969
|
+
var $routingQuoteTerms = obj($routingQuoteTermsShape);
|
|
970
|
+
var FiatRoutingQuoteTermsSchema = $routingQuoteTerms;
|
|
971
|
+
var $routingQuoteRequest = z.union([
|
|
972
|
+
obj({
|
|
973
|
+
...$routingQuoteTermsShape,
|
|
974
|
+
providers: z.array($routingProvider).min(1).refine((providers) => hasUniqueIds(providers), "each provider is listed once")
|
|
975
|
+
}),
|
|
976
|
+
obj({ ...$routingQuoteTermsShape, provider: $routingProvider })
|
|
977
|
+
]).refine(
|
|
978
|
+
(request) => {
|
|
979
|
+
const allowed = request.routingOverrides?.providers;
|
|
980
|
+
const selected = "providers" in request ? request.providers : [request.provider];
|
|
981
|
+
return allowed === void 0 || selected.every((provider) => allowed.includes(provider));
|
|
982
|
+
},
|
|
983
|
+
{ message: "requested providers must be allowed by routingOverrides", path: ["routingOverrides"] }
|
|
984
|
+
);
|
|
969
985
|
var FiatRoutingQuoteRequestSchema = $routingQuoteRequest;
|
|
970
986
|
var $routingServiceableRange = obj({ min: $money, max: $money, userMax: $money.nullable().optional() });
|
|
971
987
|
var $noRouteFields = {
|
|
@@ -2252,7 +2268,14 @@ var MoonPayResponseSchemaFor = {
|
|
|
2252
2268
|
order: MoonPayOrderResponseSchema
|
|
2253
2269
|
};
|
|
2254
2270
|
var $faultFields = {
|
|
2255
|
-
reason: z2.enum([
|
|
2271
|
+
reason: z2.enum([
|
|
2272
|
+
"SESSION_BUDGET_SPENT",
|
|
2273
|
+
"RATE_LIMITED",
|
|
2274
|
+
"PROVIDER_UNAVAILABLE",
|
|
2275
|
+
"KYC_PROVIDER_UNAVAILABLE",
|
|
2276
|
+
"SERVICE_UNAVAILABLE",
|
|
2277
|
+
"INVALID_REQUEST"
|
|
2278
|
+
]),
|
|
2256
2279
|
recovery: z2.enum(["RETRY", "REQUOTE", "NONE"])
|
|
2257
2280
|
};
|
|
2258
2281
|
var $fault = obj2($faultFields);
|
|
@@ -2287,6 +2310,7 @@ export {
|
|
|
2287
2310
|
FiatProviderSchema,
|
|
2288
2311
|
FiatRoutingQuoteErrorBodySchema,
|
|
2289
2312
|
FiatRoutingQuoteRequestSchema,
|
|
2313
|
+
FiatRoutingQuoteTermsSchema,
|
|
2290
2314
|
FiatRoutingTableErrorBodySchema,
|
|
2291
2315
|
FiatRoutingTableQuerySchema,
|
|
2292
2316
|
FiatRoutingTableResponseSchema,
|
|
@@ -188,10 +188,11 @@ export type MoonPayResponseFor = {
|
|
|
188
188
|
export type MoonPayRecovery = 'RETRY' | 'REQUOTE' | 'NONE';
|
|
189
189
|
/**
|
|
190
190
|
* `SESSION_BUDGET_SPENT`: the per-login SDK session mint budget (429). `RATE_LIMITED`: the action's
|
|
191
|
-
* request budget (429). `PROVIDER_UNAVAILABLE`: MoonPay
|
|
192
|
-
*
|
|
191
|
+
* request budget (429). `PROVIDER_UNAVAILABLE`: MoonPay is down (503). `KYC_PROVIDER_UNAVAILABLE`:
|
|
192
|
+
* the KYC provider (Sumsub) is down (503). `SERVICE_UNAVAILABLE`: one of Fun's own stores is down
|
|
193
|
+
* (503). `INVALID_REQUEST`: a bad body (400).
|
|
193
194
|
*/
|
|
194
|
-
export type MoonPayFaultReason = 'SESSION_BUDGET_SPENT' | 'RATE_LIMITED' | 'PROVIDER_UNAVAILABLE' | 'INVALID_REQUEST';
|
|
195
|
+
export type MoonPayFaultReason = 'SESSION_BUDGET_SPENT' | 'RATE_LIMITED' | 'PROVIDER_UNAVAILABLE' | 'KYC_PROVIDER_UNAVAILABLE' | 'SERVICE_UNAVAILABLE' | 'INVALID_REQUEST';
|
|
195
196
|
/** The fields a MoonPay fault adds to the shared error body. */
|
|
196
197
|
export interface MoonPayFault {
|
|
197
198
|
reason: MoonPayFaultReason;
|
package/dist/routing.d.ts
CHANGED
|
@@ -82,13 +82,8 @@ export interface FiatRoutingTableResponse {
|
|
|
82
82
|
/** In request order, duplicates removed. */
|
|
83
83
|
methods: RoutingTableMethod[];
|
|
84
84
|
}
|
|
85
|
-
/**
|
|
86
|
-
|
|
87
|
-
* provider, and never `routingOverrides`. The response is the same `FiatStepResponse` as
|
|
88
|
-
* `POST /fiat/quote`; a refusal is a `FiatRoutingQuoteErrorBody`.
|
|
89
|
-
*/
|
|
90
|
-
export interface FiatRoutingQuoteRequest {
|
|
91
|
-
provider: RoutingProvider;
|
|
85
|
+
/** The purchase terms and optional host restriction, independent of the current ordered candidates. */
|
|
86
|
+
export interface FiatRoutingQuoteTerms {
|
|
92
87
|
fiatCurrency: FiatCurrencyCode;
|
|
93
88
|
/** A positive decimal string with no leading zero, exponent or sign (`"20"`, `"20.5"`). */
|
|
94
89
|
fiatAmount: string;
|
|
@@ -106,7 +101,30 @@ export interface FiatRoutingQuoteRequest {
|
|
|
106
101
|
city?: string;
|
|
107
102
|
};
|
|
108
103
|
prepareSessionAuth?: boolean;
|
|
104
|
+
/** Host allowlist, retained for later KYC rerouting. Omitted allows every eligible provider. */
|
|
105
|
+
routingOverrides?: {
|
|
106
|
+
providers: RoutingProvider[];
|
|
107
|
+
};
|
|
109
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* `POST /fiat/routing/quote`: the terms plus which providers to price, in one of two forms.
|
|
111
|
+
*
|
|
112
|
+
* - `providers`: the interval's providers, best first. The backend prices the first, and falls
|
|
113
|
+
* through to the next on a refusal that is that provider's alone (a `FiatNoRouteError` of any
|
|
114
|
+
* `reason`, or either amount error), as the client did before. It answers the first provider that
|
|
115
|
+
* prices, or the last provider's refusal. Any other refusal stops at once.
|
|
116
|
+
* - `provider`: one provider only, with no fall-through. Kept for clients that fall through themselves.
|
|
117
|
+
*
|
|
118
|
+
* The response is the same `FiatStepResponse` as `POST /fiat/quote`, and its `provider` names the
|
|
119
|
+
* one that priced. A refusal is a `FiatRoutingQuoteErrorBody`.
|
|
120
|
+
*/
|
|
121
|
+
export type FiatRoutingQuoteRequest = FiatRoutingQuoteTerms & ({
|
|
122
|
+
providers: RoutingProvider[];
|
|
123
|
+
provider?: never;
|
|
124
|
+
} | {
|
|
125
|
+
provider: RoutingProvider;
|
|
126
|
+
providers?: never;
|
|
127
|
+
});
|
|
110
128
|
/** One serviceable range of the named provider. `userMax` is this buyer's own ceiling inside it, `null` when unmeasured. */
|
|
111
129
|
export interface RoutingServiceableRange {
|
|
112
130
|
min: FiatAmount;
|
|
@@ -160,8 +178,9 @@ export type RoutingFaultErrorBody = ErrorBodyFields & {
|
|
|
160
178
|
export type FiatRoutingTableErrorBody = RoutingRateLimitedErrorBody | RoutingFaultErrorBody;
|
|
161
179
|
/**
|
|
162
180
|
* `POST /fiat/routing/quote` refusals. A `FiatNoRouteError` (any `reason`) or either amount error is
|
|
163
|
-
* the named provider's alone
|
|
164
|
-
*
|
|
181
|
+
* the named provider's alone, so the next provider may still price: with `providers` the backend
|
|
182
|
+
* tries it, with `provider` the client does. Anything else stops the fall-through: a validation or
|
|
183
|
+
* auth refusal, a 5xx, or no provider left to try.
|
|
165
184
|
*/
|
|
166
185
|
export type FiatRoutingQuoteErrorBody = RoutingNoRouteErrorBody | RoutingAmountErrorBody | RoutingFaultErrorBody;
|
|
167
186
|
export {};
|
package/dist/routing.mjs
CHANGED
package/dist/schemas.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ import { z } from 'zod';
|
|
|
30
30
|
import type { UsStateCode } from './codes';
|
|
31
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, PreparedPayment, PaymentSurface, Quote, QuoteLimitRange, QuoteLimits, Recovery, Refund, ReportSpec, SelectOption, StatusHistoryEntry, Surface, PreferredIdentityDocument, KycFieldId, ClientExecutedDelivery, KycSdkResultReport, SurfaceKind, SurfaceProvider, TermsAcceptance, Transition, TransitionInputs, TransitionParams, Tx, FiatGeo, FiatNextRequest } from './types';
|
|
32
32
|
import type { FiatTermsErrorBody, FiatTermsRequest, FiatTermsResponse, TermsDocument, TermsDocumentAcceptance } from './terms';
|
|
33
|
-
import type { FiatRoutingQuoteErrorBody, FiatRoutingQuoteRequest, FiatRoutingTableErrorBody, FiatRoutingTableQuery, FiatRoutingTableResponse } from './routing';
|
|
33
|
+
import type { FiatRoutingQuoteErrorBody, FiatRoutingQuoteRequest, FiatRoutingQuoteTerms, FiatRoutingTableErrorBody, FiatRoutingTableQuery, FiatRoutingTableResponse } from './routing';
|
|
34
34
|
export declare const JsonSchema: z.ZodType<JsonValue>;
|
|
35
35
|
export declare const HTTP_VERBS: readonly ["GET", "POST"];
|
|
36
36
|
/** `"POST /fiat/session/verify"`, `"GET /fiat/orders/o_31c"` — the verb rides the string. */
|
|
@@ -114,6 +114,7 @@ export declare const FiatTermsResponseSchema: z.ZodType<FiatTermsResponse>;
|
|
|
114
114
|
export declare const FiatTermsErrorBodySchema: z.ZodType<FiatTermsErrorBody>;
|
|
115
115
|
export declare const FiatRoutingTableQuerySchema: z.ZodType<FiatRoutingTableQuery>;
|
|
116
116
|
export declare const FiatRoutingTableResponseSchema: z.ZodType<FiatRoutingTableResponse>;
|
|
117
|
+
export declare const FiatRoutingQuoteTermsSchema: z.ZodType<FiatRoutingQuoteTerms>;
|
|
117
118
|
export declare const FiatRoutingQuoteRequestSchema: z.ZodType<FiatRoutingQuoteRequest>;
|
|
118
119
|
export declare const FiatRoutingTableErrorBodySchema: z.ZodType<FiatRoutingTableErrorBody>;
|
|
119
120
|
export declare const FiatRoutingQuoteErrorBodySchema: z.ZodType<FiatRoutingQuoteErrorBody>;
|
package/dist/table.js
CHANGED
package/dist/table.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.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": {
|