@t402/smart-router 1.0.0-beta.1

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,937 @@
1
+ import { z } from 'zod';
2
+
3
+ /**
4
+ * Supported chain identifiers (CAIP-2 format)
5
+ */
6
+ declare const ChainId: z.ZodString;
7
+ type ChainId = z.infer<typeof ChainId>;
8
+ /**
9
+ * Asset identifier
10
+ */
11
+ declare const AssetId: z.ZodString;
12
+ type AssetId = z.infer<typeof AssetId>;
13
+ /**
14
+ * Route optimization strategy
15
+ */
16
+ declare const OptimizationStrategy: z.ZodEnum<["cost", "speed", "privacy", "balanced", "slippage"]>;
17
+ type OptimizationStrategy = z.infer<typeof OptimizationStrategy>;
18
+ /**
19
+ * Route step type
20
+ */
21
+ declare const RouteStepType: z.ZodEnum<["transfer", "swap", "bridge", "wrap", "unwrap", "approve", "deposit", "withdraw"]>;
22
+ type RouteStepType = z.infer<typeof RouteStepType>;
23
+ /**
24
+ * Protocol identifier
25
+ */
26
+ declare const ProtocolId: z.ZodString;
27
+ type ProtocolId = z.infer<typeof ProtocolId>;
28
+ /**
29
+ * Route request
30
+ */
31
+ declare const RouteRequest: z.ZodObject<{
32
+ sourceChain: z.ZodString;
33
+ sourceAsset: z.ZodString;
34
+ sourceAmount: z.ZodString;
35
+ destinationChain: z.ZodString;
36
+ destinationAsset: z.ZodOptional<z.ZodString>;
37
+ recipient: z.ZodString;
38
+ optimization: z.ZodDefault<z.ZodEnum<["cost", "speed", "privacy", "balanced", "slippage"]>>;
39
+ maxSlippage: z.ZodDefault<z.ZodString>;
40
+ maxHops: z.ZodDefault<z.ZodNumber>;
41
+ deadline: z.ZodOptional<z.ZodNumber>;
42
+ preferredProtocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
43
+ excludedProtocols: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
44
+ preferredBridges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
45
+ excludedBridges: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ sender: z.ZodString;
47
+ includeMevProtection: z.ZodDefault<z.ZodBoolean>;
48
+ includeGasEstimate: z.ZodDefault<z.ZodBoolean>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ sourceChain: string;
51
+ sourceAsset: string;
52
+ sourceAmount: string;
53
+ destinationChain: string;
54
+ recipient: string;
55
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
56
+ maxSlippage: string;
57
+ maxHops: number;
58
+ sender: string;
59
+ includeMevProtection: boolean;
60
+ includeGasEstimate: boolean;
61
+ destinationAsset?: string | undefined;
62
+ deadline?: number | undefined;
63
+ preferredProtocols?: string[] | undefined;
64
+ excludedProtocols?: string[] | undefined;
65
+ preferredBridges?: string[] | undefined;
66
+ excludedBridges?: string[] | undefined;
67
+ }, {
68
+ sourceChain: string;
69
+ sourceAsset: string;
70
+ sourceAmount: string;
71
+ destinationChain: string;
72
+ recipient: string;
73
+ sender: string;
74
+ destinationAsset?: string | undefined;
75
+ optimization?: "cost" | "speed" | "privacy" | "balanced" | "slippage" | undefined;
76
+ maxSlippage?: string | undefined;
77
+ maxHops?: number | undefined;
78
+ deadline?: number | undefined;
79
+ preferredProtocols?: string[] | undefined;
80
+ excludedProtocols?: string[] | undefined;
81
+ preferredBridges?: string[] | undefined;
82
+ excludedBridges?: string[] | undefined;
83
+ includeMevProtection?: boolean | undefined;
84
+ includeGasEstimate?: boolean | undefined;
85
+ }>;
86
+ type RouteRequest = z.infer<typeof RouteRequest>;
87
+ /**
88
+ * Individual route step
89
+ */
90
+ declare const RouteStep: z.ZodObject<{
91
+ id: z.ZodString;
92
+ type: z.ZodEnum<["transfer", "swap", "bridge", "wrap", "unwrap", "approve", "deposit", "withdraw"]>;
93
+ chain: z.ZodString;
94
+ protocol: z.ZodOptional<z.ZodString>;
95
+ inputAsset: z.ZodString;
96
+ outputAsset: z.ZodString;
97
+ inputAmount: z.ZodString;
98
+ outputAmount: z.ZodString;
99
+ minOutputAmount: z.ZodString;
100
+ contract: z.ZodString;
101
+ calldata: z.ZodOptional<z.ZodString>;
102
+ value: z.ZodOptional<z.ZodString>;
103
+ estimatedGas: z.ZodString;
104
+ estimatedTime: z.ZodNumber;
105
+ protocolFee: z.ZodOptional<z.ZodString>;
106
+ bridgeFee: z.ZodOptional<z.ZodString>;
107
+ priceImpact: z.ZodOptional<z.ZodString>;
108
+ exchangeRate: z.ZodOptional<z.ZodString>;
109
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
110
+ }, "strip", z.ZodTypeAny, {
111
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
112
+ id: string;
113
+ chain: string;
114
+ inputAsset: string;
115
+ outputAsset: string;
116
+ inputAmount: string;
117
+ outputAmount: string;
118
+ minOutputAmount: string;
119
+ contract: string;
120
+ estimatedGas: string;
121
+ estimatedTime: number;
122
+ value?: string | undefined;
123
+ protocol?: string | undefined;
124
+ calldata?: string | undefined;
125
+ protocolFee?: string | undefined;
126
+ bridgeFee?: string | undefined;
127
+ priceImpact?: string | undefined;
128
+ exchangeRate?: string | undefined;
129
+ metadata?: Record<string, unknown> | undefined;
130
+ }, {
131
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
132
+ id: string;
133
+ chain: string;
134
+ inputAsset: string;
135
+ outputAsset: string;
136
+ inputAmount: string;
137
+ outputAmount: string;
138
+ minOutputAmount: string;
139
+ contract: string;
140
+ estimatedGas: string;
141
+ estimatedTime: number;
142
+ value?: string | undefined;
143
+ protocol?: string | undefined;
144
+ calldata?: string | undefined;
145
+ protocolFee?: string | undefined;
146
+ bridgeFee?: string | undefined;
147
+ priceImpact?: string | undefined;
148
+ exchangeRate?: string | undefined;
149
+ metadata?: Record<string, unknown> | undefined;
150
+ }>;
151
+ type RouteStep = z.infer<typeof RouteStep>;
152
+ /**
153
+ * Complete route
154
+ */
155
+ declare const Route: z.ZodObject<{
156
+ id: z.ZodString;
157
+ steps: z.ZodArray<z.ZodObject<{
158
+ id: z.ZodString;
159
+ type: z.ZodEnum<["transfer", "swap", "bridge", "wrap", "unwrap", "approve", "deposit", "withdraw"]>;
160
+ chain: z.ZodString;
161
+ protocol: z.ZodOptional<z.ZodString>;
162
+ inputAsset: z.ZodString;
163
+ outputAsset: z.ZodString;
164
+ inputAmount: z.ZodString;
165
+ outputAmount: z.ZodString;
166
+ minOutputAmount: z.ZodString;
167
+ contract: z.ZodString;
168
+ calldata: z.ZodOptional<z.ZodString>;
169
+ value: z.ZodOptional<z.ZodString>;
170
+ estimatedGas: z.ZodString;
171
+ estimatedTime: z.ZodNumber;
172
+ protocolFee: z.ZodOptional<z.ZodString>;
173
+ bridgeFee: z.ZodOptional<z.ZodString>;
174
+ priceImpact: z.ZodOptional<z.ZodString>;
175
+ exchangeRate: z.ZodOptional<z.ZodString>;
176
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, "strip", z.ZodTypeAny, {
178
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
179
+ id: string;
180
+ chain: string;
181
+ inputAsset: string;
182
+ outputAsset: string;
183
+ inputAmount: string;
184
+ outputAmount: string;
185
+ minOutputAmount: string;
186
+ contract: string;
187
+ estimatedGas: string;
188
+ estimatedTime: number;
189
+ value?: string | undefined;
190
+ protocol?: string | undefined;
191
+ calldata?: string | undefined;
192
+ protocolFee?: string | undefined;
193
+ bridgeFee?: string | undefined;
194
+ priceImpact?: string | undefined;
195
+ exchangeRate?: string | undefined;
196
+ metadata?: Record<string, unknown> | undefined;
197
+ }, {
198
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
199
+ id: string;
200
+ chain: string;
201
+ inputAsset: string;
202
+ outputAsset: string;
203
+ inputAmount: string;
204
+ outputAmount: string;
205
+ minOutputAmount: string;
206
+ contract: string;
207
+ estimatedGas: string;
208
+ estimatedTime: number;
209
+ value?: string | undefined;
210
+ protocol?: string | undefined;
211
+ calldata?: string | undefined;
212
+ protocolFee?: string | undefined;
213
+ bridgeFee?: string | undefined;
214
+ priceImpact?: string | undefined;
215
+ exchangeRate?: string | undefined;
216
+ metadata?: Record<string, unknown> | undefined;
217
+ }>, "many">;
218
+ sourceChain: z.ZodString;
219
+ destinationChain: z.ZodString;
220
+ sourceAsset: z.ZodString;
221
+ destinationAsset: z.ZodString;
222
+ sourceAmount: z.ZodString;
223
+ destinationAmount: z.ZodString;
224
+ minDestinationAmount: z.ZodString;
225
+ totalGasCost: z.ZodString;
226
+ totalProtocolFees: z.ZodString;
227
+ totalBridgeFees: z.ZodString;
228
+ totalCost: z.ZodString;
229
+ estimatedTime: z.ZodNumber;
230
+ priceImpact: z.ZodString;
231
+ confidence: z.ZodNumber;
232
+ optimization: z.ZodEnum<["cost", "speed", "privacy", "balanced", "slippage"]>;
233
+ warnings: z.ZodArray<z.ZodString, "many">;
234
+ createdAt: z.ZodNumber;
235
+ expiresAt: z.ZodNumber;
236
+ }, "strip", z.ZodTypeAny, {
237
+ sourceChain: string;
238
+ sourceAsset: string;
239
+ sourceAmount: string;
240
+ destinationChain: string;
241
+ destinationAsset: string;
242
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
243
+ id: string;
244
+ estimatedTime: number;
245
+ priceImpact: string;
246
+ steps: {
247
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
248
+ id: string;
249
+ chain: string;
250
+ inputAsset: string;
251
+ outputAsset: string;
252
+ inputAmount: string;
253
+ outputAmount: string;
254
+ minOutputAmount: string;
255
+ contract: string;
256
+ estimatedGas: string;
257
+ estimatedTime: number;
258
+ value?: string | undefined;
259
+ protocol?: string | undefined;
260
+ calldata?: string | undefined;
261
+ protocolFee?: string | undefined;
262
+ bridgeFee?: string | undefined;
263
+ priceImpact?: string | undefined;
264
+ exchangeRate?: string | undefined;
265
+ metadata?: Record<string, unknown> | undefined;
266
+ }[];
267
+ destinationAmount: string;
268
+ minDestinationAmount: string;
269
+ totalGasCost: string;
270
+ totalProtocolFees: string;
271
+ totalBridgeFees: string;
272
+ totalCost: string;
273
+ confidence: number;
274
+ warnings: string[];
275
+ createdAt: number;
276
+ expiresAt: number;
277
+ }, {
278
+ sourceChain: string;
279
+ sourceAsset: string;
280
+ sourceAmount: string;
281
+ destinationChain: string;
282
+ destinationAsset: string;
283
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
284
+ id: string;
285
+ estimatedTime: number;
286
+ priceImpact: string;
287
+ steps: {
288
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
289
+ id: string;
290
+ chain: string;
291
+ inputAsset: string;
292
+ outputAsset: string;
293
+ inputAmount: string;
294
+ outputAmount: string;
295
+ minOutputAmount: string;
296
+ contract: string;
297
+ estimatedGas: string;
298
+ estimatedTime: number;
299
+ value?: string | undefined;
300
+ protocol?: string | undefined;
301
+ calldata?: string | undefined;
302
+ protocolFee?: string | undefined;
303
+ bridgeFee?: string | undefined;
304
+ priceImpact?: string | undefined;
305
+ exchangeRate?: string | undefined;
306
+ metadata?: Record<string, unknown> | undefined;
307
+ }[];
308
+ destinationAmount: string;
309
+ minDestinationAmount: string;
310
+ totalGasCost: string;
311
+ totalProtocolFees: string;
312
+ totalBridgeFees: string;
313
+ totalCost: string;
314
+ confidence: number;
315
+ warnings: string[];
316
+ createdAt: number;
317
+ expiresAt: number;
318
+ }>;
319
+ type Route = z.infer<typeof Route>;
320
+ /**
321
+ * Route comparison result
322
+ */
323
+ declare const RouteComparison: z.ZodObject<{
324
+ bestRoute: z.ZodObject<{
325
+ id: z.ZodString;
326
+ steps: z.ZodArray<z.ZodObject<{
327
+ id: z.ZodString;
328
+ type: z.ZodEnum<["transfer", "swap", "bridge", "wrap", "unwrap", "approve", "deposit", "withdraw"]>;
329
+ chain: z.ZodString;
330
+ protocol: z.ZodOptional<z.ZodString>;
331
+ inputAsset: z.ZodString;
332
+ outputAsset: z.ZodString;
333
+ inputAmount: z.ZodString;
334
+ outputAmount: z.ZodString;
335
+ minOutputAmount: z.ZodString;
336
+ contract: z.ZodString;
337
+ calldata: z.ZodOptional<z.ZodString>;
338
+ value: z.ZodOptional<z.ZodString>;
339
+ estimatedGas: z.ZodString;
340
+ estimatedTime: z.ZodNumber;
341
+ protocolFee: z.ZodOptional<z.ZodString>;
342
+ bridgeFee: z.ZodOptional<z.ZodString>;
343
+ priceImpact: z.ZodOptional<z.ZodString>;
344
+ exchangeRate: z.ZodOptional<z.ZodString>;
345
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
346
+ }, "strip", z.ZodTypeAny, {
347
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
348
+ id: string;
349
+ chain: string;
350
+ inputAsset: string;
351
+ outputAsset: string;
352
+ inputAmount: string;
353
+ outputAmount: string;
354
+ minOutputAmount: string;
355
+ contract: string;
356
+ estimatedGas: string;
357
+ estimatedTime: number;
358
+ value?: string | undefined;
359
+ protocol?: string | undefined;
360
+ calldata?: string | undefined;
361
+ protocolFee?: string | undefined;
362
+ bridgeFee?: string | undefined;
363
+ priceImpact?: string | undefined;
364
+ exchangeRate?: string | undefined;
365
+ metadata?: Record<string, unknown> | undefined;
366
+ }, {
367
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
368
+ id: string;
369
+ chain: string;
370
+ inputAsset: string;
371
+ outputAsset: string;
372
+ inputAmount: string;
373
+ outputAmount: string;
374
+ minOutputAmount: string;
375
+ contract: string;
376
+ estimatedGas: string;
377
+ estimatedTime: number;
378
+ value?: string | undefined;
379
+ protocol?: string | undefined;
380
+ calldata?: string | undefined;
381
+ protocolFee?: string | undefined;
382
+ bridgeFee?: string | undefined;
383
+ priceImpact?: string | undefined;
384
+ exchangeRate?: string | undefined;
385
+ metadata?: Record<string, unknown> | undefined;
386
+ }>, "many">;
387
+ sourceChain: z.ZodString;
388
+ destinationChain: z.ZodString;
389
+ sourceAsset: z.ZodString;
390
+ destinationAsset: z.ZodString;
391
+ sourceAmount: z.ZodString;
392
+ destinationAmount: z.ZodString;
393
+ minDestinationAmount: z.ZodString;
394
+ totalGasCost: z.ZodString;
395
+ totalProtocolFees: z.ZodString;
396
+ totalBridgeFees: z.ZodString;
397
+ totalCost: z.ZodString;
398
+ estimatedTime: z.ZodNumber;
399
+ priceImpact: z.ZodString;
400
+ confidence: z.ZodNumber;
401
+ optimization: z.ZodEnum<["cost", "speed", "privacy", "balanced", "slippage"]>;
402
+ warnings: z.ZodArray<z.ZodString, "many">;
403
+ createdAt: z.ZodNumber;
404
+ expiresAt: z.ZodNumber;
405
+ }, "strip", z.ZodTypeAny, {
406
+ sourceChain: string;
407
+ sourceAsset: string;
408
+ sourceAmount: string;
409
+ destinationChain: string;
410
+ destinationAsset: string;
411
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
412
+ id: string;
413
+ estimatedTime: number;
414
+ priceImpact: string;
415
+ steps: {
416
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
417
+ id: string;
418
+ chain: string;
419
+ inputAsset: string;
420
+ outputAsset: string;
421
+ inputAmount: string;
422
+ outputAmount: string;
423
+ minOutputAmount: string;
424
+ contract: string;
425
+ estimatedGas: string;
426
+ estimatedTime: number;
427
+ value?: string | undefined;
428
+ protocol?: string | undefined;
429
+ calldata?: string | undefined;
430
+ protocolFee?: string | undefined;
431
+ bridgeFee?: string | undefined;
432
+ priceImpact?: string | undefined;
433
+ exchangeRate?: string | undefined;
434
+ metadata?: Record<string, unknown> | undefined;
435
+ }[];
436
+ destinationAmount: string;
437
+ minDestinationAmount: string;
438
+ totalGasCost: string;
439
+ totalProtocolFees: string;
440
+ totalBridgeFees: string;
441
+ totalCost: string;
442
+ confidence: number;
443
+ warnings: string[];
444
+ createdAt: number;
445
+ expiresAt: number;
446
+ }, {
447
+ sourceChain: string;
448
+ sourceAsset: string;
449
+ sourceAmount: string;
450
+ destinationChain: string;
451
+ destinationAsset: string;
452
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
453
+ id: string;
454
+ estimatedTime: number;
455
+ priceImpact: string;
456
+ steps: {
457
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
458
+ id: string;
459
+ chain: string;
460
+ inputAsset: string;
461
+ outputAsset: string;
462
+ inputAmount: string;
463
+ outputAmount: string;
464
+ minOutputAmount: string;
465
+ contract: string;
466
+ estimatedGas: string;
467
+ estimatedTime: number;
468
+ value?: string | undefined;
469
+ protocol?: string | undefined;
470
+ calldata?: string | undefined;
471
+ protocolFee?: string | undefined;
472
+ bridgeFee?: string | undefined;
473
+ priceImpact?: string | undefined;
474
+ exchangeRate?: string | undefined;
475
+ metadata?: Record<string, unknown> | undefined;
476
+ }[];
477
+ destinationAmount: string;
478
+ minDestinationAmount: string;
479
+ totalGasCost: string;
480
+ totalProtocolFees: string;
481
+ totalBridgeFees: string;
482
+ totalCost: string;
483
+ confidence: number;
484
+ warnings: string[];
485
+ createdAt: number;
486
+ expiresAt: number;
487
+ }>;
488
+ alternatives: z.ZodArray<z.ZodObject<{
489
+ id: z.ZodString;
490
+ steps: z.ZodArray<z.ZodObject<{
491
+ id: z.ZodString;
492
+ type: z.ZodEnum<["transfer", "swap", "bridge", "wrap", "unwrap", "approve", "deposit", "withdraw"]>;
493
+ chain: z.ZodString;
494
+ protocol: z.ZodOptional<z.ZodString>;
495
+ inputAsset: z.ZodString;
496
+ outputAsset: z.ZodString;
497
+ inputAmount: z.ZodString;
498
+ outputAmount: z.ZodString;
499
+ minOutputAmount: z.ZodString;
500
+ contract: z.ZodString;
501
+ calldata: z.ZodOptional<z.ZodString>;
502
+ value: z.ZodOptional<z.ZodString>;
503
+ estimatedGas: z.ZodString;
504
+ estimatedTime: z.ZodNumber;
505
+ protocolFee: z.ZodOptional<z.ZodString>;
506
+ bridgeFee: z.ZodOptional<z.ZodString>;
507
+ priceImpact: z.ZodOptional<z.ZodString>;
508
+ exchangeRate: z.ZodOptional<z.ZodString>;
509
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
510
+ }, "strip", z.ZodTypeAny, {
511
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
512
+ id: string;
513
+ chain: string;
514
+ inputAsset: string;
515
+ outputAsset: string;
516
+ inputAmount: string;
517
+ outputAmount: string;
518
+ minOutputAmount: string;
519
+ contract: string;
520
+ estimatedGas: string;
521
+ estimatedTime: number;
522
+ value?: string | undefined;
523
+ protocol?: string | undefined;
524
+ calldata?: string | undefined;
525
+ protocolFee?: string | undefined;
526
+ bridgeFee?: string | undefined;
527
+ priceImpact?: string | undefined;
528
+ exchangeRate?: string | undefined;
529
+ metadata?: Record<string, unknown> | undefined;
530
+ }, {
531
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
532
+ id: string;
533
+ chain: string;
534
+ inputAsset: string;
535
+ outputAsset: string;
536
+ inputAmount: string;
537
+ outputAmount: string;
538
+ minOutputAmount: string;
539
+ contract: string;
540
+ estimatedGas: string;
541
+ estimatedTime: number;
542
+ value?: string | undefined;
543
+ protocol?: string | undefined;
544
+ calldata?: string | undefined;
545
+ protocolFee?: string | undefined;
546
+ bridgeFee?: string | undefined;
547
+ priceImpact?: string | undefined;
548
+ exchangeRate?: string | undefined;
549
+ metadata?: Record<string, unknown> | undefined;
550
+ }>, "many">;
551
+ sourceChain: z.ZodString;
552
+ destinationChain: z.ZodString;
553
+ sourceAsset: z.ZodString;
554
+ destinationAsset: z.ZodString;
555
+ sourceAmount: z.ZodString;
556
+ destinationAmount: z.ZodString;
557
+ minDestinationAmount: z.ZodString;
558
+ totalGasCost: z.ZodString;
559
+ totalProtocolFees: z.ZodString;
560
+ totalBridgeFees: z.ZodString;
561
+ totalCost: z.ZodString;
562
+ estimatedTime: z.ZodNumber;
563
+ priceImpact: z.ZodString;
564
+ confidence: z.ZodNumber;
565
+ optimization: z.ZodEnum<["cost", "speed", "privacy", "balanced", "slippage"]>;
566
+ warnings: z.ZodArray<z.ZodString, "many">;
567
+ createdAt: z.ZodNumber;
568
+ expiresAt: z.ZodNumber;
569
+ }, "strip", z.ZodTypeAny, {
570
+ sourceChain: string;
571
+ sourceAsset: string;
572
+ sourceAmount: string;
573
+ destinationChain: string;
574
+ destinationAsset: string;
575
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
576
+ id: string;
577
+ estimatedTime: number;
578
+ priceImpact: string;
579
+ steps: {
580
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
581
+ id: string;
582
+ chain: string;
583
+ inputAsset: string;
584
+ outputAsset: string;
585
+ inputAmount: string;
586
+ outputAmount: string;
587
+ minOutputAmount: string;
588
+ contract: string;
589
+ estimatedGas: string;
590
+ estimatedTime: number;
591
+ value?: string | undefined;
592
+ protocol?: string | undefined;
593
+ calldata?: string | undefined;
594
+ protocolFee?: string | undefined;
595
+ bridgeFee?: string | undefined;
596
+ priceImpact?: string | undefined;
597
+ exchangeRate?: string | undefined;
598
+ metadata?: Record<string, unknown> | undefined;
599
+ }[];
600
+ destinationAmount: string;
601
+ minDestinationAmount: string;
602
+ totalGasCost: string;
603
+ totalProtocolFees: string;
604
+ totalBridgeFees: string;
605
+ totalCost: string;
606
+ confidence: number;
607
+ warnings: string[];
608
+ createdAt: number;
609
+ expiresAt: number;
610
+ }, {
611
+ sourceChain: string;
612
+ sourceAsset: string;
613
+ sourceAmount: string;
614
+ destinationChain: string;
615
+ destinationAsset: string;
616
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
617
+ id: string;
618
+ estimatedTime: number;
619
+ priceImpact: string;
620
+ steps: {
621
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
622
+ id: string;
623
+ chain: string;
624
+ inputAsset: string;
625
+ outputAsset: string;
626
+ inputAmount: string;
627
+ outputAmount: string;
628
+ minOutputAmount: string;
629
+ contract: string;
630
+ estimatedGas: string;
631
+ estimatedTime: number;
632
+ value?: string | undefined;
633
+ protocol?: string | undefined;
634
+ calldata?: string | undefined;
635
+ protocolFee?: string | undefined;
636
+ bridgeFee?: string | undefined;
637
+ priceImpact?: string | undefined;
638
+ exchangeRate?: string | undefined;
639
+ metadata?: Record<string, unknown> | undefined;
640
+ }[];
641
+ destinationAmount: string;
642
+ minDestinationAmount: string;
643
+ totalGasCost: string;
644
+ totalProtocolFees: string;
645
+ totalBridgeFees: string;
646
+ totalCost: string;
647
+ confidence: number;
648
+ warnings: string[];
649
+ createdAt: number;
650
+ expiresAt: number;
651
+ }>, "many">;
652
+ comparison: z.ZodObject<{
653
+ costSavings: z.ZodString;
654
+ timeDifference: z.ZodNumber;
655
+ riskDifference: z.ZodNumber;
656
+ }, "strip", z.ZodTypeAny, {
657
+ costSavings: string;
658
+ timeDifference: number;
659
+ riskDifference: number;
660
+ }, {
661
+ costSavings: string;
662
+ timeDifference: number;
663
+ riskDifference: number;
664
+ }>;
665
+ }, "strip", z.ZodTypeAny, {
666
+ bestRoute: {
667
+ sourceChain: string;
668
+ sourceAsset: string;
669
+ sourceAmount: string;
670
+ destinationChain: string;
671
+ destinationAsset: string;
672
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
673
+ id: string;
674
+ estimatedTime: number;
675
+ priceImpact: string;
676
+ steps: {
677
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
678
+ id: string;
679
+ chain: string;
680
+ inputAsset: string;
681
+ outputAsset: string;
682
+ inputAmount: string;
683
+ outputAmount: string;
684
+ minOutputAmount: string;
685
+ contract: string;
686
+ estimatedGas: string;
687
+ estimatedTime: number;
688
+ value?: string | undefined;
689
+ protocol?: string | undefined;
690
+ calldata?: string | undefined;
691
+ protocolFee?: string | undefined;
692
+ bridgeFee?: string | undefined;
693
+ priceImpact?: string | undefined;
694
+ exchangeRate?: string | undefined;
695
+ metadata?: Record<string, unknown> | undefined;
696
+ }[];
697
+ destinationAmount: string;
698
+ minDestinationAmount: string;
699
+ totalGasCost: string;
700
+ totalProtocolFees: string;
701
+ totalBridgeFees: string;
702
+ totalCost: string;
703
+ confidence: number;
704
+ warnings: string[];
705
+ createdAt: number;
706
+ expiresAt: number;
707
+ };
708
+ alternatives: {
709
+ sourceChain: string;
710
+ sourceAsset: string;
711
+ sourceAmount: string;
712
+ destinationChain: string;
713
+ destinationAsset: string;
714
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
715
+ id: string;
716
+ estimatedTime: number;
717
+ priceImpact: string;
718
+ steps: {
719
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
720
+ id: string;
721
+ chain: string;
722
+ inputAsset: string;
723
+ outputAsset: string;
724
+ inputAmount: string;
725
+ outputAmount: string;
726
+ minOutputAmount: string;
727
+ contract: string;
728
+ estimatedGas: string;
729
+ estimatedTime: number;
730
+ value?: string | undefined;
731
+ protocol?: string | undefined;
732
+ calldata?: string | undefined;
733
+ protocolFee?: string | undefined;
734
+ bridgeFee?: string | undefined;
735
+ priceImpact?: string | undefined;
736
+ exchangeRate?: string | undefined;
737
+ metadata?: Record<string, unknown> | undefined;
738
+ }[];
739
+ destinationAmount: string;
740
+ minDestinationAmount: string;
741
+ totalGasCost: string;
742
+ totalProtocolFees: string;
743
+ totalBridgeFees: string;
744
+ totalCost: string;
745
+ confidence: number;
746
+ warnings: string[];
747
+ createdAt: number;
748
+ expiresAt: number;
749
+ }[];
750
+ comparison: {
751
+ costSavings: string;
752
+ timeDifference: number;
753
+ riskDifference: number;
754
+ };
755
+ }, {
756
+ bestRoute: {
757
+ sourceChain: string;
758
+ sourceAsset: string;
759
+ sourceAmount: string;
760
+ destinationChain: string;
761
+ destinationAsset: string;
762
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
763
+ id: string;
764
+ estimatedTime: number;
765
+ priceImpact: string;
766
+ steps: {
767
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
768
+ id: string;
769
+ chain: string;
770
+ inputAsset: string;
771
+ outputAsset: string;
772
+ inputAmount: string;
773
+ outputAmount: string;
774
+ minOutputAmount: string;
775
+ contract: string;
776
+ estimatedGas: string;
777
+ estimatedTime: number;
778
+ value?: string | undefined;
779
+ protocol?: string | undefined;
780
+ calldata?: string | undefined;
781
+ protocolFee?: string | undefined;
782
+ bridgeFee?: string | undefined;
783
+ priceImpact?: string | undefined;
784
+ exchangeRate?: string | undefined;
785
+ metadata?: Record<string, unknown> | undefined;
786
+ }[];
787
+ destinationAmount: string;
788
+ minDestinationAmount: string;
789
+ totalGasCost: string;
790
+ totalProtocolFees: string;
791
+ totalBridgeFees: string;
792
+ totalCost: string;
793
+ confidence: number;
794
+ warnings: string[];
795
+ createdAt: number;
796
+ expiresAt: number;
797
+ };
798
+ alternatives: {
799
+ sourceChain: string;
800
+ sourceAsset: string;
801
+ sourceAmount: string;
802
+ destinationChain: string;
803
+ destinationAsset: string;
804
+ optimization: "cost" | "speed" | "privacy" | "balanced" | "slippage";
805
+ id: string;
806
+ estimatedTime: number;
807
+ priceImpact: string;
808
+ steps: {
809
+ type: "transfer" | "swap" | "bridge" | "wrap" | "unwrap" | "approve" | "deposit" | "withdraw";
810
+ id: string;
811
+ chain: string;
812
+ inputAsset: string;
813
+ outputAsset: string;
814
+ inputAmount: string;
815
+ outputAmount: string;
816
+ minOutputAmount: string;
817
+ contract: string;
818
+ estimatedGas: string;
819
+ estimatedTime: number;
820
+ value?: string | undefined;
821
+ protocol?: string | undefined;
822
+ calldata?: string | undefined;
823
+ protocolFee?: string | undefined;
824
+ bridgeFee?: string | undefined;
825
+ priceImpact?: string | undefined;
826
+ exchangeRate?: string | undefined;
827
+ metadata?: Record<string, unknown> | undefined;
828
+ }[];
829
+ destinationAmount: string;
830
+ minDestinationAmount: string;
831
+ totalGasCost: string;
832
+ totalProtocolFees: string;
833
+ totalBridgeFees: string;
834
+ totalCost: string;
835
+ confidence: number;
836
+ warnings: string[];
837
+ createdAt: number;
838
+ expiresAt: number;
839
+ }[];
840
+ comparison: {
841
+ costSavings: string;
842
+ timeDifference: number;
843
+ riskDifference: number;
844
+ };
845
+ }>;
846
+ type RouteComparison = z.infer<typeof RouteComparison>;
847
+ /**
848
+ * Route validation result
849
+ */
850
+ declare const RouteValidation: z.ZodObject<{
851
+ valid: z.ZodBoolean;
852
+ errors: z.ZodArray<z.ZodObject<{
853
+ step: z.ZodOptional<z.ZodNumber>;
854
+ code: z.ZodString;
855
+ message: z.ZodString;
856
+ }, "strip", z.ZodTypeAny, {
857
+ code: string;
858
+ message: string;
859
+ step?: number | undefined;
860
+ }, {
861
+ code: string;
862
+ message: string;
863
+ step?: number | undefined;
864
+ }>, "many">;
865
+ warnings: z.ZodArray<z.ZodObject<{
866
+ step: z.ZodOptional<z.ZodNumber>;
867
+ code: z.ZodString;
868
+ message: z.ZodString;
869
+ }, "strip", z.ZodTypeAny, {
870
+ code: string;
871
+ message: string;
872
+ step?: number | undefined;
873
+ }, {
874
+ code: string;
875
+ message: string;
876
+ step?: number | undefined;
877
+ }>, "many">;
878
+ }, "strip", z.ZodTypeAny, {
879
+ valid: boolean;
880
+ warnings: {
881
+ code: string;
882
+ message: string;
883
+ step?: number | undefined;
884
+ }[];
885
+ errors: {
886
+ code: string;
887
+ message: string;
888
+ step?: number | undefined;
889
+ }[];
890
+ }, {
891
+ valid: boolean;
892
+ warnings: {
893
+ code: string;
894
+ message: string;
895
+ step?: number | undefined;
896
+ }[];
897
+ errors: {
898
+ code: string;
899
+ message: string;
900
+ step?: number | undefined;
901
+ }[];
902
+ }>;
903
+ type RouteValidation = z.infer<typeof RouteValidation>;
904
+ /**
905
+ * Network graph edge (for routing algorithms)
906
+ */
907
+ interface GraphEdge {
908
+ from: ChainId;
909
+ to: ChainId;
910
+ fromAsset: AssetId;
911
+ toAsset: AssetId;
912
+ protocol: ProtocolId;
913
+ type: RouteStepType;
914
+ cost: number;
915
+ liquidity: string;
916
+ maxAmount: string;
917
+ minAmount: string;
918
+ estimatedTime: number;
919
+ }
920
+ /**
921
+ * Network graph node
922
+ */
923
+ interface GraphNode {
924
+ chain: ChainId;
925
+ asset: AssetId;
926
+ edges: GraphEdge[];
927
+ }
928
+ /**
929
+ * Routing graph
930
+ */
931
+ interface RoutingGraph {
932
+ nodes: Map<string, GraphNode>;
933
+ edges: GraphEdge[];
934
+ lastUpdated: number;
935
+ }
936
+
937
+ export { AssetId as A, ChainId as C, type GraphEdge as G, OptimizationStrategy as O, ProtocolId as P, RouteStepType as R, RouteRequest as a, RouteStep as b, Route as c, RouteComparison as d, RouteValidation as e, type GraphNode as f, type RoutingGraph as g };