hermes-swap 0.0.12 → 0.0.13

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,725 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/abis/aggregator.ts
20
+ var aggregator_exports = {};
21
+ __export(aggregator_exports, {
22
+ default: () => aggregator_default
23
+ });
24
+ module.exports = __toCommonJS(aggregator_exports);
25
+ var AggregatorAbi = [
26
+ {
27
+ "type": "constructor",
28
+ "inputs": [
29
+ {
30
+ "name": "_owner",
31
+ "type": "address",
32
+ "internalType": "address"
33
+ },
34
+ {
35
+ "name": "_executor",
36
+ "type": "address",
37
+ "internalType": "address"
38
+ },
39
+ {
40
+ "name": "_quoter",
41
+ "type": "address",
42
+ "internalType": "address"
43
+ }
44
+ ],
45
+ "stateMutability": "nonpayable"
46
+ },
47
+ {
48
+ "type": "event",
49
+ "name": "Approved",
50
+ "inputs": [
51
+ {
52
+ "name": "tokenList",
53
+ "type": "address[]",
54
+ "indexed": false,
55
+ "internalType": "address[]"
56
+ },
57
+ {
58
+ "name": "spenderList",
59
+ "type": "address[]",
60
+ "indexed": false,
61
+ "internalType": "address[]"
62
+ }
63
+ ],
64
+ "anonymous": false
65
+ },
66
+ {
67
+ "type": "event",
68
+ "name": "ContractAdded",
69
+ "inputs": [
70
+ {
71
+ "name": "contractType",
72
+ "type": "string",
73
+ "indexed": false,
74
+ "internalType": "string"
75
+ },
76
+ {
77
+ "name": "contractAddress",
78
+ "type": "address",
79
+ "indexed": false,
80
+ "internalType": "address"
81
+ }
82
+ ],
83
+ "anonymous": false
84
+ },
85
+ {
86
+ "type": "event",
87
+ "name": "ContractRemoved",
88
+ "inputs": [
89
+ {
90
+ "name": "contractType",
91
+ "type": "string",
92
+ "indexed": false,
93
+ "internalType": "string"
94
+ }
95
+ ],
96
+ "anonymous": false
97
+ },
98
+ {
99
+ "type": "event",
100
+ "name": "ContractUpdated",
101
+ "inputs": [
102
+ {
103
+ "name": "contractType",
104
+ "type": "string",
105
+ "indexed": false,
106
+ "internalType": "string"
107
+ },
108
+ {
109
+ "name": "contractAddress",
110
+ "type": "address",
111
+ "indexed": false,
112
+ "internalType": "address"
113
+ }
114
+ ],
115
+ "anonymous": false
116
+ },
117
+ {
118
+ "type": "event",
119
+ "name": "ExecutorUpdated",
120
+ "inputs": [
121
+ {
122
+ "name": "executor",
123
+ "type": "address",
124
+ "indexed": false,
125
+ "internalType": "address"
126
+ }
127
+ ],
128
+ "anonymous": false
129
+ },
130
+ {
131
+ "type": "event",
132
+ "name": "MultiSwapped",
133
+ "inputs": [
134
+ {
135
+ "name": "userList",
136
+ "type": "address[]",
137
+ "indexed": false,
138
+ "internalType": "address[]"
139
+ },
140
+ {
141
+ "name": "amountInList",
142
+ "type": "uint256[]",
143
+ "indexed": false,
144
+ "internalType": "uint256[]"
145
+ },
146
+ {
147
+ "name": "amountOutList",
148
+ "type": "uint256[]",
149
+ "indexed": false,
150
+ "internalType": "uint256[]"
151
+ }
152
+ ],
153
+ "anonymous": false
154
+ },
155
+ {
156
+ "type": "event",
157
+ "name": "SwapAndBridge",
158
+ "inputs": [
159
+ {
160
+ "name": "user",
161
+ "type": "address",
162
+ "indexed": false,
163
+ "internalType": "address"
164
+ },
165
+ {
166
+ "name": "amountIn",
167
+ "type": "uint256",
168
+ "indexed": false,
169
+ "internalType": "uint256"
170
+ },
171
+ {
172
+ "name": "amountOut",
173
+ "type": "uint256",
174
+ "indexed": false,
175
+ "internalType": "uint256"
176
+ },
177
+ {
178
+ "name": "bridge",
179
+ "type": "string",
180
+ "indexed": false,
181
+ "internalType": "string"
182
+ }
183
+ ],
184
+ "anonymous": false
185
+ },
186
+ {
187
+ "type": "event",
188
+ "name": "Swapped",
189
+ "inputs": [
190
+ {
191
+ "name": "user",
192
+ "type": "address",
193
+ "indexed": false,
194
+ "internalType": "address"
195
+ },
196
+ {
197
+ "name": "amountIn",
198
+ "type": "uint256",
199
+ "indexed": false,
200
+ "internalType": "uint256"
201
+ },
202
+ {
203
+ "name": "amountOut",
204
+ "type": "uint256",
205
+ "indexed": false,
206
+ "internalType": "uint256"
207
+ }
208
+ ],
209
+ "anonymous": false
210
+ },
211
+ {
212
+ "type": "function",
213
+ "name": "addContract",
214
+ "inputs": [
215
+ {
216
+ "name": "contractType",
217
+ "type": "string",
218
+ "internalType": "string"
219
+ },
220
+ {
221
+ "name": "contractAddress",
222
+ "type": "address",
223
+ "internalType": "address"
224
+ }
225
+ ],
226
+ "outputs": [],
227
+ "stateMutability": "nonpayable"
228
+ },
229
+ {
230
+ "type": "function",
231
+ "name": "approve",
232
+ "inputs": [
233
+ {
234
+ "name": "tokenList",
235
+ "type": "address[]",
236
+ "internalType": "address[]"
237
+ },
238
+ {
239
+ "name": "spenderList",
240
+ "type": "address[]",
241
+ "internalType": "address[]"
242
+ }
243
+ ],
244
+ "outputs": [],
245
+ "stateMutability": "nonpayable"
246
+ },
247
+ {
248
+ "type": "function",
249
+ "name": "bridge",
250
+ "inputs": [
251
+ {
252
+ "name": "user",
253
+ "type": "address",
254
+ "internalType": "address"
255
+ },
256
+ {
257
+ "name": "bridgeParam",
258
+ "type": "tuple",
259
+ "internalType": "struct BridgeParams",
260
+ "components": [
261
+ {
262
+ "name": "bridge",
263
+ "type": "string",
264
+ "internalType": "string"
265
+ },
266
+ {
267
+ "name": "bridgeParam",
268
+ "type": "tuple",
269
+ "internalType": "struct BridgeParam",
270
+ "components": [
271
+ {
272
+ "name": "token",
273
+ "type": "address",
274
+ "internalType": "address"
275
+ },
276
+ {
277
+ "name": "amount",
278
+ "type": "uint256",
279
+ "internalType": "uint256"
280
+ },
281
+ {
282
+ "name": "bridgeAddress",
283
+ "type": "address",
284
+ "internalType": "address"
285
+ },
286
+ {
287
+ "name": "refundAddress",
288
+ "type": "address",
289
+ "internalType": "address"
290
+ },
291
+ {
292
+ "name": "destinationChain",
293
+ "type": "string",
294
+ "internalType": "string"
295
+ },
296
+ {
297
+ "name": "adapterParams",
298
+ "type": "bytes",
299
+ "internalType": "bytes"
300
+ }
301
+ ]
302
+ }
303
+ ]
304
+ }
305
+ ],
306
+ "outputs": [
307
+ {
308
+ "name": "success",
309
+ "type": "bool",
310
+ "internalType": "bool"
311
+ }
312
+ ],
313
+ "stateMutability": "nonpayable"
314
+ },
315
+ {
316
+ "type": "function",
317
+ "name": "contractList",
318
+ "inputs": [
319
+ {
320
+ "name": "",
321
+ "type": "uint256",
322
+ "internalType": "uint256"
323
+ }
324
+ ],
325
+ "outputs": [
326
+ {
327
+ "name": "contractType",
328
+ "type": "string",
329
+ "internalType": "string"
330
+ },
331
+ {
332
+ "name": "contractAddress",
333
+ "type": "address",
334
+ "internalType": "address"
335
+ }
336
+ ],
337
+ "stateMutability": "view"
338
+ },
339
+ {
340
+ "type": "function",
341
+ "name": "contractMap",
342
+ "inputs": [
343
+ {
344
+ "name": "",
345
+ "type": "string",
346
+ "internalType": "string"
347
+ }
348
+ ],
349
+ "outputs": [
350
+ {
351
+ "name": "",
352
+ "type": "address",
353
+ "internalType": "address"
354
+ }
355
+ ],
356
+ "stateMutability": "view"
357
+ },
358
+ {
359
+ "type": "function",
360
+ "name": "executor",
361
+ "inputs": [],
362
+ "outputs": [
363
+ {
364
+ "name": "",
365
+ "type": "address",
366
+ "internalType": "address"
367
+ }
368
+ ],
369
+ "stateMutability": "view"
370
+ },
371
+ {
372
+ "type": "function",
373
+ "name": "getAddressList",
374
+ "inputs": [],
375
+ "outputs": [
376
+ {
377
+ "name": "",
378
+ "type": "address[]",
379
+ "internalType": "address[]"
380
+ }
381
+ ],
382
+ "stateMutability": "view"
383
+ },
384
+ {
385
+ "type": "function",
386
+ "name": "isWhitelist",
387
+ "inputs": [
388
+ {
389
+ "name": "_address",
390
+ "type": "address",
391
+ "internalType": "address"
392
+ }
393
+ ],
394
+ "outputs": [
395
+ {
396
+ "name": "",
397
+ "type": "bool",
398
+ "internalType": "bool"
399
+ }
400
+ ],
401
+ "stateMutability": "view"
402
+ },
403
+ {
404
+ "type": "function",
405
+ "name": "multiSwap",
406
+ "inputs": [
407
+ {
408
+ "name": "userList",
409
+ "type": "address[]",
410
+ "internalType": "address[]"
411
+ },
412
+ {
413
+ "name": "amountInList",
414
+ "type": "uint256[]",
415
+ "internalType": "uint256[]"
416
+ },
417
+ {
418
+ "name": "swapParamsList",
419
+ "type": "tuple[][]",
420
+ "internalType": "struct SwapParams[][]",
421
+ "components": [
422
+ {
423
+ "name": "dexType",
424
+ "type": "string",
425
+ "internalType": "string"
426
+ },
427
+ {
428
+ "name": "pool",
429
+ "type": "address",
430
+ "internalType": "address"
431
+ },
432
+ {
433
+ "name": "fromCoin",
434
+ "type": "address",
435
+ "internalType": "address"
436
+ },
437
+ {
438
+ "name": "toCoin",
439
+ "type": "address",
440
+ "internalType": "address"
441
+ },
442
+ {
443
+ "name": "extra",
444
+ "type": "bytes",
445
+ "internalType": "bytes"
446
+ }
447
+ ]
448
+ },
449
+ {
450
+ "name": "minAmountOutList",
451
+ "type": "uint256[][]",
452
+ "internalType": "uint256[][]"
453
+ }
454
+ ],
455
+ "outputs": [
456
+ {
457
+ "name": "amountOutList",
458
+ "type": "uint256[]",
459
+ "internalType": "uint256[]"
460
+ }
461
+ ],
462
+ "stateMutability": "nonpayable"
463
+ },
464
+ {
465
+ "type": "function",
466
+ "name": "owner",
467
+ "inputs": [],
468
+ "outputs": [
469
+ {
470
+ "name": "",
471
+ "type": "address",
472
+ "internalType": "address"
473
+ }
474
+ ],
475
+ "stateMutability": "view"
476
+ },
477
+ {
478
+ "type": "function",
479
+ "name": "quoter",
480
+ "inputs": [],
481
+ "outputs": [
482
+ {
483
+ "name": "",
484
+ "type": "address",
485
+ "internalType": "address"
486
+ }
487
+ ],
488
+ "stateMutability": "view"
489
+ },
490
+ {
491
+ "type": "function",
492
+ "name": "removeContract",
493
+ "inputs": [
494
+ {
495
+ "name": "contractType",
496
+ "type": "string",
497
+ "internalType": "string"
498
+ }
499
+ ],
500
+ "outputs": [],
501
+ "stateMutability": "nonpayable"
502
+ },
503
+ {
504
+ "type": "function",
505
+ "name": "setExecutor",
506
+ "inputs": [
507
+ {
508
+ "name": "_executor",
509
+ "type": "address",
510
+ "internalType": "address"
511
+ }
512
+ ],
513
+ "outputs": [],
514
+ "stateMutability": "nonpayable"
515
+ },
516
+ {
517
+ "type": "function",
518
+ "name": "swap",
519
+ "inputs": [
520
+ {
521
+ "name": "user",
522
+ "type": "address",
523
+ "internalType": "address"
524
+ },
525
+ {
526
+ "name": "amountIn",
527
+ "type": "uint256",
528
+ "internalType": "uint256"
529
+ },
530
+ {
531
+ "name": "swapParams",
532
+ "type": "tuple[]",
533
+ "internalType": "struct SwapParams[]",
534
+ "components": [
535
+ {
536
+ "name": "dexType",
537
+ "type": "string",
538
+ "internalType": "string"
539
+ },
540
+ {
541
+ "name": "pool",
542
+ "type": "address",
543
+ "internalType": "address"
544
+ },
545
+ {
546
+ "name": "fromCoin",
547
+ "type": "address",
548
+ "internalType": "address"
549
+ },
550
+ {
551
+ "name": "toCoin",
552
+ "type": "address",
553
+ "internalType": "address"
554
+ },
555
+ {
556
+ "name": "extra",
557
+ "type": "bytes",
558
+ "internalType": "bytes"
559
+ }
560
+ ]
561
+ },
562
+ {
563
+ "name": "minAmountOutList",
564
+ "type": "uint256[]",
565
+ "internalType": "uint256[]"
566
+ }
567
+ ],
568
+ "outputs": [
569
+ {
570
+ "name": "amountOut",
571
+ "type": "uint256",
572
+ "internalType": "uint256"
573
+ }
574
+ ],
575
+ "stateMutability": "nonpayable"
576
+ },
577
+ {
578
+ "type": "function",
579
+ "name": "swapAndBridge",
580
+ "inputs": [
581
+ {
582
+ "name": "user",
583
+ "type": "address",
584
+ "internalType": "address"
585
+ },
586
+ {
587
+ "name": "amountIn",
588
+ "type": "uint256",
589
+ "internalType": "uint256"
590
+ },
591
+ {
592
+ "name": "swapParams",
593
+ "type": "tuple[]",
594
+ "internalType": "struct SwapParams[]",
595
+ "components": [
596
+ {
597
+ "name": "dexType",
598
+ "type": "string",
599
+ "internalType": "string"
600
+ },
601
+ {
602
+ "name": "pool",
603
+ "type": "address",
604
+ "internalType": "address"
605
+ },
606
+ {
607
+ "name": "fromCoin",
608
+ "type": "address",
609
+ "internalType": "address"
610
+ },
611
+ {
612
+ "name": "toCoin",
613
+ "type": "address",
614
+ "internalType": "address"
615
+ },
616
+ {
617
+ "name": "extra",
618
+ "type": "bytes",
619
+ "internalType": "bytes"
620
+ }
621
+ ]
622
+ },
623
+ {
624
+ "name": "minAmountOutList",
625
+ "type": "uint256[]",
626
+ "internalType": "uint256[]"
627
+ },
628
+ {
629
+ "name": "bridgeParam",
630
+ "type": "tuple",
631
+ "internalType": "struct BridgeParams",
632
+ "components": [
633
+ {
634
+ "name": "bridge",
635
+ "type": "string",
636
+ "internalType": "string"
637
+ },
638
+ {
639
+ "name": "bridgeParam",
640
+ "type": "tuple",
641
+ "internalType": "struct BridgeParam",
642
+ "components": [
643
+ {
644
+ "name": "token",
645
+ "type": "address",
646
+ "internalType": "address"
647
+ },
648
+ {
649
+ "name": "amount",
650
+ "type": "uint256",
651
+ "internalType": "uint256"
652
+ },
653
+ {
654
+ "name": "bridgeAddress",
655
+ "type": "address",
656
+ "internalType": "address"
657
+ },
658
+ {
659
+ "name": "refundAddress",
660
+ "type": "address",
661
+ "internalType": "address"
662
+ },
663
+ {
664
+ "name": "destinationChain",
665
+ "type": "string",
666
+ "internalType": "string"
667
+ },
668
+ {
669
+ "name": "adapterParams",
670
+ "type": "bytes",
671
+ "internalType": "bytes"
672
+ }
673
+ ]
674
+ }
675
+ ]
676
+ }
677
+ ],
678
+ "outputs": [
679
+ {
680
+ "name": "amountOut",
681
+ "type": "uint256",
682
+ "internalType": "uint256"
683
+ }
684
+ ],
685
+ "stateMutability": "nonpayable"
686
+ },
687
+ {
688
+ "type": "function",
689
+ "name": "updateContract",
690
+ "inputs": [
691
+ {
692
+ "name": "contractType",
693
+ "type": "string",
694
+ "internalType": "string"
695
+ },
696
+ {
697
+ "name": "contractAddress",
698
+ "type": "address",
699
+ "internalType": "address"
700
+ }
701
+ ],
702
+ "outputs": [],
703
+ "stateMutability": "nonpayable"
704
+ },
705
+ {
706
+ "type": "function",
707
+ "name": "whitelistMap",
708
+ "inputs": [
709
+ {
710
+ "name": "",
711
+ "type": "address",
712
+ "internalType": "address"
713
+ }
714
+ ],
715
+ "outputs": [
716
+ {
717
+ "name": "",
718
+ "type": "bool",
719
+ "internalType": "bool"
720
+ }
721
+ ],
722
+ "stateMutability": "view"
723
+ }
724
+ ];
725
+ var aggregator_default = AggregatorAbi;