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