@waiaas/actions 2.6.0-rc.6 → 2.6.0-rc.8

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.
@@ -0,0 +1,641 @@
1
+ /**
2
+ * Zod schemas for 0x Swap API v2 responses.
3
+ * Runtime validation to detect API drift early.
4
+ *
5
+ * Endpoints:
6
+ * - /swap/allowance-holder/price -> PriceResponseSchema
7
+ * - /swap/allowance-holder/quote -> QuoteResponseSchema
8
+ */
9
+ import { z } from 'zod';
10
+ export declare const PriceResponseSchema: z.ZodObject<{
11
+ blockNumber: z.ZodString;
12
+ buyAmount: z.ZodString;
13
+ buyToken: z.ZodString;
14
+ fees: z.ZodObject<{
15
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
16
+ zeroExFee: z.ZodNullable<z.ZodObject<{
17
+ amount: z.ZodString;
18
+ token: z.ZodString;
19
+ type: z.ZodString;
20
+ }, "strip", z.ZodTypeAny, {
21
+ type: string;
22
+ amount: string;
23
+ token: string;
24
+ }, {
25
+ type: string;
26
+ amount: string;
27
+ token: string;
28
+ }>>;
29
+ gasFee: z.ZodNullable<z.ZodUnknown>;
30
+ }, "strip", z.ZodTypeAny, {
31
+ zeroExFee: {
32
+ type: string;
33
+ amount: string;
34
+ token: string;
35
+ } | null;
36
+ integratorFee?: unknown;
37
+ gasFee?: unknown;
38
+ }, {
39
+ zeroExFee: {
40
+ type: string;
41
+ amount: string;
42
+ token: string;
43
+ } | null;
44
+ integratorFee?: unknown;
45
+ gasFee?: unknown;
46
+ }>;
47
+ gas: z.ZodString;
48
+ gasPrice: z.ZodString;
49
+ liquidityAvailable: z.ZodBoolean;
50
+ minBuyAmount: z.ZodString;
51
+ route: z.ZodObject<{
52
+ fills: z.ZodArray<z.ZodObject<{
53
+ from: z.ZodString;
54
+ to: z.ZodString;
55
+ source: z.ZodString;
56
+ proportionBps: z.ZodString;
57
+ }, "strip", z.ZodTypeAny, {
58
+ from: string;
59
+ to: string;
60
+ source: string;
61
+ proportionBps: string;
62
+ }, {
63
+ from: string;
64
+ to: string;
65
+ source: string;
66
+ proportionBps: string;
67
+ }>, "many">;
68
+ tokens: z.ZodArray<z.ZodObject<{
69
+ address: z.ZodString;
70
+ symbol: z.ZodString;
71
+ }, "strip", z.ZodTypeAny, {
72
+ symbol: string;
73
+ address: string;
74
+ }, {
75
+ symbol: string;
76
+ address: string;
77
+ }>, "many">;
78
+ }, "strip", z.ZodTypeAny, {
79
+ fills: {
80
+ from: string;
81
+ to: string;
82
+ source: string;
83
+ proportionBps: string;
84
+ }[];
85
+ tokens: {
86
+ symbol: string;
87
+ address: string;
88
+ }[];
89
+ }, {
90
+ fills: {
91
+ from: string;
92
+ to: string;
93
+ source: string;
94
+ proportionBps: string;
95
+ }[];
96
+ tokens: {
97
+ symbol: string;
98
+ address: string;
99
+ }[];
100
+ }>;
101
+ sellAmount: z.ZodString;
102
+ sellToken: z.ZodString;
103
+ totalNetworkFee: z.ZodString;
104
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
105
+ blockNumber: z.ZodString;
106
+ buyAmount: z.ZodString;
107
+ buyToken: z.ZodString;
108
+ fees: z.ZodObject<{
109
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
110
+ zeroExFee: z.ZodNullable<z.ZodObject<{
111
+ amount: z.ZodString;
112
+ token: z.ZodString;
113
+ type: z.ZodString;
114
+ }, "strip", z.ZodTypeAny, {
115
+ type: string;
116
+ amount: string;
117
+ token: string;
118
+ }, {
119
+ type: string;
120
+ amount: string;
121
+ token: string;
122
+ }>>;
123
+ gasFee: z.ZodNullable<z.ZodUnknown>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ zeroExFee: {
126
+ type: string;
127
+ amount: string;
128
+ token: string;
129
+ } | null;
130
+ integratorFee?: unknown;
131
+ gasFee?: unknown;
132
+ }, {
133
+ zeroExFee: {
134
+ type: string;
135
+ amount: string;
136
+ token: string;
137
+ } | null;
138
+ integratorFee?: unknown;
139
+ gasFee?: unknown;
140
+ }>;
141
+ gas: z.ZodString;
142
+ gasPrice: z.ZodString;
143
+ liquidityAvailable: z.ZodBoolean;
144
+ minBuyAmount: z.ZodString;
145
+ route: z.ZodObject<{
146
+ fills: z.ZodArray<z.ZodObject<{
147
+ from: z.ZodString;
148
+ to: z.ZodString;
149
+ source: z.ZodString;
150
+ proportionBps: z.ZodString;
151
+ }, "strip", z.ZodTypeAny, {
152
+ from: string;
153
+ to: string;
154
+ source: string;
155
+ proportionBps: string;
156
+ }, {
157
+ from: string;
158
+ to: string;
159
+ source: string;
160
+ proportionBps: string;
161
+ }>, "many">;
162
+ tokens: z.ZodArray<z.ZodObject<{
163
+ address: z.ZodString;
164
+ symbol: z.ZodString;
165
+ }, "strip", z.ZodTypeAny, {
166
+ symbol: string;
167
+ address: string;
168
+ }, {
169
+ symbol: string;
170
+ address: string;
171
+ }>, "many">;
172
+ }, "strip", z.ZodTypeAny, {
173
+ fills: {
174
+ from: string;
175
+ to: string;
176
+ source: string;
177
+ proportionBps: string;
178
+ }[];
179
+ tokens: {
180
+ symbol: string;
181
+ address: string;
182
+ }[];
183
+ }, {
184
+ fills: {
185
+ from: string;
186
+ to: string;
187
+ source: string;
188
+ proportionBps: string;
189
+ }[];
190
+ tokens: {
191
+ symbol: string;
192
+ address: string;
193
+ }[];
194
+ }>;
195
+ sellAmount: z.ZodString;
196
+ sellToken: z.ZodString;
197
+ totalNetworkFee: z.ZodString;
198
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
199
+ blockNumber: z.ZodString;
200
+ buyAmount: z.ZodString;
201
+ buyToken: z.ZodString;
202
+ fees: z.ZodObject<{
203
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
204
+ zeroExFee: z.ZodNullable<z.ZodObject<{
205
+ amount: z.ZodString;
206
+ token: z.ZodString;
207
+ type: z.ZodString;
208
+ }, "strip", z.ZodTypeAny, {
209
+ type: string;
210
+ amount: string;
211
+ token: string;
212
+ }, {
213
+ type: string;
214
+ amount: string;
215
+ token: string;
216
+ }>>;
217
+ gasFee: z.ZodNullable<z.ZodUnknown>;
218
+ }, "strip", z.ZodTypeAny, {
219
+ zeroExFee: {
220
+ type: string;
221
+ amount: string;
222
+ token: string;
223
+ } | null;
224
+ integratorFee?: unknown;
225
+ gasFee?: unknown;
226
+ }, {
227
+ zeroExFee: {
228
+ type: string;
229
+ amount: string;
230
+ token: string;
231
+ } | null;
232
+ integratorFee?: unknown;
233
+ gasFee?: unknown;
234
+ }>;
235
+ gas: z.ZodString;
236
+ gasPrice: z.ZodString;
237
+ liquidityAvailable: z.ZodBoolean;
238
+ minBuyAmount: z.ZodString;
239
+ route: z.ZodObject<{
240
+ fills: z.ZodArray<z.ZodObject<{
241
+ from: z.ZodString;
242
+ to: z.ZodString;
243
+ source: z.ZodString;
244
+ proportionBps: z.ZodString;
245
+ }, "strip", z.ZodTypeAny, {
246
+ from: string;
247
+ to: string;
248
+ source: string;
249
+ proportionBps: string;
250
+ }, {
251
+ from: string;
252
+ to: string;
253
+ source: string;
254
+ proportionBps: string;
255
+ }>, "many">;
256
+ tokens: z.ZodArray<z.ZodObject<{
257
+ address: z.ZodString;
258
+ symbol: z.ZodString;
259
+ }, "strip", z.ZodTypeAny, {
260
+ symbol: string;
261
+ address: string;
262
+ }, {
263
+ symbol: string;
264
+ address: string;
265
+ }>, "many">;
266
+ }, "strip", z.ZodTypeAny, {
267
+ fills: {
268
+ from: string;
269
+ to: string;
270
+ source: string;
271
+ proportionBps: string;
272
+ }[];
273
+ tokens: {
274
+ symbol: string;
275
+ address: string;
276
+ }[];
277
+ }, {
278
+ fills: {
279
+ from: string;
280
+ to: string;
281
+ source: string;
282
+ proportionBps: string;
283
+ }[];
284
+ tokens: {
285
+ symbol: string;
286
+ address: string;
287
+ }[];
288
+ }>;
289
+ sellAmount: z.ZodString;
290
+ sellToken: z.ZodString;
291
+ totalNetworkFee: z.ZodString;
292
+ }, z.ZodTypeAny, "passthrough">>;
293
+ export type PriceResponse = z.infer<typeof PriceResponseSchema>;
294
+ export declare const QuoteResponseSchema: z.ZodObject<{
295
+ blockNumber: z.ZodString;
296
+ buyAmount: z.ZodString;
297
+ buyToken: z.ZodString;
298
+ fees: z.ZodObject<{
299
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
300
+ zeroExFee: z.ZodNullable<z.ZodObject<{
301
+ amount: z.ZodString;
302
+ token: z.ZodString;
303
+ type: z.ZodString;
304
+ }, "strip", z.ZodTypeAny, {
305
+ type: string;
306
+ amount: string;
307
+ token: string;
308
+ }, {
309
+ type: string;
310
+ amount: string;
311
+ token: string;
312
+ }>>;
313
+ gasFee: z.ZodNullable<z.ZodUnknown>;
314
+ }, "strip", z.ZodTypeAny, {
315
+ zeroExFee: {
316
+ type: string;
317
+ amount: string;
318
+ token: string;
319
+ } | null;
320
+ integratorFee?: unknown;
321
+ gasFee?: unknown;
322
+ }, {
323
+ zeroExFee: {
324
+ type: string;
325
+ amount: string;
326
+ token: string;
327
+ } | null;
328
+ integratorFee?: unknown;
329
+ gasFee?: unknown;
330
+ }>;
331
+ gas: z.ZodString;
332
+ gasPrice: z.ZodString;
333
+ liquidityAvailable: z.ZodBoolean;
334
+ minBuyAmount: z.ZodString;
335
+ route: z.ZodObject<{
336
+ fills: z.ZodArray<z.ZodObject<{
337
+ from: z.ZodString;
338
+ to: z.ZodString;
339
+ source: z.ZodString;
340
+ proportionBps: z.ZodString;
341
+ }, "strip", z.ZodTypeAny, {
342
+ from: string;
343
+ to: string;
344
+ source: string;
345
+ proportionBps: string;
346
+ }, {
347
+ from: string;
348
+ to: string;
349
+ source: string;
350
+ proportionBps: string;
351
+ }>, "many">;
352
+ tokens: z.ZodArray<z.ZodObject<{
353
+ address: z.ZodString;
354
+ symbol: z.ZodString;
355
+ }, "strip", z.ZodTypeAny, {
356
+ symbol: string;
357
+ address: string;
358
+ }, {
359
+ symbol: string;
360
+ address: string;
361
+ }>, "many">;
362
+ }, "strip", z.ZodTypeAny, {
363
+ fills: {
364
+ from: string;
365
+ to: string;
366
+ source: string;
367
+ proportionBps: string;
368
+ }[];
369
+ tokens: {
370
+ symbol: string;
371
+ address: string;
372
+ }[];
373
+ }, {
374
+ fills: {
375
+ from: string;
376
+ to: string;
377
+ source: string;
378
+ proportionBps: string;
379
+ }[];
380
+ tokens: {
381
+ symbol: string;
382
+ address: string;
383
+ }[];
384
+ }>;
385
+ sellAmount: z.ZodString;
386
+ sellToken: z.ZodString;
387
+ totalNetworkFee: z.ZodString;
388
+ } & {
389
+ transaction: z.ZodObject<{
390
+ to: z.ZodString;
391
+ data: z.ZodString;
392
+ gas: z.ZodString;
393
+ gasPrice: z.ZodString;
394
+ value: z.ZodString;
395
+ }, "strip", z.ZodTypeAny, {
396
+ value: string;
397
+ data: string;
398
+ gas: string;
399
+ gasPrice: string;
400
+ to: string;
401
+ }, {
402
+ value: string;
403
+ data: string;
404
+ gas: string;
405
+ gasPrice: string;
406
+ to: string;
407
+ }>;
408
+ permit2: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
409
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
410
+ blockNumber: z.ZodString;
411
+ buyAmount: z.ZodString;
412
+ buyToken: z.ZodString;
413
+ fees: z.ZodObject<{
414
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
415
+ zeroExFee: z.ZodNullable<z.ZodObject<{
416
+ amount: z.ZodString;
417
+ token: z.ZodString;
418
+ type: z.ZodString;
419
+ }, "strip", z.ZodTypeAny, {
420
+ type: string;
421
+ amount: string;
422
+ token: string;
423
+ }, {
424
+ type: string;
425
+ amount: string;
426
+ token: string;
427
+ }>>;
428
+ gasFee: z.ZodNullable<z.ZodUnknown>;
429
+ }, "strip", z.ZodTypeAny, {
430
+ zeroExFee: {
431
+ type: string;
432
+ amount: string;
433
+ token: string;
434
+ } | null;
435
+ integratorFee?: unknown;
436
+ gasFee?: unknown;
437
+ }, {
438
+ zeroExFee: {
439
+ type: string;
440
+ amount: string;
441
+ token: string;
442
+ } | null;
443
+ integratorFee?: unknown;
444
+ gasFee?: unknown;
445
+ }>;
446
+ gas: z.ZodString;
447
+ gasPrice: z.ZodString;
448
+ liquidityAvailable: z.ZodBoolean;
449
+ minBuyAmount: z.ZodString;
450
+ route: z.ZodObject<{
451
+ fills: z.ZodArray<z.ZodObject<{
452
+ from: z.ZodString;
453
+ to: z.ZodString;
454
+ source: z.ZodString;
455
+ proportionBps: z.ZodString;
456
+ }, "strip", z.ZodTypeAny, {
457
+ from: string;
458
+ to: string;
459
+ source: string;
460
+ proportionBps: string;
461
+ }, {
462
+ from: string;
463
+ to: string;
464
+ source: string;
465
+ proportionBps: string;
466
+ }>, "many">;
467
+ tokens: z.ZodArray<z.ZodObject<{
468
+ address: z.ZodString;
469
+ symbol: z.ZodString;
470
+ }, "strip", z.ZodTypeAny, {
471
+ symbol: string;
472
+ address: string;
473
+ }, {
474
+ symbol: string;
475
+ address: string;
476
+ }>, "many">;
477
+ }, "strip", z.ZodTypeAny, {
478
+ fills: {
479
+ from: string;
480
+ to: string;
481
+ source: string;
482
+ proportionBps: string;
483
+ }[];
484
+ tokens: {
485
+ symbol: string;
486
+ address: string;
487
+ }[];
488
+ }, {
489
+ fills: {
490
+ from: string;
491
+ to: string;
492
+ source: string;
493
+ proportionBps: string;
494
+ }[];
495
+ tokens: {
496
+ symbol: string;
497
+ address: string;
498
+ }[];
499
+ }>;
500
+ sellAmount: z.ZodString;
501
+ sellToken: z.ZodString;
502
+ totalNetworkFee: z.ZodString;
503
+ } & {
504
+ transaction: z.ZodObject<{
505
+ to: z.ZodString;
506
+ data: z.ZodString;
507
+ gas: z.ZodString;
508
+ gasPrice: z.ZodString;
509
+ value: z.ZodString;
510
+ }, "strip", z.ZodTypeAny, {
511
+ value: string;
512
+ data: string;
513
+ gas: string;
514
+ gasPrice: string;
515
+ to: string;
516
+ }, {
517
+ value: string;
518
+ data: string;
519
+ gas: string;
520
+ gasPrice: string;
521
+ to: string;
522
+ }>;
523
+ permit2: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
524
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
525
+ blockNumber: z.ZodString;
526
+ buyAmount: z.ZodString;
527
+ buyToken: z.ZodString;
528
+ fees: z.ZodObject<{
529
+ integratorFee: z.ZodNullable<z.ZodUnknown>;
530
+ zeroExFee: z.ZodNullable<z.ZodObject<{
531
+ amount: z.ZodString;
532
+ token: z.ZodString;
533
+ type: z.ZodString;
534
+ }, "strip", z.ZodTypeAny, {
535
+ type: string;
536
+ amount: string;
537
+ token: string;
538
+ }, {
539
+ type: string;
540
+ amount: string;
541
+ token: string;
542
+ }>>;
543
+ gasFee: z.ZodNullable<z.ZodUnknown>;
544
+ }, "strip", z.ZodTypeAny, {
545
+ zeroExFee: {
546
+ type: string;
547
+ amount: string;
548
+ token: string;
549
+ } | null;
550
+ integratorFee?: unknown;
551
+ gasFee?: unknown;
552
+ }, {
553
+ zeroExFee: {
554
+ type: string;
555
+ amount: string;
556
+ token: string;
557
+ } | null;
558
+ integratorFee?: unknown;
559
+ gasFee?: unknown;
560
+ }>;
561
+ gas: z.ZodString;
562
+ gasPrice: z.ZodString;
563
+ liquidityAvailable: z.ZodBoolean;
564
+ minBuyAmount: z.ZodString;
565
+ route: z.ZodObject<{
566
+ fills: z.ZodArray<z.ZodObject<{
567
+ from: z.ZodString;
568
+ to: z.ZodString;
569
+ source: z.ZodString;
570
+ proportionBps: z.ZodString;
571
+ }, "strip", z.ZodTypeAny, {
572
+ from: string;
573
+ to: string;
574
+ source: string;
575
+ proportionBps: string;
576
+ }, {
577
+ from: string;
578
+ to: string;
579
+ source: string;
580
+ proportionBps: string;
581
+ }>, "many">;
582
+ tokens: z.ZodArray<z.ZodObject<{
583
+ address: z.ZodString;
584
+ symbol: z.ZodString;
585
+ }, "strip", z.ZodTypeAny, {
586
+ symbol: string;
587
+ address: string;
588
+ }, {
589
+ symbol: string;
590
+ address: string;
591
+ }>, "many">;
592
+ }, "strip", z.ZodTypeAny, {
593
+ fills: {
594
+ from: string;
595
+ to: string;
596
+ source: string;
597
+ proportionBps: string;
598
+ }[];
599
+ tokens: {
600
+ symbol: string;
601
+ address: string;
602
+ }[];
603
+ }, {
604
+ fills: {
605
+ from: string;
606
+ to: string;
607
+ source: string;
608
+ proportionBps: string;
609
+ }[];
610
+ tokens: {
611
+ symbol: string;
612
+ address: string;
613
+ }[];
614
+ }>;
615
+ sellAmount: z.ZodString;
616
+ sellToken: z.ZodString;
617
+ totalNetworkFee: z.ZodString;
618
+ } & {
619
+ transaction: z.ZodObject<{
620
+ to: z.ZodString;
621
+ data: z.ZodString;
622
+ gas: z.ZodString;
623
+ gasPrice: z.ZodString;
624
+ value: z.ZodString;
625
+ }, "strip", z.ZodTypeAny, {
626
+ value: string;
627
+ data: string;
628
+ gas: string;
629
+ gasPrice: string;
630
+ to: string;
631
+ }, {
632
+ value: string;
633
+ data: string;
634
+ gas: string;
635
+ gasPrice: string;
636
+ to: string;
637
+ }>;
638
+ permit2: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
639
+ }, z.ZodTypeAny, "passthrough">>;
640
+ export type QuoteResponse = z.infer<typeof QuoteResponseSchema>;
641
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/providers/zerox-swap/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAgChB,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAMhE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAShB,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Zod schemas for 0x Swap API v2 responses.
3
+ * Runtime validation to detect API drift early.
4
+ *
5
+ * Endpoints:
6
+ * - /swap/allowance-holder/price -> PriceResponseSchema
7
+ * - /swap/allowance-holder/quote -> QuoteResponseSchema
8
+ */
9
+ import { z } from 'zod';
10
+ // ---------------------------------------------------------------------------
11
+ // Price Response (/swap/allowance-holder/price) (ZXSW-02)
12
+ // ---------------------------------------------------------------------------
13
+ export const PriceResponseSchema = z.object({
14
+ blockNumber: z.string(),
15
+ buyAmount: z.string(),
16
+ buyToken: z.string(),
17
+ fees: z.object({
18
+ integratorFee: z.unknown().nullable(),
19
+ zeroExFee: z.object({
20
+ amount: z.string(),
21
+ token: z.string(),
22
+ type: z.string(),
23
+ }).nullable(),
24
+ gasFee: z.unknown().nullable(),
25
+ }),
26
+ gas: z.string(),
27
+ gasPrice: z.string(),
28
+ liquidityAvailable: z.boolean(), // ZXSW-07: must validate this
29
+ minBuyAmount: z.string(),
30
+ route: z.object({
31
+ fills: z.array(z.object({
32
+ from: z.string(),
33
+ to: z.string(),
34
+ source: z.string(),
35
+ proportionBps: z.string(),
36
+ })),
37
+ tokens: z.array(z.object({
38
+ address: z.string(),
39
+ symbol: z.string(),
40
+ })),
41
+ }),
42
+ sellAmount: z.string(),
43
+ sellToken: z.string(),
44
+ totalNetworkFee: z.string(),
45
+ }).passthrough(); // Allow extra fields from API updates
46
+ // ---------------------------------------------------------------------------
47
+ // Quote Response (/swap/allowance-holder/quote) (ZXSW-03)
48
+ // ---------------------------------------------------------------------------
49
+ export const QuoteResponseSchema = PriceResponseSchema.extend({
50
+ transaction: z.object({
51
+ to: z.string(), // AllowanceHolder contract
52
+ data: z.string(), // calldata (hex)
53
+ gas: z.string(),
54
+ gasPrice: z.string(),
55
+ value: z.string(), // native token value (wei)
56
+ }),
57
+ permit2: z.unknown().nullable().optional(), // null for AllowanceHolder flow
58
+ }).passthrough();
59
+ //# sourceMappingURL=schemas.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../src/providers/zerox-swap/schemas.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,8EAA8E;AAC9E,0DAA0D;AAC1D,8EAA8E;AAE9E,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC1C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC;QACb,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QACrC,SAAS,EAAE,CAAC,CAAC,MAAM,CAAC;YAClB,MAAM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