@chainflip/sdk 0.1.0

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,2128 @@
1
+ import { utils, Contract, BigNumber } from 'ethers';
2
+
3
+ var __defProp = Object.defineProperty;
4
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
5
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
6
+ var __publicField = (obj, key, value) => {
7
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
+ return value;
9
+ };
10
+
11
+ // ../shared/src/enums.ts
12
+ var arrayToMap = /* @__PURE__ */ __name((array) => Object.fromEntries(array.map((key) => [
13
+ key,
14
+ key
15
+ ])), "arrayToMap");
16
+ var Chains = arrayToMap([
17
+ "Bitcoin",
18
+ "Ethereum",
19
+ "Polkadot"
20
+ ]);
21
+ var Assets = arrayToMap([
22
+ "FLIP",
23
+ "USDC",
24
+ "DOT",
25
+ "ETH",
26
+ "BTC"
27
+ ]);
28
+ var ChainflipNetworks = arrayToMap([
29
+ "sisyphos",
30
+ "perseverance",
31
+ "mainnet",
32
+ "partnernet"
33
+ ]);
34
+ var isTestnet = /* @__PURE__ */ __name((network) => network !== ChainflipNetworks.mainnet, "isTestnet");
35
+ var assetChains = {
36
+ [Assets.ETH]: Chains.Ethereum,
37
+ [Assets.FLIP]: Chains.Ethereum,
38
+ [Assets.USDC]: Chains.Ethereum,
39
+ [Assets.BTC]: Chains.Bitcoin,
40
+ [Assets.DOT]: Chains.Polkadot
41
+ };
42
+ var assetDecimals = {
43
+ [Assets.DOT]: 10,
44
+ [Assets.ETH]: 18,
45
+ [Assets.FLIP]: 18,
46
+ [Assets.USDC]: 6,
47
+ [Assets.BTC]: 8
48
+ };
49
+ var assetContractIds = {
50
+ // 0 is reservered for particular cross chain messaging scenarios where we want to pass
51
+ // through a message without making a swap.
52
+ [Assets.ETH]: 1,
53
+ [Assets.FLIP]: 2,
54
+ [Assets.USDC]: 3,
55
+ [Assets.DOT]: 4,
56
+ [Assets.BTC]: 5
57
+ };
58
+ var chainAssets = {
59
+ [Chains.Ethereum]: [
60
+ Assets.ETH,
61
+ Assets.USDC,
62
+ Assets.FLIP
63
+ ],
64
+ [Chains.Bitcoin]: [
65
+ Assets.BTC
66
+ ],
67
+ [Chains.Polkadot]: [
68
+ Assets.DOT
69
+ ]
70
+ };
71
+ var chainContractIds = {
72
+ [Chains.Ethereum]: 1,
73
+ [Chains.Polkadot]: 2,
74
+ [Chains.Bitcoin]: 3
75
+ };
76
+ var _abi = [
77
+ {
78
+ inputs: [
79
+ {
80
+ internalType: "address",
81
+ name: "owner",
82
+ type: "address"
83
+ },
84
+ {
85
+ internalType: "address",
86
+ name: "spender",
87
+ type: "address"
88
+ }
89
+ ],
90
+ name: "allowance",
91
+ outputs: [
92
+ {
93
+ internalType: "uint256",
94
+ name: "",
95
+ type: "uint256"
96
+ }
97
+ ],
98
+ stateMutability: "view",
99
+ type: "function"
100
+ },
101
+ {
102
+ inputs: [
103
+ {
104
+ internalType: "address",
105
+ name: "spender",
106
+ type: "address"
107
+ },
108
+ {
109
+ internalType: "uint256",
110
+ name: "amount",
111
+ type: "uint256"
112
+ }
113
+ ],
114
+ name: "approve",
115
+ outputs: [
116
+ {
117
+ internalType: "bool",
118
+ name: "",
119
+ type: "bool"
120
+ }
121
+ ],
122
+ stateMutability: "nonpayable",
123
+ type: "function"
124
+ },
125
+ {
126
+ inputs: [
127
+ {
128
+ internalType: "address",
129
+ name: "account",
130
+ type: "address"
131
+ }
132
+ ],
133
+ name: "balanceOf",
134
+ outputs: [
135
+ {
136
+ internalType: "uint256",
137
+ name: "",
138
+ type: "uint256"
139
+ }
140
+ ],
141
+ stateMutability: "view",
142
+ type: "function"
143
+ }
144
+ ];
145
+ var ERC20__factory = class {
146
+ static createInterface() {
147
+ return new utils.Interface(_abi);
148
+ }
149
+ static connect(address, signerOrProvider) {
150
+ return new Contract(address, _abi, signerOrProvider);
151
+ }
152
+ };
153
+ __name(ERC20__factory, "ERC20__factory");
154
+ __publicField(ERC20__factory, "abi", _abi);
155
+ var _abi2 = [
156
+ {
157
+ inputs: [
158
+ {
159
+ internalType: "contract IKeyManager",
160
+ name: "keyManager",
161
+ type: "address"
162
+ },
163
+ {
164
+ internalType: "uint256",
165
+ name: "minFunding",
166
+ type: "uint256"
167
+ }
168
+ ],
169
+ stateMutability: "nonpayable",
170
+ type: "constructor"
171
+ },
172
+ {
173
+ anonymous: false,
174
+ inputs: [
175
+ {
176
+ indexed: false,
177
+ internalType: "bool",
178
+ name: "communityGuardDisabled",
179
+ type: "bool"
180
+ }
181
+ ],
182
+ name: "CommunityGuardDisabled",
183
+ type: "event"
184
+ },
185
+ {
186
+ anonymous: false,
187
+ inputs: [
188
+ {
189
+ indexed: false,
190
+ internalType: "address",
191
+ name: "flip",
192
+ type: "address"
193
+ }
194
+ ],
195
+ name: "FLIPSet",
196
+ type: "event"
197
+ },
198
+ {
199
+ anonymous: false,
200
+ inputs: [
201
+ {
202
+ indexed: false,
203
+ internalType: "uint256",
204
+ name: "oldSupply",
205
+ type: "uint256"
206
+ },
207
+ {
208
+ indexed: false,
209
+ internalType: "uint256",
210
+ name: "newSupply",
211
+ type: "uint256"
212
+ },
213
+ {
214
+ indexed: false,
215
+ internalType: "uint256",
216
+ name: "stateChainBlockNumber",
217
+ type: "uint256"
218
+ }
219
+ ],
220
+ name: "FlipSupplyUpdated",
221
+ type: "event"
222
+ },
223
+ {
224
+ anonymous: false,
225
+ inputs: [
226
+ {
227
+ indexed: true,
228
+ internalType: "bytes32",
229
+ name: "nodeID",
230
+ type: "bytes32"
231
+ },
232
+ {
233
+ indexed: false,
234
+ internalType: "uint256",
235
+ name: "amount",
236
+ type: "uint256"
237
+ },
238
+ {
239
+ indexed: false,
240
+ internalType: "address",
241
+ name: "funder",
242
+ type: "address"
243
+ }
244
+ ],
245
+ name: "Funded",
246
+ type: "event"
247
+ },
248
+ {
249
+ anonymous: false,
250
+ inputs: [
251
+ {
252
+ indexed: false,
253
+ internalType: "address",
254
+ name: "to",
255
+ type: "address"
256
+ },
257
+ {
258
+ indexed: false,
259
+ internalType: "uint256",
260
+ name: "amount",
261
+ type: "uint256"
262
+ }
263
+ ],
264
+ name: "GovernanceWithdrawal",
265
+ type: "event"
266
+ },
267
+ {
268
+ anonymous: false,
269
+ inputs: [
270
+ {
271
+ indexed: false,
272
+ internalType: "uint256",
273
+ name: "oldMinFunding",
274
+ type: "uint256"
275
+ },
276
+ {
277
+ indexed: false,
278
+ internalType: "uint256",
279
+ name: "newMinFunding",
280
+ type: "uint256"
281
+ }
282
+ ],
283
+ name: "MinFundingChanged",
284
+ type: "event"
285
+ },
286
+ {
287
+ anonymous: false,
288
+ inputs: [
289
+ {
290
+ indexed: true,
291
+ internalType: "bytes32",
292
+ name: "nodeID",
293
+ type: "bytes32"
294
+ },
295
+ {
296
+ indexed: false,
297
+ internalType: "uint256",
298
+ name: "amount",
299
+ type: "uint256"
300
+ }
301
+ ],
302
+ name: "RedemptionExecuted",
303
+ type: "event"
304
+ },
305
+ {
306
+ anonymous: false,
307
+ inputs: [
308
+ {
309
+ indexed: true,
310
+ internalType: "bytes32",
311
+ name: "nodeID",
312
+ type: "bytes32"
313
+ },
314
+ {
315
+ indexed: false,
316
+ internalType: "uint256",
317
+ name: "amount",
318
+ type: "uint256"
319
+ }
320
+ ],
321
+ name: "RedemptionExpired",
322
+ type: "event"
323
+ },
324
+ {
325
+ anonymous: false,
326
+ inputs: [
327
+ {
328
+ indexed: true,
329
+ internalType: "bytes32",
330
+ name: "nodeID",
331
+ type: "bytes32"
332
+ },
333
+ {
334
+ indexed: false,
335
+ internalType: "uint256",
336
+ name: "amount",
337
+ type: "uint256"
338
+ },
339
+ {
340
+ indexed: true,
341
+ internalType: "address",
342
+ name: "redeemAddress",
343
+ type: "address"
344
+ },
345
+ {
346
+ indexed: false,
347
+ internalType: "uint48",
348
+ name: "startTime",
349
+ type: "uint48"
350
+ },
351
+ {
352
+ indexed: false,
353
+ internalType: "uint48",
354
+ name: "expiryTime",
355
+ type: "uint48"
356
+ }
357
+ ],
358
+ name: "RedemptionRegistered",
359
+ type: "event"
360
+ },
361
+ {
362
+ anonymous: false,
363
+ inputs: [
364
+ {
365
+ indexed: false,
366
+ internalType: "bool",
367
+ name: "suspended",
368
+ type: "bool"
369
+ }
370
+ ],
371
+ name: "Suspended",
372
+ type: "event"
373
+ },
374
+ {
375
+ anonymous: false,
376
+ inputs: [
377
+ {
378
+ indexed: false,
379
+ internalType: "address",
380
+ name: "keyManager",
381
+ type: "address"
382
+ }
383
+ ],
384
+ name: "UpdatedKeyManager",
385
+ type: "event"
386
+ },
387
+ {
388
+ inputs: [],
389
+ name: "REDEMPTION_DELAY",
390
+ outputs: [
391
+ {
392
+ internalType: "uint48",
393
+ name: "",
394
+ type: "uint48"
395
+ }
396
+ ],
397
+ stateMutability: "view",
398
+ type: "function"
399
+ },
400
+ {
401
+ inputs: [],
402
+ name: "disableCommunityGuard",
403
+ outputs: [],
404
+ stateMutability: "nonpayable",
405
+ type: "function"
406
+ },
407
+ {
408
+ inputs: [],
409
+ name: "enableCommunityGuard",
410
+ outputs: [],
411
+ stateMutability: "nonpayable",
412
+ type: "function"
413
+ },
414
+ {
415
+ inputs: [
416
+ {
417
+ internalType: "bytes32",
418
+ name: "nodeID",
419
+ type: "bytes32"
420
+ }
421
+ ],
422
+ name: "executeRedemption",
423
+ outputs: [],
424
+ stateMutability: "nonpayable",
425
+ type: "function"
426
+ },
427
+ {
428
+ inputs: [
429
+ {
430
+ internalType: "bytes32",
431
+ name: "nodeID",
432
+ type: "bytes32"
433
+ },
434
+ {
435
+ internalType: "uint256",
436
+ name: "amount",
437
+ type: "uint256"
438
+ }
439
+ ],
440
+ name: "fundStateChainAccount",
441
+ outputs: [],
442
+ stateMutability: "nonpayable",
443
+ type: "function"
444
+ },
445
+ {
446
+ inputs: [],
447
+ name: "getCommunityGuardDisabled",
448
+ outputs: [
449
+ {
450
+ internalType: "bool",
451
+ name: "",
452
+ type: "bool"
453
+ }
454
+ ],
455
+ stateMutability: "view",
456
+ type: "function"
457
+ },
458
+ {
459
+ inputs: [],
460
+ name: "getCommunityKey",
461
+ outputs: [
462
+ {
463
+ internalType: "address",
464
+ name: "",
465
+ type: "address"
466
+ }
467
+ ],
468
+ stateMutability: "view",
469
+ type: "function"
470
+ },
471
+ {
472
+ inputs: [],
473
+ name: "getFLIP",
474
+ outputs: [
475
+ {
476
+ internalType: "contract IFLIP",
477
+ name: "",
478
+ type: "address"
479
+ }
480
+ ],
481
+ stateMutability: "view",
482
+ type: "function"
483
+ },
484
+ {
485
+ inputs: [],
486
+ name: "getGovernor",
487
+ outputs: [
488
+ {
489
+ internalType: "address",
490
+ name: "",
491
+ type: "address"
492
+ }
493
+ ],
494
+ stateMutability: "view",
495
+ type: "function"
496
+ },
497
+ {
498
+ inputs: [],
499
+ name: "getKeyManager",
500
+ outputs: [
501
+ {
502
+ internalType: "contract IKeyManager",
503
+ name: "",
504
+ type: "address"
505
+ }
506
+ ],
507
+ stateMutability: "view",
508
+ type: "function"
509
+ },
510
+ {
511
+ inputs: [],
512
+ name: "getLastSupplyUpdateBlockNumber",
513
+ outputs: [
514
+ {
515
+ internalType: "uint256",
516
+ name: "",
517
+ type: "uint256"
518
+ }
519
+ ],
520
+ stateMutability: "view",
521
+ type: "function"
522
+ },
523
+ {
524
+ inputs: [],
525
+ name: "getMinimumFunding",
526
+ outputs: [
527
+ {
528
+ internalType: "uint256",
529
+ name: "",
530
+ type: "uint256"
531
+ }
532
+ ],
533
+ stateMutability: "view",
534
+ type: "function"
535
+ },
536
+ {
537
+ inputs: [
538
+ {
539
+ internalType: "bytes32",
540
+ name: "nodeID",
541
+ type: "bytes32"
542
+ }
543
+ ],
544
+ name: "getPendingRedemption",
545
+ outputs: [
546
+ {
547
+ components: [
548
+ {
549
+ internalType: "uint256",
550
+ name: "amount",
551
+ type: "uint256"
552
+ },
553
+ {
554
+ internalType: "address",
555
+ name: "redeemAddress",
556
+ type: "address"
557
+ },
558
+ {
559
+ internalType: "uint48",
560
+ name: "startTime",
561
+ type: "uint48"
562
+ },
563
+ {
564
+ internalType: "uint48",
565
+ name: "expiryTime",
566
+ type: "uint48"
567
+ }
568
+ ],
569
+ internalType: "struct IStateChainGateway.Redemption",
570
+ name: "",
571
+ type: "tuple"
572
+ }
573
+ ],
574
+ stateMutability: "view",
575
+ type: "function"
576
+ },
577
+ {
578
+ inputs: [],
579
+ name: "getSuspendedState",
580
+ outputs: [
581
+ {
582
+ internalType: "bool",
583
+ name: "",
584
+ type: "bool"
585
+ }
586
+ ],
587
+ stateMutability: "view",
588
+ type: "function"
589
+ },
590
+ {
591
+ inputs: [],
592
+ name: "govUpdateFlipIssuer",
593
+ outputs: [],
594
+ stateMutability: "nonpayable",
595
+ type: "function"
596
+ },
597
+ {
598
+ inputs: [],
599
+ name: "govWithdraw",
600
+ outputs: [],
601
+ stateMutability: "nonpayable",
602
+ type: "function"
603
+ },
604
+ {
605
+ inputs: [
606
+ {
607
+ components: [
608
+ {
609
+ internalType: "uint256",
610
+ name: "sig",
611
+ type: "uint256"
612
+ },
613
+ {
614
+ internalType: "uint256",
615
+ name: "nonce",
616
+ type: "uint256"
617
+ },
618
+ {
619
+ internalType: "address",
620
+ name: "kTimesGAddress",
621
+ type: "address"
622
+ }
623
+ ],
624
+ internalType: "struct IShared.SigData",
625
+ name: "sigData",
626
+ type: "tuple"
627
+ },
628
+ {
629
+ internalType: "bytes32",
630
+ name: "nodeID",
631
+ type: "bytes32"
632
+ },
633
+ {
634
+ internalType: "uint256",
635
+ name: "amount",
636
+ type: "uint256"
637
+ },
638
+ {
639
+ internalType: "address",
640
+ name: "redeemAddress",
641
+ type: "address"
642
+ },
643
+ {
644
+ internalType: "uint48",
645
+ name: "expiryTime",
646
+ type: "uint48"
647
+ }
648
+ ],
649
+ name: "registerRedemption",
650
+ outputs: [],
651
+ stateMutability: "nonpayable",
652
+ type: "function"
653
+ },
654
+ {
655
+ inputs: [],
656
+ name: "resume",
657
+ outputs: [],
658
+ stateMutability: "nonpayable",
659
+ type: "function"
660
+ },
661
+ {
662
+ inputs: [
663
+ {
664
+ internalType: "contract IFLIP",
665
+ name: "flip",
666
+ type: "address"
667
+ }
668
+ ],
669
+ name: "setFlip",
670
+ outputs: [],
671
+ stateMutability: "nonpayable",
672
+ type: "function"
673
+ },
674
+ {
675
+ inputs: [
676
+ {
677
+ internalType: "uint256",
678
+ name: "newMinFunding",
679
+ type: "uint256"
680
+ }
681
+ ],
682
+ name: "setMinFunding",
683
+ outputs: [],
684
+ stateMutability: "nonpayable",
685
+ type: "function"
686
+ },
687
+ {
688
+ inputs: [],
689
+ name: "suspend",
690
+ outputs: [],
691
+ stateMutability: "nonpayable",
692
+ type: "function"
693
+ },
694
+ {
695
+ inputs: [
696
+ {
697
+ components: [
698
+ {
699
+ internalType: "uint256",
700
+ name: "sig",
701
+ type: "uint256"
702
+ },
703
+ {
704
+ internalType: "uint256",
705
+ name: "nonce",
706
+ type: "uint256"
707
+ },
708
+ {
709
+ internalType: "address",
710
+ name: "kTimesGAddress",
711
+ type: "address"
712
+ }
713
+ ],
714
+ internalType: "struct IShared.SigData",
715
+ name: "sigData",
716
+ type: "tuple"
717
+ },
718
+ {
719
+ internalType: "address",
720
+ name: "newIssuer",
721
+ type: "address"
722
+ },
723
+ {
724
+ internalType: "bool",
725
+ name: "omitChecks",
726
+ type: "bool"
727
+ }
728
+ ],
729
+ name: "updateFlipIssuer",
730
+ outputs: [],
731
+ stateMutability: "nonpayable",
732
+ type: "function"
733
+ },
734
+ {
735
+ inputs: [
736
+ {
737
+ components: [
738
+ {
739
+ internalType: "uint256",
740
+ name: "sig",
741
+ type: "uint256"
742
+ },
743
+ {
744
+ internalType: "uint256",
745
+ name: "nonce",
746
+ type: "uint256"
747
+ },
748
+ {
749
+ internalType: "address",
750
+ name: "kTimesGAddress",
751
+ type: "address"
752
+ }
753
+ ],
754
+ internalType: "struct IShared.SigData",
755
+ name: "sigData",
756
+ type: "tuple"
757
+ },
758
+ {
759
+ internalType: "uint256",
760
+ name: "newTotalSupply",
761
+ type: "uint256"
762
+ },
763
+ {
764
+ internalType: "uint256",
765
+ name: "stateChainBlockNumber",
766
+ type: "uint256"
767
+ }
768
+ ],
769
+ name: "updateFlipSupply",
770
+ outputs: [],
771
+ stateMutability: "nonpayable",
772
+ type: "function"
773
+ },
774
+ {
775
+ inputs: [
776
+ {
777
+ components: [
778
+ {
779
+ internalType: "uint256",
780
+ name: "sig",
781
+ type: "uint256"
782
+ },
783
+ {
784
+ internalType: "uint256",
785
+ name: "nonce",
786
+ type: "uint256"
787
+ },
788
+ {
789
+ internalType: "address",
790
+ name: "kTimesGAddress",
791
+ type: "address"
792
+ }
793
+ ],
794
+ internalType: "struct IShared.SigData",
795
+ name: "sigData",
796
+ type: "tuple"
797
+ },
798
+ {
799
+ internalType: "contract IKeyManager",
800
+ name: "keyManager",
801
+ type: "address"
802
+ },
803
+ {
804
+ internalType: "bool",
805
+ name: "omitChecks",
806
+ type: "bool"
807
+ }
808
+ ],
809
+ name: "updateKeyManager",
810
+ outputs: [],
811
+ stateMutability: "nonpayable",
812
+ type: "function"
813
+ }
814
+ ];
815
+ var StateChainGateway__factory = class {
816
+ static createInterface() {
817
+ return new utils.Interface(_abi2);
818
+ }
819
+ static connect(address, signerOrProvider) {
820
+ return new Contract(address, _abi2, signerOrProvider);
821
+ }
822
+ };
823
+ __name(StateChainGateway__factory, "StateChainGateway__factory");
824
+ __publicField(StateChainGateway__factory, "abi", _abi2);
825
+ var _abi3 = [
826
+ {
827
+ inputs: [
828
+ {
829
+ internalType: "contract IKeyManager",
830
+ name: "keyManager",
831
+ type: "address"
832
+ }
833
+ ],
834
+ stateMutability: "nonpayable",
835
+ type: "constructor"
836
+ },
837
+ {
838
+ anonymous: false,
839
+ inputs: [
840
+ {
841
+ indexed: false,
842
+ internalType: "bytes32",
843
+ name: "swapID",
844
+ type: "bytes32"
845
+ },
846
+ {
847
+ indexed: false,
848
+ internalType: "uint256",
849
+ name: "amount",
850
+ type: "uint256"
851
+ }
852
+ ],
853
+ name: "AddGasNative",
854
+ type: "event"
855
+ },
856
+ {
857
+ anonymous: false,
858
+ inputs: [
859
+ {
860
+ indexed: false,
861
+ internalType: "bytes32",
862
+ name: "swapID",
863
+ type: "bytes32"
864
+ },
865
+ {
866
+ indexed: false,
867
+ internalType: "uint256",
868
+ name: "amount",
869
+ type: "uint256"
870
+ },
871
+ {
872
+ indexed: false,
873
+ internalType: "address",
874
+ name: "token",
875
+ type: "address"
876
+ }
877
+ ],
878
+ name: "AddGasToken",
879
+ type: "event"
880
+ },
881
+ {
882
+ anonymous: false,
883
+ inputs: [
884
+ {
885
+ indexed: false,
886
+ internalType: "bool",
887
+ name: "communityGuardDisabled",
888
+ type: "bool"
889
+ }
890
+ ],
891
+ name: "CommunityGuardDisabled",
892
+ type: "event"
893
+ },
894
+ {
895
+ anonymous: false,
896
+ inputs: [
897
+ {
898
+ indexed: true,
899
+ internalType: "address payable",
900
+ name: "multicallAddress",
901
+ type: "address"
902
+ },
903
+ {
904
+ indexed: false,
905
+ internalType: "uint256",
906
+ name: "amount",
907
+ type: "uint256"
908
+ },
909
+ {
910
+ indexed: true,
911
+ internalType: "address",
912
+ name: "token",
913
+ type: "address"
914
+ },
915
+ {
916
+ indexed: false,
917
+ internalType: "bytes",
918
+ name: "reason",
919
+ type: "bytes"
920
+ }
921
+ ],
922
+ name: "ExecuteActionsFailed",
923
+ type: "event"
924
+ },
925
+ {
926
+ anonymous: false,
927
+ inputs: [
928
+ {
929
+ indexed: false,
930
+ internalType: "bool",
931
+ name: "suspended",
932
+ type: "bool"
933
+ }
934
+ ],
935
+ name: "Suspended",
936
+ type: "event"
937
+ },
938
+ {
939
+ anonymous: false,
940
+ inputs: [
941
+ {
942
+ indexed: false,
943
+ internalType: "uint32",
944
+ name: "dstChain",
945
+ type: "uint32"
946
+ },
947
+ {
948
+ indexed: false,
949
+ internalType: "bytes",
950
+ name: "dstAddress",
951
+ type: "bytes"
952
+ },
953
+ {
954
+ indexed: false,
955
+ internalType: "uint32",
956
+ name: "dstToken",
957
+ type: "uint32"
958
+ },
959
+ {
960
+ indexed: false,
961
+ internalType: "uint256",
962
+ name: "amount",
963
+ type: "uint256"
964
+ },
965
+ {
966
+ indexed: true,
967
+ internalType: "address",
968
+ name: "sender",
969
+ type: "address"
970
+ },
971
+ {
972
+ indexed: false,
973
+ internalType: "bytes",
974
+ name: "cfParameters",
975
+ type: "bytes"
976
+ }
977
+ ],
978
+ name: "SwapNative",
979
+ type: "event"
980
+ },
981
+ {
982
+ anonymous: false,
983
+ inputs: [
984
+ {
985
+ indexed: false,
986
+ internalType: "uint32",
987
+ name: "dstChain",
988
+ type: "uint32"
989
+ },
990
+ {
991
+ indexed: false,
992
+ internalType: "bytes",
993
+ name: "dstAddress",
994
+ type: "bytes"
995
+ },
996
+ {
997
+ indexed: false,
998
+ internalType: "uint32",
999
+ name: "dstToken",
1000
+ type: "uint32"
1001
+ },
1002
+ {
1003
+ indexed: false,
1004
+ internalType: "address",
1005
+ name: "srcToken",
1006
+ type: "address"
1007
+ },
1008
+ {
1009
+ indexed: false,
1010
+ internalType: "uint256",
1011
+ name: "amount",
1012
+ type: "uint256"
1013
+ },
1014
+ {
1015
+ indexed: true,
1016
+ internalType: "address",
1017
+ name: "sender",
1018
+ type: "address"
1019
+ },
1020
+ {
1021
+ indexed: false,
1022
+ internalType: "bytes",
1023
+ name: "cfParameters",
1024
+ type: "bytes"
1025
+ }
1026
+ ],
1027
+ name: "SwapToken",
1028
+ type: "event"
1029
+ },
1030
+ {
1031
+ anonymous: false,
1032
+ inputs: [
1033
+ {
1034
+ indexed: true,
1035
+ internalType: "address payable",
1036
+ name: "recipient",
1037
+ type: "address"
1038
+ },
1039
+ {
1040
+ indexed: false,
1041
+ internalType: "uint256",
1042
+ name: "amount",
1043
+ type: "uint256"
1044
+ }
1045
+ ],
1046
+ name: "TransferNativeFailed",
1047
+ type: "event"
1048
+ },
1049
+ {
1050
+ anonymous: false,
1051
+ inputs: [
1052
+ {
1053
+ indexed: true,
1054
+ internalType: "address payable",
1055
+ name: "recipient",
1056
+ type: "address"
1057
+ },
1058
+ {
1059
+ indexed: false,
1060
+ internalType: "uint256",
1061
+ name: "amount",
1062
+ type: "uint256"
1063
+ },
1064
+ {
1065
+ indexed: true,
1066
+ internalType: "address",
1067
+ name: "token",
1068
+ type: "address"
1069
+ },
1070
+ {
1071
+ indexed: false,
1072
+ internalType: "bytes",
1073
+ name: "reason",
1074
+ type: "bytes"
1075
+ }
1076
+ ],
1077
+ name: "TransferTokenFailed",
1078
+ type: "event"
1079
+ },
1080
+ {
1081
+ anonymous: false,
1082
+ inputs: [
1083
+ {
1084
+ indexed: false,
1085
+ internalType: "address",
1086
+ name: "keyManager",
1087
+ type: "address"
1088
+ }
1089
+ ],
1090
+ name: "UpdatedKeyManager",
1091
+ type: "event"
1092
+ },
1093
+ {
1094
+ anonymous: false,
1095
+ inputs: [
1096
+ {
1097
+ indexed: false,
1098
+ internalType: "uint32",
1099
+ name: "dstChain",
1100
+ type: "uint32"
1101
+ },
1102
+ {
1103
+ indexed: false,
1104
+ internalType: "bytes",
1105
+ name: "dstAddress",
1106
+ type: "bytes"
1107
+ },
1108
+ {
1109
+ indexed: false,
1110
+ internalType: "uint32",
1111
+ name: "dstToken",
1112
+ type: "uint32"
1113
+ },
1114
+ {
1115
+ indexed: false,
1116
+ internalType: "uint256",
1117
+ name: "amount",
1118
+ type: "uint256"
1119
+ },
1120
+ {
1121
+ indexed: true,
1122
+ internalType: "address",
1123
+ name: "sender",
1124
+ type: "address"
1125
+ },
1126
+ {
1127
+ indexed: false,
1128
+ internalType: "bytes",
1129
+ name: "message",
1130
+ type: "bytes"
1131
+ },
1132
+ {
1133
+ indexed: false,
1134
+ internalType: "uint256",
1135
+ name: "gasAmount",
1136
+ type: "uint256"
1137
+ },
1138
+ {
1139
+ indexed: false,
1140
+ internalType: "bytes",
1141
+ name: "cfParameters",
1142
+ type: "bytes"
1143
+ }
1144
+ ],
1145
+ name: "XCallNative",
1146
+ type: "event"
1147
+ },
1148
+ {
1149
+ anonymous: false,
1150
+ inputs: [
1151
+ {
1152
+ indexed: false,
1153
+ internalType: "uint32",
1154
+ name: "dstChain",
1155
+ type: "uint32"
1156
+ },
1157
+ {
1158
+ indexed: false,
1159
+ internalType: "bytes",
1160
+ name: "dstAddress",
1161
+ type: "bytes"
1162
+ },
1163
+ {
1164
+ indexed: false,
1165
+ internalType: "uint32",
1166
+ name: "dstToken",
1167
+ type: "uint32"
1168
+ },
1169
+ {
1170
+ indexed: false,
1171
+ internalType: "address",
1172
+ name: "srcToken",
1173
+ type: "address"
1174
+ },
1175
+ {
1176
+ indexed: false,
1177
+ internalType: "uint256",
1178
+ name: "amount",
1179
+ type: "uint256"
1180
+ },
1181
+ {
1182
+ indexed: true,
1183
+ internalType: "address",
1184
+ name: "sender",
1185
+ type: "address"
1186
+ },
1187
+ {
1188
+ indexed: false,
1189
+ internalType: "bytes",
1190
+ name: "message",
1191
+ type: "bytes"
1192
+ },
1193
+ {
1194
+ indexed: false,
1195
+ internalType: "uint256",
1196
+ name: "gasAmount",
1197
+ type: "uint256"
1198
+ },
1199
+ {
1200
+ indexed: false,
1201
+ internalType: "bytes",
1202
+ name: "cfParameters",
1203
+ type: "bytes"
1204
+ }
1205
+ ],
1206
+ name: "XCallToken",
1207
+ type: "event"
1208
+ },
1209
+ {
1210
+ inputs: [
1211
+ {
1212
+ internalType: "bytes32",
1213
+ name: "swapID",
1214
+ type: "bytes32"
1215
+ }
1216
+ ],
1217
+ name: "addGasNative",
1218
+ outputs: [],
1219
+ stateMutability: "payable",
1220
+ type: "function"
1221
+ },
1222
+ {
1223
+ inputs: [
1224
+ {
1225
+ internalType: "bytes32",
1226
+ name: "swapID",
1227
+ type: "bytes32"
1228
+ },
1229
+ {
1230
+ internalType: "uint256",
1231
+ name: "amount",
1232
+ type: "uint256"
1233
+ },
1234
+ {
1235
+ internalType: "contract IERC20",
1236
+ name: "token",
1237
+ type: "address"
1238
+ }
1239
+ ],
1240
+ name: "addGasToken",
1241
+ outputs: [],
1242
+ stateMutability: "nonpayable",
1243
+ type: "function"
1244
+ },
1245
+ {
1246
+ inputs: [
1247
+ {
1248
+ components: [
1249
+ {
1250
+ internalType: "uint256",
1251
+ name: "sig",
1252
+ type: "uint256"
1253
+ },
1254
+ {
1255
+ internalType: "uint256",
1256
+ name: "nonce",
1257
+ type: "uint256"
1258
+ },
1259
+ {
1260
+ internalType: "address",
1261
+ name: "kTimesGAddress",
1262
+ type: "address"
1263
+ }
1264
+ ],
1265
+ internalType: "struct IShared.SigData",
1266
+ name: "sigData",
1267
+ type: "tuple"
1268
+ },
1269
+ {
1270
+ components: [
1271
+ {
1272
+ internalType: "bytes32",
1273
+ name: "swapID",
1274
+ type: "bytes32"
1275
+ },
1276
+ {
1277
+ internalType: "address",
1278
+ name: "token",
1279
+ type: "address"
1280
+ }
1281
+ ],
1282
+ internalType: "struct IShared.DeployFetchParams[]",
1283
+ name: "deployFetchParamsArray",
1284
+ type: "tuple[]"
1285
+ },
1286
+ {
1287
+ components: [
1288
+ {
1289
+ internalType: "address payable",
1290
+ name: "fetchContract",
1291
+ type: "address"
1292
+ },
1293
+ {
1294
+ internalType: "address",
1295
+ name: "token",
1296
+ type: "address"
1297
+ }
1298
+ ],
1299
+ internalType: "struct IShared.FetchParams[]",
1300
+ name: "fetchParamsArray",
1301
+ type: "tuple[]"
1302
+ },
1303
+ {
1304
+ components: [
1305
+ {
1306
+ internalType: "address",
1307
+ name: "token",
1308
+ type: "address"
1309
+ },
1310
+ {
1311
+ internalType: "address payable",
1312
+ name: "recipient",
1313
+ type: "address"
1314
+ },
1315
+ {
1316
+ internalType: "uint256",
1317
+ name: "amount",
1318
+ type: "uint256"
1319
+ }
1320
+ ],
1321
+ internalType: "struct IShared.TransferParams[]",
1322
+ name: "transferParamsArray",
1323
+ type: "tuple[]"
1324
+ }
1325
+ ],
1326
+ name: "allBatch",
1327
+ outputs: [],
1328
+ stateMutability: "nonpayable",
1329
+ type: "function"
1330
+ },
1331
+ {
1332
+ inputs: [
1333
+ {
1334
+ components: [
1335
+ {
1336
+ internalType: "uint256",
1337
+ name: "sig",
1338
+ type: "uint256"
1339
+ },
1340
+ {
1341
+ internalType: "uint256",
1342
+ name: "nonce",
1343
+ type: "uint256"
1344
+ },
1345
+ {
1346
+ internalType: "address",
1347
+ name: "kTimesGAddress",
1348
+ type: "address"
1349
+ }
1350
+ ],
1351
+ internalType: "struct IShared.SigData",
1352
+ name: "sigData",
1353
+ type: "tuple"
1354
+ },
1355
+ {
1356
+ components: [
1357
+ {
1358
+ internalType: "bytes32",
1359
+ name: "swapID",
1360
+ type: "bytes32"
1361
+ },
1362
+ {
1363
+ internalType: "address",
1364
+ name: "token",
1365
+ type: "address"
1366
+ }
1367
+ ],
1368
+ internalType: "struct IShared.DeployFetchParams[]",
1369
+ name: "deployFetchParamsArray",
1370
+ type: "tuple[]"
1371
+ }
1372
+ ],
1373
+ name: "deployAndFetchBatch",
1374
+ outputs: [],
1375
+ stateMutability: "nonpayable",
1376
+ type: "function"
1377
+ },
1378
+ {
1379
+ inputs: [],
1380
+ name: "disableCommunityGuard",
1381
+ outputs: [],
1382
+ stateMutability: "nonpayable",
1383
+ type: "function"
1384
+ },
1385
+ {
1386
+ inputs: [],
1387
+ name: "enableCommunityGuard",
1388
+ outputs: [],
1389
+ stateMutability: "nonpayable",
1390
+ type: "function"
1391
+ },
1392
+ {
1393
+ inputs: [
1394
+ {
1395
+ components: [
1396
+ {
1397
+ internalType: "uint256",
1398
+ name: "sig",
1399
+ type: "uint256"
1400
+ },
1401
+ {
1402
+ internalType: "uint256",
1403
+ name: "nonce",
1404
+ type: "uint256"
1405
+ },
1406
+ {
1407
+ internalType: "address",
1408
+ name: "kTimesGAddress",
1409
+ type: "address"
1410
+ }
1411
+ ],
1412
+ internalType: "struct IShared.SigData",
1413
+ name: "sigData",
1414
+ type: "tuple"
1415
+ },
1416
+ {
1417
+ components: [
1418
+ {
1419
+ internalType: "address",
1420
+ name: "token",
1421
+ type: "address"
1422
+ },
1423
+ {
1424
+ internalType: "address payable",
1425
+ name: "recipient",
1426
+ type: "address"
1427
+ },
1428
+ {
1429
+ internalType: "uint256",
1430
+ name: "amount",
1431
+ type: "uint256"
1432
+ }
1433
+ ],
1434
+ internalType: "struct IShared.TransferParams",
1435
+ name: "transferParams",
1436
+ type: "tuple"
1437
+ },
1438
+ {
1439
+ components: [
1440
+ {
1441
+ internalType: "enum IMulticall.CallType",
1442
+ name: "callType",
1443
+ type: "uint8"
1444
+ },
1445
+ {
1446
+ internalType: "address",
1447
+ name: "target",
1448
+ type: "address"
1449
+ },
1450
+ {
1451
+ internalType: "uint256",
1452
+ name: "value",
1453
+ type: "uint256"
1454
+ },
1455
+ {
1456
+ internalType: "bytes",
1457
+ name: "callData",
1458
+ type: "bytes"
1459
+ },
1460
+ {
1461
+ internalType: "bytes",
1462
+ name: "payload",
1463
+ type: "bytes"
1464
+ }
1465
+ ],
1466
+ internalType: "struct IMulticall.Call[]",
1467
+ name: "calls",
1468
+ type: "tuple[]"
1469
+ },
1470
+ {
1471
+ internalType: "uint256",
1472
+ name: "gasMulticall",
1473
+ type: "uint256"
1474
+ }
1475
+ ],
1476
+ name: "executeActions",
1477
+ outputs: [],
1478
+ stateMutability: "nonpayable",
1479
+ type: "function"
1480
+ },
1481
+ {
1482
+ inputs: [
1483
+ {
1484
+ components: [
1485
+ {
1486
+ internalType: "uint256",
1487
+ name: "sig",
1488
+ type: "uint256"
1489
+ },
1490
+ {
1491
+ internalType: "uint256",
1492
+ name: "nonce",
1493
+ type: "uint256"
1494
+ },
1495
+ {
1496
+ internalType: "address",
1497
+ name: "kTimesGAddress",
1498
+ type: "address"
1499
+ }
1500
+ ],
1501
+ internalType: "struct IShared.SigData",
1502
+ name: "sigData",
1503
+ type: "tuple"
1504
+ },
1505
+ {
1506
+ internalType: "address",
1507
+ name: "recipient",
1508
+ type: "address"
1509
+ },
1510
+ {
1511
+ internalType: "uint32",
1512
+ name: "srcChain",
1513
+ type: "uint32"
1514
+ },
1515
+ {
1516
+ internalType: "bytes",
1517
+ name: "srcAddress",
1518
+ type: "bytes"
1519
+ },
1520
+ {
1521
+ internalType: "bytes",
1522
+ name: "message",
1523
+ type: "bytes"
1524
+ }
1525
+ ],
1526
+ name: "executexCall",
1527
+ outputs: [],
1528
+ stateMutability: "nonpayable",
1529
+ type: "function"
1530
+ },
1531
+ {
1532
+ inputs: [
1533
+ {
1534
+ components: [
1535
+ {
1536
+ internalType: "uint256",
1537
+ name: "sig",
1538
+ type: "uint256"
1539
+ },
1540
+ {
1541
+ internalType: "uint256",
1542
+ name: "nonce",
1543
+ type: "uint256"
1544
+ },
1545
+ {
1546
+ internalType: "address",
1547
+ name: "kTimesGAddress",
1548
+ type: "address"
1549
+ }
1550
+ ],
1551
+ internalType: "struct IShared.SigData",
1552
+ name: "sigData",
1553
+ type: "tuple"
1554
+ },
1555
+ {
1556
+ components: [
1557
+ {
1558
+ internalType: "address",
1559
+ name: "token",
1560
+ type: "address"
1561
+ },
1562
+ {
1563
+ internalType: "address payable",
1564
+ name: "recipient",
1565
+ type: "address"
1566
+ },
1567
+ {
1568
+ internalType: "uint256",
1569
+ name: "amount",
1570
+ type: "uint256"
1571
+ }
1572
+ ],
1573
+ internalType: "struct IShared.TransferParams",
1574
+ name: "transferParams",
1575
+ type: "tuple"
1576
+ },
1577
+ {
1578
+ internalType: "uint32",
1579
+ name: "srcChain",
1580
+ type: "uint32"
1581
+ },
1582
+ {
1583
+ internalType: "bytes",
1584
+ name: "srcAddress",
1585
+ type: "bytes"
1586
+ },
1587
+ {
1588
+ internalType: "bytes",
1589
+ name: "message",
1590
+ type: "bytes"
1591
+ }
1592
+ ],
1593
+ name: "executexSwapAndCall",
1594
+ outputs: [],
1595
+ stateMutability: "nonpayable",
1596
+ type: "function"
1597
+ },
1598
+ {
1599
+ inputs: [
1600
+ {
1601
+ components: [
1602
+ {
1603
+ internalType: "uint256",
1604
+ name: "sig",
1605
+ type: "uint256"
1606
+ },
1607
+ {
1608
+ internalType: "uint256",
1609
+ name: "nonce",
1610
+ type: "uint256"
1611
+ },
1612
+ {
1613
+ internalType: "address",
1614
+ name: "kTimesGAddress",
1615
+ type: "address"
1616
+ }
1617
+ ],
1618
+ internalType: "struct IShared.SigData",
1619
+ name: "sigData",
1620
+ type: "tuple"
1621
+ },
1622
+ {
1623
+ components: [
1624
+ {
1625
+ internalType: "address payable",
1626
+ name: "fetchContract",
1627
+ type: "address"
1628
+ },
1629
+ {
1630
+ internalType: "address",
1631
+ name: "token",
1632
+ type: "address"
1633
+ }
1634
+ ],
1635
+ internalType: "struct IShared.FetchParams[]",
1636
+ name: "fetchParamsArray",
1637
+ type: "tuple[]"
1638
+ }
1639
+ ],
1640
+ name: "fetchBatch",
1641
+ outputs: [],
1642
+ stateMutability: "nonpayable",
1643
+ type: "function"
1644
+ },
1645
+ {
1646
+ inputs: [],
1647
+ name: "getCommunityGuardDisabled",
1648
+ outputs: [
1649
+ {
1650
+ internalType: "bool",
1651
+ name: "",
1652
+ type: "bool"
1653
+ }
1654
+ ],
1655
+ stateMutability: "view",
1656
+ type: "function"
1657
+ },
1658
+ {
1659
+ inputs: [],
1660
+ name: "getCommunityKey",
1661
+ outputs: [
1662
+ {
1663
+ internalType: "address",
1664
+ name: "",
1665
+ type: "address"
1666
+ }
1667
+ ],
1668
+ stateMutability: "view",
1669
+ type: "function"
1670
+ },
1671
+ {
1672
+ inputs: [],
1673
+ name: "getGovernor",
1674
+ outputs: [
1675
+ {
1676
+ internalType: "address",
1677
+ name: "",
1678
+ type: "address"
1679
+ }
1680
+ ],
1681
+ stateMutability: "view",
1682
+ type: "function"
1683
+ },
1684
+ {
1685
+ inputs: [],
1686
+ name: "getKeyManager",
1687
+ outputs: [
1688
+ {
1689
+ internalType: "contract IKeyManager",
1690
+ name: "",
1691
+ type: "address"
1692
+ }
1693
+ ],
1694
+ stateMutability: "view",
1695
+ type: "function"
1696
+ },
1697
+ {
1698
+ inputs: [],
1699
+ name: "getSuspendedState",
1700
+ outputs: [
1701
+ {
1702
+ internalType: "bool",
1703
+ name: "",
1704
+ type: "bool"
1705
+ }
1706
+ ],
1707
+ stateMutability: "view",
1708
+ type: "function"
1709
+ },
1710
+ {
1711
+ inputs: [
1712
+ {
1713
+ internalType: "address[]",
1714
+ name: "tokens",
1715
+ type: "address[]"
1716
+ }
1717
+ ],
1718
+ name: "govWithdraw",
1719
+ outputs: [],
1720
+ stateMutability: "nonpayable",
1721
+ type: "function"
1722
+ },
1723
+ {
1724
+ inputs: [],
1725
+ name: "resume",
1726
+ outputs: [],
1727
+ stateMutability: "nonpayable",
1728
+ type: "function"
1729
+ },
1730
+ {
1731
+ inputs: [],
1732
+ name: "suspend",
1733
+ outputs: [],
1734
+ stateMutability: "nonpayable",
1735
+ type: "function"
1736
+ },
1737
+ {
1738
+ inputs: [
1739
+ {
1740
+ components: [
1741
+ {
1742
+ internalType: "uint256",
1743
+ name: "sig",
1744
+ type: "uint256"
1745
+ },
1746
+ {
1747
+ internalType: "uint256",
1748
+ name: "nonce",
1749
+ type: "uint256"
1750
+ },
1751
+ {
1752
+ internalType: "address",
1753
+ name: "kTimesGAddress",
1754
+ type: "address"
1755
+ }
1756
+ ],
1757
+ internalType: "struct IShared.SigData",
1758
+ name: "sigData",
1759
+ type: "tuple"
1760
+ },
1761
+ {
1762
+ components: [
1763
+ {
1764
+ internalType: "address",
1765
+ name: "token",
1766
+ type: "address"
1767
+ },
1768
+ {
1769
+ internalType: "address payable",
1770
+ name: "recipient",
1771
+ type: "address"
1772
+ },
1773
+ {
1774
+ internalType: "uint256",
1775
+ name: "amount",
1776
+ type: "uint256"
1777
+ }
1778
+ ],
1779
+ internalType: "struct IShared.TransferParams",
1780
+ name: "transferParams",
1781
+ type: "tuple"
1782
+ }
1783
+ ],
1784
+ name: "transfer",
1785
+ outputs: [],
1786
+ stateMutability: "nonpayable",
1787
+ type: "function"
1788
+ },
1789
+ {
1790
+ inputs: [
1791
+ {
1792
+ components: [
1793
+ {
1794
+ internalType: "uint256",
1795
+ name: "sig",
1796
+ type: "uint256"
1797
+ },
1798
+ {
1799
+ internalType: "uint256",
1800
+ name: "nonce",
1801
+ type: "uint256"
1802
+ },
1803
+ {
1804
+ internalType: "address",
1805
+ name: "kTimesGAddress",
1806
+ type: "address"
1807
+ }
1808
+ ],
1809
+ internalType: "struct IShared.SigData",
1810
+ name: "sigData",
1811
+ type: "tuple"
1812
+ },
1813
+ {
1814
+ components: [
1815
+ {
1816
+ internalType: "address",
1817
+ name: "token",
1818
+ type: "address"
1819
+ },
1820
+ {
1821
+ internalType: "address payable",
1822
+ name: "recipient",
1823
+ type: "address"
1824
+ },
1825
+ {
1826
+ internalType: "uint256",
1827
+ name: "amount",
1828
+ type: "uint256"
1829
+ }
1830
+ ],
1831
+ internalType: "struct IShared.TransferParams[]",
1832
+ name: "transferParamsArray",
1833
+ type: "tuple[]"
1834
+ }
1835
+ ],
1836
+ name: "transferBatch",
1837
+ outputs: [],
1838
+ stateMutability: "nonpayable",
1839
+ type: "function"
1840
+ },
1841
+ {
1842
+ inputs: [
1843
+ {
1844
+ components: [
1845
+ {
1846
+ internalType: "uint256",
1847
+ name: "sig",
1848
+ type: "uint256"
1849
+ },
1850
+ {
1851
+ internalType: "uint256",
1852
+ name: "nonce",
1853
+ type: "uint256"
1854
+ },
1855
+ {
1856
+ internalType: "address",
1857
+ name: "kTimesGAddress",
1858
+ type: "address"
1859
+ }
1860
+ ],
1861
+ internalType: "struct IShared.SigData",
1862
+ name: "sigData",
1863
+ type: "tuple"
1864
+ },
1865
+ {
1866
+ internalType: "contract IKeyManager",
1867
+ name: "keyManager",
1868
+ type: "address"
1869
+ },
1870
+ {
1871
+ internalType: "bool",
1872
+ name: "omitChecks",
1873
+ type: "bool"
1874
+ }
1875
+ ],
1876
+ name: "updateKeyManager",
1877
+ outputs: [],
1878
+ stateMutability: "nonpayable",
1879
+ type: "function"
1880
+ },
1881
+ {
1882
+ inputs: [
1883
+ {
1884
+ internalType: "uint32",
1885
+ name: "dstChain",
1886
+ type: "uint32"
1887
+ },
1888
+ {
1889
+ internalType: "bytes",
1890
+ name: "dstAddress",
1891
+ type: "bytes"
1892
+ },
1893
+ {
1894
+ internalType: "uint32",
1895
+ name: "dstToken",
1896
+ type: "uint32"
1897
+ },
1898
+ {
1899
+ internalType: "bytes",
1900
+ name: "message",
1901
+ type: "bytes"
1902
+ },
1903
+ {
1904
+ internalType: "uint256",
1905
+ name: "gasAmount",
1906
+ type: "uint256"
1907
+ },
1908
+ {
1909
+ internalType: "bytes",
1910
+ name: "cfParameters",
1911
+ type: "bytes"
1912
+ }
1913
+ ],
1914
+ name: "xCallNative",
1915
+ outputs: [],
1916
+ stateMutability: "payable",
1917
+ type: "function"
1918
+ },
1919
+ {
1920
+ inputs: [
1921
+ {
1922
+ internalType: "uint32",
1923
+ name: "dstChain",
1924
+ type: "uint32"
1925
+ },
1926
+ {
1927
+ internalType: "bytes",
1928
+ name: "dstAddress",
1929
+ type: "bytes"
1930
+ },
1931
+ {
1932
+ internalType: "uint32",
1933
+ name: "dstToken",
1934
+ type: "uint32"
1935
+ },
1936
+ {
1937
+ internalType: "bytes",
1938
+ name: "message",
1939
+ type: "bytes"
1940
+ },
1941
+ {
1942
+ internalType: "uint256",
1943
+ name: "gasAmount",
1944
+ type: "uint256"
1945
+ },
1946
+ {
1947
+ internalType: "contract IERC20",
1948
+ name: "srcToken",
1949
+ type: "address"
1950
+ },
1951
+ {
1952
+ internalType: "uint256",
1953
+ name: "amount",
1954
+ type: "uint256"
1955
+ },
1956
+ {
1957
+ internalType: "bytes",
1958
+ name: "cfParameters",
1959
+ type: "bytes"
1960
+ }
1961
+ ],
1962
+ name: "xCallToken",
1963
+ outputs: [],
1964
+ stateMutability: "nonpayable",
1965
+ type: "function"
1966
+ },
1967
+ {
1968
+ inputs: [
1969
+ {
1970
+ internalType: "uint32",
1971
+ name: "dstChain",
1972
+ type: "uint32"
1973
+ },
1974
+ {
1975
+ internalType: "bytes",
1976
+ name: "dstAddress",
1977
+ type: "bytes"
1978
+ },
1979
+ {
1980
+ internalType: "uint32",
1981
+ name: "dstToken",
1982
+ type: "uint32"
1983
+ },
1984
+ {
1985
+ internalType: "bytes",
1986
+ name: "cfParameters",
1987
+ type: "bytes"
1988
+ }
1989
+ ],
1990
+ name: "xSwapNative",
1991
+ outputs: [],
1992
+ stateMutability: "payable",
1993
+ type: "function"
1994
+ },
1995
+ {
1996
+ inputs: [
1997
+ {
1998
+ internalType: "uint32",
1999
+ name: "dstChain",
2000
+ type: "uint32"
2001
+ },
2002
+ {
2003
+ internalType: "bytes",
2004
+ name: "dstAddress",
2005
+ type: "bytes"
2006
+ },
2007
+ {
2008
+ internalType: "uint32",
2009
+ name: "dstToken",
2010
+ type: "uint32"
2011
+ },
2012
+ {
2013
+ internalType: "contract IERC20",
2014
+ name: "srcToken",
2015
+ type: "address"
2016
+ },
2017
+ {
2018
+ internalType: "uint256",
2019
+ name: "amount",
2020
+ type: "uint256"
2021
+ },
2022
+ {
2023
+ internalType: "bytes",
2024
+ name: "cfParameters",
2025
+ type: "bytes"
2026
+ }
2027
+ ],
2028
+ name: "xSwapToken",
2029
+ outputs: [],
2030
+ stateMutability: "nonpayable",
2031
+ type: "function"
2032
+ },
2033
+ {
2034
+ stateMutability: "payable",
2035
+ type: "receive"
2036
+ }
2037
+ ];
2038
+ var Vault__factory = class {
2039
+ static createInterface() {
2040
+ return new utils.Interface(_abi3);
2041
+ }
2042
+ static connect(address, signerOrProvider) {
2043
+ return new Contract(address, _abi3, signerOrProvider);
2044
+ }
2045
+ };
2046
+ __name(Vault__factory, "Vault__factory");
2047
+ __publicField(Vault__factory, "abi", _abi3);
2048
+
2049
+ // ../shared/src/consts.ts
2050
+ var ADDRESSES = {
2051
+ [ChainflipNetworks.sisyphos]: {
2052
+ FLIP_CONTRACT_ADDRESS: "0x2FD78122663A07672e9ac63486573A99EB00125d",
2053
+ VAULT_CONTRACT_ADDRESS: "0xd498606dcb9F440CD9F06B397C40fd3327FC2550",
2054
+ STATE_CHAIN_MANAGER_CONTRACT_ADDRESS: "0xCCF267Bc5B709F1A1738122f3b76Cd01F0d9f947"
2055
+ },
2056
+ [ChainflipNetworks.partnernet]: {
2057
+ FLIP_CONTRACT_ADDRESS: "0x7D18Ed38e962FA25f39109f4aC8FbC4C75a0475C",
2058
+ VAULT_CONTRACT_ADDRESS: "0xE781866455c5EF1f791975512f7E27814Dc200E1",
2059
+ STATE_CHAIN_MANAGER_CONTRACT_ADDRESS: "0x5aC721F46b88E8671c1B62A501CD78b7C8b07a62"
2060
+ },
2061
+ [ChainflipNetworks.perseverance]: {
2062
+ FLIP_CONTRACT_ADDRESS: "0x1194C91d47Fc1b65bE18db38380B5344682b67db",
2063
+ VAULT_CONTRACT_ADDRESS: "0xF1B061aCCDAa4B7c029128b49aBc047F89D5CB8d",
2064
+ STATE_CHAIN_MANAGER_CONTRACT_ADDRESS: "0xC960C4eEe4ADf40d24374D85094f3219cf2DD8EB"
2065
+ }
2066
+ };
2067
+ var GOERLI_USDC_CONTRACT_ADDRESS = "0x07865c6E87B9F70255377e024ace6630C1Eaa37F";
2068
+
2069
+ // ../shared/src/guards.ts
2070
+ var isString = /* @__PURE__ */ __name((value) => typeof value === "string", "isString");
2071
+ function assert(condition, message) {
2072
+ if (condition)
2073
+ return;
2074
+ const error = new Error(message);
2075
+ if (error.stack) {
2076
+ error.stack = error.stack.replace(/\n.+/, "\n");
2077
+ }
2078
+ throw error;
2079
+ }
2080
+ __name(assert, "assert");
2081
+ var isTokenSwap = /* @__PURE__ */ __name((params) => "srcAsset" in params, "isTokenSwap");
2082
+ var isTokenCall = /* @__PURE__ */ __name((params) => "srcAsset" in params, "isTokenCall");
2083
+
2084
+ // ../shared/src/contracts.ts
2085
+ var getTokenContractAddress = /* @__PURE__ */ __name((asset, network) => {
2086
+ assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
2087
+ if (asset === Assets.FLIP)
2088
+ return ADDRESSES[network].FLIP_CONTRACT_ADDRESS;
2089
+ assert(asset === Assets.USDC, "Only FLIP and USDC are supported for now");
2090
+ return GOERLI_USDC_CONTRACT_ADDRESS;
2091
+ }, "getTokenContractAddress");
2092
+ var getStateChainGatewayContractAddress = /* @__PURE__ */ __name((network) => {
2093
+ assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
2094
+ return ADDRESSES[network].STATE_CHAIN_MANAGER_CONTRACT_ADDRESS;
2095
+ }, "getStateChainGatewayContractAddress");
2096
+ var checkAllowance = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20Address, signer) => {
2097
+ const erc20 = ERC20__factory.connect(erc20Address, signer);
2098
+ const signerAddress = await signer.getAddress();
2099
+ const allowance = await erc20.allowance(signerAddress, spenderAddress);
2100
+ return {
2101
+ allowance,
2102
+ isAllowable: allowance.gte(amount),
2103
+ erc20
2104
+ };
2105
+ }, "checkAllowance");
2106
+ var approve = /* @__PURE__ */ __name(async (amount, spenderAddress, erc20, allowance, nonce) => {
2107
+ const amountBigNumber = BigNumber.from(amount);
2108
+ const allowanceBigNumber = BigNumber.from(allowance);
2109
+ if (allowanceBigNumber.gte(amountBigNumber))
2110
+ return null;
2111
+ const requiredAmount = amountBigNumber.sub(allowanceBigNumber);
2112
+ const tx = await erc20.approve(spenderAddress, requiredAmount, {
2113
+ nonce
2114
+ });
2115
+ return tx.wait(1);
2116
+ }, "approve");
2117
+ var getVaultManagerContractAddress = /* @__PURE__ */ __name((network) => {
2118
+ assert(network !== ChainflipNetworks.mainnet, "Mainnet is not yet supported");
2119
+ return ADDRESSES[network].VAULT_CONTRACT_ADDRESS;
2120
+ }, "getVaultManagerContractAddress");
2121
+ var getFlipBalance = /* @__PURE__ */ __name(async (network, signer) => {
2122
+ const flipAddress = getTokenContractAddress("FLIP", network);
2123
+ const flip = ERC20__factory.connect(flipAddress, signer);
2124
+ const balance = await flip.balanceOf(await signer.getAddress());
2125
+ return balance.toBigInt();
2126
+ }, "getFlipBalance");
2127
+
2128
+ export { Assets, ChainflipNetworks, Chains, StateChainGateway__factory, Vault__factory, __name, approve, assert, assetChains, assetContractIds, assetDecimals, chainAssets, chainContractIds, checkAllowance, getFlipBalance, getStateChainGatewayContractAddress, getTokenContractAddress, getVaultManagerContractAddress, isString, isTestnet, isTokenCall, isTokenSwap };