@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.
- package/.github/workflows/ci.yml +19 -0
- package/dist/package.json +13 -12
- package/dist/src/abi/index.js +2 -4
- package/dist/src/abi/interopX.json +1436 -0
- package/dist/src/alias.js +10 -0
- package/dist/src/api/index.js +3 -0
- package/dist/src/constants/addresses.js +2 -7
- package/dist/src/constants/index.js +0 -1
- package/dist/src/constants/tokens.js +62 -39
- package/dist/src/db/models/transaction.js +29 -11
- package/dist/src/gnosis/actions/index.js +9 -0
- package/dist/src/gnosis/actions/withdraw/index.js +114 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +7 -18
- package/dist/src/net/protocol/dial/SignatureDialProtocol.js +9 -10
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +2 -0
- package/dist/src/net/protocol/index.js +11 -1
- package/dist/src/tasks/InteropX/SyncLogSubmitEvents.js +84 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +7 -2
- package/dist/src/tasks/index.js +8 -30
- package/dist/src/typechain/{InteropBridgeToken.js → InteropX.js} +0 -0
- package/dist/src/typechain/factories/InteropX__factory.js +1928 -0
- package/dist/src/typechain/factories/index.js +3 -5
- package/dist/src/typechain/index.js +3 -5
- package/dist/src/utils/index.js +46 -89
- package/package.json +13 -12
- package/src/abi/index.ts +2 -4
- package/src/abi/interopX.json +1436 -0
- package/src/alias.ts +6 -0
- package/src/api/index.ts +3 -0
- package/src/constants/addresses.ts +3 -8
- package/src/constants/index.ts +0 -1
- package/src/constants/tokens.ts +63 -40
- package/src/db/models/transaction.ts +65 -25
- package/src/gnosis/actions/index.ts +5 -0
- package/src/gnosis/actions/withdraw/index.ts +155 -0
- package/src/gnosis/index.ts +19 -0
- package/src/index.ts +6 -17
- package/src/net/protocol/dial/SignatureDialProtocol.ts +11 -13
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +3 -1
- package/src/net/protocol/index.ts +13 -3
- package/src/tasks/InteropX/SyncLogSubmitEvents.ts +136 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +7 -2
- package/src/tasks/index.ts +10 -40
- package/src/typechain/InteropX.ts +1216 -0
- package/src/typechain/factories/InteropX__factory.ts +1932 -0
- package/src/typechain/factories/index.ts +1 -2
- package/src/typechain/index.ts +2 -4
- package/src/utils/index.ts +98 -128
- package/tsconfig.json +7 -2
- package/dist/src/abi/interopBridgeToken.json +0 -298
- package/dist/src/abi/interopXGateway.json +0 -184
- package/dist/src/constants/itokens.js +0 -13
- package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +0 -146
- package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +0 -71
- package/dist/src/tasks/InteropBridge/SyncMintEvents.js +0 -66
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -162
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -74
- package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +0 -71
- package/dist/src/typechain/InteropXGateway.js +0 -2
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -471
- package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
- package/src/abi/interopBridgeToken.json +0 -298
- package/src/abi/interopXGateway.json +0 -184
- package/src/constants/itokens.ts +0 -10
- package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +0 -231
- package/src/tasks/InteropBridge/SyncBurnEvents.ts +0 -121
- package/src/tasks/InteropBridge/SyncMintEvents.ts +0 -98
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -257
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -124
- package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +0 -103
- package/src/typechain/InteropBridgeToken.ts +0 -692
- package/src/typechain/InteropXGateway.ts +0 -407
- package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -478
- 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
|
-
|
28
|
+
sourceStatus: {
|
29
|
+
[sequelize_1.Op.notIn]: ['success', 'failed'],
|
30
|
+
},
|
28
31
|
sourceCreatedAt: {
|
29
|
-
[sequelize_1.Op.gte]: new Date(Date.now() -
|
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}`);
|
package/dist/src/tasks/index.js
CHANGED
@@ -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
|
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
|
14
|
+
// new SyncTransactionStatusTask(),
|
19
15
|
new AutoUpdateTask_1.default(),
|
20
|
-
//
|
21
|
-
new
|
22
|
-
|
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}`);
|
File without changes
|