@fun-xyz/fiat-contract 0.38.0 → 0.39.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/dist/{chunk-QVBSAAXU.mjs → chunk-LMF4OMUW.mjs} +1 -1
- package/dist/index.js +4 -11
- package/dist/index.mjs +4 -11
- package/dist/routing.d.ts +9 -0
- package/dist/table.js +1 -1
- package/dist/table.mjs +1 -1
- package/dist/types.d.ts +0 -17
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1159,7 +1159,8 @@ var $routingTableMethod = obj({
|
|
|
1159
1159
|
});
|
|
1160
1160
|
var $routingTableResponse = obj({
|
|
1161
1161
|
expiresAt: $isoInstant,
|
|
1162
|
-
methods: import_zod.z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once")
|
|
1162
|
+
methods: import_zod.z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once"),
|
|
1163
|
+
feeSubsidy: obj({ subsidized: import_zod.z.boolean() }).optional()
|
|
1163
1164
|
});
|
|
1164
1165
|
var FiatRoutingTableResponseSchema = $routingTableResponse;
|
|
1165
1166
|
var $routingQuoteTermsShape = {
|
|
@@ -1244,16 +1245,8 @@ var $providerBoundStepResponse = obj({
|
|
|
1244
1245
|
expiresAt: import_zod.z.string()
|
|
1245
1246
|
}).optional(),
|
|
1246
1247
|
orderId: import_zod.z.string().optional(),
|
|
1247
|
-
refreshLimits: import_zod.z.literal(true).optional()
|
|
1248
|
-
feeSubsidy: obj({ estimatedFee: $money.optional() }).optional()
|
|
1248
|
+
refreshLimits: import_zod.z.literal(true).optional()
|
|
1249
1249
|
}).superRefine((response, context) => {
|
|
1250
|
-
if (response.feeSubsidy !== void 0 && "quote" in response.state && response.state.quote?.feeSubsidy !== void 0) {
|
|
1251
|
-
context.addIssue({
|
|
1252
|
-
code: "custom",
|
|
1253
|
-
path: ["feeSubsidy"],
|
|
1254
|
-
message: "a priced quote carries quote.feeSubsidy instead"
|
|
1255
|
-
});
|
|
1256
|
-
}
|
|
1257
1250
|
if (response.preparedPayment !== void 0 && response.preparedPayment.surface.provider !== response.provider) {
|
|
1258
1251
|
context.addIssue({
|
|
1259
1252
|
code: "custom",
|
|
@@ -1299,7 +1292,7 @@ var $stepResponse = import_zod.z.union([$providerBoundStepResponse, $blockedStep
|
|
|
1299
1292
|
var FiatStepResponseSchema = $stepResponse;
|
|
1300
1293
|
|
|
1301
1294
|
// package.json
|
|
1302
|
-
var version = "0.
|
|
1295
|
+
var version = "0.39.0";
|
|
1303
1296
|
|
|
1304
1297
|
// src/table.ts
|
|
1305
1298
|
var TABLE_VERSION = version;
|
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-LMF4OMUW.mjs";
|
|
16
16
|
import {
|
|
17
17
|
MOONPAY_ENDPOINTS
|
|
18
18
|
} from "./chunk-TIEGTTFY.mjs";
|
|
@@ -1009,7 +1009,8 @@ var $routingTableMethod = obj({
|
|
|
1009
1009
|
});
|
|
1010
1010
|
var $routingTableResponse = obj({
|
|
1011
1011
|
expiresAt: $isoInstant,
|
|
1012
|
-
methods: z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once")
|
|
1012
|
+
methods: z.array($routingTableMethod).refine((methods) => hasUniqueIds(methods.map((entry) => entry.method)), "each method is listed once"),
|
|
1013
|
+
feeSubsidy: obj({ subsidized: z.boolean() }).optional()
|
|
1013
1014
|
});
|
|
1014
1015
|
var FiatRoutingTableResponseSchema = $routingTableResponse;
|
|
1015
1016
|
var $routingQuoteTermsShape = {
|
|
@@ -1094,16 +1095,8 @@ var $providerBoundStepResponse = obj({
|
|
|
1094
1095
|
expiresAt: z.string()
|
|
1095
1096
|
}).optional(),
|
|
1096
1097
|
orderId: z.string().optional(),
|
|
1097
|
-
refreshLimits: z.literal(true).optional()
|
|
1098
|
-
feeSubsidy: obj({ estimatedFee: $money.optional() }).optional()
|
|
1098
|
+
refreshLimits: z.literal(true).optional()
|
|
1099
1099
|
}).superRefine((response, context) => {
|
|
1100
|
-
if (response.feeSubsidy !== void 0 && "quote" in response.state && response.state.quote?.feeSubsidy !== void 0) {
|
|
1101
|
-
context.addIssue({
|
|
1102
|
-
code: "custom",
|
|
1103
|
-
path: ["feeSubsidy"],
|
|
1104
|
-
message: "a priced quote carries quote.feeSubsidy instead"
|
|
1105
|
-
});
|
|
1106
|
-
}
|
|
1107
1100
|
if (response.preparedPayment !== void 0 && response.preparedPayment.surface.provider !== response.provider) {
|
|
1108
1101
|
context.addIssue({
|
|
1109
1102
|
code: "custom",
|
package/dist/routing.d.ts
CHANGED
|
@@ -108,6 +108,15 @@ export interface FiatRoutingTableResponse {
|
|
|
108
108
|
expiresAt: string;
|
|
109
109
|
/** In request order, duplicates removed. */
|
|
110
110
|
methods: RoutingTableMethod[];
|
|
111
|
+
/**
|
|
112
|
+
* Whether this buyer's next order in the table's corridor has its fee reimbursed: show the fee as FREE
|
|
113
|
+
* when `subsidized`, before and after an amount is entered. A priced `Quote.feeSubsidy` is the exact
|
|
114
|
+
* amount and wins. Absent when the backend could not decide: treat it as not subsidized. A prediction:
|
|
115
|
+
* settlement decides again.
|
|
116
|
+
*/
|
|
117
|
+
feeSubsidy?: {
|
|
118
|
+
subsidized: boolean;
|
|
119
|
+
};
|
|
111
120
|
}
|
|
112
121
|
/** The purchase terms and optional host restriction, independent of the current ordered candidates. */
|
|
113
122
|
export interface FiatRoutingQuoteTerms {
|
package/dist/table.js
CHANGED
package/dist/table.mjs
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -162,17 +162,6 @@ export interface Quote {
|
|
|
162
162
|
*/
|
|
163
163
|
feeSubsidy?: FiatAmount;
|
|
164
164
|
}
|
|
165
|
-
/**
|
|
166
|
-
* The fee is predicted to be reimbursed after settlement: render it as FREE. Settlement decides again.
|
|
167
|
-
* Carried before any provider price exists; a priced `Quote` carries `Quote.feeSubsidy` instead.
|
|
168
|
-
*/
|
|
169
|
-
export interface FeeSubsidy {
|
|
170
|
-
/**
|
|
171
|
-
* The fee being waived, estimated from the provider's published schedule. Absent when the provider
|
|
172
|
-
* or the delivered target has no reliable estimate: show FREE without a number, never a guess.
|
|
173
|
-
*/
|
|
174
|
-
estimatedFee?: FiatAmount;
|
|
175
|
-
}
|
|
176
165
|
/** One inclusive amount interval the current routing set can actually serve. */
|
|
177
166
|
export interface QuoteLimitRange {
|
|
178
167
|
min: string;
|
|
@@ -770,12 +759,6 @@ export type FiatStepResponse = (FiatStepResponseBase & {
|
|
|
770
759
|
kind: 'BLOCKED';
|
|
771
760
|
}>;
|
|
772
761
|
provider: FiatProvider;
|
|
773
|
-
/**
|
|
774
|
-
* Sent only on the response that answers a quote request, before a price: never beside a
|
|
775
|
-
* `Quote.feeSubsidy`. Keep it by the `quoteRef` this response's transitions carry; later steps of
|
|
776
|
-
* that ref omit it, and a ref with no prediction is not subsidized.
|
|
777
|
-
*/
|
|
778
|
-
feeSubsidy?: FeeSubsidy;
|
|
779
762
|
/** Optional future payment artifact; never one of this response's currently active transitions. */
|
|
780
763
|
preparedPayment?: PreparedPayment;
|
|
781
764
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fun-xyz/fiat-contract",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.39.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": {
|