@instadapp/interop-x 0.0.0-dev.868731f → 0.0.0-dev.8965b57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/dist/package.json +8 -7
  2. package/dist/src/abi/index.js +2 -4
  3. package/dist/src/abi/interopXContract.json +391 -0
  4. package/dist/src/alias.js +10 -0
  5. package/dist/src/api/index.js +6 -3
  6. package/dist/src/config/index.js +11 -1
  7. package/dist/src/constants/addresses.js +3 -3
  8. package/dist/src/constants/index.js +0 -1
  9. package/dist/src/constants/tokens.js +31 -1
  10. package/dist/src/db/models/transaction.js +26 -10
  11. package/dist/src/gnosis/actions/index.js +9 -0
  12. package/dist/src/gnosis/actions/withdraw/index.js +55 -0
  13. package/dist/src/gnosis/index.js +20 -0
  14. package/dist/src/index.js +75 -24
  15. package/dist/src/net/peer/index.js +2 -1
  16. package/dist/src/net/pool/index.js +25 -9
  17. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +8 -2
  18. package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
  19. package/dist/src/net/protocol/index.js +51 -1
  20. package/dist/src/tasks/AutoUpdateTask.js +70 -0
  21. package/dist/src/tasks/BaseTask.js +11 -3
  22. package/dist/src/tasks/InteropXContract/ProcessBridgeRequestEvents.js +152 -0
  23. package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +77 -0
  24. package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +89 -0
  25. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
  26. package/dist/src/tasks/index.js +15 -8
  27. package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
  28. package/dist/src/typechain/factories/InteropXContract__factory.js +526 -0
  29. package/dist/src/typechain/factories/index.js +3 -5
  30. package/dist/src/typechain/index.js +3 -5
  31. package/dist/src/utils/index.js +32 -42
  32. package/package.json +8 -7
  33. package/src/abi/index.ts +2 -4
  34. package/src/abi/interopXContract.json +391 -0
  35. package/src/alias.ts +6 -0
  36. package/src/api/index.ts +5 -2
  37. package/src/config/index.ts +11 -1
  38. package/src/constants/addresses.ts +3 -3
  39. package/src/constants/index.ts +0 -1
  40. package/src/constants/tokens.ts +32 -2
  41. package/src/db/models/transaction.ts +64 -25
  42. package/src/gnosis/actions/index.ts +5 -0
  43. package/src/gnosis/actions/withdraw/index.ts +76 -0
  44. package/src/gnosis/index.ts +19 -0
  45. package/src/index.ts +96 -26
  46. package/src/net/peer/index.ts +2 -1
  47. package/src/net/pool/index.ts +33 -13
  48. package/src/net/protocol/dial/SignatureDialProtocol.ts +10 -4
  49. package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
  50. package/src/net/protocol/index.ts +67 -1
  51. package/src/tasks/AutoUpdateTask.ts +82 -0
  52. package/src/tasks/BaseTask.ts +13 -3
  53. package/src/tasks/InteropXContract/ProcessBridgeRequestEvents.ts +216 -0
  54. package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +114 -0
  55. package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +120 -0
  56. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
  57. package/src/tasks/index.ts +23 -9
  58. package/src/typechain/InteropXContract.ts +524 -0
  59. package/src/typechain/factories/InteropXContract__factory.ts +533 -0
  60. package/src/typechain/factories/index.ts +1 -2
  61. package/src/typechain/index.ts +2 -4
  62. package/src/utils/index.ts +67 -65
  63. package/tsconfig.json +7 -2
  64. package/dist/src/abi/interopBridgeToken.json +0 -286
  65. package/dist/src/abi/interopXGateway.json +0 -184
  66. package/dist/src/constants/itokens.js +0 -13
  67. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -152
  68. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -75
  69. package/dist/src/typechain/InteropXGateway.js +0 -2
  70. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -459
  71. package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
  72. package/src/abi/interopBridgeToken.json +0 -286
  73. package/src/abi/interopXGateway.json +0 -184
  74. package/src/constants/itokens.ts +0 -10
  75. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -247
  76. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -126
  77. package/src/typechain/InteropBridgeToken.ts +0 -686
  78. package/src/typechain/InteropXGateway.ts +0 -407
  79. package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -466
  80. package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -0,0 +1,533 @@
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: true,
18
+ internalType: "address",
19
+ name: "bridger",
20
+ type: "address",
21
+ },
22
+ {
23
+ components: [
24
+ {
25
+ components: [
26
+ {
27
+ internalType: "address",
28
+ name: "sourceToken",
29
+ type: "address",
30
+ },
31
+ {
32
+ internalType: "address",
33
+ name: "targetToken",
34
+ type: "address",
35
+ },
36
+ {
37
+ internalType: "uint256",
38
+ name: "amount",
39
+ type: "uint256",
40
+ },
41
+ ],
42
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
43
+ name: "supply",
44
+ type: "tuple[]",
45
+ },
46
+ {
47
+ components: [
48
+ {
49
+ internalType: "address",
50
+ name: "sourceToken",
51
+ type: "address",
52
+ },
53
+ {
54
+ internalType: "address",
55
+ name: "targetToken",
56
+ type: "address",
57
+ },
58
+ {
59
+ internalType: "uint256",
60
+ name: "amount",
61
+ type: "uint256",
62
+ },
63
+ ],
64
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
65
+ name: "withdraw",
66
+ type: "tuple[]",
67
+ },
68
+ ],
69
+ indexed: false,
70
+ internalType: "struct InteropXContractBeta.Position",
71
+ name: "position",
72
+ type: "tuple",
73
+ },
74
+ {
75
+ indexed: true,
76
+ internalType: "uint32",
77
+ name: "sourceChainId",
78
+ type: "uint32",
79
+ },
80
+ {
81
+ indexed: false,
82
+ internalType: "uint32",
83
+ name: "targetChainId",
84
+ type: "uint32",
85
+ },
86
+ {
87
+ indexed: true,
88
+ internalType: "bytes32",
89
+ name: "requestTransactionHash",
90
+ type: "bytes32",
91
+ },
92
+ {
93
+ indexed: false,
94
+ internalType: "bytes",
95
+ name: "metadata",
96
+ type: "bytes",
97
+ },
98
+ ],
99
+ name: "LogBridgeCommitted",
100
+ type: "event",
101
+ },
102
+ {
103
+ anonymous: false,
104
+ inputs: [
105
+ {
106
+ indexed: true,
107
+ internalType: "address",
108
+ name: "bridger",
109
+ type: "address",
110
+ },
111
+ {
112
+ components: [
113
+ {
114
+ components: [
115
+ {
116
+ internalType: "address",
117
+ name: "sourceToken",
118
+ type: "address",
119
+ },
120
+ {
121
+ internalType: "address",
122
+ name: "targetToken",
123
+ type: "address",
124
+ },
125
+ {
126
+ internalType: "uint256",
127
+ name: "amount",
128
+ type: "uint256",
129
+ },
130
+ ],
131
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
132
+ name: "supply",
133
+ type: "tuple[]",
134
+ },
135
+ {
136
+ components: [
137
+ {
138
+ internalType: "address",
139
+ name: "sourceToken",
140
+ type: "address",
141
+ },
142
+ {
143
+ internalType: "address",
144
+ name: "targetToken",
145
+ type: "address",
146
+ },
147
+ {
148
+ internalType: "uint256",
149
+ name: "amount",
150
+ type: "uint256",
151
+ },
152
+ ],
153
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
154
+ name: "withdraw",
155
+ type: "tuple[]",
156
+ },
157
+ ],
158
+ indexed: false,
159
+ internalType: "struct InteropXContractBeta.Position",
160
+ name: "position",
161
+ type: "tuple",
162
+ },
163
+ {
164
+ indexed: false,
165
+ internalType: "uint256",
166
+ name: "sourceChainId",
167
+ type: "uint256",
168
+ },
169
+ {
170
+ indexed: true,
171
+ internalType: "uint256",
172
+ name: "targetChainId",
173
+ type: "uint256",
174
+ },
175
+ {
176
+ indexed: true,
177
+ internalType: "bytes32",
178
+ name: "requestTransactionHash",
179
+ type: "bytes32",
180
+ },
181
+ {
182
+ indexed: false,
183
+ internalType: "bytes32",
184
+ name: "targetCommittedTransactionHash",
185
+ type: "bytes32",
186
+ },
187
+ {
188
+ indexed: false,
189
+ internalType: "bytes",
190
+ name: "metadata",
191
+ type: "bytes",
192
+ },
193
+ ],
194
+ name: "LogBridgeCompleted",
195
+ type: "event",
196
+ },
197
+ {
198
+ anonymous: false,
199
+ inputs: [
200
+ {
201
+ indexed: true,
202
+ internalType: "address",
203
+ name: "bridger",
204
+ type: "address",
205
+ },
206
+ {
207
+ components: [
208
+ {
209
+ components: [
210
+ {
211
+ internalType: "address",
212
+ name: "sourceToken",
213
+ type: "address",
214
+ },
215
+ {
216
+ internalType: "address",
217
+ name: "targetToken",
218
+ type: "address",
219
+ },
220
+ {
221
+ internalType: "uint256",
222
+ name: "amount",
223
+ type: "uint256",
224
+ },
225
+ ],
226
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
227
+ name: "supply",
228
+ type: "tuple[]",
229
+ },
230
+ {
231
+ components: [
232
+ {
233
+ internalType: "address",
234
+ name: "sourceToken",
235
+ type: "address",
236
+ },
237
+ {
238
+ internalType: "address",
239
+ name: "targetToken",
240
+ type: "address",
241
+ },
242
+ {
243
+ internalType: "uint256",
244
+ name: "amount",
245
+ type: "uint256",
246
+ },
247
+ ],
248
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
249
+ name: "withdraw",
250
+ type: "tuple[]",
251
+ },
252
+ ],
253
+ indexed: false,
254
+ internalType: "struct InteropXContractBeta.Position",
255
+ name: "position",
256
+ type: "tuple",
257
+ },
258
+ {
259
+ indexed: false,
260
+ internalType: "uint256",
261
+ name: "sourceChainId",
262
+ type: "uint256",
263
+ },
264
+ {
265
+ indexed: true,
266
+ internalType: "uint256",
267
+ name: "targetChainId",
268
+ type: "uint256",
269
+ },
270
+ {
271
+ indexed: false,
272
+ internalType: "bytes",
273
+ name: "metadata",
274
+ type: "bytes",
275
+ },
276
+ ],
277
+ name: "LogBridgeRequest",
278
+ type: "event",
279
+ },
280
+ {
281
+ anonymous: false,
282
+ inputs: [
283
+ {
284
+ indexed: true,
285
+ internalType: "address",
286
+ name: "bridger",
287
+ type: "address",
288
+ },
289
+ {
290
+ components: [
291
+ {
292
+ components: [
293
+ {
294
+ internalType: "address",
295
+ name: "sourceToken",
296
+ type: "address",
297
+ },
298
+ {
299
+ internalType: "address",
300
+ name: "targetToken",
301
+ type: "address",
302
+ },
303
+ {
304
+ internalType: "uint256",
305
+ name: "amount",
306
+ type: "uint256",
307
+ },
308
+ ],
309
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
310
+ name: "supply",
311
+ type: "tuple[]",
312
+ },
313
+ {
314
+ components: [
315
+ {
316
+ internalType: "address",
317
+ name: "sourceToken",
318
+ type: "address",
319
+ },
320
+ {
321
+ internalType: "address",
322
+ name: "targetToken",
323
+ type: "address",
324
+ },
325
+ {
326
+ internalType: "uint256",
327
+ name: "amount",
328
+ type: "uint256",
329
+ },
330
+ ],
331
+ internalType: "struct InteropXContractBeta.TokenInfo[]",
332
+ name: "withdraw",
333
+ type: "tuple[]",
334
+ },
335
+ ],
336
+ indexed: false,
337
+ internalType: "struct InteropXContractBeta.Position",
338
+ name: "position",
339
+ type: "tuple",
340
+ },
341
+ {
342
+ indexed: false,
343
+ internalType: "uint32",
344
+ name: "sourceChainId",
345
+ type: "uint32",
346
+ },
347
+ {
348
+ indexed: true,
349
+ internalType: "uint32",
350
+ name: "targetChainId",
351
+ type: "uint32",
352
+ },
353
+ {
354
+ indexed: true,
355
+ internalType: "bytes32",
356
+ name: "requestTransactionHash",
357
+ type: "bytes32",
358
+ },
359
+ {
360
+ indexed: false,
361
+ internalType: "bytes",
362
+ name: "metadata",
363
+ type: "bytes",
364
+ },
365
+ ],
366
+ name: "LogBridgeRequestSent",
367
+ type: "event",
368
+ },
369
+ {
370
+ inputs: [],
371
+ name: "_vnonce",
372
+ outputs: [
373
+ {
374
+ internalType: "uint256",
375
+ name: "",
376
+ type: "uint256",
377
+ },
378
+ ],
379
+ stateMutability: "view",
380
+ type: "function",
381
+ },
382
+ {
383
+ inputs: [
384
+ {
385
+ internalType: "address",
386
+ name: "to_",
387
+ type: "address",
388
+ },
389
+ {
390
+ internalType: "address",
391
+ name: "sourceToken_",
392
+ type: "address",
393
+ },
394
+ {
395
+ internalType: "address",
396
+ name: "targetToken_",
397
+ type: "address",
398
+ },
399
+ {
400
+ internalType: "uint256",
401
+ name: "amount_",
402
+ type: "uint256",
403
+ },
404
+ {
405
+ internalType: "uint32",
406
+ name: "targetChainId_",
407
+ type: "uint32",
408
+ },
409
+ {
410
+ internalType: "bytes32",
411
+ name: "transactionHash_",
412
+ type: "bytes32",
413
+ },
414
+ {
415
+ internalType: "bytes",
416
+ name: "metadata_",
417
+ type: "bytes",
418
+ },
419
+ ],
420
+ name: "completeBridge",
421
+ outputs: [],
422
+ stateMutability: "nonpayable",
423
+ type: "function",
424
+ },
425
+ {
426
+ inputs: [
427
+ {
428
+ internalType: "address",
429
+ name: "sourceToken_",
430
+ type: "address",
431
+ },
432
+ {
433
+ internalType: "address",
434
+ name: "targetToken_",
435
+ type: "address",
436
+ },
437
+ {
438
+ internalType: "uint256",
439
+ name: "amount_",
440
+ type: "uint256",
441
+ },
442
+ {
443
+ internalType: "uint32",
444
+ name: "targetChainId_",
445
+ type: "uint32",
446
+ },
447
+ {
448
+ internalType: "bytes",
449
+ name: "metadata_",
450
+ type: "bytes",
451
+ },
452
+ ],
453
+ name: "requestWithdraw",
454
+ outputs: [],
455
+ stateMutability: "nonpayable",
456
+ type: "function",
457
+ },
458
+ {
459
+ inputs: [
460
+ {
461
+ internalType: "address",
462
+ name: "",
463
+ type: "address",
464
+ },
465
+ ],
466
+ name: "whitelistedMapping",
467
+ outputs: [
468
+ {
469
+ internalType: "uint256",
470
+ name: "",
471
+ type: "uint256",
472
+ },
473
+ ],
474
+ stateMutability: "view",
475
+ type: "function",
476
+ },
477
+ {
478
+ inputs: [
479
+ {
480
+ internalType: "address",
481
+ name: "user_",
482
+ type: "address",
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: "chainId_",
502
+ type: "uint32",
503
+ },
504
+ {
505
+ internalType: "bytes32",
506
+ name: "transactionHash_",
507
+ type: "bytes32",
508
+ },
509
+ {
510
+ internalType: "bytes",
511
+ name: "metadata_",
512
+ type: "bytes",
513
+ },
514
+ ],
515
+ name: "withdrawRequested",
516
+ outputs: [],
517
+ stateMutability: "nonpayable",
518
+ type: "function",
519
+ },
520
+ ];
521
+
522
+ export class InteropXContract__factory {
523
+ static readonly abi = _abi;
524
+ static createInterface(): InteropXContractInterface {
525
+ return new utils.Interface(_abi) as InteropXContractInterface;
526
+ }
527
+ static connect(
528
+ address: string,
529
+ signerOrProvider: Signer | Provider
530
+ ): InteropXContract {
531
+ return new Contract(address, _abi, signerOrProvider) as InteropXContract;
532
+ }
533
+ }
@@ -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";