@instadapp/interop-x 0.0.0-dev.6ea4ee5 → 0.0.0-dev.733ff78
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/bin/interop-x +1 -1
- package/dist/package.json +73 -0
- package/dist/{abi → src/abi}/erc20.json +0 -0
- package/dist/{abi → src/abi}/gnosisSafe.json +0 -0
- package/dist/{abi → src/abi}/index.js +0 -0
- package/dist/{abi → src/abi}/interopBridgeToken.json +21 -9
- package/dist/{abi → src/abi}/interopXGateway.json +11 -11
- package/dist/src/api/index.js +36 -0
- package/dist/{config → src/config}/index.js +11 -1
- package/dist/{constants → src/constants}/addresses.js +1 -9
- package/dist/{constants → src/constants}/index.js +1 -0
- package/dist/src/constants/itokens.js +13 -0
- package/dist/{constants → src/constants}/tokens.js +0 -0
- package/dist/{db → src/db}/index.js +0 -0
- package/dist/{db → src/db}/models/index.js +0 -0
- package/dist/{db → src/db}/models/transaction.js +11 -1
- package/dist/{db → src/db}/sequelize.js +1 -1
- package/dist/src/gnosis/actions/deposit.js +48 -0
- package/dist/src/gnosis/actions/index.js +11 -0
- package/dist/src/gnosis/actions/withdraw.js +50 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +133 -0
- package/dist/{logger → src/logger}/index.js +0 -0
- package/dist/{net → src/net}/index.js +0 -0
- package/dist/{net → src/net}/peer/index.js +8 -3
- package/dist/{net → src/net}/pool/index.js +32 -9
- package/dist/{net → src/net}/protocol/dial/BaseDialProtocol.js +0 -0
- package/dist/{net → src/net}/protocol/dial/SignatureDialProtocol.js +17 -12
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
- package/dist/{net → src/net}/protocol/index.js +51 -1
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/{tasks → src/tasks}/BaseTask.js +12 -4
- package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +162 -0
- package/dist/src/tasks/InteropBridge/SyncBurnEvents.js +71 -0
- package/dist/src/tasks/InteropBridge/SyncMintEvents.js +67 -0
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +164 -0
- package/dist/{tasks → src/tasks}/InteropXGateway/SyncDepositEvents.js +18 -23
- package/dist/src/tasks/InteropXGateway/SyncWithdrawtEvents.js +72 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
- package/dist/src/tasks/index.js +55 -0
- package/dist/{typechain → src/typechain}/Erc20.js +0 -0
- package/dist/{typechain → src/typechain}/GnosisSafe.js +0 -0
- package/dist/{typechain → src/typechain}/InteropBridgeToken.js +0 -0
- package/dist/{typechain → src/typechain}/InteropXGateway.js +0 -0
- package/dist/{typechain → src/typechain}/common.js +0 -0
- package/dist/{typechain → src/typechain}/factories/Erc20__factory.js +0 -0
- package/dist/{typechain → src/typechain}/factories/GnosisSafe__factory.js +0 -0
- package/dist/{typechain → src/typechain}/factories/InteropBridgeToken__factory.js +23 -11
- package/dist/{typechain → src/typechain}/factories/InteropXGateway__factory.js +14 -14
- package/dist/{typechain → src/typechain}/factories/index.js +0 -0
- package/dist/{typechain → src/typechain}/index.js +0 -0
- package/dist/{types.js → src/types.js} +0 -0
- package/dist/{utils → src/utils}/index.js +62 -6
- package/package.json +12 -5
- package/patches/@ethersproject+properties+5.6.0.patch +13 -0
- package/src/abi/interopBridgeToken.json +21 -9
- package/src/abi/interopXGateway.json +11 -11
- package/src/api/index.ts +36 -0
- package/src/config/index.ts +11 -1
- package/src/constants/addresses.ts +1 -9
- package/src/constants/index.ts +1 -0
- package/src/constants/itokens.ts +10 -0
- package/src/db/models/transaction.ts +18 -4
- package/src/db/sequelize.ts +1 -1
- package/src/gnosis/actions/deposit.ts +63 -0
- package/src/gnosis/actions/index.ts +7 -0
- package/src/gnosis/actions/withdraw.ts +67 -0
- package/src/gnosis/index.ts +19 -0
- package/src/index.ts +99 -8
- package/src/net/peer/index.ts +9 -7
- package/src/net/pool/index.ts +41 -11
- package/src/net/protocol/dial/SignatureDialProtocol.ts +19 -13
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
- package/src/net/protocol/index.ts +67 -1
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +14 -4
- package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +249 -0
- package/src/tasks/InteropBridge/SyncBurnEvents.ts +119 -0
- package/src/tasks/InteropBridge/SyncMintEvents.ts +99 -0
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +260 -0
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +25 -15
- package/src/tasks/InteropXGateway/SyncWithdrawtEvents.ts +105 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
- package/src/tasks/index.ts +43 -2
- package/src/typechain/InteropBridgeToken.ts +23 -17
- package/src/typechain/InteropXGateway.ts +13 -13
- package/src/typechain/factories/InteropBridgeToken__factory.ts +23 -11
- package/src/typechain/factories/InteropXGateway__factory.ts +14 -14
- package/src/utils/index.ts +76 -7
- package/dist/index.js +0 -63
- package/dist/tasks/index.js +0 -27
@@ -29,11 +29,11 @@ import type {
|
|
29
29
|
export interface InteropXGatewayInterface extends utils.Interface {
|
30
30
|
functions: {
|
31
31
|
"_vnonce()": FunctionFragment;
|
32
|
-
"deposit(address,uint256,
|
33
|
-
"depositFor(address,address,uint256,
|
32
|
+
"deposit(address,uint256,uint32)": FunctionFragment;
|
33
|
+
"depositFor(address,address,uint256,uint32)": FunctionFragment;
|
34
34
|
"owner()": FunctionFragment;
|
35
35
|
"renounceOwnership()": FunctionFragment;
|
36
|
-
"systemWithdraw(uint256,address,address,
|
36
|
+
"systemWithdraw(uint256,address,address,uint32,bytes32)": FunctionFragment;
|
37
37
|
"transferOwnership(address)": FunctionFragment;
|
38
38
|
};
|
39
39
|
|
@@ -89,8 +89,8 @@ export interface InteropXGatewayInterface extends utils.Interface {
|
|
89
89
|
): Result;
|
90
90
|
|
91
91
|
events: {
|
92
|
-
"LogGatewayDeposit(address,address,uint256,uint256,
|
93
|
-
"LogGatewayWithdraw(address,address,uint256,
|
92
|
+
"LogGatewayDeposit(address,address,uint256,uint256,uint32,uint32)": EventFragment;
|
93
|
+
"LogGatewayWithdraw(address,address,uint256,uint32,uint32,bytes32)": EventFragment;
|
94
94
|
"OwnershipTransferred(address,address)": EventFragment;
|
95
95
|
};
|
96
96
|
|
@@ -104,11 +104,11 @@ export interface LogGatewayDepositEventObject {
|
|
104
104
|
token: string;
|
105
105
|
amount: BigNumber;
|
106
106
|
vnonce: BigNumber;
|
107
|
-
sourceChainId:
|
108
|
-
targetChainId:
|
107
|
+
sourceChainId: number;
|
108
|
+
targetChainId: number;
|
109
109
|
}
|
110
110
|
export type LogGatewayDepositEvent = TypedEvent<
|
111
|
-
[string, string, BigNumber, BigNumber,
|
111
|
+
[string, string, BigNumber, BigNumber, number, number],
|
112
112
|
LogGatewayDepositEventObject
|
113
113
|
>;
|
114
114
|
|
@@ -119,12 +119,12 @@ export interface LogGatewayWithdrawEventObject {
|
|
119
119
|
user: string;
|
120
120
|
token: string;
|
121
121
|
amount: BigNumber;
|
122
|
-
sourceChainId:
|
123
|
-
targetChainId:
|
122
|
+
sourceChainId: number;
|
123
|
+
targetChainId: number;
|
124
124
|
transactionHash: string;
|
125
125
|
}
|
126
126
|
export type LogGatewayWithdrawEvent = TypedEvent<
|
127
|
-
[string, string, BigNumber,
|
127
|
+
[string, string, BigNumber, number, number, string],
|
128
128
|
LogGatewayWithdrawEventObject
|
129
129
|
>;
|
130
130
|
|
@@ -283,7 +283,7 @@ export interface InteropXGateway extends BaseContract {
|
|
283
283
|
};
|
284
284
|
|
285
285
|
filters: {
|
286
|
-
"LogGatewayDeposit(address,address,uint256,uint256,
|
286
|
+
"LogGatewayDeposit(address,address,uint256,uint256,uint32,uint32)"(
|
287
287
|
user?: null,
|
288
288
|
token?: string | null,
|
289
289
|
amount?: null,
|
@@ -300,7 +300,7 @@ export interface InteropXGateway extends BaseContract {
|
|
300
300
|
targetChainId?: BigNumberish | null
|
301
301
|
): LogGatewayDepositEventFilter;
|
302
302
|
|
303
|
-
"LogGatewayWithdraw(address,address,uint256,
|
303
|
+
"LogGatewayWithdraw(address,address,uint256,uint32,uint32,bytes32)"(
|
304
304
|
user?: null,
|
305
305
|
token?: string | null,
|
306
306
|
amount?: null,
|
@@ -61,11 +61,17 @@ const _abi = [
|
|
61
61
|
name: "amount",
|
62
62
|
type: "uint256",
|
63
63
|
},
|
64
|
+
{
|
65
|
+
indexed: false,
|
66
|
+
internalType: "uint32",
|
67
|
+
name: "sourceChainId",
|
68
|
+
type: "uint32",
|
69
|
+
},
|
64
70
|
{
|
65
71
|
indexed: true,
|
66
|
-
internalType: "
|
67
|
-
name: "
|
68
|
-
type: "
|
72
|
+
internalType: "uint32",
|
73
|
+
name: "targetChainId",
|
74
|
+
type: "uint32",
|
69
75
|
},
|
70
76
|
],
|
71
77
|
name: "Burn",
|
@@ -88,14 +94,20 @@ const _abi = [
|
|
88
94
|
},
|
89
95
|
{
|
90
96
|
indexed: true,
|
91
|
-
internalType: "
|
92
|
-
name: "
|
93
|
-
type: "
|
97
|
+
internalType: "uint32",
|
98
|
+
name: "sourceChainId",
|
99
|
+
type: "uint32",
|
100
|
+
},
|
101
|
+
{
|
102
|
+
indexed: false,
|
103
|
+
internalType: "uint32",
|
104
|
+
name: "targetChainId",
|
105
|
+
type: "uint32",
|
94
106
|
},
|
95
107
|
{
|
96
108
|
indexed: true,
|
97
109
|
internalType: "bytes32",
|
98
|
-
name: "
|
110
|
+
name: "submitTransactionHash",
|
99
111
|
type: "bytes32",
|
100
112
|
},
|
101
113
|
],
|
@@ -226,9 +238,9 @@ const _abi = [
|
|
226
238
|
type: "uint256",
|
227
239
|
},
|
228
240
|
{
|
229
|
-
internalType: "
|
241
|
+
internalType: "uint32",
|
230
242
|
name: "chainId",
|
231
|
-
type: "
|
243
|
+
type: "uint32",
|
232
244
|
},
|
233
245
|
],
|
234
246
|
name: "burn",
|
@@ -310,9 +322,9 @@ const _abi = [
|
|
310
322
|
type: "uint256",
|
311
323
|
},
|
312
324
|
{
|
313
|
-
internalType: "
|
325
|
+
internalType: "uint32",
|
314
326
|
name: "chainId",
|
315
|
-
type: "
|
327
|
+
type: "uint32",
|
316
328
|
},
|
317
329
|
{
|
318
330
|
internalType: "bytes32",
|
@@ -50,15 +50,15 @@ const _abi = [
|
|
50
50
|
},
|
51
51
|
{
|
52
52
|
indexed: false,
|
53
|
-
internalType: "
|
53
|
+
internalType: "uint32",
|
54
54
|
name: "sourceChainId",
|
55
|
-
type: "
|
55
|
+
type: "uint32",
|
56
56
|
},
|
57
57
|
{
|
58
58
|
indexed: true,
|
59
|
-
internalType: "
|
59
|
+
internalType: "uint32",
|
60
60
|
name: "targetChainId",
|
61
|
-
type: "
|
61
|
+
type: "uint32",
|
62
62
|
},
|
63
63
|
],
|
64
64
|
name: "LogGatewayDeposit",
|
@@ -87,15 +87,15 @@ const _abi = [
|
|
87
87
|
},
|
88
88
|
{
|
89
89
|
indexed: true,
|
90
|
-
internalType: "
|
90
|
+
internalType: "uint32",
|
91
91
|
name: "sourceChainId",
|
92
|
-
type: "
|
92
|
+
type: "uint32",
|
93
93
|
},
|
94
94
|
{
|
95
95
|
indexed: false,
|
96
|
-
internalType: "
|
96
|
+
internalType: "uint32",
|
97
97
|
name: "targetChainId",
|
98
|
-
type: "
|
98
|
+
type: "uint32",
|
99
99
|
},
|
100
100
|
{
|
101
101
|
indexed: true,
|
@@ -152,9 +152,9 @@ const _abi = [
|
|
152
152
|
type: "uint256",
|
153
153
|
},
|
154
154
|
{
|
155
|
-
internalType: "
|
155
|
+
internalType: "uint32",
|
156
156
|
name: "chainId_",
|
157
|
-
type: "
|
157
|
+
type: "uint32",
|
158
158
|
},
|
159
159
|
],
|
160
160
|
name: "deposit",
|
@@ -180,9 +180,9 @@ const _abi = [
|
|
180
180
|
type: "uint256",
|
181
181
|
},
|
182
182
|
{
|
183
|
-
internalType: "
|
183
|
+
internalType: "uint32",
|
184
184
|
name: "chainId_",
|
185
|
-
type: "
|
185
|
+
type: "uint32",
|
186
186
|
},
|
187
187
|
],
|
188
188
|
name: "depositFor",
|
@@ -228,9 +228,9 @@ const _abi = [
|
|
228
228
|
type: "address",
|
229
229
|
},
|
230
230
|
{
|
231
|
-
internalType: "
|
231
|
+
internalType: "uint32",
|
232
232
|
name: "chainId_",
|
233
|
-
type: "
|
233
|
+
type: "uint32",
|
234
234
|
},
|
235
235
|
{
|
236
236
|
internalType: "bytes32",
|
package/src/utils/index.ts
CHANGED
@@ -6,12 +6,23 @@ import axiosRetry from "axios-retry";
|
|
6
6
|
import { addresses } from '@/constants';
|
7
7
|
import { ChainId } from '@/types'
|
8
8
|
import { ethers } from 'ethers';
|
9
|
-
|
10
9
|
export const http = axios.create();
|
11
10
|
|
12
11
|
axiosRetry(http, { retries: 3, retryDelay: axiosRetry.exponentialDelay });
|
13
12
|
|
14
13
|
|
14
|
+
export function shortenHash(hash: string, length: number = 4) {
|
15
|
+
if (!hash) return;
|
16
|
+
|
17
|
+
if (hash.length < 12) return hash;
|
18
|
+
|
19
|
+
const beginningChars = hash.startsWith("0x") ? length + 2 : length;
|
20
|
+
|
21
|
+
const shortened = hash.substr(0, beginningChars) + "…" + hash.substr(-length);
|
22
|
+
|
23
|
+
return shortened;
|
24
|
+
}
|
25
|
+
|
15
26
|
export function short(buffer: Buffer): string {
|
16
27
|
return buffer.toString('hex').slice(0, 8) + '...'
|
17
28
|
}
|
@@ -71,11 +82,11 @@ export const signGnosisSafeTx = async ({
|
|
71
82
|
export const getRpcProviderUrl = (chainId: ChainId) => {
|
72
83
|
switch (chainId) {
|
73
84
|
case 1:
|
74
|
-
return 'https://rpc.
|
85
|
+
return 'https://rpc.ankr.com/eth';
|
75
86
|
case 137:
|
76
|
-
return 'https://rpc.
|
87
|
+
return 'https://rpc.ankr.com/polygon';
|
77
88
|
case 43114:
|
78
|
-
return 'https://rpc.
|
89
|
+
return 'https://rpc.ankr.com/avalanche';
|
79
90
|
default:
|
80
91
|
throw new Error(`Unknown chainId: ${chainId}`);
|
81
92
|
}
|
@@ -119,11 +130,69 @@ export const asyncCallWithTimeout = async <T>(asyncPromise: Promise<T>, timeout:
|
|
119
130
|
}
|
120
131
|
|
121
132
|
|
122
|
-
export const generateInteropTransactionHash = (data: {
|
133
|
+
export const generateInteropTransactionHash = (data: { action: string, submitTransactionHash: string, sourceChainId: string | number, targetChainId: string | number }) => {
|
123
134
|
return ethers.utils.solidityKeccak256(['string', 'string', 'string', 'string'], [
|
124
|
-
String(data.
|
125
|
-
String(data.
|
135
|
+
String(data.action),
|
136
|
+
String(data.submitTransactionHash),
|
126
137
|
String(data.sourceChainId),
|
127
138
|
String(data.targetChainId),
|
128
139
|
]);
|
140
|
+
}
|
141
|
+
|
142
|
+
export function getContract<TContract extends ethers.Contract>(address: string, contractInterface: ethers.ContractInterface | any, signerOrProvider?: ethers.Signer | ethers.providers.Provider) {
|
143
|
+
if (!ethers.utils.getAddress(address) || address === ethers.constants.AddressZero) {
|
144
|
+
throw Error(`Invalid 'address' parameter '${address}'.`)
|
145
|
+
}
|
146
|
+
|
147
|
+
const contract = new ethers.Contract(
|
148
|
+
address,
|
149
|
+
contractInterface,
|
150
|
+
signerOrProvider
|
151
|
+
) as TContract
|
152
|
+
|
153
|
+
// Make sure the contract properties is writable
|
154
|
+
const desc = Object.getOwnPropertyDescriptor(contract, 'functions');
|
155
|
+
|
156
|
+
if (!desc || desc.writable !== true) {
|
157
|
+
return contract
|
158
|
+
}
|
159
|
+
|
160
|
+
return new Proxy(contract, {
|
161
|
+
get(target, prop, receiver) {
|
162
|
+
const value = Reflect.get(target, prop, receiver);
|
163
|
+
|
164
|
+
if (typeof value === 'function' && (contract.functions.hasOwnProperty(prop) || ['queryFilter'].includes(String(prop)))) {
|
165
|
+
return async (...args: any[]) => {
|
166
|
+
try {
|
167
|
+
return await value.bind(contract)(...args);
|
168
|
+
} catch (error) {
|
169
|
+
throw new Error(`Error calling "${String(prop)}" on "${address}": ${error.reason || error.message}`)
|
170
|
+
}
|
171
|
+
}
|
172
|
+
}
|
173
|
+
|
174
|
+
|
175
|
+
if (typeof value === 'object' && ['populateTransaction', 'estimateGas', 'functions', 'callStatic'].includes(String(prop))) {
|
176
|
+
const parentProp = String(prop);
|
177
|
+
|
178
|
+
return new Proxy(value, {
|
179
|
+
get(target, prop, receiver) {
|
180
|
+
const value = Reflect.get(target, prop, receiver);
|
181
|
+
|
182
|
+
if (typeof value === 'function') {
|
183
|
+
return async (...args: any[]) => {
|
184
|
+
try {
|
185
|
+
return await value.bind(contract)(...args);
|
186
|
+
} catch (error) {
|
187
|
+
throw new Error(`Error calling "${String(prop)}" using "${parentProp}" on "${address}": ${error.reason || error.message}`)
|
188
|
+
}
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
})
|
193
|
+
}
|
194
|
+
|
195
|
+
return value;
|
196
|
+
},
|
197
|
+
});
|
129
198
|
}
|
package/dist/index.js
DELETED
@@ -1,63 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
const module_alias_1 = __importDefault(require("module-alias"));
|
7
|
-
module_alias_1.default.addAliases({
|
8
|
-
"@/": __dirname + "/",
|
9
|
-
"@/logger": __dirname + "/logger",
|
10
|
-
"@/tasks": __dirname + "/tasks",
|
11
|
-
"@/utils": __dirname + "/utils",
|
12
|
-
"@/net": __dirname + "/net",
|
13
|
-
"@/db": __dirname + "/db",
|
14
|
-
"@/config": __dirname + "/config",
|
15
|
-
"@/types": __dirname + "/types",
|
16
|
-
"@/abi": __dirname + "/abi",
|
17
|
-
"@/constants": __dirname + "/constants",
|
18
|
-
"@/typechain": __dirname + "/typechain"
|
19
|
-
});
|
20
|
-
(0, module_alias_1.default)();
|
21
|
-
const assert_1 = __importDefault(require("assert"));
|
22
|
-
const dotenv_1 = __importDefault(require("dotenv"));
|
23
|
-
const ethers_1 = require("ethers");
|
24
|
-
dotenv_1.default.config();
|
25
|
-
const logger_1 = __importDefault(require("@/logger"));
|
26
|
-
const logger = new logger_1.default('Process');
|
27
|
-
if (process.argv.at(-1) === 'help') {
|
28
|
-
console.log('Usage:');
|
29
|
-
console.log(' PRIVATE_KEY=abcd1234 interop-x');
|
30
|
-
console.log(' PRIVATE_KEY=abcd1234 STAGING=true interop-x');
|
31
|
-
process.exit(0);
|
32
|
-
}
|
33
|
-
(0, assert_1.default)(process.env.PRIVATE_KEY, "PRIVATE_KEY is not defined");
|
34
|
-
try {
|
35
|
-
new ethers_1.ethers.Wallet(process.env.PRIVATE_KEY);
|
36
|
-
}
|
37
|
-
catch (e) {
|
38
|
-
logger.error('Invalid private key');
|
39
|
-
process.exit(1);
|
40
|
-
}
|
41
|
-
const tasks_1 = require("@/tasks");
|
42
|
-
const net_1 = require("@/net");
|
43
|
-
async function main() {
|
44
|
-
(0, net_1.startPeer)({});
|
45
|
-
const tasks = new tasks_1.Tasks();
|
46
|
-
tasks.start();
|
47
|
-
}
|
48
|
-
main()
|
49
|
-
.then(() => {
|
50
|
-
}).catch(err => {
|
51
|
-
console.error(err);
|
52
|
-
});
|
53
|
-
process.on('SIGINT', () => {
|
54
|
-
logger.debug('received SIGINT signal. exiting.');
|
55
|
-
process.exit(0);
|
56
|
-
});
|
57
|
-
process.on('SIGTERM', () => {
|
58
|
-
logger.debug('received SIGTERM signal. exiting.');
|
59
|
-
process.exit(0);
|
60
|
-
});
|
61
|
-
process.on('unhandledRejection', (reason, p) => {
|
62
|
-
logger.error('unhandled rejection: promise:', p, 'reason:', reason);
|
63
|
-
});
|
package/dist/tasks/index.js
DELETED
@@ -1,27 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
-
};
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
6
|
-
exports.Tasks = void 0;
|
7
|
-
const SyncDepositEvents_1 = __importDefault(require("./InteropXGateway/SyncDepositEvents"));
|
8
|
-
class Tasks {
|
9
|
-
constructor() {
|
10
|
-
this.tasks = [
|
11
|
-
new SyncDepositEvents_1.default({
|
12
|
-
chainId: 43114
|
13
|
-
})
|
14
|
-
];
|
15
|
-
}
|
16
|
-
async start() {
|
17
|
-
for (const task of this.tasks) {
|
18
|
-
try {
|
19
|
-
task.start();
|
20
|
-
}
|
21
|
-
catch (error) {
|
22
|
-
console.error(`Error starting task: ${task.constructor.name}`);
|
23
|
-
}
|
24
|
-
}
|
25
|
-
}
|
26
|
-
}
|
27
|
-
exports.Tasks = Tasks;
|