@instadapp/interop-x 0.0.0-dev.ef78459 → 0.0.0-dev.f0a6281
Sign up to get free protection for your applications and to get access to all the features.
- package/.env.example +2 -1
- package/bin/interop-x +1 -1
- package/dist/package.json +73 -0
- package/dist/src/abi/erc20.json +350 -0
- package/dist/src/abi/gnosisSafe.json +747 -0
- package/dist/src/abi/index.js +15 -0
- package/dist/src/abi/interopBridgeToken.json +298 -0
- package/dist/src/abi/interopXGateway.json +184 -0
- package/dist/src/api/index.js +33 -0
- package/dist/src/config/index.js +31 -0
- package/dist/src/constants/addresses.js +20 -0
- package/dist/{constants → src/constants}/index.js +2 -0
- package/dist/src/constants/itokens.js +13 -0
- package/dist/src/constants/tokens.js +107 -0
- package/dist/{db → src/db}/index.js +0 -0
- package/dist/{db → src/db}/models/index.js +1 -1
- package/dist/src/db/models/transaction.js +54 -0
- package/dist/{db → src/db}/sequelize.js +2 -1
- package/dist/src/index.js +130 -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 +20 -12
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +28 -0
- package/dist/{net → src/net}/protocol/index.js +44 -4
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/{tasks → src/tasks}/BaseTask.js +13 -5
- package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +146 -0
- package/dist/src/tasks/InteropBridge/SyncWithdrawEvents.js +71 -0
- package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +161 -0
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +74 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +53 -0
- package/dist/src/tasks/index.js +44 -0
- package/dist/src/typechain/Erc20.js +2 -0
- package/dist/src/typechain/GnosisSafe.js +2 -0
- package/dist/src/typechain/InteropBridgeToken.js +2 -0
- package/dist/src/typechain/InteropXGateway.js +2 -0
- package/dist/src/typechain/common.js +2 -0
- package/dist/src/typechain/factories/Erc20__factory.js +367 -0
- package/dist/src/typechain/factories/GnosisSafe__factory.js +1174 -0
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +471 -0
- package/dist/src/typechain/factories/InteropXGateway__factory.js +265 -0
- package/dist/src/typechain/factories/index.js +14 -0
- package/dist/src/typechain/index.js +35 -0
- package/dist/{types.js → src/types.js} +0 -0
- package/dist/src/utils/index.js +238 -0
- package/package.json +18 -10
- package/patches/@ethersproject+properties+5.6.0.patch +13 -0
- package/src/abi/erc20.json +350 -0
- package/src/abi/gnosisSafe.json +747 -0
- package/src/abi/index.ts +11 -0
- package/src/abi/interopBridgeToken.json +298 -0
- package/src/abi/interopXGateway.json +184 -0
- package/src/api/index.ts +33 -0
- package/src/config/index.ts +17 -1
- package/src/constants/addresses.ts +9 -2
- package/src/constants/index.ts +2 -0
- package/src/constants/itokens.ts +10 -0
- package/src/constants/tokens.ts +104 -0
- package/src/db/models/index.ts +1 -1
- package/src/db/models/transaction.ts +96 -0
- package/src/db/sequelize.ts +2 -1
- package/src/index.ts +119 -7
- package/src/net/peer/index.ts +9 -7
- package/src/net/pool/index.ts +41 -11
- package/src/net/protocol/dial/SignatureDialProtocol.ts +24 -15
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +31 -0
- package/src/net/protocol/index.ts +60 -4
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +15 -6
- package/src/tasks/InteropBridge/ProcessWithdrawEvents.ts +231 -0
- package/src/tasks/InteropBridge/SyncWithdrawEvents.ts +121 -0
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +256 -0
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +124 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +65 -0
- package/src/tasks/index.ts +26 -1
- package/src/typechain/Erc20.ts +491 -0
- package/src/typechain/GnosisSafe.ts +1728 -0
- package/src/typechain/InteropBridgeToken.ts +692 -0
- package/src/typechain/InteropXGateway.ts +407 -0
- package/src/typechain/common.ts +44 -0
- package/src/typechain/factories/Erc20__factory.ts +368 -0
- package/src/typechain/factories/GnosisSafe__factory.ts +1178 -0
- package/src/typechain/factories/InteropBridgeToken__factory.ts +478 -0
- package/src/typechain/factories/InteropXGateway__factory.ts +272 -0
- package/src/typechain/factories/index.ts +7 -0
- package/src/typechain/index.ts +12 -0
- package/src/types.ts +1 -1
- package/src/utils/index.ts +206 -3
- package/dist/config/index.js +0 -17
- package/dist/constants/addresses.js +0 -13
- package/dist/db/models/execution.js +0 -38
- package/dist/index.js +0 -43
- package/dist/tasks/index.js +0 -19
- package/dist/utils/index.js +0 -89
- package/src/db/models/execution.ts +0 -57
package/.env.example
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
PRIVATE_KEY=
|
1
|
+
PRIVATE_KEY=
|
2
|
+
STAGING=
|
package/bin/interop-x
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
require('../dist/index')
|
2
|
+
require('../dist/src/index')
|
@@ -0,0 +1,73 @@
|
|
1
|
+
{
|
2
|
+
"name": "@instadapp/interop-x",
|
3
|
+
"version": "0.0.0-dev.f0a6281",
|
4
|
+
"license": "MIT",
|
5
|
+
"main": "dist/index.js",
|
6
|
+
"engines": {
|
7
|
+
"node": ">=16",
|
8
|
+
"yarn": "^1.22.0"
|
9
|
+
},
|
10
|
+
"scripts": {
|
11
|
+
"start": "yarn build && node bin/interop-x",
|
12
|
+
"build": "yarn generate-abi-types && export GIT_REF=$(git rev-parse --short HEAD) && rimraf ./dist && tsc -p tsconfig.json && replace-in-file '@GIT_SHORT_HASH@' $GIT_REF ./dist/**/*.js",
|
13
|
+
"dev": "yarn generate-abi-types && NODE_ENV=development nodemon",
|
14
|
+
"generate-abi-types": "typechain --target=ethers-v5 'src/abi/*.json' --out-dir 'src/typechain'",
|
15
|
+
"prepublishOnly": "yarn build",
|
16
|
+
"postinstall": "patch-package"
|
17
|
+
},
|
18
|
+
"nodemonConfig": {
|
19
|
+
"watch": [
|
20
|
+
"src"
|
21
|
+
],
|
22
|
+
"ext": "ts",
|
23
|
+
"exec": "./node_modules/.bin/ts-node --files -r tsconfig-paths/register ./src/index.ts"
|
24
|
+
},
|
25
|
+
"dependencies": {
|
26
|
+
"@achingbrain/libp2p-gossipsub": "^0.12.2",
|
27
|
+
"@fastify/cors": "^7.0.0",
|
28
|
+
"await-spawn": "^4.0.2",
|
29
|
+
"axios": "^0.27.1",
|
30
|
+
"axios-retry": "^3.2.4",
|
31
|
+
"chalk": "4.1.2",
|
32
|
+
"dotenv": "^16.0.0",
|
33
|
+
"ethereumjs-util": "^7.1.4",
|
34
|
+
"ethers": "^5.6.4",
|
35
|
+
"ethers-multisend": "^2.1.1",
|
36
|
+
"expand-home-dir": "^0.0.3",
|
37
|
+
"fastify": "^3.28.0",
|
38
|
+
"fs-extra": "^10.1.0",
|
39
|
+
"libp2p": "^0.36.2",
|
40
|
+
"libp2p-bootstrap": "^0.14.0",
|
41
|
+
"libp2p-kad-dht": "^0.28.6",
|
42
|
+
"libp2p-mdns": "^0.18.0",
|
43
|
+
"libp2p-mplex": "^0.10.7",
|
44
|
+
"libp2p-noise": "^4.0.0",
|
45
|
+
"libp2p-pubsub-peer-discovery": "^4.0.0",
|
46
|
+
"libp2p-tcp": "^0.17.2",
|
47
|
+
"libp2p-websockets": "^0.16.2",
|
48
|
+
"luxon": "^2.3.2",
|
49
|
+
"module-alias": "^2.2.2",
|
50
|
+
"patch-package": "^6.4.7",
|
51
|
+
"postinstall-postinstall": "^2.1.0",
|
52
|
+
"sequelize": "6.18.0",
|
53
|
+
"sqlite3": "^5.0.5",
|
54
|
+
"waait": "^1.0.5"
|
55
|
+
},
|
56
|
+
"bin": {
|
57
|
+
"interop-x": "bin/interop-x",
|
58
|
+
"interopx": "bin/interop-x"
|
59
|
+
},
|
60
|
+
"devDependencies": {
|
61
|
+
"@typechain/ethers-v5": "^10.0.0",
|
62
|
+
"@types/bn.js": "^5.1.0",
|
63
|
+
"@types/fs-extra": "^9.0.13",
|
64
|
+
"@types/node": "^17.0.17",
|
65
|
+
"nodemon": "^2.0.15",
|
66
|
+
"replace-in-file": "^6.3.2",
|
67
|
+
"rimraf": "^3.0.2",
|
68
|
+
"ts-node": "^10.5.0",
|
69
|
+
"tsconfig-paths": "^3.12.0",
|
70
|
+
"typechain": "^8.0.0",
|
71
|
+
"typescript": "^4.5.5"
|
72
|
+
}
|
73
|
+
}
|
@@ -0,0 +1,350 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"inputs": [
|
4
|
+
{
|
5
|
+
"internalType": "uint256",
|
6
|
+
"name": "_totalSupply",
|
7
|
+
"type": "uint256"
|
8
|
+
}
|
9
|
+
],
|
10
|
+
"payable": false,
|
11
|
+
"stateMutability": "nonpayable",
|
12
|
+
"type": "constructor"
|
13
|
+
},
|
14
|
+
{
|
15
|
+
"anonymous": false,
|
16
|
+
"inputs": [
|
17
|
+
{
|
18
|
+
"indexed": true,
|
19
|
+
"internalType": "address",
|
20
|
+
"name": "owner",
|
21
|
+
"type": "address"
|
22
|
+
},
|
23
|
+
{
|
24
|
+
"indexed": true,
|
25
|
+
"internalType": "address",
|
26
|
+
"name": "spender",
|
27
|
+
"type": "address"
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"indexed": false,
|
31
|
+
"internalType": "uint256",
|
32
|
+
"name": "value",
|
33
|
+
"type": "uint256"
|
34
|
+
}
|
35
|
+
],
|
36
|
+
"name": "Approval",
|
37
|
+
"type": "event"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"anonymous": false,
|
41
|
+
"inputs": [
|
42
|
+
{
|
43
|
+
"indexed": true,
|
44
|
+
"internalType": "address",
|
45
|
+
"name": "from",
|
46
|
+
"type": "address"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"indexed": true,
|
50
|
+
"internalType": "address",
|
51
|
+
"name": "to",
|
52
|
+
"type": "address"
|
53
|
+
},
|
54
|
+
{
|
55
|
+
"indexed": false,
|
56
|
+
"internalType": "uint256",
|
57
|
+
"name": "value",
|
58
|
+
"type": "uint256"
|
59
|
+
}
|
60
|
+
],
|
61
|
+
"name": "Transfer",
|
62
|
+
"type": "event"
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"constant": true,
|
66
|
+
"inputs": [],
|
67
|
+
"name": "DOMAIN_SEPARATOR",
|
68
|
+
"outputs": [
|
69
|
+
{
|
70
|
+
"internalType": "bytes32",
|
71
|
+
"name": "",
|
72
|
+
"type": "bytes32"
|
73
|
+
}
|
74
|
+
],
|
75
|
+
"payable": false,
|
76
|
+
"stateMutability": "view",
|
77
|
+
"type": "function"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"constant": true,
|
81
|
+
"inputs": [],
|
82
|
+
"name": "PERMIT_TYPEHASH",
|
83
|
+
"outputs": [
|
84
|
+
{
|
85
|
+
"internalType": "bytes32",
|
86
|
+
"name": "",
|
87
|
+
"type": "bytes32"
|
88
|
+
}
|
89
|
+
],
|
90
|
+
"payable": false,
|
91
|
+
"stateMutability": "view",
|
92
|
+
"type": "function"
|
93
|
+
},
|
94
|
+
{
|
95
|
+
"constant": true,
|
96
|
+
"inputs": [
|
97
|
+
{
|
98
|
+
"internalType": "address",
|
99
|
+
"name": "",
|
100
|
+
"type": "address"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"internalType": "address",
|
104
|
+
"name": "",
|
105
|
+
"type": "address"
|
106
|
+
}
|
107
|
+
],
|
108
|
+
"name": "allowance",
|
109
|
+
"outputs": [
|
110
|
+
{
|
111
|
+
"internalType": "uint256",
|
112
|
+
"name": "",
|
113
|
+
"type": "uint256"
|
114
|
+
}
|
115
|
+
],
|
116
|
+
"payable": false,
|
117
|
+
"stateMutability": "view",
|
118
|
+
"type": "function"
|
119
|
+
},
|
120
|
+
{
|
121
|
+
"constant": false,
|
122
|
+
"inputs": [
|
123
|
+
{
|
124
|
+
"internalType": "address",
|
125
|
+
"name": "spender",
|
126
|
+
"type": "address"
|
127
|
+
},
|
128
|
+
{
|
129
|
+
"internalType": "uint256",
|
130
|
+
"name": "value",
|
131
|
+
"type": "uint256"
|
132
|
+
}
|
133
|
+
],
|
134
|
+
"name": "approve",
|
135
|
+
"outputs": [
|
136
|
+
{
|
137
|
+
"internalType": "bool",
|
138
|
+
"name": "",
|
139
|
+
"type": "bool"
|
140
|
+
}
|
141
|
+
],
|
142
|
+
"payable": false,
|
143
|
+
"stateMutability": "nonpayable",
|
144
|
+
"type": "function"
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"constant": true,
|
148
|
+
"inputs": [
|
149
|
+
{
|
150
|
+
"internalType": "address",
|
151
|
+
"name": "",
|
152
|
+
"type": "address"
|
153
|
+
}
|
154
|
+
],
|
155
|
+
"name": "balanceOf",
|
156
|
+
"outputs": [
|
157
|
+
{
|
158
|
+
"internalType": "uint256",
|
159
|
+
"name": "",
|
160
|
+
"type": "uint256"
|
161
|
+
}
|
162
|
+
],
|
163
|
+
"payable": false,
|
164
|
+
"stateMutability": "view",
|
165
|
+
"type": "function"
|
166
|
+
},
|
167
|
+
{
|
168
|
+
"constant": true,
|
169
|
+
"inputs": [],
|
170
|
+
"name": "decimals",
|
171
|
+
"outputs": [
|
172
|
+
{
|
173
|
+
"internalType": "uint8",
|
174
|
+
"name": "",
|
175
|
+
"type": "uint8"
|
176
|
+
}
|
177
|
+
],
|
178
|
+
"payable": false,
|
179
|
+
"stateMutability": "view",
|
180
|
+
"type": "function"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"constant": true,
|
184
|
+
"inputs": [],
|
185
|
+
"name": "name",
|
186
|
+
"outputs": [
|
187
|
+
{
|
188
|
+
"internalType": "string",
|
189
|
+
"name": "",
|
190
|
+
"type": "string"
|
191
|
+
}
|
192
|
+
],
|
193
|
+
"payable": false,
|
194
|
+
"stateMutability": "view",
|
195
|
+
"type": "function"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"constant": true,
|
199
|
+
"inputs": [
|
200
|
+
{
|
201
|
+
"internalType": "address",
|
202
|
+
"name": "",
|
203
|
+
"type": "address"
|
204
|
+
}
|
205
|
+
],
|
206
|
+
"name": "nonces",
|
207
|
+
"outputs": [
|
208
|
+
{
|
209
|
+
"internalType": "uint256",
|
210
|
+
"name": "",
|
211
|
+
"type": "uint256"
|
212
|
+
}
|
213
|
+
],
|
214
|
+
"payable": false,
|
215
|
+
"stateMutability": "view",
|
216
|
+
"type": "function"
|
217
|
+
},
|
218
|
+
{
|
219
|
+
"constant": false,
|
220
|
+
"inputs": [
|
221
|
+
{
|
222
|
+
"internalType": "address",
|
223
|
+
"name": "owner",
|
224
|
+
"type": "address"
|
225
|
+
},
|
226
|
+
{
|
227
|
+
"internalType": "address",
|
228
|
+
"name": "spender",
|
229
|
+
"type": "address"
|
230
|
+
},
|
231
|
+
{
|
232
|
+
"internalType": "uint256",
|
233
|
+
"name": "value",
|
234
|
+
"type": "uint256"
|
235
|
+
},
|
236
|
+
{
|
237
|
+
"internalType": "uint256",
|
238
|
+
"name": "deadline",
|
239
|
+
"type": "uint256"
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"internalType": "uint8",
|
243
|
+
"name": "v",
|
244
|
+
"type": "uint8"
|
245
|
+
},
|
246
|
+
{
|
247
|
+
"internalType": "bytes32",
|
248
|
+
"name": "r",
|
249
|
+
"type": "bytes32"
|
250
|
+
},
|
251
|
+
{
|
252
|
+
"internalType": "bytes32",
|
253
|
+
"name": "s",
|
254
|
+
"type": "bytes32"
|
255
|
+
}
|
256
|
+
],
|
257
|
+
"name": "permit",
|
258
|
+
"outputs": [],
|
259
|
+
"payable": false,
|
260
|
+
"stateMutability": "nonpayable",
|
261
|
+
"type": "function"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"constant": true,
|
265
|
+
"inputs": [],
|
266
|
+
"name": "symbol",
|
267
|
+
"outputs": [
|
268
|
+
{
|
269
|
+
"internalType": "string",
|
270
|
+
"name": "",
|
271
|
+
"type": "string"
|
272
|
+
}
|
273
|
+
],
|
274
|
+
"payable": false,
|
275
|
+
"stateMutability": "view",
|
276
|
+
"type": "function"
|
277
|
+
},
|
278
|
+
{
|
279
|
+
"constant": true,
|
280
|
+
"inputs": [],
|
281
|
+
"name": "totalSupply",
|
282
|
+
"outputs": [
|
283
|
+
{
|
284
|
+
"internalType": "uint256",
|
285
|
+
"name": "",
|
286
|
+
"type": "uint256"
|
287
|
+
}
|
288
|
+
],
|
289
|
+
"payable": false,
|
290
|
+
"stateMutability": "view",
|
291
|
+
"type": "function"
|
292
|
+
},
|
293
|
+
{
|
294
|
+
"constant": false,
|
295
|
+
"inputs": [
|
296
|
+
{
|
297
|
+
"internalType": "address",
|
298
|
+
"name": "to",
|
299
|
+
"type": "address"
|
300
|
+
},
|
301
|
+
{
|
302
|
+
"internalType": "uint256",
|
303
|
+
"name": "value",
|
304
|
+
"type": "uint256"
|
305
|
+
}
|
306
|
+
],
|
307
|
+
"name": "transfer",
|
308
|
+
"outputs": [
|
309
|
+
{
|
310
|
+
"internalType": "bool",
|
311
|
+
"name": "",
|
312
|
+
"type": "bool"
|
313
|
+
}
|
314
|
+
],
|
315
|
+
"payable": false,
|
316
|
+
"stateMutability": "nonpayable",
|
317
|
+
"type": "function"
|
318
|
+
},
|
319
|
+
{
|
320
|
+
"constant": false,
|
321
|
+
"inputs": [
|
322
|
+
{
|
323
|
+
"internalType": "address",
|
324
|
+
"name": "from",
|
325
|
+
"type": "address"
|
326
|
+
},
|
327
|
+
{
|
328
|
+
"internalType": "address",
|
329
|
+
"name": "to",
|
330
|
+
"type": "address"
|
331
|
+
},
|
332
|
+
{
|
333
|
+
"internalType": "uint256",
|
334
|
+
"name": "value",
|
335
|
+
"type": "uint256"
|
336
|
+
}
|
337
|
+
],
|
338
|
+
"name": "transferFrom",
|
339
|
+
"outputs": [
|
340
|
+
{
|
341
|
+
"internalType": "bool",
|
342
|
+
"name": "",
|
343
|
+
"type": "bool"
|
344
|
+
}
|
345
|
+
],
|
346
|
+
"payable": false,
|
347
|
+
"stateMutability": "nonpayable",
|
348
|
+
"type": "function"
|
349
|
+
}
|
350
|
+
]
|