@gibs/quotes 1.13.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/LICENSE +15 -0
- package/README.md +45 -0
- package/dist/cache.d.ts +73 -0
- package/dist/cache.js +137 -0
- package/dist/carriers/calibration.d.ts +115 -0
- package/dist/carriers/calibration.js +83 -0
- package/dist/carriers/lifi.d.ts +63 -0
- package/dist/carriers/lifi.js +217 -0
- package/dist/carriers/near-intents.d.ts +91 -0
- package/dist/carriers/near-intents.js +249 -0
- package/dist/carriers/price-catalogue.d.ts +186 -0
- package/dist/carriers/price-catalogue.js +191 -0
- package/dist/carriers/relay.d.ts +97 -0
- package/dist/carriers/relay.js +242 -0
- package/dist/chain-lists.d.ts +144 -0
- package/dist/chain-lists.js +169 -0
- package/dist/client.d.ts +102 -0
- package/dist/client.js +402 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +18 -0
- package/dist/quote-guards.d.ts +128 -0
- package/dist/quote-guards.js +240 -0
- package/dist/quote-refusals.d.ts +180 -0
- package/dist/quote-refusals.js +284 -0
- package/dist/quote-service-contract.d.ts +2240 -0
- package/dist/quote-service-contract.js +247 -0
- package/dist/search/capabilities.d.ts +68 -0
- package/dist/search/capabilities.js +28 -0
- package/dist/search/enumerate.d.ts +162 -0
- package/dist/search/enumerate.js +313 -0
- package/dist/search/index.d.ts +17 -0
- package/dist/search/index.js +17 -0
- package/dist/search/serve.d.ts +178 -0
- package/dist/search/serve.js +142 -0
- package/dist/search/waves.d.ts +481 -0
- package/dist/search/waves.js +939 -0
- package/dist/single-flight.d.ts +90 -0
- package/dist/single-flight.js +142 -0
- package/dist/types.d.ts +502 -0
- package/dist/types.js +1 -0
- package/dist/upstream.d.ts +126 -0
- package/dist/upstream.js +343 -0
- package/llms.txt +217 -0
- package/package.json +142 -0
|
@@ -0,0 +1,2240 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The wire contract for `POST /v1/display-quotes` — the one endpoint a
|
|
4
|
+
* display-quote service (or a browser calling providers directly under the
|
|
5
|
+
* same contract) answers. See `docs/quote-service.md`'s "Endpoint" and
|
|
6
|
+
* "Cache" sections, which this module implements exactly.
|
|
7
|
+
*
|
|
8
|
+
* NOTHING HERE NAMES A HOST, A KEY, OR A CHAIN. This module carries the
|
|
9
|
+
* SHAPE of a request and an answer, never a fact about who asks it or what
|
|
10
|
+
* they ask about — see `docs/quote-service.md`'s "Library" section for why:
|
|
11
|
+
* this package runs for any host, with its own providers, its own chains and
|
|
12
|
+
* its own tripwires, all supplied through a configuration object a later
|
|
13
|
+
* module in this package defines.
|
|
14
|
+
*/
|
|
15
|
+
/**
|
|
16
|
+
* A decimal string of digits only — the wire spelling of a base-units
|
|
17
|
+
* amount. No sign, no decimal point, no leading `0x`: `BigInt` reads it
|
|
18
|
+
* directly.
|
|
19
|
+
*/
|
|
20
|
+
export declare const baseUnitsAmountSchema: z.ZodString;
|
|
21
|
+
/**
|
|
22
|
+
* A decimal-string amount that answers EXACTLY the amount it was asked for
|
|
23
|
+
* — a genuine, un-scaled reply, safe to hand to an execution builder as the
|
|
24
|
+
* delivery target. Branded so it cannot be confused with {@link EstimatedDelivery}
|
|
25
|
+
* at the type level, even though both are, at runtime, the same shape of
|
|
26
|
+
* string.
|
|
27
|
+
*
|
|
28
|
+
* See `quote-service-contract.test-d.ts` for the type-level proof this
|
|
29
|
+
* brand exists to make possible: an {@link EstimatedDelivery} cannot reach
|
|
30
|
+
* {@link decodeExactAmount}, and therefore cannot reach a bigint-typed
|
|
31
|
+
* execution field such as `ConsolidatedQuoteRequest.toAmount`.
|
|
32
|
+
*/
|
|
33
|
+
export declare const exactAmountSchema: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
34
|
+
export type ExactAmount = z.infer<typeof exactAmountSchema>;
|
|
35
|
+
/**
|
|
36
|
+
* A decimal-string amount SCALED from a nearby, already-cached amount's
|
|
37
|
+
* real answer — never the provider's own answer for the amount asked. See
|
|
38
|
+
* `docs/quote-service.md`'s "Rules that never bend": "A figure from a
|
|
39
|
+
* nearby amount is never presented as the user's exact quote."
|
|
40
|
+
*
|
|
41
|
+
* THIS IS THE BRAND `docs/quote-service.md` CALLS FOR BY NAME. It exists so
|
|
42
|
+
* a scaled figure is a DIFFERENT TYPE from an exact one, not merely a
|
|
43
|
+
* different runtime value that happens to carry the same shape — the two
|
|
44
|
+
* are interchangeable as plain strings, which is exactly the danger: a
|
|
45
|
+
* refactor that quietly widens a parameter from {@link ExactAmount} to
|
|
46
|
+
* `string` would let a scaled estimate slip through unnoticed. Kept
|
|
47
|
+
* distinct, `decodeExactAmount` refuses to compile against this brand, and
|
|
48
|
+
* nothing that only accepts {@link ExactAmount} can be handed one.
|
|
49
|
+
*/
|
|
50
|
+
export declare const estimatedDeliverySchema: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
51
|
+
export type EstimatedDelivery = z.infer<typeof estimatedDeliverySchema>;
|
|
52
|
+
/**
|
|
53
|
+
* Encodes a bigint amount as the wire's plain decimal-string form. The
|
|
54
|
+
* inverse of {@link decodeBaseUnitsAmount}.
|
|
55
|
+
*
|
|
56
|
+
* @param amount - a non-negative amount in base units
|
|
57
|
+
* @returns the decimal-string wire spelling
|
|
58
|
+
*/
|
|
59
|
+
export declare const encodeBaseUnitsAmount: (amount: bigint) => string;
|
|
60
|
+
/**
|
|
61
|
+
* Decodes a wire decimal-string amount into bigint base units.
|
|
62
|
+
*
|
|
63
|
+
* @param amount - the wire string
|
|
64
|
+
* @returns the bigint value
|
|
65
|
+
* @throws when `amount` is not a plain, non-negative decimal integer string
|
|
66
|
+
*/
|
|
67
|
+
export declare const decodeBaseUnitsAmount: (amount: string) => bigint;
|
|
68
|
+
/**
|
|
69
|
+
* Marks a bigint as an ask's genuine, EXACT answer, ready for the wire.
|
|
70
|
+
*
|
|
71
|
+
* @param amount - the exact delivered (or minimum) amount, in base units
|
|
72
|
+
* @returns the branded {@link ExactAmount}
|
|
73
|
+
*/
|
|
74
|
+
export declare const toExactAmount: (amount: bigint) => ExactAmount;
|
|
75
|
+
/**
|
|
76
|
+
* Marks a bigint as a SCALED estimate, ready for the wire — never a
|
|
77
|
+
* genuine answer to the amount actually asked.
|
|
78
|
+
*
|
|
79
|
+
* @param amount - the scaled delivered (or minimum) amount, in base units
|
|
80
|
+
* @returns the branded {@link EstimatedDelivery}
|
|
81
|
+
*/
|
|
82
|
+
export declare const toEstimatedDelivery: (amount: bigint) => EstimatedDelivery;
|
|
83
|
+
/**
|
|
84
|
+
* Decodes an amount an execution builder may spend as an EXACT figure.
|
|
85
|
+
*
|
|
86
|
+
* Only {@link ExactAmount} decodes here. Passing an {@link EstimatedDelivery}
|
|
87
|
+
* is a compile-time error — see `quote-service-contract.test-d.ts` — which is
|
|
88
|
+
* what makes `docs/quote-service.md`'s rule ("a scaled figure is unsafe" for
|
|
89
|
+
* `precision: 'exact'`) impossible to violate by accident rather than merely
|
|
90
|
+
* documented.
|
|
91
|
+
*
|
|
92
|
+
* @param amount - a branded exact amount
|
|
93
|
+
* @returns the bigint value
|
|
94
|
+
*/
|
|
95
|
+
export declare const decodeExactAmount: (amount: ExactAmount) => bigint;
|
|
96
|
+
/**
|
|
97
|
+
* A chain-and-token pair a {@link DisplayAsk} names on one side of the
|
|
98
|
+
* transfer.
|
|
99
|
+
*/
|
|
100
|
+
export declare const assetRefSchema: z.ZodObject<{
|
|
101
|
+
chainId: z.ZodNumber;
|
|
102
|
+
token: z.ZodString;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
chainId: number;
|
|
105
|
+
token: string;
|
|
106
|
+
}, {
|
|
107
|
+
chainId: number;
|
|
108
|
+
token: string;
|
|
109
|
+
}>;
|
|
110
|
+
export type AssetRef = z.infer<typeof assetRefSchema>;
|
|
111
|
+
/**
|
|
112
|
+
* One question inside a display-quote request: what every eligible
|
|
113
|
+
* provider expects to deliver for `amount` of `from.token` sent as
|
|
114
|
+
* `to.token`.
|
|
115
|
+
*
|
|
116
|
+
* See `docs/quote-service.md`'s "Endpoint" section for the field-by-field
|
|
117
|
+
* contract this schema encodes exactly.
|
|
118
|
+
*/
|
|
119
|
+
export declare const displayAskSchema: z.ZodObject<{
|
|
120
|
+
from: z.ZodObject<{
|
|
121
|
+
chainId: z.ZodNumber;
|
|
122
|
+
token: z.ZodString;
|
|
123
|
+
}, "strict", z.ZodTypeAny, {
|
|
124
|
+
chainId: number;
|
|
125
|
+
token: string;
|
|
126
|
+
}, {
|
|
127
|
+
chainId: number;
|
|
128
|
+
token: string;
|
|
129
|
+
}>;
|
|
130
|
+
to: z.ZodObject<{
|
|
131
|
+
chainId: z.ZodNumber;
|
|
132
|
+
token: z.ZodString;
|
|
133
|
+
}, "strict", z.ZodTypeAny, {
|
|
134
|
+
chainId: number;
|
|
135
|
+
token: string;
|
|
136
|
+
}, {
|
|
137
|
+
chainId: number;
|
|
138
|
+
token: string;
|
|
139
|
+
}>;
|
|
140
|
+
/** Decimal string, base units of `from.token`. */
|
|
141
|
+
amount: z.ZodString;
|
|
142
|
+
/**
|
|
143
|
+
* Defaults to the ecosystem `to.chainId` belongs to when omitted — see
|
|
144
|
+
* `ecosystemByChainId` in `@gibs/bridge-sdk`.
|
|
145
|
+
*/
|
|
146
|
+
recipientEcosystem: z.ZodOptional<z.ZodEnum<["evm", "svm", "bvm", "tvm", "tonvm", "hypevm", "zcash"]>>;
|
|
147
|
+
/** Defaults to every provider eligible for this pair when omitted. */
|
|
148
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodEnum<["lifi", "relay", "near-intents"]>, "many">>;
|
|
149
|
+
/** Defaults to `'estimate-ok'` when omitted. */
|
|
150
|
+
precision: z.ZodOptional<z.ZodEnum<["estimate-ok", "exact"]>>;
|
|
151
|
+
}, "strict", z.ZodTypeAny, {
|
|
152
|
+
from: {
|
|
153
|
+
chainId: number;
|
|
154
|
+
token: string;
|
|
155
|
+
};
|
|
156
|
+
to: {
|
|
157
|
+
chainId: number;
|
|
158
|
+
token: string;
|
|
159
|
+
};
|
|
160
|
+
amount: string;
|
|
161
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
162
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
163
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
164
|
+
}, {
|
|
165
|
+
from: {
|
|
166
|
+
chainId: number;
|
|
167
|
+
token: string;
|
|
168
|
+
};
|
|
169
|
+
to: {
|
|
170
|
+
chainId: number;
|
|
171
|
+
token: string;
|
|
172
|
+
};
|
|
173
|
+
amount: string;
|
|
174
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
175
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
176
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
177
|
+
}>;
|
|
178
|
+
export type DisplayAsk = z.infer<typeof displayAskSchema>;
|
|
179
|
+
/** The body of `POST /v1/display-quotes`: 1 to 24 asks, answered in order. */
|
|
180
|
+
export declare const displayQuoteRequestSchema: z.ZodObject<{
|
|
181
|
+
asks: z.ZodArray<z.ZodObject<{
|
|
182
|
+
from: z.ZodObject<{
|
|
183
|
+
chainId: z.ZodNumber;
|
|
184
|
+
token: z.ZodString;
|
|
185
|
+
}, "strict", z.ZodTypeAny, {
|
|
186
|
+
chainId: number;
|
|
187
|
+
token: string;
|
|
188
|
+
}, {
|
|
189
|
+
chainId: number;
|
|
190
|
+
token: string;
|
|
191
|
+
}>;
|
|
192
|
+
to: z.ZodObject<{
|
|
193
|
+
chainId: z.ZodNumber;
|
|
194
|
+
token: z.ZodString;
|
|
195
|
+
}, "strict", z.ZodTypeAny, {
|
|
196
|
+
chainId: number;
|
|
197
|
+
token: string;
|
|
198
|
+
}, {
|
|
199
|
+
chainId: number;
|
|
200
|
+
token: string;
|
|
201
|
+
}>;
|
|
202
|
+
/** Decimal string, base units of `from.token`. */
|
|
203
|
+
amount: z.ZodString;
|
|
204
|
+
/**
|
|
205
|
+
* Defaults to the ecosystem `to.chainId` belongs to when omitted — see
|
|
206
|
+
* `ecosystemByChainId` in `@gibs/bridge-sdk`.
|
|
207
|
+
*/
|
|
208
|
+
recipientEcosystem: z.ZodOptional<z.ZodEnum<["evm", "svm", "bvm", "tvm", "tonvm", "hypevm", "zcash"]>>;
|
|
209
|
+
/** Defaults to every provider eligible for this pair when omitted. */
|
|
210
|
+
providers: z.ZodOptional<z.ZodArray<z.ZodEnum<["lifi", "relay", "near-intents"]>, "many">>;
|
|
211
|
+
/** Defaults to `'estimate-ok'` when omitted. */
|
|
212
|
+
precision: z.ZodOptional<z.ZodEnum<["estimate-ok", "exact"]>>;
|
|
213
|
+
}, "strict", z.ZodTypeAny, {
|
|
214
|
+
from: {
|
|
215
|
+
chainId: number;
|
|
216
|
+
token: string;
|
|
217
|
+
};
|
|
218
|
+
to: {
|
|
219
|
+
chainId: number;
|
|
220
|
+
token: string;
|
|
221
|
+
};
|
|
222
|
+
amount: string;
|
|
223
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
224
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
225
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
from: {
|
|
228
|
+
chainId: number;
|
|
229
|
+
token: string;
|
|
230
|
+
};
|
|
231
|
+
to: {
|
|
232
|
+
chainId: number;
|
|
233
|
+
token: string;
|
|
234
|
+
};
|
|
235
|
+
amount: string;
|
|
236
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
237
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
238
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
239
|
+
}>, "many">;
|
|
240
|
+
}, "strict", z.ZodTypeAny, {
|
|
241
|
+
asks: {
|
|
242
|
+
from: {
|
|
243
|
+
chainId: number;
|
|
244
|
+
token: string;
|
|
245
|
+
};
|
|
246
|
+
to: {
|
|
247
|
+
chainId: number;
|
|
248
|
+
token: string;
|
|
249
|
+
};
|
|
250
|
+
amount: string;
|
|
251
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
252
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
253
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
254
|
+
}[];
|
|
255
|
+
}, {
|
|
256
|
+
asks: {
|
|
257
|
+
from: {
|
|
258
|
+
chainId: number;
|
|
259
|
+
token: string;
|
|
260
|
+
};
|
|
261
|
+
to: {
|
|
262
|
+
chainId: number;
|
|
263
|
+
token: string;
|
|
264
|
+
};
|
|
265
|
+
amount: string;
|
|
266
|
+
recipientEcosystem?: "evm" | "svm" | "bvm" | "tvm" | "tonvm" | "hypevm" | "zcash" | undefined;
|
|
267
|
+
providers?: ("lifi" | "relay" | "near-intents")[] | undefined;
|
|
268
|
+
precision?: "exact" | "estimate-ok" | undefined;
|
|
269
|
+
}[];
|
|
270
|
+
}>;
|
|
271
|
+
export type DisplayQuoteRequest = z.infer<typeof displayQuoteRequestSchema>;
|
|
272
|
+
/** Where an answer came from, relative to this service's cache. */
|
|
273
|
+
export declare const displayAnswerCacheStateSchema: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
274
|
+
export type DisplayAnswerCacheState = z.infer<typeof displayAnswerCacheStateSchema>;
|
|
275
|
+
/** A genuine answer to exactly the amount asked. */
|
|
276
|
+
export declare const exactQuotedDisplayAnswerSchema: z.ZodObject<{
|
|
277
|
+
basis: z.ZodLiteral<"exact">;
|
|
278
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
279
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
280
|
+
status: z.ZodLiteral<"quoted">;
|
|
281
|
+
/**
|
|
282
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
283
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
284
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
285
|
+
*/
|
|
286
|
+
askedAmount: z.ZodString;
|
|
287
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
288
|
+
quotedAt: z.ZodString;
|
|
289
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
290
|
+
ageMs: z.ZodNumber;
|
|
291
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
292
|
+
}, "strict", z.ZodTypeAny, {
|
|
293
|
+
status: "quoted";
|
|
294
|
+
basis: "exact";
|
|
295
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
296
|
+
askedAmount: string;
|
|
297
|
+
quotedAt: string;
|
|
298
|
+
ageMs: number;
|
|
299
|
+
cache: "miss" | "hit" | "joined";
|
|
300
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
301
|
+
}, {
|
|
302
|
+
status: "quoted";
|
|
303
|
+
basis: "exact";
|
|
304
|
+
expectedAmount: string;
|
|
305
|
+
askedAmount: string;
|
|
306
|
+
quotedAt: string;
|
|
307
|
+
ageMs: number;
|
|
308
|
+
cache: "miss" | "hit" | "joined";
|
|
309
|
+
minimumAmount?: string | undefined;
|
|
310
|
+
}>;
|
|
311
|
+
export type ExactQuotedDisplayAnswer = z.infer<typeof exactQuotedDisplayAnswerSchema>;
|
|
312
|
+
/**
|
|
313
|
+
* An answer SCALED from a nearby cached amount's real answer — see
|
|
314
|
+
* `docs/quote-service.md`'s "Cache" section, "Scaling". `scaledFrom` carries
|
|
315
|
+
* the RAW pair the scaling was computed from (the amount actually asked
|
|
316
|
+
* upstream, and its own unscaled answer), so a client can audit or
|
|
317
|
+
* re-derive the figure; `expectedAmount`/`minimumAmount` are the SCALED
|
|
318
|
+
* estimate for this ask's own `askedAmount`.
|
|
319
|
+
*/
|
|
320
|
+
export declare const scaledQuotedDisplayAnswerSchema: z.ZodObject<{
|
|
321
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
322
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
323
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
324
|
+
scaledFrom: z.ZodObject<{
|
|
325
|
+
askedAmount: z.ZodString;
|
|
326
|
+
expectedAmount: z.ZodString;
|
|
327
|
+
}, "strict", z.ZodTypeAny, {
|
|
328
|
+
expectedAmount: string;
|
|
329
|
+
askedAmount: string;
|
|
330
|
+
}, {
|
|
331
|
+
expectedAmount: string;
|
|
332
|
+
askedAmount: string;
|
|
333
|
+
}>;
|
|
334
|
+
status: z.ZodLiteral<"quoted">;
|
|
335
|
+
/**
|
|
336
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
337
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
338
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
339
|
+
*/
|
|
340
|
+
askedAmount: z.ZodString;
|
|
341
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
342
|
+
quotedAt: z.ZodString;
|
|
343
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
344
|
+
ageMs: z.ZodNumber;
|
|
345
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
346
|
+
}, "strict", z.ZodTypeAny, {
|
|
347
|
+
status: "quoted";
|
|
348
|
+
basis: "scaled-from-nearby-amount";
|
|
349
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
350
|
+
askedAmount: string;
|
|
351
|
+
quotedAt: string;
|
|
352
|
+
ageMs: number;
|
|
353
|
+
cache: "miss" | "hit" | "joined";
|
|
354
|
+
scaledFrom: {
|
|
355
|
+
expectedAmount: string;
|
|
356
|
+
askedAmount: string;
|
|
357
|
+
};
|
|
358
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
359
|
+
}, {
|
|
360
|
+
status: "quoted";
|
|
361
|
+
basis: "scaled-from-nearby-amount";
|
|
362
|
+
expectedAmount: string;
|
|
363
|
+
askedAmount: string;
|
|
364
|
+
quotedAt: string;
|
|
365
|
+
ageMs: number;
|
|
366
|
+
cache: "miss" | "hit" | "joined";
|
|
367
|
+
scaledFrom: {
|
|
368
|
+
expectedAmount: string;
|
|
369
|
+
askedAmount: string;
|
|
370
|
+
};
|
|
371
|
+
minimumAmount?: string | undefined;
|
|
372
|
+
}>;
|
|
373
|
+
export type ScaledQuotedDisplayAnswer = z.infer<typeof scaledQuotedDisplayAnswerSchema>;
|
|
374
|
+
export declare const quotedDisplayAnswerSchema: z.ZodUnion<[z.ZodObject<{
|
|
375
|
+
basis: z.ZodLiteral<"exact">;
|
|
376
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
377
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
378
|
+
status: z.ZodLiteral<"quoted">;
|
|
379
|
+
/**
|
|
380
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
381
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
382
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
383
|
+
*/
|
|
384
|
+
askedAmount: z.ZodString;
|
|
385
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
386
|
+
quotedAt: z.ZodString;
|
|
387
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
388
|
+
ageMs: z.ZodNumber;
|
|
389
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
390
|
+
}, "strict", z.ZodTypeAny, {
|
|
391
|
+
status: "quoted";
|
|
392
|
+
basis: "exact";
|
|
393
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
394
|
+
askedAmount: string;
|
|
395
|
+
quotedAt: string;
|
|
396
|
+
ageMs: number;
|
|
397
|
+
cache: "miss" | "hit" | "joined";
|
|
398
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
399
|
+
}, {
|
|
400
|
+
status: "quoted";
|
|
401
|
+
basis: "exact";
|
|
402
|
+
expectedAmount: string;
|
|
403
|
+
askedAmount: string;
|
|
404
|
+
quotedAt: string;
|
|
405
|
+
ageMs: number;
|
|
406
|
+
cache: "miss" | "hit" | "joined";
|
|
407
|
+
minimumAmount?: string | undefined;
|
|
408
|
+
}>, z.ZodObject<{
|
|
409
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
410
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
411
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
412
|
+
scaledFrom: z.ZodObject<{
|
|
413
|
+
askedAmount: z.ZodString;
|
|
414
|
+
expectedAmount: z.ZodString;
|
|
415
|
+
}, "strict", z.ZodTypeAny, {
|
|
416
|
+
expectedAmount: string;
|
|
417
|
+
askedAmount: string;
|
|
418
|
+
}, {
|
|
419
|
+
expectedAmount: string;
|
|
420
|
+
askedAmount: string;
|
|
421
|
+
}>;
|
|
422
|
+
status: z.ZodLiteral<"quoted">;
|
|
423
|
+
/**
|
|
424
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
425
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
426
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
427
|
+
*/
|
|
428
|
+
askedAmount: z.ZodString;
|
|
429
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
430
|
+
quotedAt: z.ZodString;
|
|
431
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
432
|
+
ageMs: z.ZodNumber;
|
|
433
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
434
|
+
}, "strict", z.ZodTypeAny, {
|
|
435
|
+
status: "quoted";
|
|
436
|
+
basis: "scaled-from-nearby-amount";
|
|
437
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
438
|
+
askedAmount: string;
|
|
439
|
+
quotedAt: string;
|
|
440
|
+
ageMs: number;
|
|
441
|
+
cache: "miss" | "hit" | "joined";
|
|
442
|
+
scaledFrom: {
|
|
443
|
+
expectedAmount: string;
|
|
444
|
+
askedAmount: string;
|
|
445
|
+
};
|
|
446
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
447
|
+
}, {
|
|
448
|
+
status: "quoted";
|
|
449
|
+
basis: "scaled-from-nearby-amount";
|
|
450
|
+
expectedAmount: string;
|
|
451
|
+
askedAmount: string;
|
|
452
|
+
quotedAt: string;
|
|
453
|
+
ageMs: number;
|
|
454
|
+
cache: "miss" | "hit" | "joined";
|
|
455
|
+
scaledFrom: {
|
|
456
|
+
expectedAmount: string;
|
|
457
|
+
askedAmount: string;
|
|
458
|
+
};
|
|
459
|
+
minimumAmount?: string | undefined;
|
|
460
|
+
}>]>;
|
|
461
|
+
export type QuotedDisplayAnswer = z.infer<typeof quotedDisplayAnswerSchema>;
|
|
462
|
+
/** The provider was asked and declined, could not be asked, or was never asked at all. */
|
|
463
|
+
export declare const refusedDisplayAnswerSchema: z.ZodObject<{
|
|
464
|
+
status: z.ZodLiteral<"refused">;
|
|
465
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
466
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
467
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
468
|
+
}, "strict", z.ZodTypeAny, {
|
|
469
|
+
status: "refused";
|
|
470
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
471
|
+
reason: string | null;
|
|
472
|
+
minimumAmount?: string | undefined;
|
|
473
|
+
}, {
|
|
474
|
+
status: "refused";
|
|
475
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
476
|
+
reason: string | null;
|
|
477
|
+
minimumAmount?: string | undefined;
|
|
478
|
+
}>;
|
|
479
|
+
export type RefusedDisplayAnswer = z.infer<typeof refusedDisplayAnswerSchema>;
|
|
480
|
+
/** The provider's own call is still in flight; ask again after `retryAfterMs`. */
|
|
481
|
+
export declare const pendingDisplayAnswerSchema: z.ZodObject<{
|
|
482
|
+
status: z.ZodLiteral<"pending">;
|
|
483
|
+
retryAfterMs: z.ZodNumber;
|
|
484
|
+
}, "strict", z.ZodTypeAny, {
|
|
485
|
+
status: "pending";
|
|
486
|
+
retryAfterMs: number;
|
|
487
|
+
}, {
|
|
488
|
+
status: "pending";
|
|
489
|
+
retryAfterMs: number;
|
|
490
|
+
}>;
|
|
491
|
+
export type PendingDisplayAnswer = z.infer<typeof pendingDisplayAnswerSchema>;
|
|
492
|
+
/** One provider's answer to one {@link DisplayAsk} — the three shapes `docs/quote-service.md`'s "Endpoint" section names. */
|
|
493
|
+
export declare const displayProviderSlotSchema: z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
494
|
+
basis: z.ZodLiteral<"exact">;
|
|
495
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
496
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
497
|
+
status: z.ZodLiteral<"quoted">;
|
|
498
|
+
/**
|
|
499
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
500
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
501
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
502
|
+
*/
|
|
503
|
+
askedAmount: z.ZodString;
|
|
504
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
505
|
+
quotedAt: z.ZodString;
|
|
506
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
507
|
+
ageMs: z.ZodNumber;
|
|
508
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
509
|
+
}, "strict", z.ZodTypeAny, {
|
|
510
|
+
status: "quoted";
|
|
511
|
+
basis: "exact";
|
|
512
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
513
|
+
askedAmount: string;
|
|
514
|
+
quotedAt: string;
|
|
515
|
+
ageMs: number;
|
|
516
|
+
cache: "miss" | "hit" | "joined";
|
|
517
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
518
|
+
}, {
|
|
519
|
+
status: "quoted";
|
|
520
|
+
basis: "exact";
|
|
521
|
+
expectedAmount: string;
|
|
522
|
+
askedAmount: string;
|
|
523
|
+
quotedAt: string;
|
|
524
|
+
ageMs: number;
|
|
525
|
+
cache: "miss" | "hit" | "joined";
|
|
526
|
+
minimumAmount?: string | undefined;
|
|
527
|
+
}>, z.ZodObject<{
|
|
528
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
529
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
530
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
531
|
+
scaledFrom: z.ZodObject<{
|
|
532
|
+
askedAmount: z.ZodString;
|
|
533
|
+
expectedAmount: z.ZodString;
|
|
534
|
+
}, "strict", z.ZodTypeAny, {
|
|
535
|
+
expectedAmount: string;
|
|
536
|
+
askedAmount: string;
|
|
537
|
+
}, {
|
|
538
|
+
expectedAmount: string;
|
|
539
|
+
askedAmount: string;
|
|
540
|
+
}>;
|
|
541
|
+
status: z.ZodLiteral<"quoted">;
|
|
542
|
+
/**
|
|
543
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
544
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
545
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
546
|
+
*/
|
|
547
|
+
askedAmount: z.ZodString;
|
|
548
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
549
|
+
quotedAt: z.ZodString;
|
|
550
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
551
|
+
ageMs: z.ZodNumber;
|
|
552
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
553
|
+
}, "strict", z.ZodTypeAny, {
|
|
554
|
+
status: "quoted";
|
|
555
|
+
basis: "scaled-from-nearby-amount";
|
|
556
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
557
|
+
askedAmount: string;
|
|
558
|
+
quotedAt: string;
|
|
559
|
+
ageMs: number;
|
|
560
|
+
cache: "miss" | "hit" | "joined";
|
|
561
|
+
scaledFrom: {
|
|
562
|
+
expectedAmount: string;
|
|
563
|
+
askedAmount: string;
|
|
564
|
+
};
|
|
565
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
566
|
+
}, {
|
|
567
|
+
status: "quoted";
|
|
568
|
+
basis: "scaled-from-nearby-amount";
|
|
569
|
+
expectedAmount: string;
|
|
570
|
+
askedAmount: string;
|
|
571
|
+
quotedAt: string;
|
|
572
|
+
ageMs: number;
|
|
573
|
+
cache: "miss" | "hit" | "joined";
|
|
574
|
+
scaledFrom: {
|
|
575
|
+
expectedAmount: string;
|
|
576
|
+
askedAmount: string;
|
|
577
|
+
};
|
|
578
|
+
minimumAmount?: string | undefined;
|
|
579
|
+
}>]>, z.ZodObject<{
|
|
580
|
+
status: z.ZodLiteral<"refused">;
|
|
581
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
582
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
583
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
584
|
+
}, "strict", z.ZodTypeAny, {
|
|
585
|
+
status: "refused";
|
|
586
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
587
|
+
reason: string | null;
|
|
588
|
+
minimumAmount?: string | undefined;
|
|
589
|
+
}, {
|
|
590
|
+
status: "refused";
|
|
591
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
592
|
+
reason: string | null;
|
|
593
|
+
minimumAmount?: string | undefined;
|
|
594
|
+
}>, z.ZodObject<{
|
|
595
|
+
status: z.ZodLiteral<"pending">;
|
|
596
|
+
retryAfterMs: z.ZodNumber;
|
|
597
|
+
}, "strict", z.ZodTypeAny, {
|
|
598
|
+
status: "pending";
|
|
599
|
+
retryAfterMs: number;
|
|
600
|
+
}, {
|
|
601
|
+
status: "pending";
|
|
602
|
+
retryAfterMs: number;
|
|
603
|
+
}>]>;
|
|
604
|
+
export type DisplayProviderSlot = z.infer<typeof displayProviderSlotSchema>;
|
|
605
|
+
/** Every provider slot answered for one {@link DisplayAsk}, keyed by provider id. */
|
|
606
|
+
export declare const displayAnswerSchema: z.ZodObject<{
|
|
607
|
+
providers: z.ZodObject<{
|
|
608
|
+
lifi: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
609
|
+
basis: z.ZodLiteral<"exact">;
|
|
610
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
611
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
612
|
+
status: z.ZodLiteral<"quoted">;
|
|
613
|
+
/**
|
|
614
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
615
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
616
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
617
|
+
*/
|
|
618
|
+
askedAmount: z.ZodString;
|
|
619
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
620
|
+
quotedAt: z.ZodString;
|
|
621
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
622
|
+
ageMs: z.ZodNumber;
|
|
623
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
624
|
+
}, "strict", z.ZodTypeAny, {
|
|
625
|
+
status: "quoted";
|
|
626
|
+
basis: "exact";
|
|
627
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
628
|
+
askedAmount: string;
|
|
629
|
+
quotedAt: string;
|
|
630
|
+
ageMs: number;
|
|
631
|
+
cache: "miss" | "hit" | "joined";
|
|
632
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
633
|
+
}, {
|
|
634
|
+
status: "quoted";
|
|
635
|
+
basis: "exact";
|
|
636
|
+
expectedAmount: string;
|
|
637
|
+
askedAmount: string;
|
|
638
|
+
quotedAt: string;
|
|
639
|
+
ageMs: number;
|
|
640
|
+
cache: "miss" | "hit" | "joined";
|
|
641
|
+
minimumAmount?: string | undefined;
|
|
642
|
+
}>, z.ZodObject<{
|
|
643
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
644
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
645
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
646
|
+
scaledFrom: z.ZodObject<{
|
|
647
|
+
askedAmount: z.ZodString;
|
|
648
|
+
expectedAmount: z.ZodString;
|
|
649
|
+
}, "strict", z.ZodTypeAny, {
|
|
650
|
+
expectedAmount: string;
|
|
651
|
+
askedAmount: string;
|
|
652
|
+
}, {
|
|
653
|
+
expectedAmount: string;
|
|
654
|
+
askedAmount: string;
|
|
655
|
+
}>;
|
|
656
|
+
status: z.ZodLiteral<"quoted">;
|
|
657
|
+
/**
|
|
658
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
659
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
660
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
661
|
+
*/
|
|
662
|
+
askedAmount: z.ZodString;
|
|
663
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
664
|
+
quotedAt: z.ZodString;
|
|
665
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
666
|
+
ageMs: z.ZodNumber;
|
|
667
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
668
|
+
}, "strict", z.ZodTypeAny, {
|
|
669
|
+
status: "quoted";
|
|
670
|
+
basis: "scaled-from-nearby-amount";
|
|
671
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
672
|
+
askedAmount: string;
|
|
673
|
+
quotedAt: string;
|
|
674
|
+
ageMs: number;
|
|
675
|
+
cache: "miss" | "hit" | "joined";
|
|
676
|
+
scaledFrom: {
|
|
677
|
+
expectedAmount: string;
|
|
678
|
+
askedAmount: string;
|
|
679
|
+
};
|
|
680
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
681
|
+
}, {
|
|
682
|
+
status: "quoted";
|
|
683
|
+
basis: "scaled-from-nearby-amount";
|
|
684
|
+
expectedAmount: string;
|
|
685
|
+
askedAmount: string;
|
|
686
|
+
quotedAt: string;
|
|
687
|
+
ageMs: number;
|
|
688
|
+
cache: "miss" | "hit" | "joined";
|
|
689
|
+
scaledFrom: {
|
|
690
|
+
expectedAmount: string;
|
|
691
|
+
askedAmount: string;
|
|
692
|
+
};
|
|
693
|
+
minimumAmount?: string | undefined;
|
|
694
|
+
}>]>, z.ZodObject<{
|
|
695
|
+
status: z.ZodLiteral<"refused">;
|
|
696
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
697
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
698
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
699
|
+
}, "strict", z.ZodTypeAny, {
|
|
700
|
+
status: "refused";
|
|
701
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
702
|
+
reason: string | null;
|
|
703
|
+
minimumAmount?: string | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
status: "refused";
|
|
706
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
707
|
+
reason: string | null;
|
|
708
|
+
minimumAmount?: string | undefined;
|
|
709
|
+
}>, z.ZodObject<{
|
|
710
|
+
status: z.ZodLiteral<"pending">;
|
|
711
|
+
retryAfterMs: z.ZodNumber;
|
|
712
|
+
}, "strict", z.ZodTypeAny, {
|
|
713
|
+
status: "pending";
|
|
714
|
+
retryAfterMs: number;
|
|
715
|
+
}, {
|
|
716
|
+
status: "pending";
|
|
717
|
+
retryAfterMs: number;
|
|
718
|
+
}>]>>;
|
|
719
|
+
relay: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
720
|
+
basis: z.ZodLiteral<"exact">;
|
|
721
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
722
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
723
|
+
status: z.ZodLiteral<"quoted">;
|
|
724
|
+
/**
|
|
725
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
726
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
727
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
728
|
+
*/
|
|
729
|
+
askedAmount: z.ZodString;
|
|
730
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
731
|
+
quotedAt: z.ZodString;
|
|
732
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
733
|
+
ageMs: z.ZodNumber;
|
|
734
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
735
|
+
}, "strict", z.ZodTypeAny, {
|
|
736
|
+
status: "quoted";
|
|
737
|
+
basis: "exact";
|
|
738
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
739
|
+
askedAmount: string;
|
|
740
|
+
quotedAt: string;
|
|
741
|
+
ageMs: number;
|
|
742
|
+
cache: "miss" | "hit" | "joined";
|
|
743
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
744
|
+
}, {
|
|
745
|
+
status: "quoted";
|
|
746
|
+
basis: "exact";
|
|
747
|
+
expectedAmount: string;
|
|
748
|
+
askedAmount: string;
|
|
749
|
+
quotedAt: string;
|
|
750
|
+
ageMs: number;
|
|
751
|
+
cache: "miss" | "hit" | "joined";
|
|
752
|
+
minimumAmount?: string | undefined;
|
|
753
|
+
}>, z.ZodObject<{
|
|
754
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
755
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
756
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
757
|
+
scaledFrom: z.ZodObject<{
|
|
758
|
+
askedAmount: z.ZodString;
|
|
759
|
+
expectedAmount: z.ZodString;
|
|
760
|
+
}, "strict", z.ZodTypeAny, {
|
|
761
|
+
expectedAmount: string;
|
|
762
|
+
askedAmount: string;
|
|
763
|
+
}, {
|
|
764
|
+
expectedAmount: string;
|
|
765
|
+
askedAmount: string;
|
|
766
|
+
}>;
|
|
767
|
+
status: z.ZodLiteral<"quoted">;
|
|
768
|
+
/**
|
|
769
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
770
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
771
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
772
|
+
*/
|
|
773
|
+
askedAmount: z.ZodString;
|
|
774
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
775
|
+
quotedAt: z.ZodString;
|
|
776
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
777
|
+
ageMs: z.ZodNumber;
|
|
778
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
779
|
+
}, "strict", z.ZodTypeAny, {
|
|
780
|
+
status: "quoted";
|
|
781
|
+
basis: "scaled-from-nearby-amount";
|
|
782
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
783
|
+
askedAmount: string;
|
|
784
|
+
quotedAt: string;
|
|
785
|
+
ageMs: number;
|
|
786
|
+
cache: "miss" | "hit" | "joined";
|
|
787
|
+
scaledFrom: {
|
|
788
|
+
expectedAmount: string;
|
|
789
|
+
askedAmount: string;
|
|
790
|
+
};
|
|
791
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
792
|
+
}, {
|
|
793
|
+
status: "quoted";
|
|
794
|
+
basis: "scaled-from-nearby-amount";
|
|
795
|
+
expectedAmount: string;
|
|
796
|
+
askedAmount: string;
|
|
797
|
+
quotedAt: string;
|
|
798
|
+
ageMs: number;
|
|
799
|
+
cache: "miss" | "hit" | "joined";
|
|
800
|
+
scaledFrom: {
|
|
801
|
+
expectedAmount: string;
|
|
802
|
+
askedAmount: string;
|
|
803
|
+
};
|
|
804
|
+
minimumAmount?: string | undefined;
|
|
805
|
+
}>]>, z.ZodObject<{
|
|
806
|
+
status: z.ZodLiteral<"refused">;
|
|
807
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
808
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
809
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
810
|
+
}, "strict", z.ZodTypeAny, {
|
|
811
|
+
status: "refused";
|
|
812
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
813
|
+
reason: string | null;
|
|
814
|
+
minimumAmount?: string | undefined;
|
|
815
|
+
}, {
|
|
816
|
+
status: "refused";
|
|
817
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
818
|
+
reason: string | null;
|
|
819
|
+
minimumAmount?: string | undefined;
|
|
820
|
+
}>, z.ZodObject<{
|
|
821
|
+
status: z.ZodLiteral<"pending">;
|
|
822
|
+
retryAfterMs: z.ZodNumber;
|
|
823
|
+
}, "strict", z.ZodTypeAny, {
|
|
824
|
+
status: "pending";
|
|
825
|
+
retryAfterMs: number;
|
|
826
|
+
}, {
|
|
827
|
+
status: "pending";
|
|
828
|
+
retryAfterMs: number;
|
|
829
|
+
}>]>>;
|
|
830
|
+
'near-intents': z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
831
|
+
basis: z.ZodLiteral<"exact">;
|
|
832
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
833
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
834
|
+
status: z.ZodLiteral<"quoted">;
|
|
835
|
+
/**
|
|
836
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
837
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
838
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
839
|
+
*/
|
|
840
|
+
askedAmount: z.ZodString;
|
|
841
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
842
|
+
quotedAt: z.ZodString;
|
|
843
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
844
|
+
ageMs: z.ZodNumber;
|
|
845
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
846
|
+
}, "strict", z.ZodTypeAny, {
|
|
847
|
+
status: "quoted";
|
|
848
|
+
basis: "exact";
|
|
849
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
850
|
+
askedAmount: string;
|
|
851
|
+
quotedAt: string;
|
|
852
|
+
ageMs: number;
|
|
853
|
+
cache: "miss" | "hit" | "joined";
|
|
854
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
855
|
+
}, {
|
|
856
|
+
status: "quoted";
|
|
857
|
+
basis: "exact";
|
|
858
|
+
expectedAmount: string;
|
|
859
|
+
askedAmount: string;
|
|
860
|
+
quotedAt: string;
|
|
861
|
+
ageMs: number;
|
|
862
|
+
cache: "miss" | "hit" | "joined";
|
|
863
|
+
minimumAmount?: string | undefined;
|
|
864
|
+
}>, z.ZodObject<{
|
|
865
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
866
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
867
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
868
|
+
scaledFrom: z.ZodObject<{
|
|
869
|
+
askedAmount: z.ZodString;
|
|
870
|
+
expectedAmount: z.ZodString;
|
|
871
|
+
}, "strict", z.ZodTypeAny, {
|
|
872
|
+
expectedAmount: string;
|
|
873
|
+
askedAmount: string;
|
|
874
|
+
}, {
|
|
875
|
+
expectedAmount: string;
|
|
876
|
+
askedAmount: string;
|
|
877
|
+
}>;
|
|
878
|
+
status: z.ZodLiteral<"quoted">;
|
|
879
|
+
/**
|
|
880
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
881
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
882
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
883
|
+
*/
|
|
884
|
+
askedAmount: z.ZodString;
|
|
885
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
886
|
+
quotedAt: z.ZodString;
|
|
887
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
888
|
+
ageMs: z.ZodNumber;
|
|
889
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
890
|
+
}, "strict", z.ZodTypeAny, {
|
|
891
|
+
status: "quoted";
|
|
892
|
+
basis: "scaled-from-nearby-amount";
|
|
893
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
894
|
+
askedAmount: string;
|
|
895
|
+
quotedAt: string;
|
|
896
|
+
ageMs: number;
|
|
897
|
+
cache: "miss" | "hit" | "joined";
|
|
898
|
+
scaledFrom: {
|
|
899
|
+
expectedAmount: string;
|
|
900
|
+
askedAmount: string;
|
|
901
|
+
};
|
|
902
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
903
|
+
}, {
|
|
904
|
+
status: "quoted";
|
|
905
|
+
basis: "scaled-from-nearby-amount";
|
|
906
|
+
expectedAmount: string;
|
|
907
|
+
askedAmount: string;
|
|
908
|
+
quotedAt: string;
|
|
909
|
+
ageMs: number;
|
|
910
|
+
cache: "miss" | "hit" | "joined";
|
|
911
|
+
scaledFrom: {
|
|
912
|
+
expectedAmount: string;
|
|
913
|
+
askedAmount: string;
|
|
914
|
+
};
|
|
915
|
+
minimumAmount?: string | undefined;
|
|
916
|
+
}>]>, z.ZodObject<{
|
|
917
|
+
status: z.ZodLiteral<"refused">;
|
|
918
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
919
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
920
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
921
|
+
}, "strict", z.ZodTypeAny, {
|
|
922
|
+
status: "refused";
|
|
923
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
924
|
+
reason: string | null;
|
|
925
|
+
minimumAmount?: string | undefined;
|
|
926
|
+
}, {
|
|
927
|
+
status: "refused";
|
|
928
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
929
|
+
reason: string | null;
|
|
930
|
+
minimumAmount?: string | undefined;
|
|
931
|
+
}>, z.ZodObject<{
|
|
932
|
+
status: z.ZodLiteral<"pending">;
|
|
933
|
+
retryAfterMs: z.ZodNumber;
|
|
934
|
+
}, "strict", z.ZodTypeAny, {
|
|
935
|
+
status: "pending";
|
|
936
|
+
retryAfterMs: number;
|
|
937
|
+
}, {
|
|
938
|
+
status: "pending";
|
|
939
|
+
retryAfterMs: number;
|
|
940
|
+
}>]>>;
|
|
941
|
+
}, "strict", z.ZodTypeAny, {
|
|
942
|
+
lifi?: {
|
|
943
|
+
status: "quoted";
|
|
944
|
+
basis: "exact";
|
|
945
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
946
|
+
askedAmount: string;
|
|
947
|
+
quotedAt: string;
|
|
948
|
+
ageMs: number;
|
|
949
|
+
cache: "miss" | "hit" | "joined";
|
|
950
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
951
|
+
} | {
|
|
952
|
+
status: "quoted";
|
|
953
|
+
basis: "scaled-from-nearby-amount";
|
|
954
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
955
|
+
askedAmount: string;
|
|
956
|
+
quotedAt: string;
|
|
957
|
+
ageMs: number;
|
|
958
|
+
cache: "miss" | "hit" | "joined";
|
|
959
|
+
scaledFrom: {
|
|
960
|
+
expectedAmount: string;
|
|
961
|
+
askedAmount: string;
|
|
962
|
+
};
|
|
963
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
964
|
+
} | {
|
|
965
|
+
status: "refused";
|
|
966
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
967
|
+
reason: string | null;
|
|
968
|
+
minimumAmount?: string | undefined;
|
|
969
|
+
} | {
|
|
970
|
+
status: "pending";
|
|
971
|
+
retryAfterMs: number;
|
|
972
|
+
} | undefined;
|
|
973
|
+
relay?: {
|
|
974
|
+
status: "quoted";
|
|
975
|
+
basis: "exact";
|
|
976
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
977
|
+
askedAmount: string;
|
|
978
|
+
quotedAt: string;
|
|
979
|
+
ageMs: number;
|
|
980
|
+
cache: "miss" | "hit" | "joined";
|
|
981
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
982
|
+
} | {
|
|
983
|
+
status: "quoted";
|
|
984
|
+
basis: "scaled-from-nearby-amount";
|
|
985
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
986
|
+
askedAmount: string;
|
|
987
|
+
quotedAt: string;
|
|
988
|
+
ageMs: number;
|
|
989
|
+
cache: "miss" | "hit" | "joined";
|
|
990
|
+
scaledFrom: {
|
|
991
|
+
expectedAmount: string;
|
|
992
|
+
askedAmount: string;
|
|
993
|
+
};
|
|
994
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
995
|
+
} | {
|
|
996
|
+
status: "refused";
|
|
997
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
998
|
+
reason: string | null;
|
|
999
|
+
minimumAmount?: string | undefined;
|
|
1000
|
+
} | {
|
|
1001
|
+
status: "pending";
|
|
1002
|
+
retryAfterMs: number;
|
|
1003
|
+
} | undefined;
|
|
1004
|
+
'near-intents'?: {
|
|
1005
|
+
status: "quoted";
|
|
1006
|
+
basis: "exact";
|
|
1007
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1008
|
+
askedAmount: string;
|
|
1009
|
+
quotedAt: string;
|
|
1010
|
+
ageMs: number;
|
|
1011
|
+
cache: "miss" | "hit" | "joined";
|
|
1012
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1013
|
+
} | {
|
|
1014
|
+
status: "quoted";
|
|
1015
|
+
basis: "scaled-from-nearby-amount";
|
|
1016
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1017
|
+
askedAmount: string;
|
|
1018
|
+
quotedAt: string;
|
|
1019
|
+
ageMs: number;
|
|
1020
|
+
cache: "miss" | "hit" | "joined";
|
|
1021
|
+
scaledFrom: {
|
|
1022
|
+
expectedAmount: string;
|
|
1023
|
+
askedAmount: string;
|
|
1024
|
+
};
|
|
1025
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1026
|
+
} | {
|
|
1027
|
+
status: "refused";
|
|
1028
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1029
|
+
reason: string | null;
|
|
1030
|
+
minimumAmount?: string | undefined;
|
|
1031
|
+
} | {
|
|
1032
|
+
status: "pending";
|
|
1033
|
+
retryAfterMs: number;
|
|
1034
|
+
} | undefined;
|
|
1035
|
+
}, {
|
|
1036
|
+
lifi?: {
|
|
1037
|
+
status: "quoted";
|
|
1038
|
+
basis: "exact";
|
|
1039
|
+
expectedAmount: string;
|
|
1040
|
+
askedAmount: string;
|
|
1041
|
+
quotedAt: string;
|
|
1042
|
+
ageMs: number;
|
|
1043
|
+
cache: "miss" | "hit" | "joined";
|
|
1044
|
+
minimumAmount?: string | undefined;
|
|
1045
|
+
} | {
|
|
1046
|
+
status: "quoted";
|
|
1047
|
+
basis: "scaled-from-nearby-amount";
|
|
1048
|
+
expectedAmount: string;
|
|
1049
|
+
askedAmount: string;
|
|
1050
|
+
quotedAt: string;
|
|
1051
|
+
ageMs: number;
|
|
1052
|
+
cache: "miss" | "hit" | "joined";
|
|
1053
|
+
scaledFrom: {
|
|
1054
|
+
expectedAmount: string;
|
|
1055
|
+
askedAmount: string;
|
|
1056
|
+
};
|
|
1057
|
+
minimumAmount?: string | undefined;
|
|
1058
|
+
} | {
|
|
1059
|
+
status: "refused";
|
|
1060
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1061
|
+
reason: string | null;
|
|
1062
|
+
minimumAmount?: string | undefined;
|
|
1063
|
+
} | {
|
|
1064
|
+
status: "pending";
|
|
1065
|
+
retryAfterMs: number;
|
|
1066
|
+
} | undefined;
|
|
1067
|
+
relay?: {
|
|
1068
|
+
status: "quoted";
|
|
1069
|
+
basis: "exact";
|
|
1070
|
+
expectedAmount: string;
|
|
1071
|
+
askedAmount: string;
|
|
1072
|
+
quotedAt: string;
|
|
1073
|
+
ageMs: number;
|
|
1074
|
+
cache: "miss" | "hit" | "joined";
|
|
1075
|
+
minimumAmount?: string | undefined;
|
|
1076
|
+
} | {
|
|
1077
|
+
status: "quoted";
|
|
1078
|
+
basis: "scaled-from-nearby-amount";
|
|
1079
|
+
expectedAmount: string;
|
|
1080
|
+
askedAmount: string;
|
|
1081
|
+
quotedAt: string;
|
|
1082
|
+
ageMs: number;
|
|
1083
|
+
cache: "miss" | "hit" | "joined";
|
|
1084
|
+
scaledFrom: {
|
|
1085
|
+
expectedAmount: string;
|
|
1086
|
+
askedAmount: string;
|
|
1087
|
+
};
|
|
1088
|
+
minimumAmount?: string | undefined;
|
|
1089
|
+
} | {
|
|
1090
|
+
status: "refused";
|
|
1091
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1092
|
+
reason: string | null;
|
|
1093
|
+
minimumAmount?: string | undefined;
|
|
1094
|
+
} | {
|
|
1095
|
+
status: "pending";
|
|
1096
|
+
retryAfterMs: number;
|
|
1097
|
+
} | undefined;
|
|
1098
|
+
'near-intents'?: {
|
|
1099
|
+
status: "quoted";
|
|
1100
|
+
basis: "exact";
|
|
1101
|
+
expectedAmount: string;
|
|
1102
|
+
askedAmount: string;
|
|
1103
|
+
quotedAt: string;
|
|
1104
|
+
ageMs: number;
|
|
1105
|
+
cache: "miss" | "hit" | "joined";
|
|
1106
|
+
minimumAmount?: string | undefined;
|
|
1107
|
+
} | {
|
|
1108
|
+
status: "quoted";
|
|
1109
|
+
basis: "scaled-from-nearby-amount";
|
|
1110
|
+
expectedAmount: string;
|
|
1111
|
+
askedAmount: string;
|
|
1112
|
+
quotedAt: string;
|
|
1113
|
+
ageMs: number;
|
|
1114
|
+
cache: "miss" | "hit" | "joined";
|
|
1115
|
+
scaledFrom: {
|
|
1116
|
+
expectedAmount: string;
|
|
1117
|
+
askedAmount: string;
|
|
1118
|
+
};
|
|
1119
|
+
minimumAmount?: string | undefined;
|
|
1120
|
+
} | {
|
|
1121
|
+
status: "refused";
|
|
1122
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1123
|
+
reason: string | null;
|
|
1124
|
+
minimumAmount?: string | undefined;
|
|
1125
|
+
} | {
|
|
1126
|
+
status: "pending";
|
|
1127
|
+
retryAfterMs: number;
|
|
1128
|
+
} | undefined;
|
|
1129
|
+
}>;
|
|
1130
|
+
}, "strict", z.ZodTypeAny, {
|
|
1131
|
+
providers: {
|
|
1132
|
+
lifi?: {
|
|
1133
|
+
status: "quoted";
|
|
1134
|
+
basis: "exact";
|
|
1135
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1136
|
+
askedAmount: string;
|
|
1137
|
+
quotedAt: string;
|
|
1138
|
+
ageMs: number;
|
|
1139
|
+
cache: "miss" | "hit" | "joined";
|
|
1140
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1141
|
+
} | {
|
|
1142
|
+
status: "quoted";
|
|
1143
|
+
basis: "scaled-from-nearby-amount";
|
|
1144
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1145
|
+
askedAmount: string;
|
|
1146
|
+
quotedAt: string;
|
|
1147
|
+
ageMs: number;
|
|
1148
|
+
cache: "miss" | "hit" | "joined";
|
|
1149
|
+
scaledFrom: {
|
|
1150
|
+
expectedAmount: string;
|
|
1151
|
+
askedAmount: string;
|
|
1152
|
+
};
|
|
1153
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1154
|
+
} | {
|
|
1155
|
+
status: "refused";
|
|
1156
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1157
|
+
reason: string | null;
|
|
1158
|
+
minimumAmount?: string | undefined;
|
|
1159
|
+
} | {
|
|
1160
|
+
status: "pending";
|
|
1161
|
+
retryAfterMs: number;
|
|
1162
|
+
} | undefined;
|
|
1163
|
+
relay?: {
|
|
1164
|
+
status: "quoted";
|
|
1165
|
+
basis: "exact";
|
|
1166
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1167
|
+
askedAmount: string;
|
|
1168
|
+
quotedAt: string;
|
|
1169
|
+
ageMs: number;
|
|
1170
|
+
cache: "miss" | "hit" | "joined";
|
|
1171
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1172
|
+
} | {
|
|
1173
|
+
status: "quoted";
|
|
1174
|
+
basis: "scaled-from-nearby-amount";
|
|
1175
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1176
|
+
askedAmount: string;
|
|
1177
|
+
quotedAt: string;
|
|
1178
|
+
ageMs: number;
|
|
1179
|
+
cache: "miss" | "hit" | "joined";
|
|
1180
|
+
scaledFrom: {
|
|
1181
|
+
expectedAmount: string;
|
|
1182
|
+
askedAmount: string;
|
|
1183
|
+
};
|
|
1184
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1185
|
+
} | {
|
|
1186
|
+
status: "refused";
|
|
1187
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1188
|
+
reason: string | null;
|
|
1189
|
+
minimumAmount?: string | undefined;
|
|
1190
|
+
} | {
|
|
1191
|
+
status: "pending";
|
|
1192
|
+
retryAfterMs: number;
|
|
1193
|
+
} | undefined;
|
|
1194
|
+
'near-intents'?: {
|
|
1195
|
+
status: "quoted";
|
|
1196
|
+
basis: "exact";
|
|
1197
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1198
|
+
askedAmount: string;
|
|
1199
|
+
quotedAt: string;
|
|
1200
|
+
ageMs: number;
|
|
1201
|
+
cache: "miss" | "hit" | "joined";
|
|
1202
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1203
|
+
} | {
|
|
1204
|
+
status: "quoted";
|
|
1205
|
+
basis: "scaled-from-nearby-amount";
|
|
1206
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1207
|
+
askedAmount: string;
|
|
1208
|
+
quotedAt: string;
|
|
1209
|
+
ageMs: number;
|
|
1210
|
+
cache: "miss" | "hit" | "joined";
|
|
1211
|
+
scaledFrom: {
|
|
1212
|
+
expectedAmount: string;
|
|
1213
|
+
askedAmount: string;
|
|
1214
|
+
};
|
|
1215
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1216
|
+
} | {
|
|
1217
|
+
status: "refused";
|
|
1218
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1219
|
+
reason: string | null;
|
|
1220
|
+
minimumAmount?: string | undefined;
|
|
1221
|
+
} | {
|
|
1222
|
+
status: "pending";
|
|
1223
|
+
retryAfterMs: number;
|
|
1224
|
+
} | undefined;
|
|
1225
|
+
};
|
|
1226
|
+
}, {
|
|
1227
|
+
providers: {
|
|
1228
|
+
lifi?: {
|
|
1229
|
+
status: "quoted";
|
|
1230
|
+
basis: "exact";
|
|
1231
|
+
expectedAmount: string;
|
|
1232
|
+
askedAmount: string;
|
|
1233
|
+
quotedAt: string;
|
|
1234
|
+
ageMs: number;
|
|
1235
|
+
cache: "miss" | "hit" | "joined";
|
|
1236
|
+
minimumAmount?: string | undefined;
|
|
1237
|
+
} | {
|
|
1238
|
+
status: "quoted";
|
|
1239
|
+
basis: "scaled-from-nearby-amount";
|
|
1240
|
+
expectedAmount: string;
|
|
1241
|
+
askedAmount: string;
|
|
1242
|
+
quotedAt: string;
|
|
1243
|
+
ageMs: number;
|
|
1244
|
+
cache: "miss" | "hit" | "joined";
|
|
1245
|
+
scaledFrom: {
|
|
1246
|
+
expectedAmount: string;
|
|
1247
|
+
askedAmount: string;
|
|
1248
|
+
};
|
|
1249
|
+
minimumAmount?: string | undefined;
|
|
1250
|
+
} | {
|
|
1251
|
+
status: "refused";
|
|
1252
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1253
|
+
reason: string | null;
|
|
1254
|
+
minimumAmount?: string | undefined;
|
|
1255
|
+
} | {
|
|
1256
|
+
status: "pending";
|
|
1257
|
+
retryAfterMs: number;
|
|
1258
|
+
} | undefined;
|
|
1259
|
+
relay?: {
|
|
1260
|
+
status: "quoted";
|
|
1261
|
+
basis: "exact";
|
|
1262
|
+
expectedAmount: string;
|
|
1263
|
+
askedAmount: string;
|
|
1264
|
+
quotedAt: string;
|
|
1265
|
+
ageMs: number;
|
|
1266
|
+
cache: "miss" | "hit" | "joined";
|
|
1267
|
+
minimumAmount?: string | undefined;
|
|
1268
|
+
} | {
|
|
1269
|
+
status: "quoted";
|
|
1270
|
+
basis: "scaled-from-nearby-amount";
|
|
1271
|
+
expectedAmount: string;
|
|
1272
|
+
askedAmount: string;
|
|
1273
|
+
quotedAt: string;
|
|
1274
|
+
ageMs: number;
|
|
1275
|
+
cache: "miss" | "hit" | "joined";
|
|
1276
|
+
scaledFrom: {
|
|
1277
|
+
expectedAmount: string;
|
|
1278
|
+
askedAmount: string;
|
|
1279
|
+
};
|
|
1280
|
+
minimumAmount?: string | undefined;
|
|
1281
|
+
} | {
|
|
1282
|
+
status: "refused";
|
|
1283
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1284
|
+
reason: string | null;
|
|
1285
|
+
minimumAmount?: string | undefined;
|
|
1286
|
+
} | {
|
|
1287
|
+
status: "pending";
|
|
1288
|
+
retryAfterMs: number;
|
|
1289
|
+
} | undefined;
|
|
1290
|
+
'near-intents'?: {
|
|
1291
|
+
status: "quoted";
|
|
1292
|
+
basis: "exact";
|
|
1293
|
+
expectedAmount: string;
|
|
1294
|
+
askedAmount: string;
|
|
1295
|
+
quotedAt: string;
|
|
1296
|
+
ageMs: number;
|
|
1297
|
+
cache: "miss" | "hit" | "joined";
|
|
1298
|
+
minimumAmount?: string | undefined;
|
|
1299
|
+
} | {
|
|
1300
|
+
status: "quoted";
|
|
1301
|
+
basis: "scaled-from-nearby-amount";
|
|
1302
|
+
expectedAmount: string;
|
|
1303
|
+
askedAmount: string;
|
|
1304
|
+
quotedAt: string;
|
|
1305
|
+
ageMs: number;
|
|
1306
|
+
cache: "miss" | "hit" | "joined";
|
|
1307
|
+
scaledFrom: {
|
|
1308
|
+
expectedAmount: string;
|
|
1309
|
+
askedAmount: string;
|
|
1310
|
+
};
|
|
1311
|
+
minimumAmount?: string | undefined;
|
|
1312
|
+
} | {
|
|
1313
|
+
status: "refused";
|
|
1314
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1315
|
+
reason: string | null;
|
|
1316
|
+
minimumAmount?: string | undefined;
|
|
1317
|
+
} | {
|
|
1318
|
+
status: "pending";
|
|
1319
|
+
retryAfterMs: number;
|
|
1320
|
+
} | undefined;
|
|
1321
|
+
};
|
|
1322
|
+
}>;
|
|
1323
|
+
export type DisplayAnswer = z.infer<typeof displayAnswerSchema>;
|
|
1324
|
+
/** The body of a `POST /v1/display-quotes` response: one answer per ask, in ask order. */
|
|
1325
|
+
export declare const displayQuoteResponseSchema: z.ZodObject<{
|
|
1326
|
+
answers: z.ZodArray<z.ZodObject<{
|
|
1327
|
+
providers: z.ZodObject<{
|
|
1328
|
+
lifi: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
1329
|
+
basis: z.ZodLiteral<"exact">;
|
|
1330
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
1331
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
1332
|
+
status: z.ZodLiteral<"quoted">;
|
|
1333
|
+
/**
|
|
1334
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1335
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1336
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1337
|
+
*/
|
|
1338
|
+
askedAmount: z.ZodString;
|
|
1339
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1340
|
+
quotedAt: z.ZodString;
|
|
1341
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1342
|
+
ageMs: z.ZodNumber;
|
|
1343
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1344
|
+
}, "strict", z.ZodTypeAny, {
|
|
1345
|
+
status: "quoted";
|
|
1346
|
+
basis: "exact";
|
|
1347
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1348
|
+
askedAmount: string;
|
|
1349
|
+
quotedAt: string;
|
|
1350
|
+
ageMs: number;
|
|
1351
|
+
cache: "miss" | "hit" | "joined";
|
|
1352
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1353
|
+
}, {
|
|
1354
|
+
status: "quoted";
|
|
1355
|
+
basis: "exact";
|
|
1356
|
+
expectedAmount: string;
|
|
1357
|
+
askedAmount: string;
|
|
1358
|
+
quotedAt: string;
|
|
1359
|
+
ageMs: number;
|
|
1360
|
+
cache: "miss" | "hit" | "joined";
|
|
1361
|
+
minimumAmount?: string | undefined;
|
|
1362
|
+
}>, z.ZodObject<{
|
|
1363
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
1364
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
1365
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
1366
|
+
scaledFrom: z.ZodObject<{
|
|
1367
|
+
askedAmount: z.ZodString;
|
|
1368
|
+
expectedAmount: z.ZodString;
|
|
1369
|
+
}, "strict", z.ZodTypeAny, {
|
|
1370
|
+
expectedAmount: string;
|
|
1371
|
+
askedAmount: string;
|
|
1372
|
+
}, {
|
|
1373
|
+
expectedAmount: string;
|
|
1374
|
+
askedAmount: string;
|
|
1375
|
+
}>;
|
|
1376
|
+
status: z.ZodLiteral<"quoted">;
|
|
1377
|
+
/**
|
|
1378
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1379
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1380
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1381
|
+
*/
|
|
1382
|
+
askedAmount: z.ZodString;
|
|
1383
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1384
|
+
quotedAt: z.ZodString;
|
|
1385
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1386
|
+
ageMs: z.ZodNumber;
|
|
1387
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1388
|
+
}, "strict", z.ZodTypeAny, {
|
|
1389
|
+
status: "quoted";
|
|
1390
|
+
basis: "scaled-from-nearby-amount";
|
|
1391
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1392
|
+
askedAmount: string;
|
|
1393
|
+
quotedAt: string;
|
|
1394
|
+
ageMs: number;
|
|
1395
|
+
cache: "miss" | "hit" | "joined";
|
|
1396
|
+
scaledFrom: {
|
|
1397
|
+
expectedAmount: string;
|
|
1398
|
+
askedAmount: string;
|
|
1399
|
+
};
|
|
1400
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1401
|
+
}, {
|
|
1402
|
+
status: "quoted";
|
|
1403
|
+
basis: "scaled-from-nearby-amount";
|
|
1404
|
+
expectedAmount: string;
|
|
1405
|
+
askedAmount: string;
|
|
1406
|
+
quotedAt: string;
|
|
1407
|
+
ageMs: number;
|
|
1408
|
+
cache: "miss" | "hit" | "joined";
|
|
1409
|
+
scaledFrom: {
|
|
1410
|
+
expectedAmount: string;
|
|
1411
|
+
askedAmount: string;
|
|
1412
|
+
};
|
|
1413
|
+
minimumAmount?: string | undefined;
|
|
1414
|
+
}>]>, z.ZodObject<{
|
|
1415
|
+
status: z.ZodLiteral<"refused">;
|
|
1416
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
1417
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
1418
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
1419
|
+
}, "strict", z.ZodTypeAny, {
|
|
1420
|
+
status: "refused";
|
|
1421
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1422
|
+
reason: string | null;
|
|
1423
|
+
minimumAmount?: string | undefined;
|
|
1424
|
+
}, {
|
|
1425
|
+
status: "refused";
|
|
1426
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1427
|
+
reason: string | null;
|
|
1428
|
+
minimumAmount?: string | undefined;
|
|
1429
|
+
}>, z.ZodObject<{
|
|
1430
|
+
status: z.ZodLiteral<"pending">;
|
|
1431
|
+
retryAfterMs: z.ZodNumber;
|
|
1432
|
+
}, "strict", z.ZodTypeAny, {
|
|
1433
|
+
status: "pending";
|
|
1434
|
+
retryAfterMs: number;
|
|
1435
|
+
}, {
|
|
1436
|
+
status: "pending";
|
|
1437
|
+
retryAfterMs: number;
|
|
1438
|
+
}>]>>;
|
|
1439
|
+
relay: z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
1440
|
+
basis: z.ZodLiteral<"exact">;
|
|
1441
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
1442
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
1443
|
+
status: z.ZodLiteral<"quoted">;
|
|
1444
|
+
/**
|
|
1445
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1446
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1447
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1448
|
+
*/
|
|
1449
|
+
askedAmount: z.ZodString;
|
|
1450
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1451
|
+
quotedAt: z.ZodString;
|
|
1452
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1453
|
+
ageMs: z.ZodNumber;
|
|
1454
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1455
|
+
}, "strict", z.ZodTypeAny, {
|
|
1456
|
+
status: "quoted";
|
|
1457
|
+
basis: "exact";
|
|
1458
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1459
|
+
askedAmount: string;
|
|
1460
|
+
quotedAt: string;
|
|
1461
|
+
ageMs: number;
|
|
1462
|
+
cache: "miss" | "hit" | "joined";
|
|
1463
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1464
|
+
}, {
|
|
1465
|
+
status: "quoted";
|
|
1466
|
+
basis: "exact";
|
|
1467
|
+
expectedAmount: string;
|
|
1468
|
+
askedAmount: string;
|
|
1469
|
+
quotedAt: string;
|
|
1470
|
+
ageMs: number;
|
|
1471
|
+
cache: "miss" | "hit" | "joined";
|
|
1472
|
+
minimumAmount?: string | undefined;
|
|
1473
|
+
}>, z.ZodObject<{
|
|
1474
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
1475
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
1476
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
1477
|
+
scaledFrom: z.ZodObject<{
|
|
1478
|
+
askedAmount: z.ZodString;
|
|
1479
|
+
expectedAmount: z.ZodString;
|
|
1480
|
+
}, "strict", z.ZodTypeAny, {
|
|
1481
|
+
expectedAmount: string;
|
|
1482
|
+
askedAmount: string;
|
|
1483
|
+
}, {
|
|
1484
|
+
expectedAmount: string;
|
|
1485
|
+
askedAmount: string;
|
|
1486
|
+
}>;
|
|
1487
|
+
status: z.ZodLiteral<"quoted">;
|
|
1488
|
+
/**
|
|
1489
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1490
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1491
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1492
|
+
*/
|
|
1493
|
+
askedAmount: z.ZodString;
|
|
1494
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1495
|
+
quotedAt: z.ZodString;
|
|
1496
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1497
|
+
ageMs: z.ZodNumber;
|
|
1498
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1499
|
+
}, "strict", z.ZodTypeAny, {
|
|
1500
|
+
status: "quoted";
|
|
1501
|
+
basis: "scaled-from-nearby-amount";
|
|
1502
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1503
|
+
askedAmount: string;
|
|
1504
|
+
quotedAt: string;
|
|
1505
|
+
ageMs: number;
|
|
1506
|
+
cache: "miss" | "hit" | "joined";
|
|
1507
|
+
scaledFrom: {
|
|
1508
|
+
expectedAmount: string;
|
|
1509
|
+
askedAmount: string;
|
|
1510
|
+
};
|
|
1511
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1512
|
+
}, {
|
|
1513
|
+
status: "quoted";
|
|
1514
|
+
basis: "scaled-from-nearby-amount";
|
|
1515
|
+
expectedAmount: string;
|
|
1516
|
+
askedAmount: string;
|
|
1517
|
+
quotedAt: string;
|
|
1518
|
+
ageMs: number;
|
|
1519
|
+
cache: "miss" | "hit" | "joined";
|
|
1520
|
+
scaledFrom: {
|
|
1521
|
+
expectedAmount: string;
|
|
1522
|
+
askedAmount: string;
|
|
1523
|
+
};
|
|
1524
|
+
minimumAmount?: string | undefined;
|
|
1525
|
+
}>]>, z.ZodObject<{
|
|
1526
|
+
status: z.ZodLiteral<"refused">;
|
|
1527
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
1528
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
1529
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
1530
|
+
}, "strict", z.ZodTypeAny, {
|
|
1531
|
+
status: "refused";
|
|
1532
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1533
|
+
reason: string | null;
|
|
1534
|
+
minimumAmount?: string | undefined;
|
|
1535
|
+
}, {
|
|
1536
|
+
status: "refused";
|
|
1537
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1538
|
+
reason: string | null;
|
|
1539
|
+
minimumAmount?: string | undefined;
|
|
1540
|
+
}>, z.ZodObject<{
|
|
1541
|
+
status: z.ZodLiteral<"pending">;
|
|
1542
|
+
retryAfterMs: z.ZodNumber;
|
|
1543
|
+
}, "strict", z.ZodTypeAny, {
|
|
1544
|
+
status: "pending";
|
|
1545
|
+
retryAfterMs: number;
|
|
1546
|
+
}, {
|
|
1547
|
+
status: "pending";
|
|
1548
|
+
retryAfterMs: number;
|
|
1549
|
+
}>]>>;
|
|
1550
|
+
'near-intents': z.ZodOptional<z.ZodUnion<[z.ZodUnion<[z.ZodObject<{
|
|
1551
|
+
basis: z.ZodLiteral<"exact">;
|
|
1552
|
+
expectedAmount: z.ZodBranded<z.ZodString, "ExactAmount">;
|
|
1553
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "ExactAmount">>;
|
|
1554
|
+
status: z.ZodLiteral<"quoted">;
|
|
1555
|
+
/**
|
|
1556
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1557
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1558
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1559
|
+
*/
|
|
1560
|
+
askedAmount: z.ZodString;
|
|
1561
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1562
|
+
quotedAt: z.ZodString;
|
|
1563
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1564
|
+
ageMs: z.ZodNumber;
|
|
1565
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1566
|
+
}, "strict", z.ZodTypeAny, {
|
|
1567
|
+
status: "quoted";
|
|
1568
|
+
basis: "exact";
|
|
1569
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1570
|
+
askedAmount: string;
|
|
1571
|
+
quotedAt: string;
|
|
1572
|
+
ageMs: number;
|
|
1573
|
+
cache: "miss" | "hit" | "joined";
|
|
1574
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1575
|
+
}, {
|
|
1576
|
+
status: "quoted";
|
|
1577
|
+
basis: "exact";
|
|
1578
|
+
expectedAmount: string;
|
|
1579
|
+
askedAmount: string;
|
|
1580
|
+
quotedAt: string;
|
|
1581
|
+
ageMs: number;
|
|
1582
|
+
cache: "miss" | "hit" | "joined";
|
|
1583
|
+
minimumAmount?: string | undefined;
|
|
1584
|
+
}>, z.ZodObject<{
|
|
1585
|
+
basis: z.ZodLiteral<"scaled-from-nearby-amount">;
|
|
1586
|
+
expectedAmount: z.ZodBranded<z.ZodString, "EstimatedDelivery">;
|
|
1587
|
+
minimumAmount: z.ZodOptional<z.ZodBranded<z.ZodString, "EstimatedDelivery">>;
|
|
1588
|
+
scaledFrom: z.ZodObject<{
|
|
1589
|
+
askedAmount: z.ZodString;
|
|
1590
|
+
expectedAmount: z.ZodString;
|
|
1591
|
+
}, "strict", z.ZodTypeAny, {
|
|
1592
|
+
expectedAmount: string;
|
|
1593
|
+
askedAmount: string;
|
|
1594
|
+
}, {
|
|
1595
|
+
expectedAmount: string;
|
|
1596
|
+
askedAmount: string;
|
|
1597
|
+
}>;
|
|
1598
|
+
status: z.ZodLiteral<"quoted">;
|
|
1599
|
+
/**
|
|
1600
|
+
* The amount this answer is FOR: always the asker's own requested amount
|
|
1601
|
+
* (`DisplayAsk.amount`), never the nearby amount a scaled answer was
|
|
1602
|
+
* actually derived from — that pair lives in `scaledFrom` below.
|
|
1603
|
+
*/
|
|
1604
|
+
askedAmount: z.ZodString;
|
|
1605
|
+
/** When the underlying provider answer was recorded, ISO 8601. */
|
|
1606
|
+
quotedAt: z.ZodString;
|
|
1607
|
+
/** Milliseconds between `quotedAt` and now. */
|
|
1608
|
+
ageMs: z.ZodNumber;
|
|
1609
|
+
cache: z.ZodEnum<["miss", "hit", "joined"]>;
|
|
1610
|
+
}, "strict", z.ZodTypeAny, {
|
|
1611
|
+
status: "quoted";
|
|
1612
|
+
basis: "scaled-from-nearby-amount";
|
|
1613
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1614
|
+
askedAmount: string;
|
|
1615
|
+
quotedAt: string;
|
|
1616
|
+
ageMs: number;
|
|
1617
|
+
cache: "miss" | "hit" | "joined";
|
|
1618
|
+
scaledFrom: {
|
|
1619
|
+
expectedAmount: string;
|
|
1620
|
+
askedAmount: string;
|
|
1621
|
+
};
|
|
1622
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1623
|
+
}, {
|
|
1624
|
+
status: "quoted";
|
|
1625
|
+
basis: "scaled-from-nearby-amount";
|
|
1626
|
+
expectedAmount: string;
|
|
1627
|
+
askedAmount: string;
|
|
1628
|
+
quotedAt: string;
|
|
1629
|
+
ageMs: number;
|
|
1630
|
+
cache: "miss" | "hit" | "joined";
|
|
1631
|
+
scaledFrom: {
|
|
1632
|
+
expectedAmount: string;
|
|
1633
|
+
askedAmount: string;
|
|
1634
|
+
};
|
|
1635
|
+
minimumAmount?: string | undefined;
|
|
1636
|
+
}>]>, z.ZodObject<{
|
|
1637
|
+
status: z.ZodLiteral<"refused">;
|
|
1638
|
+
kind: z.ZodEnum<["no-quote", "could-not-ask", "cannot-carry", "invalid-api-key"]>;
|
|
1639
|
+
reason: z.ZodNullable<z.ZodString>;
|
|
1640
|
+
minimumAmount: z.ZodOptional<z.ZodString>;
|
|
1641
|
+
}, "strict", z.ZodTypeAny, {
|
|
1642
|
+
status: "refused";
|
|
1643
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1644
|
+
reason: string | null;
|
|
1645
|
+
minimumAmount?: string | undefined;
|
|
1646
|
+
}, {
|
|
1647
|
+
status: "refused";
|
|
1648
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1649
|
+
reason: string | null;
|
|
1650
|
+
minimumAmount?: string | undefined;
|
|
1651
|
+
}>, z.ZodObject<{
|
|
1652
|
+
status: z.ZodLiteral<"pending">;
|
|
1653
|
+
retryAfterMs: z.ZodNumber;
|
|
1654
|
+
}, "strict", z.ZodTypeAny, {
|
|
1655
|
+
status: "pending";
|
|
1656
|
+
retryAfterMs: number;
|
|
1657
|
+
}, {
|
|
1658
|
+
status: "pending";
|
|
1659
|
+
retryAfterMs: number;
|
|
1660
|
+
}>]>>;
|
|
1661
|
+
}, "strict", z.ZodTypeAny, {
|
|
1662
|
+
lifi?: {
|
|
1663
|
+
status: "quoted";
|
|
1664
|
+
basis: "exact";
|
|
1665
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1666
|
+
askedAmount: string;
|
|
1667
|
+
quotedAt: string;
|
|
1668
|
+
ageMs: number;
|
|
1669
|
+
cache: "miss" | "hit" | "joined";
|
|
1670
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1671
|
+
} | {
|
|
1672
|
+
status: "quoted";
|
|
1673
|
+
basis: "scaled-from-nearby-amount";
|
|
1674
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1675
|
+
askedAmount: string;
|
|
1676
|
+
quotedAt: string;
|
|
1677
|
+
ageMs: number;
|
|
1678
|
+
cache: "miss" | "hit" | "joined";
|
|
1679
|
+
scaledFrom: {
|
|
1680
|
+
expectedAmount: string;
|
|
1681
|
+
askedAmount: string;
|
|
1682
|
+
};
|
|
1683
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1684
|
+
} | {
|
|
1685
|
+
status: "refused";
|
|
1686
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1687
|
+
reason: string | null;
|
|
1688
|
+
minimumAmount?: string | undefined;
|
|
1689
|
+
} | {
|
|
1690
|
+
status: "pending";
|
|
1691
|
+
retryAfterMs: number;
|
|
1692
|
+
} | undefined;
|
|
1693
|
+
relay?: {
|
|
1694
|
+
status: "quoted";
|
|
1695
|
+
basis: "exact";
|
|
1696
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1697
|
+
askedAmount: string;
|
|
1698
|
+
quotedAt: string;
|
|
1699
|
+
ageMs: number;
|
|
1700
|
+
cache: "miss" | "hit" | "joined";
|
|
1701
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1702
|
+
} | {
|
|
1703
|
+
status: "quoted";
|
|
1704
|
+
basis: "scaled-from-nearby-amount";
|
|
1705
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1706
|
+
askedAmount: string;
|
|
1707
|
+
quotedAt: string;
|
|
1708
|
+
ageMs: number;
|
|
1709
|
+
cache: "miss" | "hit" | "joined";
|
|
1710
|
+
scaledFrom: {
|
|
1711
|
+
expectedAmount: string;
|
|
1712
|
+
askedAmount: string;
|
|
1713
|
+
};
|
|
1714
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1715
|
+
} | {
|
|
1716
|
+
status: "refused";
|
|
1717
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1718
|
+
reason: string | null;
|
|
1719
|
+
minimumAmount?: string | undefined;
|
|
1720
|
+
} | {
|
|
1721
|
+
status: "pending";
|
|
1722
|
+
retryAfterMs: number;
|
|
1723
|
+
} | undefined;
|
|
1724
|
+
'near-intents'?: {
|
|
1725
|
+
status: "quoted";
|
|
1726
|
+
basis: "exact";
|
|
1727
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1728
|
+
askedAmount: string;
|
|
1729
|
+
quotedAt: string;
|
|
1730
|
+
ageMs: number;
|
|
1731
|
+
cache: "miss" | "hit" | "joined";
|
|
1732
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1733
|
+
} | {
|
|
1734
|
+
status: "quoted";
|
|
1735
|
+
basis: "scaled-from-nearby-amount";
|
|
1736
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1737
|
+
askedAmount: string;
|
|
1738
|
+
quotedAt: string;
|
|
1739
|
+
ageMs: number;
|
|
1740
|
+
cache: "miss" | "hit" | "joined";
|
|
1741
|
+
scaledFrom: {
|
|
1742
|
+
expectedAmount: string;
|
|
1743
|
+
askedAmount: string;
|
|
1744
|
+
};
|
|
1745
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1746
|
+
} | {
|
|
1747
|
+
status: "refused";
|
|
1748
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1749
|
+
reason: string | null;
|
|
1750
|
+
minimumAmount?: string | undefined;
|
|
1751
|
+
} | {
|
|
1752
|
+
status: "pending";
|
|
1753
|
+
retryAfterMs: number;
|
|
1754
|
+
} | undefined;
|
|
1755
|
+
}, {
|
|
1756
|
+
lifi?: {
|
|
1757
|
+
status: "quoted";
|
|
1758
|
+
basis: "exact";
|
|
1759
|
+
expectedAmount: string;
|
|
1760
|
+
askedAmount: string;
|
|
1761
|
+
quotedAt: string;
|
|
1762
|
+
ageMs: number;
|
|
1763
|
+
cache: "miss" | "hit" | "joined";
|
|
1764
|
+
minimumAmount?: string | undefined;
|
|
1765
|
+
} | {
|
|
1766
|
+
status: "quoted";
|
|
1767
|
+
basis: "scaled-from-nearby-amount";
|
|
1768
|
+
expectedAmount: string;
|
|
1769
|
+
askedAmount: string;
|
|
1770
|
+
quotedAt: string;
|
|
1771
|
+
ageMs: number;
|
|
1772
|
+
cache: "miss" | "hit" | "joined";
|
|
1773
|
+
scaledFrom: {
|
|
1774
|
+
expectedAmount: string;
|
|
1775
|
+
askedAmount: string;
|
|
1776
|
+
};
|
|
1777
|
+
minimumAmount?: string | undefined;
|
|
1778
|
+
} | {
|
|
1779
|
+
status: "refused";
|
|
1780
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1781
|
+
reason: string | null;
|
|
1782
|
+
minimumAmount?: string | undefined;
|
|
1783
|
+
} | {
|
|
1784
|
+
status: "pending";
|
|
1785
|
+
retryAfterMs: number;
|
|
1786
|
+
} | undefined;
|
|
1787
|
+
relay?: {
|
|
1788
|
+
status: "quoted";
|
|
1789
|
+
basis: "exact";
|
|
1790
|
+
expectedAmount: string;
|
|
1791
|
+
askedAmount: string;
|
|
1792
|
+
quotedAt: string;
|
|
1793
|
+
ageMs: number;
|
|
1794
|
+
cache: "miss" | "hit" | "joined";
|
|
1795
|
+
minimumAmount?: string | undefined;
|
|
1796
|
+
} | {
|
|
1797
|
+
status: "quoted";
|
|
1798
|
+
basis: "scaled-from-nearby-amount";
|
|
1799
|
+
expectedAmount: string;
|
|
1800
|
+
askedAmount: string;
|
|
1801
|
+
quotedAt: string;
|
|
1802
|
+
ageMs: number;
|
|
1803
|
+
cache: "miss" | "hit" | "joined";
|
|
1804
|
+
scaledFrom: {
|
|
1805
|
+
expectedAmount: string;
|
|
1806
|
+
askedAmount: string;
|
|
1807
|
+
};
|
|
1808
|
+
minimumAmount?: string | undefined;
|
|
1809
|
+
} | {
|
|
1810
|
+
status: "refused";
|
|
1811
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1812
|
+
reason: string | null;
|
|
1813
|
+
minimumAmount?: string | undefined;
|
|
1814
|
+
} | {
|
|
1815
|
+
status: "pending";
|
|
1816
|
+
retryAfterMs: number;
|
|
1817
|
+
} | undefined;
|
|
1818
|
+
'near-intents'?: {
|
|
1819
|
+
status: "quoted";
|
|
1820
|
+
basis: "exact";
|
|
1821
|
+
expectedAmount: string;
|
|
1822
|
+
askedAmount: string;
|
|
1823
|
+
quotedAt: string;
|
|
1824
|
+
ageMs: number;
|
|
1825
|
+
cache: "miss" | "hit" | "joined";
|
|
1826
|
+
minimumAmount?: string | undefined;
|
|
1827
|
+
} | {
|
|
1828
|
+
status: "quoted";
|
|
1829
|
+
basis: "scaled-from-nearby-amount";
|
|
1830
|
+
expectedAmount: string;
|
|
1831
|
+
askedAmount: string;
|
|
1832
|
+
quotedAt: string;
|
|
1833
|
+
ageMs: number;
|
|
1834
|
+
cache: "miss" | "hit" | "joined";
|
|
1835
|
+
scaledFrom: {
|
|
1836
|
+
expectedAmount: string;
|
|
1837
|
+
askedAmount: string;
|
|
1838
|
+
};
|
|
1839
|
+
minimumAmount?: string | undefined;
|
|
1840
|
+
} | {
|
|
1841
|
+
status: "refused";
|
|
1842
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1843
|
+
reason: string | null;
|
|
1844
|
+
minimumAmount?: string | undefined;
|
|
1845
|
+
} | {
|
|
1846
|
+
status: "pending";
|
|
1847
|
+
retryAfterMs: number;
|
|
1848
|
+
} | undefined;
|
|
1849
|
+
}>;
|
|
1850
|
+
}, "strict", z.ZodTypeAny, {
|
|
1851
|
+
providers: {
|
|
1852
|
+
lifi?: {
|
|
1853
|
+
status: "quoted";
|
|
1854
|
+
basis: "exact";
|
|
1855
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1856
|
+
askedAmount: string;
|
|
1857
|
+
quotedAt: string;
|
|
1858
|
+
ageMs: number;
|
|
1859
|
+
cache: "miss" | "hit" | "joined";
|
|
1860
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1861
|
+
} | {
|
|
1862
|
+
status: "quoted";
|
|
1863
|
+
basis: "scaled-from-nearby-amount";
|
|
1864
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1865
|
+
askedAmount: string;
|
|
1866
|
+
quotedAt: string;
|
|
1867
|
+
ageMs: number;
|
|
1868
|
+
cache: "miss" | "hit" | "joined";
|
|
1869
|
+
scaledFrom: {
|
|
1870
|
+
expectedAmount: string;
|
|
1871
|
+
askedAmount: string;
|
|
1872
|
+
};
|
|
1873
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1874
|
+
} | {
|
|
1875
|
+
status: "refused";
|
|
1876
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1877
|
+
reason: string | null;
|
|
1878
|
+
minimumAmount?: string | undefined;
|
|
1879
|
+
} | {
|
|
1880
|
+
status: "pending";
|
|
1881
|
+
retryAfterMs: number;
|
|
1882
|
+
} | undefined;
|
|
1883
|
+
relay?: {
|
|
1884
|
+
status: "quoted";
|
|
1885
|
+
basis: "exact";
|
|
1886
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1887
|
+
askedAmount: string;
|
|
1888
|
+
quotedAt: string;
|
|
1889
|
+
ageMs: number;
|
|
1890
|
+
cache: "miss" | "hit" | "joined";
|
|
1891
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1892
|
+
} | {
|
|
1893
|
+
status: "quoted";
|
|
1894
|
+
basis: "scaled-from-nearby-amount";
|
|
1895
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1896
|
+
askedAmount: string;
|
|
1897
|
+
quotedAt: string;
|
|
1898
|
+
ageMs: number;
|
|
1899
|
+
cache: "miss" | "hit" | "joined";
|
|
1900
|
+
scaledFrom: {
|
|
1901
|
+
expectedAmount: string;
|
|
1902
|
+
askedAmount: string;
|
|
1903
|
+
};
|
|
1904
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1905
|
+
} | {
|
|
1906
|
+
status: "refused";
|
|
1907
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1908
|
+
reason: string | null;
|
|
1909
|
+
minimumAmount?: string | undefined;
|
|
1910
|
+
} | {
|
|
1911
|
+
status: "pending";
|
|
1912
|
+
retryAfterMs: number;
|
|
1913
|
+
} | undefined;
|
|
1914
|
+
'near-intents'?: {
|
|
1915
|
+
status: "quoted";
|
|
1916
|
+
basis: "exact";
|
|
1917
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
1918
|
+
askedAmount: string;
|
|
1919
|
+
quotedAt: string;
|
|
1920
|
+
ageMs: number;
|
|
1921
|
+
cache: "miss" | "hit" | "joined";
|
|
1922
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
1923
|
+
} | {
|
|
1924
|
+
status: "quoted";
|
|
1925
|
+
basis: "scaled-from-nearby-amount";
|
|
1926
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
1927
|
+
askedAmount: string;
|
|
1928
|
+
quotedAt: string;
|
|
1929
|
+
ageMs: number;
|
|
1930
|
+
cache: "miss" | "hit" | "joined";
|
|
1931
|
+
scaledFrom: {
|
|
1932
|
+
expectedAmount: string;
|
|
1933
|
+
askedAmount: string;
|
|
1934
|
+
};
|
|
1935
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
1936
|
+
} | {
|
|
1937
|
+
status: "refused";
|
|
1938
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1939
|
+
reason: string | null;
|
|
1940
|
+
minimumAmount?: string | undefined;
|
|
1941
|
+
} | {
|
|
1942
|
+
status: "pending";
|
|
1943
|
+
retryAfterMs: number;
|
|
1944
|
+
} | undefined;
|
|
1945
|
+
};
|
|
1946
|
+
}, {
|
|
1947
|
+
providers: {
|
|
1948
|
+
lifi?: {
|
|
1949
|
+
status: "quoted";
|
|
1950
|
+
basis: "exact";
|
|
1951
|
+
expectedAmount: string;
|
|
1952
|
+
askedAmount: string;
|
|
1953
|
+
quotedAt: string;
|
|
1954
|
+
ageMs: number;
|
|
1955
|
+
cache: "miss" | "hit" | "joined";
|
|
1956
|
+
minimumAmount?: string | undefined;
|
|
1957
|
+
} | {
|
|
1958
|
+
status: "quoted";
|
|
1959
|
+
basis: "scaled-from-nearby-amount";
|
|
1960
|
+
expectedAmount: string;
|
|
1961
|
+
askedAmount: string;
|
|
1962
|
+
quotedAt: string;
|
|
1963
|
+
ageMs: number;
|
|
1964
|
+
cache: "miss" | "hit" | "joined";
|
|
1965
|
+
scaledFrom: {
|
|
1966
|
+
expectedAmount: string;
|
|
1967
|
+
askedAmount: string;
|
|
1968
|
+
};
|
|
1969
|
+
minimumAmount?: string | undefined;
|
|
1970
|
+
} | {
|
|
1971
|
+
status: "refused";
|
|
1972
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
1973
|
+
reason: string | null;
|
|
1974
|
+
minimumAmount?: string | undefined;
|
|
1975
|
+
} | {
|
|
1976
|
+
status: "pending";
|
|
1977
|
+
retryAfterMs: number;
|
|
1978
|
+
} | undefined;
|
|
1979
|
+
relay?: {
|
|
1980
|
+
status: "quoted";
|
|
1981
|
+
basis: "exact";
|
|
1982
|
+
expectedAmount: string;
|
|
1983
|
+
askedAmount: string;
|
|
1984
|
+
quotedAt: string;
|
|
1985
|
+
ageMs: number;
|
|
1986
|
+
cache: "miss" | "hit" | "joined";
|
|
1987
|
+
minimumAmount?: string | undefined;
|
|
1988
|
+
} | {
|
|
1989
|
+
status: "quoted";
|
|
1990
|
+
basis: "scaled-from-nearby-amount";
|
|
1991
|
+
expectedAmount: string;
|
|
1992
|
+
askedAmount: string;
|
|
1993
|
+
quotedAt: string;
|
|
1994
|
+
ageMs: number;
|
|
1995
|
+
cache: "miss" | "hit" | "joined";
|
|
1996
|
+
scaledFrom: {
|
|
1997
|
+
expectedAmount: string;
|
|
1998
|
+
askedAmount: string;
|
|
1999
|
+
};
|
|
2000
|
+
minimumAmount?: string | undefined;
|
|
2001
|
+
} | {
|
|
2002
|
+
status: "refused";
|
|
2003
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2004
|
+
reason: string | null;
|
|
2005
|
+
minimumAmount?: string | undefined;
|
|
2006
|
+
} | {
|
|
2007
|
+
status: "pending";
|
|
2008
|
+
retryAfterMs: number;
|
|
2009
|
+
} | undefined;
|
|
2010
|
+
'near-intents'?: {
|
|
2011
|
+
status: "quoted";
|
|
2012
|
+
basis: "exact";
|
|
2013
|
+
expectedAmount: string;
|
|
2014
|
+
askedAmount: string;
|
|
2015
|
+
quotedAt: string;
|
|
2016
|
+
ageMs: number;
|
|
2017
|
+
cache: "miss" | "hit" | "joined";
|
|
2018
|
+
minimumAmount?: string | undefined;
|
|
2019
|
+
} | {
|
|
2020
|
+
status: "quoted";
|
|
2021
|
+
basis: "scaled-from-nearby-amount";
|
|
2022
|
+
expectedAmount: string;
|
|
2023
|
+
askedAmount: string;
|
|
2024
|
+
quotedAt: string;
|
|
2025
|
+
ageMs: number;
|
|
2026
|
+
cache: "miss" | "hit" | "joined";
|
|
2027
|
+
scaledFrom: {
|
|
2028
|
+
expectedAmount: string;
|
|
2029
|
+
askedAmount: string;
|
|
2030
|
+
};
|
|
2031
|
+
minimumAmount?: string | undefined;
|
|
2032
|
+
} | {
|
|
2033
|
+
status: "refused";
|
|
2034
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2035
|
+
reason: string | null;
|
|
2036
|
+
minimumAmount?: string | undefined;
|
|
2037
|
+
} | {
|
|
2038
|
+
status: "pending";
|
|
2039
|
+
retryAfterMs: number;
|
|
2040
|
+
} | undefined;
|
|
2041
|
+
};
|
|
2042
|
+
}>, "many">;
|
|
2043
|
+
}, "strict", z.ZodTypeAny, {
|
|
2044
|
+
answers: {
|
|
2045
|
+
providers: {
|
|
2046
|
+
lifi?: {
|
|
2047
|
+
status: "quoted";
|
|
2048
|
+
basis: "exact";
|
|
2049
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
2050
|
+
askedAmount: string;
|
|
2051
|
+
quotedAt: string;
|
|
2052
|
+
ageMs: number;
|
|
2053
|
+
cache: "miss" | "hit" | "joined";
|
|
2054
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
2055
|
+
} | {
|
|
2056
|
+
status: "quoted";
|
|
2057
|
+
basis: "scaled-from-nearby-amount";
|
|
2058
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
2059
|
+
askedAmount: string;
|
|
2060
|
+
quotedAt: string;
|
|
2061
|
+
ageMs: number;
|
|
2062
|
+
cache: "miss" | "hit" | "joined";
|
|
2063
|
+
scaledFrom: {
|
|
2064
|
+
expectedAmount: string;
|
|
2065
|
+
askedAmount: string;
|
|
2066
|
+
};
|
|
2067
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
2068
|
+
} | {
|
|
2069
|
+
status: "refused";
|
|
2070
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2071
|
+
reason: string | null;
|
|
2072
|
+
minimumAmount?: string | undefined;
|
|
2073
|
+
} | {
|
|
2074
|
+
status: "pending";
|
|
2075
|
+
retryAfterMs: number;
|
|
2076
|
+
} | undefined;
|
|
2077
|
+
relay?: {
|
|
2078
|
+
status: "quoted";
|
|
2079
|
+
basis: "exact";
|
|
2080
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
2081
|
+
askedAmount: string;
|
|
2082
|
+
quotedAt: string;
|
|
2083
|
+
ageMs: number;
|
|
2084
|
+
cache: "miss" | "hit" | "joined";
|
|
2085
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
2086
|
+
} | {
|
|
2087
|
+
status: "quoted";
|
|
2088
|
+
basis: "scaled-from-nearby-amount";
|
|
2089
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
2090
|
+
askedAmount: string;
|
|
2091
|
+
quotedAt: string;
|
|
2092
|
+
ageMs: number;
|
|
2093
|
+
cache: "miss" | "hit" | "joined";
|
|
2094
|
+
scaledFrom: {
|
|
2095
|
+
expectedAmount: string;
|
|
2096
|
+
askedAmount: string;
|
|
2097
|
+
};
|
|
2098
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
2099
|
+
} | {
|
|
2100
|
+
status: "refused";
|
|
2101
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2102
|
+
reason: string | null;
|
|
2103
|
+
minimumAmount?: string | undefined;
|
|
2104
|
+
} | {
|
|
2105
|
+
status: "pending";
|
|
2106
|
+
retryAfterMs: number;
|
|
2107
|
+
} | undefined;
|
|
2108
|
+
'near-intents'?: {
|
|
2109
|
+
status: "quoted";
|
|
2110
|
+
basis: "exact";
|
|
2111
|
+
expectedAmount: string & z.BRAND<"ExactAmount">;
|
|
2112
|
+
askedAmount: string;
|
|
2113
|
+
quotedAt: string;
|
|
2114
|
+
ageMs: number;
|
|
2115
|
+
cache: "miss" | "hit" | "joined";
|
|
2116
|
+
minimumAmount?: (string & z.BRAND<"ExactAmount">) | undefined;
|
|
2117
|
+
} | {
|
|
2118
|
+
status: "quoted";
|
|
2119
|
+
basis: "scaled-from-nearby-amount";
|
|
2120
|
+
expectedAmount: string & z.BRAND<"EstimatedDelivery">;
|
|
2121
|
+
askedAmount: string;
|
|
2122
|
+
quotedAt: string;
|
|
2123
|
+
ageMs: number;
|
|
2124
|
+
cache: "miss" | "hit" | "joined";
|
|
2125
|
+
scaledFrom: {
|
|
2126
|
+
expectedAmount: string;
|
|
2127
|
+
askedAmount: string;
|
|
2128
|
+
};
|
|
2129
|
+
minimumAmount?: (string & z.BRAND<"EstimatedDelivery">) | undefined;
|
|
2130
|
+
} | {
|
|
2131
|
+
status: "refused";
|
|
2132
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2133
|
+
reason: string | null;
|
|
2134
|
+
minimumAmount?: string | undefined;
|
|
2135
|
+
} | {
|
|
2136
|
+
status: "pending";
|
|
2137
|
+
retryAfterMs: number;
|
|
2138
|
+
} | undefined;
|
|
2139
|
+
};
|
|
2140
|
+
}[];
|
|
2141
|
+
}, {
|
|
2142
|
+
answers: {
|
|
2143
|
+
providers: {
|
|
2144
|
+
lifi?: {
|
|
2145
|
+
status: "quoted";
|
|
2146
|
+
basis: "exact";
|
|
2147
|
+
expectedAmount: string;
|
|
2148
|
+
askedAmount: string;
|
|
2149
|
+
quotedAt: string;
|
|
2150
|
+
ageMs: number;
|
|
2151
|
+
cache: "miss" | "hit" | "joined";
|
|
2152
|
+
minimumAmount?: string | undefined;
|
|
2153
|
+
} | {
|
|
2154
|
+
status: "quoted";
|
|
2155
|
+
basis: "scaled-from-nearby-amount";
|
|
2156
|
+
expectedAmount: string;
|
|
2157
|
+
askedAmount: string;
|
|
2158
|
+
quotedAt: string;
|
|
2159
|
+
ageMs: number;
|
|
2160
|
+
cache: "miss" | "hit" | "joined";
|
|
2161
|
+
scaledFrom: {
|
|
2162
|
+
expectedAmount: string;
|
|
2163
|
+
askedAmount: string;
|
|
2164
|
+
};
|
|
2165
|
+
minimumAmount?: string | undefined;
|
|
2166
|
+
} | {
|
|
2167
|
+
status: "refused";
|
|
2168
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2169
|
+
reason: string | null;
|
|
2170
|
+
minimumAmount?: string | undefined;
|
|
2171
|
+
} | {
|
|
2172
|
+
status: "pending";
|
|
2173
|
+
retryAfterMs: number;
|
|
2174
|
+
} | undefined;
|
|
2175
|
+
relay?: {
|
|
2176
|
+
status: "quoted";
|
|
2177
|
+
basis: "exact";
|
|
2178
|
+
expectedAmount: string;
|
|
2179
|
+
askedAmount: string;
|
|
2180
|
+
quotedAt: string;
|
|
2181
|
+
ageMs: number;
|
|
2182
|
+
cache: "miss" | "hit" | "joined";
|
|
2183
|
+
minimumAmount?: string | undefined;
|
|
2184
|
+
} | {
|
|
2185
|
+
status: "quoted";
|
|
2186
|
+
basis: "scaled-from-nearby-amount";
|
|
2187
|
+
expectedAmount: string;
|
|
2188
|
+
askedAmount: string;
|
|
2189
|
+
quotedAt: string;
|
|
2190
|
+
ageMs: number;
|
|
2191
|
+
cache: "miss" | "hit" | "joined";
|
|
2192
|
+
scaledFrom: {
|
|
2193
|
+
expectedAmount: string;
|
|
2194
|
+
askedAmount: string;
|
|
2195
|
+
};
|
|
2196
|
+
minimumAmount?: string | undefined;
|
|
2197
|
+
} | {
|
|
2198
|
+
status: "refused";
|
|
2199
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2200
|
+
reason: string | null;
|
|
2201
|
+
minimumAmount?: string | undefined;
|
|
2202
|
+
} | {
|
|
2203
|
+
status: "pending";
|
|
2204
|
+
retryAfterMs: number;
|
|
2205
|
+
} | undefined;
|
|
2206
|
+
'near-intents'?: {
|
|
2207
|
+
status: "quoted";
|
|
2208
|
+
basis: "exact";
|
|
2209
|
+
expectedAmount: string;
|
|
2210
|
+
askedAmount: string;
|
|
2211
|
+
quotedAt: string;
|
|
2212
|
+
ageMs: number;
|
|
2213
|
+
cache: "miss" | "hit" | "joined";
|
|
2214
|
+
minimumAmount?: string | undefined;
|
|
2215
|
+
} | {
|
|
2216
|
+
status: "quoted";
|
|
2217
|
+
basis: "scaled-from-nearby-amount";
|
|
2218
|
+
expectedAmount: string;
|
|
2219
|
+
askedAmount: string;
|
|
2220
|
+
quotedAt: string;
|
|
2221
|
+
ageMs: number;
|
|
2222
|
+
cache: "miss" | "hit" | "joined";
|
|
2223
|
+
scaledFrom: {
|
|
2224
|
+
expectedAmount: string;
|
|
2225
|
+
askedAmount: string;
|
|
2226
|
+
};
|
|
2227
|
+
minimumAmount?: string | undefined;
|
|
2228
|
+
} | {
|
|
2229
|
+
status: "refused";
|
|
2230
|
+
kind: "no-quote" | "could-not-ask" | "cannot-carry" | "invalid-api-key";
|
|
2231
|
+
reason: string | null;
|
|
2232
|
+
minimumAmount?: string | undefined;
|
|
2233
|
+
} | {
|
|
2234
|
+
status: "pending";
|
|
2235
|
+
retryAfterMs: number;
|
|
2236
|
+
} | undefined;
|
|
2237
|
+
};
|
|
2238
|
+
}[];
|
|
2239
|
+
}>;
|
|
2240
|
+
export type DisplayQuoteResponse = z.infer<typeof displayQuoteResponseSchema>;
|