@instadapp/interop-x 0.0.0-dev.733ff78 → 0.0.0-dev.76d0265

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/dist/package.json +13 -12
  2. package/dist/src/abi/index.js +2 -4
  3. package/dist/src/abi/interopXContract.json +454 -0
  4. package/dist/src/alias.js +10 -0
  5. package/dist/src/constants/addresses.js +7 -7
  6. package/dist/src/constants/index.js +0 -1
  7. package/dist/src/constants/tokens.js +62 -39
  8. package/dist/src/db/models/transaction.js +19 -11
  9. package/dist/src/gnosis/actions/index.js +0 -2
  10. package/dist/src/gnosis/actions/withdraw/index.js +115 -0
  11. package/dist/src/gnosis/index.js +4 -4
  12. package/dist/src/index.js +5 -19
  13. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +6 -2
  14. package/dist/src/tasks/{InteropBridge/ProcessWithdrawEvents.js → InteropXContract/ProcessBridgeRequestEvents.js} +50 -53
  15. package/dist/src/tasks/InteropXContract/SyncBridgeCommittedEvents.js +93 -0
  16. package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
  17. package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +90 -0
  18. package/dist/src/tasks/index.js +16 -30
  19. package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
  20. package/dist/src/typechain/factories/InteropXContract__factory.js +635 -0
  21. package/dist/src/typechain/factories/index.js +3 -5
  22. package/dist/src/typechain/index.js +3 -5
  23. package/dist/src/utils/index.js +44 -8
  24. package/package.json +13 -12
  25. package/src/abi/index.ts +2 -4
  26. package/src/abi/interopXContract.json +454 -0
  27. package/src/alias.ts +6 -0
  28. package/src/constants/addresses.ts +8 -8
  29. package/src/constants/index.ts +0 -1
  30. package/src/constants/tokens.ts +63 -40
  31. package/src/db/models/transaction.ts +66 -27
  32. package/src/gnosis/actions/index.ts +0 -2
  33. package/src/gnosis/actions/withdraw/index.ts +155 -0
  34. package/src/gnosis/index.ts +5 -5
  35. package/src/index.ts +4 -18
  36. package/src/net/protocol/dial/SignatureDialProtocol.ts +6 -2
  37. package/src/tasks/{InteropBridge/ProcessWithdrawEvents.ts → InteropXContract/ProcessBridgeRequestEvents.ts} +78 -100
  38. package/src/tasks/InteropXContract/SyncBridgeCommittedEvents.ts +125 -0
  39. package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +115 -0
  40. package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +121 -0
  41. package/src/tasks/index.ts +18 -36
  42. package/src/typechain/InteropXContract.ts +680 -0
  43. package/src/typechain/factories/InteropXContract__factory.ts +642 -0
  44. package/src/typechain/factories/index.ts +1 -2
  45. package/src/typechain/index.ts +2 -4
  46. package/src/utils/index.ts +85 -8
  47. package/tsconfig.json +7 -2
  48. package/dist/src/abi/interopBridgeToken.json +0 -298
  49. package/dist/src/abi/interopXGateway.json +0 -184
  50. package/dist/src/constants/itokens.js +0 -13
  51. package/dist/src/gnosis/actions/deposit.js +0 -48
  52. package/dist/src/gnosis/actions/withdraw.js +0 -50
  53. package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +0 -71
  54. package/dist/src/tasks/InteropBridge/SyncMintEvents.js +0 -67
  55. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -164
  56. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -74
  57. package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +0 -72
  58. package/dist/src/typechain/InteropXGateway.js +0 -2
  59. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -471
  60. package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
  61. package/src/abi/interopBridgeToken.json +0 -298
  62. package/src/abi/interopXGateway.json +0 -184
  63. package/src/constants/itokens.ts +0 -10
  64. package/src/gnosis/actions/deposit.ts +0 -63
  65. package/src/gnosis/actions/withdraw.ts +0 -67
  66. package/src/tasks/InteropBridge/SyncBurnEvents.ts +0 -119
  67. package/src/tasks/InteropBridge/SyncMintEvents.ts +0 -99
  68. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -260
  69. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -124
  70. package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +0 -105
  71. package/src/typechain/InteropBridgeToken.ts +0 -692
  72. package/src/typechain/InteropXGateway.ts +0 -407
  73. package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -478
  74. package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -0,0 +1,642 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import { Contract, Signer, utils } from "ethers";
6
+ import type { Provider } from "@ethersproject/providers";
7
+ import type {
8
+ InteropXContract,
9
+ InteropXContractInterface,
10
+ } from "../InteropXContract";
11
+
12
+ const _abi = [
13
+ {
14
+ anonymous: false,
15
+ inputs: [
16
+ {
17
+ indexed: false,
18
+ internalType: "string",
19
+ name: "actionId",
20
+ type: "string",
21
+ },
22
+ {
23
+ indexed: true,
24
+ internalType: "address",
25
+ name: "bridger",
26
+ type: "address",
27
+ },
28
+ {
29
+ components: [
30
+ {
31
+ components: [
32
+ {
33
+ internalType: "address",
34
+ name: "sourceToken",
35
+ type: "address",
36
+ },
37
+ {
38
+ internalType: "address",
39
+ name: "targetToken",
40
+ type: "address",
41
+ },
42
+ {
43
+ internalType: "uint256",
44
+ name: "amount",
45
+ type: "uint256",
46
+ },
47
+ ],
48
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
49
+ name: "supply",
50
+ type: "tuple[]",
51
+ },
52
+ {
53
+ components: [
54
+ {
55
+ internalType: "address",
56
+ name: "sourceToken",
57
+ type: "address",
58
+ },
59
+ {
60
+ internalType: "address",
61
+ name: "targetToken",
62
+ type: "address",
63
+ },
64
+ {
65
+ internalType: "uint256",
66
+ name: "amount",
67
+ type: "uint256",
68
+ },
69
+ ],
70
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
71
+ name: "withdraw",
72
+ type: "tuple[]",
73
+ },
74
+ ],
75
+ indexed: false,
76
+ internalType: "struct InteropXContractBeta.Position",
77
+ name: "position",
78
+ type: "tuple",
79
+ },
80
+ {
81
+ indexed: true,
82
+ internalType: "uint32",
83
+ name: "sourceChainId",
84
+ type: "uint32",
85
+ },
86
+ {
87
+ indexed: false,
88
+ internalType: "uint32",
89
+ name: "targetChainId",
90
+ type: "uint32",
91
+ },
92
+ {
93
+ indexed: true,
94
+ internalType: "bytes32",
95
+ name: "requestTransactionHash",
96
+ type: "bytes32",
97
+ },
98
+ {
99
+ indexed: false,
100
+ internalType: "bytes",
101
+ name: "metadata",
102
+ type: "bytes",
103
+ },
104
+ ],
105
+ name: "LogBridgeCommitted",
106
+ type: "event",
107
+ },
108
+ {
109
+ anonymous: false,
110
+ inputs: [
111
+ {
112
+ indexed: false,
113
+ internalType: "string",
114
+ name: "actionId",
115
+ type: "string",
116
+ },
117
+ {
118
+ indexed: true,
119
+ internalType: "address",
120
+ name: "bridger",
121
+ type: "address",
122
+ },
123
+ {
124
+ components: [
125
+ {
126
+ components: [
127
+ {
128
+ internalType: "address",
129
+ name: "sourceToken",
130
+ type: "address",
131
+ },
132
+ {
133
+ internalType: "address",
134
+ name: "targetToken",
135
+ type: "address",
136
+ },
137
+ {
138
+ internalType: "uint256",
139
+ name: "amount",
140
+ type: "uint256",
141
+ },
142
+ ],
143
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
144
+ name: "supply",
145
+ type: "tuple[]",
146
+ },
147
+ {
148
+ components: [
149
+ {
150
+ internalType: "address",
151
+ name: "sourceToken",
152
+ type: "address",
153
+ },
154
+ {
155
+ internalType: "address",
156
+ name: "targetToken",
157
+ type: "address",
158
+ },
159
+ {
160
+ internalType: "uint256",
161
+ name: "amount",
162
+ type: "uint256",
163
+ },
164
+ ],
165
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
166
+ name: "withdraw",
167
+ type: "tuple[]",
168
+ },
169
+ ],
170
+ indexed: false,
171
+ internalType: "struct InteropXContractBeta.Position",
172
+ name: "position",
173
+ type: "tuple",
174
+ },
175
+ {
176
+ indexed: false,
177
+ internalType: "uint256",
178
+ name: "sourceChainId",
179
+ type: "uint256",
180
+ },
181
+ {
182
+ indexed: true,
183
+ internalType: "uint256",
184
+ name: "targetChainId",
185
+ type: "uint256",
186
+ },
187
+ {
188
+ indexed: true,
189
+ internalType: "bytes32",
190
+ name: "requestTransactionHash",
191
+ type: "bytes32",
192
+ },
193
+ {
194
+ indexed: false,
195
+ internalType: "bytes32",
196
+ name: "targetCommittedTransactionHash",
197
+ type: "bytes32",
198
+ },
199
+ {
200
+ indexed: false,
201
+ internalType: "bytes",
202
+ name: "metadata",
203
+ type: "bytes",
204
+ },
205
+ ],
206
+ name: "LogBridgeCompleted",
207
+ type: "event",
208
+ },
209
+ {
210
+ anonymous: false,
211
+ inputs: [
212
+ {
213
+ indexed: false,
214
+ internalType: "string",
215
+ name: "actionId",
216
+ type: "string",
217
+ },
218
+ {
219
+ indexed: true,
220
+ internalType: "address",
221
+ name: "bridger",
222
+ type: "address",
223
+ },
224
+ {
225
+ components: [
226
+ {
227
+ components: [
228
+ {
229
+ internalType: "address",
230
+ name: "sourceToken",
231
+ type: "address",
232
+ },
233
+ {
234
+ internalType: "address",
235
+ name: "targetToken",
236
+ type: "address",
237
+ },
238
+ {
239
+ internalType: "uint256",
240
+ name: "amount",
241
+ type: "uint256",
242
+ },
243
+ ],
244
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
245
+ name: "supply",
246
+ type: "tuple[]",
247
+ },
248
+ {
249
+ components: [
250
+ {
251
+ internalType: "address",
252
+ name: "sourceToken",
253
+ type: "address",
254
+ },
255
+ {
256
+ internalType: "address",
257
+ name: "targetToken",
258
+ type: "address",
259
+ },
260
+ {
261
+ internalType: "uint256",
262
+ name: "amount",
263
+ type: "uint256",
264
+ },
265
+ ],
266
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
267
+ name: "withdraw",
268
+ type: "tuple[]",
269
+ },
270
+ ],
271
+ indexed: false,
272
+ internalType: "struct InteropXContractBeta.Position",
273
+ name: "position",
274
+ type: "tuple",
275
+ },
276
+ {
277
+ indexed: false,
278
+ internalType: "uint256",
279
+ name: "sourceChainId",
280
+ type: "uint256",
281
+ },
282
+ {
283
+ indexed: true,
284
+ internalType: "uint256",
285
+ name: "targetChainId",
286
+ type: "uint256",
287
+ },
288
+ {
289
+ indexed: false,
290
+ internalType: "bytes",
291
+ name: "metadata",
292
+ type: "bytes",
293
+ },
294
+ ],
295
+ name: "LogBridgeRequest",
296
+ type: "event",
297
+ },
298
+ {
299
+ anonymous: false,
300
+ inputs: [
301
+ {
302
+ indexed: false,
303
+ internalType: "string",
304
+ name: "actionId",
305
+ type: "string",
306
+ },
307
+ {
308
+ indexed: true,
309
+ internalType: "address",
310
+ name: "bridger",
311
+ type: "address",
312
+ },
313
+ {
314
+ components: [
315
+ {
316
+ components: [
317
+ {
318
+ internalType: "address",
319
+ name: "sourceToken",
320
+ type: "address",
321
+ },
322
+ {
323
+ internalType: "address",
324
+ name: "targetToken",
325
+ type: "address",
326
+ },
327
+ {
328
+ internalType: "uint256",
329
+ name: "amount",
330
+ type: "uint256",
331
+ },
332
+ ],
333
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
334
+ name: "supply",
335
+ type: "tuple[]",
336
+ },
337
+ {
338
+ components: [
339
+ {
340
+ internalType: "address",
341
+ name: "sourceToken",
342
+ type: "address",
343
+ },
344
+ {
345
+ internalType: "address",
346
+ name: "targetToken",
347
+ type: "address",
348
+ },
349
+ {
350
+ internalType: "uint256",
351
+ name: "amount",
352
+ type: "uint256",
353
+ },
354
+ ],
355
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
356
+ name: "withdraw",
357
+ type: "tuple[]",
358
+ },
359
+ ],
360
+ indexed: false,
361
+ internalType: "struct InteropXContractBeta.Position",
362
+ name: "position",
363
+ type: "tuple",
364
+ },
365
+ {
366
+ indexed: false,
367
+ internalType: "uint32",
368
+ name: "sourceChainId",
369
+ type: "uint32",
370
+ },
371
+ {
372
+ indexed: true,
373
+ internalType: "uint32",
374
+ name: "targetChainId",
375
+ type: "uint32",
376
+ },
377
+ {
378
+ indexed: true,
379
+ internalType: "bytes32",
380
+ name: "requestTransactionHash",
381
+ type: "bytes32",
382
+ },
383
+ {
384
+ indexed: false,
385
+ internalType: "bytes",
386
+ name: "metadata",
387
+ type: "bytes",
388
+ },
389
+ ],
390
+ name: "LogBridgeRequestSent",
391
+ type: "event",
392
+ },
393
+ {
394
+ inputs: [
395
+ {
396
+ internalType: "string",
397
+ name: "actionId",
398
+ type: "string",
399
+ },
400
+ {
401
+ internalType: "address",
402
+ name: "to_",
403
+ type: "address",
404
+ },
405
+ {
406
+ internalType: "address",
407
+ name: "sourceToken_",
408
+ type: "address",
409
+ },
410
+ {
411
+ internalType: "address",
412
+ name: "targetToken_",
413
+ type: "address",
414
+ },
415
+ {
416
+ internalType: "uint256",
417
+ name: "amount_",
418
+ type: "uint256",
419
+ },
420
+ {
421
+ internalType: "uint32",
422
+ name: "sourceChainId_",
423
+ type: "uint32",
424
+ },
425
+ {
426
+ internalType: "bytes32",
427
+ name: "transactionHash_",
428
+ type: "bytes32",
429
+ },
430
+ {
431
+ internalType: "bytes",
432
+ name: "metadata_",
433
+ type: "bytes",
434
+ },
435
+ ],
436
+ name: "completeBridge",
437
+ outputs: [],
438
+ stateMutability: "nonpayable",
439
+ type: "function",
440
+ },
441
+ {
442
+ inputs: [
443
+ {
444
+ internalType: "address",
445
+ name: "user",
446
+ type: "address",
447
+ },
448
+ {
449
+ internalType: "address[]",
450
+ name: "tokens",
451
+ type: "address[]",
452
+ },
453
+ ],
454
+ name: "getBridgeAmounts",
455
+ outputs: [
456
+ {
457
+ components: [
458
+ {
459
+ internalType: "uint256",
460
+ name: "deposit",
461
+ type: "uint256",
462
+ },
463
+ {
464
+ internalType: "uint256",
465
+ name: "withdraw",
466
+ type: "uint256",
467
+ },
468
+ ],
469
+ internalType: "struct InteropXContractBeta.UserData[]",
470
+ name: "userData",
471
+ type: "tuple[]",
472
+ },
473
+ ],
474
+ stateMutability: "view",
475
+ type: "function",
476
+ },
477
+ {
478
+ inputs: [
479
+ {
480
+ internalType: "string",
481
+ name: "actionId",
482
+ type: "string",
483
+ },
484
+ {
485
+ internalType: "address",
486
+ name: "sourceToken_",
487
+ type: "address",
488
+ },
489
+ {
490
+ internalType: "address",
491
+ name: "targetToken_",
492
+ type: "address",
493
+ },
494
+ {
495
+ internalType: "uint256",
496
+ name: "amount_",
497
+ type: "uint256",
498
+ },
499
+ {
500
+ internalType: "uint32",
501
+ name: "targetChainId_",
502
+ type: "uint32",
503
+ },
504
+ {
505
+ internalType: "bytes",
506
+ name: "metadata_",
507
+ type: "bytes",
508
+ },
509
+ ],
510
+ name: "requestWithdraw",
511
+ outputs: [],
512
+ stateMutability: "nonpayable",
513
+ type: "function",
514
+ },
515
+ {
516
+ inputs: [
517
+ {
518
+ internalType: "address",
519
+ name: "token",
520
+ type: "address",
521
+ },
522
+ {
523
+ internalType: "bool",
524
+ name: "toggle",
525
+ type: "bool",
526
+ },
527
+ ],
528
+ name: "toggleWhitelist",
529
+ outputs: [],
530
+ stateMutability: "nonpayable",
531
+ type: "function",
532
+ },
533
+ {
534
+ inputs: [
535
+ {
536
+ internalType: "address",
537
+ name: "",
538
+ type: "address",
539
+ },
540
+ {
541
+ internalType: "address",
542
+ name: "",
543
+ type: "address",
544
+ },
545
+ ],
546
+ name: "userMapping",
547
+ outputs: [
548
+ {
549
+ internalType: "uint256",
550
+ name: "deposit",
551
+ type: "uint256",
552
+ },
553
+ {
554
+ internalType: "uint256",
555
+ name: "withdraw",
556
+ type: "uint256",
557
+ },
558
+ ],
559
+ stateMutability: "view",
560
+ type: "function",
561
+ },
562
+ {
563
+ inputs: [
564
+ {
565
+ internalType: "address",
566
+ name: "",
567
+ type: "address",
568
+ },
569
+ ],
570
+ name: "whitelistedTokens",
571
+ outputs: [
572
+ {
573
+ internalType: "bool",
574
+ name: "",
575
+ type: "bool",
576
+ },
577
+ ],
578
+ stateMutability: "view",
579
+ type: "function",
580
+ },
581
+ {
582
+ inputs: [
583
+ {
584
+ internalType: "string",
585
+ name: "actionId",
586
+ type: "string",
587
+ },
588
+ {
589
+ internalType: "address",
590
+ name: "user_",
591
+ type: "address",
592
+ },
593
+ {
594
+ internalType: "address",
595
+ name: "sourceToken_",
596
+ type: "address",
597
+ },
598
+ {
599
+ internalType: "address",
600
+ name: "targetToken_",
601
+ type: "address",
602
+ },
603
+ {
604
+ internalType: "uint256",
605
+ name: "amount_",
606
+ type: "uint256",
607
+ },
608
+ {
609
+ internalType: "uint32",
610
+ name: "chainId_",
611
+ type: "uint32",
612
+ },
613
+ {
614
+ internalType: "bytes32",
615
+ name: "transactionHash_",
616
+ type: "bytes32",
617
+ },
618
+ {
619
+ internalType: "bytes",
620
+ name: "metadata_",
621
+ type: "bytes",
622
+ },
623
+ ],
624
+ name: "withdrawRequested",
625
+ outputs: [],
626
+ stateMutability: "nonpayable",
627
+ type: "function",
628
+ },
629
+ ];
630
+
631
+ export class InteropXContract__factory {
632
+ static readonly abi = _abi;
633
+ static createInterface(): InteropXContractInterface {
634
+ return new utils.Interface(_abi) as InteropXContractInterface;
635
+ }
636
+ static connect(
637
+ address: string,
638
+ signerOrProvider: Signer | Provider
639
+ ): InteropXContract {
640
+ return new Contract(address, _abi, signerOrProvider) as InteropXContract;
641
+ }
642
+ }
@@ -3,5 +3,4 @@
3
3
  /* eslint-disable */
4
4
  export { Erc20__factory } from "./Erc20__factory";
5
5
  export { GnosisSafe__factory } from "./GnosisSafe__factory";
6
- export { InteropBridgeToken__factory } from "./InteropBridgeToken__factory";
7
- export { InteropXGateway__factory } from "./InteropXGateway__factory";
6
+ export { InteropXContract__factory } from "./InteropXContract__factory";
@@ -3,10 +3,8 @@
3
3
  /* eslint-disable */
4
4
  export type { Erc20 } from "./Erc20";
5
5
  export type { GnosisSafe } from "./GnosisSafe";
6
- export type { InteropBridgeToken } from "./InteropBridgeToken";
7
- export type { InteropXGateway } from "./InteropXGateway";
6
+ export type { InteropXContract } from "./InteropXContract";
8
7
  export * as factories from "./factories";
9
8
  export { Erc20__factory } from "./factories/Erc20__factory";
10
9
  export { GnosisSafe__factory } from "./factories/GnosisSafe__factory";
11
- export { InteropBridgeToken__factory } from "./factories/InteropBridgeToken__factory";
12
- export { InteropXGateway__factory } from "./factories/InteropXGateway__factory";
10
+ export { InteropXContract__factory } from "./factories/InteropXContract__factory";