@rabby-wallet/rabby-swap 0.0.19 → 0.0.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/abi.js ADDED
@@ -0,0 +1,766 @@
1
+ export const OneInchABI = [
2
+ {
3
+ inputs: [
4
+ {
5
+ internalType: "contract IAggregationExecutor",
6
+ name: "executor",
7
+ type: "address",
8
+ },
9
+ {
10
+ components: [
11
+ {
12
+ internalType: "contract IERC20",
13
+ name: "srcToken",
14
+ type: "address",
15
+ },
16
+ {
17
+ internalType: "contract IERC20",
18
+ name: "dstToken",
19
+ type: "address",
20
+ },
21
+ {
22
+ internalType: "address payable",
23
+ name: "srcReceiver",
24
+ type: "address",
25
+ },
26
+ {
27
+ internalType: "address payable",
28
+ name: "dstReceiver",
29
+ type: "address",
30
+ },
31
+ { internalType: "uint256", name: "amount", type: "uint256" },
32
+ { internalType: "uint256", name: "minReturnAmount", type: "uint256" },
33
+ { internalType: "uint256", name: "flags", type: "uint256" },
34
+ ],
35
+ internalType: "struct GenericRouter.SwapDescription",
36
+ name: "desc",
37
+ type: "tuple",
38
+ },
39
+ { internalType: "bytes", name: "permit", type: "bytes" },
40
+ { internalType: "bytes", name: "data", type: "bytes" },
41
+ ],
42
+ name: "swap",
43
+ outputs: [
44
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
45
+ { internalType: "uint256", name: "spentAmount", type: "uint256" },
46
+ ],
47
+ stateMutability: "payable",
48
+ type: "function",
49
+ },
50
+ {
51
+ inputs: [
52
+ { internalType: "uint256", name: "amount", type: "uint256" },
53
+ { internalType: "uint256", name: "minReturn", type: "uint256" },
54
+ { internalType: "uint256[]", name: "pools", type: "uint256[]" },
55
+ ],
56
+ name: "uniswapV3Swap",
57
+ outputs: [
58
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
59
+ ],
60
+ stateMutability: "payable",
61
+ type: "function",
62
+ },
63
+ {
64
+ inputs: [
65
+ { internalType: "address payable", name: "recipient", type: "address" },
66
+ { internalType: "uint256", name: "amount", type: "uint256" },
67
+ { internalType: "uint256", name: "minReturn", type: "uint256" },
68
+ { internalType: "uint256[]", name: "pools", type: "uint256[]" },
69
+ ],
70
+ name: "uniswapV3SwapTo",
71
+ outputs: [
72
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
73
+ ],
74
+ stateMutability: "payable",
75
+ type: "function",
76
+ },
77
+ {
78
+ inputs: [
79
+ { internalType: "contract IERC20", name: "srcToken", type: "address" },
80
+ { internalType: "uint256", name: "amount", type: "uint256" },
81
+ { internalType: "uint256", name: "minReturn", type: "uint256" },
82
+ { internalType: "uint256[]", name: "pools", type: "uint256[]" },
83
+ ],
84
+ name: "unoswap",
85
+ outputs: [
86
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
87
+ ],
88
+ stateMutability: "payable",
89
+ type: "function",
90
+ },
91
+ {
92
+ inputs: [
93
+ { internalType: "address payable", name: "recipient", type: "address" },
94
+ { internalType: "contract IERC20", name: "srcToken", type: "address" },
95
+ { internalType: "uint256", name: "amount", type: "uint256" },
96
+ { internalType: "uint256", name: "minReturn", type: "uint256" },
97
+ { internalType: "uint256[]", name: "pools", type: "uint256[]" },
98
+ ],
99
+ name: "unoswapTo",
100
+ outputs: [
101
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
102
+ ],
103
+ stateMutability: "payable",
104
+ type: "function",
105
+ },
106
+ ];
107
+ export const ZeroXABI = [
108
+ {
109
+ inputs: [
110
+ {
111
+ name: "inputToken",
112
+ type: "address",
113
+ },
114
+ {
115
+ name: "outputToken",
116
+ type: "address",
117
+ },
118
+ {
119
+ name: "inputTokenAmount",
120
+ type: "uint256",
121
+ },
122
+ {
123
+ name: "minOutputTokenAmount",
124
+ type: "uint256",
125
+ },
126
+ {
127
+ name: "transformations",
128
+ type: "(uint32,bytes)[]",
129
+ components: [
130
+ {
131
+ name: "deploymentNonce",
132
+ type: "uint32",
133
+ },
134
+ {
135
+ name: "data",
136
+ type: "bytes",
137
+ },
138
+ ],
139
+ },
140
+ ],
141
+ name: "transformERC20",
142
+ outputs: [
143
+ {
144
+ name: "outputTokenAmount",
145
+ type: "uint256",
146
+ },
147
+ ],
148
+ stateMutability: "payable",
149
+ type: "function",
150
+ },
151
+ ];
152
+ export const ParaSwapABI = [
153
+ {
154
+ inputs: [
155
+ {
156
+ components: [
157
+ {
158
+ internalType: "address",
159
+ name: "fromToken",
160
+ type: "address",
161
+ },
162
+ {
163
+ internalType: "uint256",
164
+ name: "fromAmount",
165
+ type: "uint256",
166
+ },
167
+ {
168
+ internalType: "uint256",
169
+ name: "toAmount",
170
+ type: "uint256",
171
+ },
172
+ {
173
+ internalType: "uint256",
174
+ name: "expectedAmount",
175
+ type: "uint256",
176
+ },
177
+ {
178
+ internalType: "address payable",
179
+ name: "beneficiary",
180
+ type: "address",
181
+ },
182
+ {
183
+ components: [
184
+ {
185
+ internalType: "uint256",
186
+ name: "fromAmountPercent",
187
+ type: "uint256",
188
+ },
189
+ {
190
+ components: [
191
+ {
192
+ internalType: "address",
193
+ name: "to",
194
+ type: "address",
195
+ },
196
+ {
197
+ internalType: "uint256",
198
+ name: "totalNetworkFee",
199
+ type: "uint256",
200
+ },
201
+ {
202
+ components: [
203
+ {
204
+ internalType: "address payable",
205
+ name: "adapter",
206
+ type: "address",
207
+ },
208
+ {
209
+ internalType: "uint256",
210
+ name: "percent",
211
+ type: "uint256",
212
+ },
213
+ {
214
+ internalType: "uint256",
215
+ name: "networkFee",
216
+ type: "uint256",
217
+ },
218
+ {
219
+ components: [
220
+ {
221
+ internalType: "uint256",
222
+ name: "index",
223
+ type: "uint256",
224
+ },
225
+ {
226
+ internalType: "address",
227
+ name: "targetExchange",
228
+ type: "address",
229
+ },
230
+ {
231
+ internalType: "uint256",
232
+ name: "percent",
233
+ type: "uint256",
234
+ },
235
+ {
236
+ internalType: "bytes",
237
+ name: "payload",
238
+ type: "bytes",
239
+ },
240
+ {
241
+ internalType: "uint256",
242
+ name: "networkFee",
243
+ type: "uint256",
244
+ },
245
+ ],
246
+ internalType: "struct Utils.Route[]",
247
+ name: "route",
248
+ type: "tuple[]",
249
+ },
250
+ ],
251
+ internalType: "struct Utils.Adapter[]",
252
+ name: "adapters",
253
+ type: "tuple[]",
254
+ },
255
+ ],
256
+ internalType: "struct Utils.Path[]",
257
+ name: "path",
258
+ type: "tuple[]",
259
+ },
260
+ ],
261
+ internalType: "struct Utils.MegaSwapPath[]",
262
+ name: "path",
263
+ type: "tuple[]",
264
+ },
265
+ {
266
+ internalType: "address payable",
267
+ name: "partner",
268
+ type: "address",
269
+ },
270
+ {
271
+ internalType: "uint256",
272
+ name: "feePercent",
273
+ type: "uint256",
274
+ },
275
+ {
276
+ internalType: "bytes",
277
+ name: "permit",
278
+ type: "bytes",
279
+ },
280
+ {
281
+ internalType: "uint256",
282
+ name: "deadline",
283
+ type: "uint256",
284
+ },
285
+ {
286
+ internalType: "bytes16",
287
+ name: "uuid",
288
+ type: "bytes16",
289
+ },
290
+ ],
291
+ internalType: "struct Utils.MegaSwapSellData",
292
+ name: "data",
293
+ type: "tuple",
294
+ },
295
+ ],
296
+ name: "megaSwap",
297
+ outputs: [
298
+ {
299
+ internalType: "uint256",
300
+ name: "",
301
+ type: "uint256",
302
+ },
303
+ ],
304
+ stateMutability: "payable",
305
+ type: "function",
306
+ },
307
+ {
308
+ inputs: [
309
+ {
310
+ components: [
311
+ {
312
+ internalType: "address",
313
+ name: "fromToken",
314
+ type: "address",
315
+ },
316
+ {
317
+ internalType: "uint256",
318
+ name: "fromAmount",
319
+ type: "uint256",
320
+ },
321
+ {
322
+ internalType: "uint256",
323
+ name: "toAmount",
324
+ type: "uint256",
325
+ },
326
+ {
327
+ internalType: "uint256",
328
+ name: "expectedAmount",
329
+ type: "uint256",
330
+ },
331
+ {
332
+ internalType: "address payable",
333
+ name: "beneficiary",
334
+ type: "address",
335
+ },
336
+ {
337
+ components: [
338
+ {
339
+ internalType: "address",
340
+ name: "to",
341
+ type: "address",
342
+ },
343
+ {
344
+ internalType: "uint256",
345
+ name: "totalNetworkFee",
346
+ type: "uint256",
347
+ },
348
+ {
349
+ components: [
350
+ {
351
+ internalType: "address payable",
352
+ name: "adapter",
353
+ type: "address",
354
+ },
355
+ {
356
+ internalType: "uint256",
357
+ name: "percent",
358
+ type: "uint256",
359
+ },
360
+ {
361
+ internalType: "uint256",
362
+ name: "networkFee",
363
+ type: "uint256",
364
+ },
365
+ {
366
+ components: [
367
+ {
368
+ internalType: "uint256",
369
+ name: "index",
370
+ type: "uint256",
371
+ },
372
+ {
373
+ internalType: "address",
374
+ name: "targetExchange",
375
+ type: "address",
376
+ },
377
+ {
378
+ internalType: "uint256",
379
+ name: "percent",
380
+ type: "uint256",
381
+ },
382
+ {
383
+ internalType: "bytes",
384
+ name: "payload",
385
+ type: "bytes",
386
+ },
387
+ {
388
+ internalType: "uint256",
389
+ name: "networkFee",
390
+ type: "uint256",
391
+ },
392
+ ],
393
+ internalType: "struct Utils.Route[]",
394
+ name: "route",
395
+ type: "tuple[]",
396
+ },
397
+ ],
398
+ internalType: "struct Utils.Adapter[]",
399
+ name: "adapters",
400
+ type: "tuple[]",
401
+ },
402
+ ],
403
+ internalType: "struct Utils.Path[]",
404
+ name: "path",
405
+ type: "tuple[]",
406
+ },
407
+ {
408
+ internalType: "address payable",
409
+ name: "partner",
410
+ type: "address",
411
+ },
412
+ {
413
+ internalType: "uint256",
414
+ name: "feePercent",
415
+ type: "uint256",
416
+ },
417
+ {
418
+ internalType: "bytes",
419
+ name: "permit",
420
+ type: "bytes",
421
+ },
422
+ {
423
+ internalType: "uint256",
424
+ name: "deadline",
425
+ type: "uint256",
426
+ },
427
+ {
428
+ internalType: "bytes16",
429
+ name: "uuid",
430
+ type: "bytes16",
431
+ },
432
+ ],
433
+ internalType: "struct Utils.SellData",
434
+ name: "data",
435
+ type: "tuple",
436
+ },
437
+ ],
438
+ name: "multiSwap",
439
+ outputs: [
440
+ {
441
+ internalType: "uint256",
442
+ name: "",
443
+ type: "uint256",
444
+ },
445
+ ],
446
+ stateMutability: "payable",
447
+ type: "function",
448
+ },
449
+ {
450
+ inputs: [
451
+ {
452
+ components: [
453
+ {
454
+ internalType: "address",
455
+ name: "fromToken",
456
+ type: "address",
457
+ },
458
+ {
459
+ internalType: "address",
460
+ name: "toToken",
461
+ type: "address",
462
+ },
463
+ {
464
+ internalType: "uint256",
465
+ name: "fromAmount",
466
+ type: "uint256",
467
+ },
468
+ {
469
+ internalType: "uint256",
470
+ name: "toAmount",
471
+ type: "uint256",
472
+ },
473
+ {
474
+ internalType: "uint256",
475
+ name: "expectedAmount",
476
+ type: "uint256",
477
+ },
478
+ {
479
+ internalType: "address[]",
480
+ name: "callees",
481
+ type: "address[]",
482
+ },
483
+ {
484
+ internalType: "bytes",
485
+ name: "exchangeData",
486
+ type: "bytes",
487
+ },
488
+ {
489
+ internalType: "uint256[]",
490
+ name: "startIndexes",
491
+ type: "uint256[]",
492
+ },
493
+ {
494
+ internalType: "uint256[]",
495
+ name: "values",
496
+ type: "uint256[]",
497
+ },
498
+ {
499
+ internalType: "address payable",
500
+ name: "beneficiary",
501
+ type: "address",
502
+ },
503
+ {
504
+ internalType: "address payable",
505
+ name: "partner",
506
+ type: "address",
507
+ },
508
+ {
509
+ internalType: "uint256",
510
+ name: "feePercent",
511
+ type: "uint256",
512
+ },
513
+ {
514
+ internalType: "bytes",
515
+ name: "permit",
516
+ type: "bytes",
517
+ },
518
+ {
519
+ internalType: "uint256",
520
+ name: "deadline",
521
+ type: "uint256",
522
+ },
523
+ {
524
+ internalType: "bytes16",
525
+ name: "uuid",
526
+ type: "bytes16",
527
+ },
528
+ ],
529
+ internalType: "struct Utils.SimpleData",
530
+ name: "data",
531
+ type: "tuple",
532
+ },
533
+ ],
534
+ name: "simpleSwap",
535
+ outputs: [
536
+ {
537
+ internalType: "uint256",
538
+ name: "receivedAmount",
539
+ type: "uint256",
540
+ },
541
+ ],
542
+ stateMutability: "payable",
543
+ type: "function",
544
+ },
545
+ ];
546
+ export const OpenOceanABI = [
547
+ {
548
+ anonymous: false,
549
+ inputs: [
550
+ {
551
+ indexed: true,
552
+ internalType: "address",
553
+ name: "previousOwner",
554
+ type: "address",
555
+ },
556
+ {
557
+ indexed: true,
558
+ internalType: "address",
559
+ name: "newOwner",
560
+ type: "address",
561
+ },
562
+ ],
563
+ name: "OwnershipTransferred",
564
+ type: "event",
565
+ },
566
+ {
567
+ anonymous: false,
568
+ inputs: [
569
+ {
570
+ indexed: false,
571
+ internalType: "address",
572
+ name: "account",
573
+ type: "address",
574
+ },
575
+ ],
576
+ name: "Paused",
577
+ type: "event",
578
+ },
579
+ {
580
+ anonymous: false,
581
+ inputs: [
582
+ {
583
+ indexed: true,
584
+ internalType: "address",
585
+ name: "sender",
586
+ type: "address",
587
+ },
588
+ {
589
+ indexed: true,
590
+ internalType: "contract IERC20",
591
+ name: "srcToken",
592
+ type: "address",
593
+ },
594
+ {
595
+ indexed: true,
596
+ internalType: "contract IERC20",
597
+ name: "dstToken",
598
+ type: "address",
599
+ },
600
+ {
601
+ indexed: false,
602
+ internalType: "address",
603
+ name: "dstReceiver",
604
+ type: "address",
605
+ },
606
+ {
607
+ indexed: false,
608
+ internalType: "uint256",
609
+ name: "amount",
610
+ type: "uint256",
611
+ },
612
+ {
613
+ indexed: false,
614
+ internalType: "uint256",
615
+ name: "spentAmount",
616
+ type: "uint256",
617
+ },
618
+ {
619
+ indexed: false,
620
+ internalType: "uint256",
621
+ name: "returnAmount",
622
+ type: "uint256",
623
+ },
624
+ {
625
+ indexed: false,
626
+ internalType: "uint256",
627
+ name: "minReturnAmount",
628
+ type: "uint256",
629
+ },
630
+ {
631
+ indexed: false,
632
+ internalType: "uint256",
633
+ name: "guaranteedAmount",
634
+ type: "uint256",
635
+ },
636
+ {
637
+ indexed: false,
638
+ internalType: "address",
639
+ name: "referrer",
640
+ type: "address",
641
+ },
642
+ ],
643
+ name: "Swapped",
644
+ type: "event",
645
+ },
646
+ {
647
+ anonymous: false,
648
+ inputs: [
649
+ {
650
+ indexed: false,
651
+ internalType: "address",
652
+ name: "account",
653
+ type: "address",
654
+ },
655
+ ],
656
+ name: "Unpaused",
657
+ type: "event",
658
+ },
659
+ {
660
+ inputs: [],
661
+ name: "initialize",
662
+ outputs: [],
663
+ stateMutability: "nonpayable",
664
+ type: "function",
665
+ },
666
+ {
667
+ inputs: [],
668
+ name: "owner",
669
+ outputs: [{ internalType: "address", name: "", type: "address" }],
670
+ stateMutability: "view",
671
+ type: "function",
672
+ },
673
+ {
674
+ inputs: [],
675
+ name: "pause",
676
+ outputs: [],
677
+ stateMutability: "nonpayable",
678
+ type: "function",
679
+ },
680
+ {
681
+ inputs: [],
682
+ name: "paused",
683
+ outputs: [{ internalType: "bool", name: "", type: "bool" }],
684
+ stateMutability: "view",
685
+ type: "function",
686
+ },
687
+ {
688
+ inputs: [],
689
+ name: "renounceOwnership",
690
+ outputs: [],
691
+ stateMutability: "nonpayable",
692
+ type: "function",
693
+ },
694
+ {
695
+ inputs: [
696
+ { internalType: "contract IERC20", name: "token", type: "address" },
697
+ { internalType: "uint256", name: "amount", type: "uint256" },
698
+ ],
699
+ name: "rescueFunds",
700
+ outputs: [],
701
+ stateMutability: "nonpayable",
702
+ type: "function",
703
+ },
704
+ {
705
+ inputs: [
706
+ {
707
+ internalType: "contract IOpenOceanCaller",
708
+ name: "caller",
709
+ type: "address",
710
+ },
711
+ {
712
+ components: [
713
+ {
714
+ internalType: "contract IERC20",
715
+ name: "srcToken",
716
+ type: "address",
717
+ },
718
+ {
719
+ internalType: "contract IERC20",
720
+ name: "dstToken",
721
+ type: "address",
722
+ },
723
+ { internalType: "address", name: "srcReceiver", type: "address" },
724
+ { internalType: "address", name: "dstReceiver", type: "address" },
725
+ { internalType: "uint256", name: "amount", type: "uint256" },
726
+ { internalType: "uint256", name: "minReturnAmount", type: "uint256" },
727
+ {
728
+ internalType: "uint256",
729
+ name: "guaranteedAmount",
730
+ type: "uint256",
731
+ },
732
+ { internalType: "uint256", name: "flags", type: "uint256" },
733
+ { internalType: "address", name: "referrer", type: "address" },
734
+ { internalType: "bytes", name: "permit", type: "bytes" },
735
+ ],
736
+ internalType: "struct OpenOceanExchange.SwapDescription",
737
+ name: "desc",
738
+ type: "tuple",
739
+ },
740
+ {
741
+ components: [
742
+ { internalType: "uint256", name: "target", type: "uint256" },
743
+ { internalType: "uint256", name: "gasLimit", type: "uint256" },
744
+ { internalType: "uint256", name: "value", type: "uint256" },
745
+ { internalType: "bytes", name: "data", type: "bytes" },
746
+ ],
747
+ internalType: "struct IOpenOceanCaller.CallDescription[]",
748
+ name: "calls",
749
+ type: "tuple[]",
750
+ },
751
+ ],
752
+ name: "swap",
753
+ outputs: [
754
+ { internalType: "uint256", name: "returnAmount", type: "uint256" },
755
+ ],
756
+ stateMutability: "payable",
757
+ type: "function",
758
+ },
759
+ {
760
+ inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
761
+ name: "transferOwnership",
762
+ outputs: [],
763
+ stateMutability: "nonpayable",
764
+ type: "function",
765
+ },
766
+ ];