@instadapp/interop-x 0.0.0-dev.2c0a756 → 0.0.0-dev.376f394

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.
Files changed (75) hide show
  1. package/.github/workflows/ci.yml +19 -0
  2. package/dist/package.json +13 -12
  3. package/dist/src/abi/index.js +2 -4
  4. package/dist/src/abi/interopX.json +1436 -0
  5. package/dist/src/alias.js +10 -0
  6. package/dist/src/api/index.js +3 -0
  7. package/dist/src/constants/addresses.js +2 -7
  8. package/dist/src/constants/index.js +0 -1
  9. package/dist/src/constants/tokens.js +62 -39
  10. package/dist/src/db/models/transaction.js +29 -11
  11. package/dist/src/gnosis/actions/index.js +9 -0
  12. package/dist/src/gnosis/actions/withdraw/index.js +114 -0
  13. package/dist/src/gnosis/index.js +20 -0
  14. package/dist/src/index.js +7 -18
  15. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +9 -10
  16. package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +2 -0
  17. package/dist/src/net/protocol/index.js +11 -1
  18. package/dist/src/tasks/InteropX/SyncLogSubmitEvents.js +84 -0
  19. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +7 -2
  20. package/dist/src/tasks/index.js +8 -30
  21. package/dist/src/typechain/{InteropBridgeToken.js → InteropX.js} +0 -0
  22. package/dist/src/typechain/factories/InteropX__factory.js +1928 -0
  23. package/dist/src/typechain/factories/index.js +3 -5
  24. package/dist/src/typechain/index.js +3 -5
  25. package/dist/src/utils/index.js +46 -89
  26. package/package.json +13 -12
  27. package/src/abi/index.ts +2 -4
  28. package/src/abi/interopX.json +1436 -0
  29. package/src/alias.ts +6 -0
  30. package/src/api/index.ts +3 -0
  31. package/src/constants/addresses.ts +3 -8
  32. package/src/constants/index.ts +0 -1
  33. package/src/constants/tokens.ts +63 -40
  34. package/src/db/models/transaction.ts +65 -25
  35. package/src/gnosis/actions/index.ts +5 -0
  36. package/src/gnosis/actions/withdraw/index.ts +155 -0
  37. package/src/gnosis/index.ts +19 -0
  38. package/src/index.ts +6 -17
  39. package/src/net/protocol/dial/SignatureDialProtocol.ts +11 -13
  40. package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +3 -1
  41. package/src/net/protocol/index.ts +13 -3
  42. package/src/tasks/InteropX/SyncLogSubmitEvents.ts +136 -0
  43. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +7 -2
  44. package/src/tasks/index.ts +10 -40
  45. package/src/typechain/InteropX.ts +1216 -0
  46. package/src/typechain/factories/InteropX__factory.ts +1932 -0
  47. package/src/typechain/factories/index.ts +1 -2
  48. package/src/typechain/index.ts +2 -4
  49. package/src/utils/index.ts +98 -128
  50. package/tsconfig.json +7 -2
  51. package/dist/src/abi/interopBridgeToken.json +0 -298
  52. package/dist/src/abi/interopXGateway.json +0 -184
  53. package/dist/src/constants/itokens.js +0 -13
  54. package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +0 -146
  55. package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +0 -71
  56. package/dist/src/tasks/InteropBridge/SyncMintEvents.js +0 -66
  57. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -162
  58. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -74
  59. package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +0 -71
  60. package/dist/src/typechain/InteropXGateway.js +0 -2
  61. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -471
  62. package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
  63. package/src/abi/interopBridgeToken.json +0 -298
  64. package/src/abi/interopXGateway.json +0 -184
  65. package/src/constants/itokens.ts +0 -10
  66. package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +0 -231
  67. package/src/tasks/InteropBridge/SyncBurnEvents.ts +0 -121
  68. package/src/tasks/InteropBridge/SyncMintEvents.ts +0 -98
  69. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -257
  70. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -124
  71. package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +0 -103
  72. package/src/typechain/InteropBridgeToken.ts +0 -692
  73. package/src/typechain/InteropXGateway.ts +0 -407
  74. package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -478
  75. package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -20,13 +20,16 @@ class SyncTransactionStatusTask extends BaseTask_1.BaseTask {
20
20
  // if transaction is pending for more than 1 hour, check lead node for status
21
21
  const leadNode = net_1.peerPool.getLeadPeer();
22
22
  if (!leadNode) {
23
+ console.log("No lead node found");
23
24
  return;
24
25
  }
25
26
  const transaction = await db_1.Transaction.findOne({
26
27
  where: {
27
- status: 'pending',
28
+ sourceStatus: {
29
+ [sequelize_1.Op.notIn]: ['success', 'failed'],
30
+ },
28
31
  sourceCreatedAt: {
29
- [sequelize_1.Op.gte]: new Date(Date.now() - 60 * 60 * 1000),
32
+ [sequelize_1.Op.gte]: new Date(Date.now() - 15 * 60 * 1000),
30
33
  },
31
34
  }
32
35
  });
@@ -42,9 +45,11 @@ class SyncTransactionStatusTask extends BaseTask_1.BaseTask {
42
45
  transaction.sourceStatus = transactionStatus.sourceStatus;
43
46
  transaction.sourceTransactionHash = transactionStatus.sourceTransactionHash;
44
47
  transaction.sourceErrors = transactionStatus.sourceErrors;
48
+ transaction.sourceLogs = transactionStatus.sourceLogs;
45
49
  transaction.targetStatus = transactionStatus.targetStatus;
46
50
  transaction.targetTransactionHash = transactionStatus.targetTransactionHash;
47
51
  transaction.targetErrors = transactionStatus.targetErrors;
52
+ transaction.targetLogs = transactionStatus.targetLogs;
48
53
  transaction.status = transactionStatus.status;
49
54
  await transaction.save();
50
55
  this.logger.info(`Updated transaction status for ${transaction.transactionHash}`);
@@ -4,48 +4,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Tasks = void 0;
7
- const ProcessDepositEvents_1 = __importDefault(require("./InteropXGateway/ProcessDepositEvents"));
8
- const SyncDepositEvents_1 = __importDefault(require("./InteropXGateway/SyncDepositEvents"));
9
- const SyncWithdrawtEvents_1 = __importDefault(require("./InteropXGateway/SyncWithdrawtEvents"));
10
- const SyncBurnEvents_1 = __importDefault(require("./InteropBridge/SyncBurnEvents"));
11
- const SyncBurnEvents_2 = __importDefault(require("./InteropBridge/SyncBurnEvents"));
12
- const SyncMintEvents_1 = __importDefault(require("./InteropBridge/SyncMintEvents"));
7
+ const waait_1 = __importDefault(require("waait"));
13
8
  const SyncTransactionStatusTask_1 = __importDefault(require("./Transactions/SyncTransactionStatusTask"));
14
9
  const AutoUpdateTask_1 = __importDefault(require("./AutoUpdateTask"));
10
+ const SyncLogSubmitEvents_1 = __importDefault(require("./InteropX/SyncLogSubmitEvents"));
15
11
  class Tasks {
16
12
  constructor() {
17
13
  this.tasks = [
18
- new SyncTransactionStatusTask_1.default(),
14
+ // new SyncTransactionStatusTask(),
19
15
  new AutoUpdateTask_1.default(),
20
- // InteropXGateway
21
- new SyncDepositEvents_1.default({
22
- chainId: 43114
23
- }),
24
- new ProcessDepositEvents_1.default({
25
- chainId: 43114
26
- }),
27
- new SyncWithdrawtEvents_1.default({
28
- chainId: 43114
29
- }),
30
- // InteropBridge
31
- new SyncBurnEvents_1.default({
32
- chainId: 137,
33
- itokenAddress: '0xEab02fe1F016eE3e4106c1C6aad35FeEe657268E',
34
- }),
35
- new SyncMintEvents_1.default({
36
- chainId: 137,
37
- itokenAddress: '0xEab02fe1F016eE3e4106c1C6aad35FeEe657268E',
38
- }),
39
- new SyncBurnEvents_2.default({
40
- chainId: 137,
41
- itokenAddress: '0xEab02fe1F016eE3e4106c1C6aad35FeEe657268E',
42
- })
16
+ // InteropX
17
+ new SyncLogSubmitEvents_1.default({ chainId: 137 }),
18
+ new SyncLogSubmitEvents_1.default({ chainId: 43114 }),
19
+ new SyncTransactionStatusTask_1.default(),
43
20
  ];
44
21
  }
45
22
  async start() {
46
23
  for (const task of this.tasks) {
47
24
  try {
48
25
  task.start();
26
+ await (0, waait_1.default)(1000);
49
27
  }
50
28
  catch (error) {
51
29
  console.error(`Error starting task: ${task.constructor.name}`);