@chainflip/sdk 1.7.0 → 1.8.0-beta.1

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