@instadapp/interop-x 0.0.0-dev.9387bd9 → 0.0.0-dev.9b26e43
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/.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 +13 -0
- package/dist/src/abi/interopXContract.json +391 -0
- package/dist/src/alias.js +10 -0
- package/dist/src/api/index.js +36 -0
- package/dist/src/config/index.js +31 -0
- package/dist/src/constants/addresses.js +20 -0
- package/dist/{constants → src/constants}/index.js +1 -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 +72 -0
- package/dist/{db → src/db}/sequelize.js +2 -1
- package/dist/src/gnosis/actions/index.js +9 -0
- package/dist/src/gnosis/actions/withdraw/index.js +41 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +119 -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 +13 -8
- package/dist/{net → src/net}/pool/index.js +34 -11
- package/dist/{net → src/net}/protocol/dial/BaseDialProtocol.js +1 -1
- package/dist/{net → src/net}/protocol/dial/SignatureDialProtocol.js +21 -14
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
- package/dist/{net → src/net}/protocol/index.js +54 -4
- package/dist/src/tasks/AutoUpdateTask.js +70 -0
- package/dist/{tasks → src/tasks}/BaseTask.js +14 -6
- package/dist/src/tasks/InteropXContract/ProcessBridgeRequestEvents.js +147 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +80 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
- package/dist/src/tasks/index.js +38 -0
- package/dist/src/typechain/Erc20.js +2 -0
- package/dist/src/typechain/GnosisSafe.js +2 -0
- package/dist/src/typechain/InteropXContract.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/InteropXContract__factory.js +526 -0
- package/dist/src/typechain/factories/index.js +12 -0
- package/dist/src/typechain/index.js +33 -0
- package/dist/{types.js → src/types.js} +0 -0
- package/dist/src/utils/index.js +168 -0
- package/package.json +21 -7
- 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 +9 -0
- package/src/abi/interopXContract.json +391 -0
- package/src/alias.ts +6 -0
- package/src/api/index.ts +36 -0
- package/src/config/index.ts +18 -2
- package/src/constants/addresses.ts +9 -2
- package/src/constants/index.ts +1 -0
- package/src/constants/tokens.ts +104 -0
- package/src/db/index.ts +1 -1
- package/src/db/models/index.ts +1 -1
- package/src/db/models/transaction.ts +141 -0
- package/src/db/sequelize.ts +2 -1
- package/src/gnosis/actions/index.ts +5 -0
- package/src/gnosis/actions/withdraw/index.ts +56 -0
- package/src/gnosis/index.ts +19 -0
- package/src/index.ts +109 -7
- package/src/net/peer/index.ts +12 -10
- package/src/net/pool/index.ts +43 -13
- package/src/net/protocol/dial/BaseDialProtocol.ts +1 -1
- package/src/net/protocol/dial/SignatureDialProtocol.ts +24 -17
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
- package/src/net/protocol/index.ts +70 -4
- package/src/tasks/AutoUpdateTask.ts +82 -0
- package/src/tasks/BaseTask.ts +16 -7
- package/src/tasks/InteropXContract/ProcessBridgeRequestEvents.ts +211 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +116 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +112 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
- package/src/tasks/index.ts +24 -2
- package/src/typechain/Erc20.ts +491 -0
- package/src/typechain/GnosisSafe.ts +1728 -0
- package/src/typechain/InteropXContract.ts +524 -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/InteropXContract__factory.ts +533 -0
- package/src/typechain/factories/index.ts +6 -0
- package/src/typechain/index.ts +10 -0
- package/src/types.ts +2 -2
- package/src/utils/index.ts +129 -5
- package/tsconfig.json +8 -0
- 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 -42
- package/dist/tasks/index.js +0 -19
- package/dist/utils/index.js +0 -89
- package/src/db/models/execution.ts +0 -57
package/src/abi/index.ts
ADDED
@@ -0,0 +1,391 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"anonymous": false,
|
4
|
+
"inputs": [
|
5
|
+
{
|
6
|
+
"indexed": true,
|
7
|
+
"internalType": "address",
|
8
|
+
"name": "bridger",
|
9
|
+
"type": "address"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"components": [
|
13
|
+
{
|
14
|
+
"components": [
|
15
|
+
{
|
16
|
+
"internalType": "address",
|
17
|
+
"name": "sourceToken",
|
18
|
+
"type": "address"
|
19
|
+
},
|
20
|
+
{
|
21
|
+
"internalType": "address",
|
22
|
+
"name": "targetToken",
|
23
|
+
"type": "address"
|
24
|
+
},
|
25
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
26
|
+
],
|
27
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
28
|
+
"name": "supply",
|
29
|
+
"type": "tuple[]"
|
30
|
+
},
|
31
|
+
{
|
32
|
+
"components": [
|
33
|
+
{
|
34
|
+
"internalType": "address",
|
35
|
+
"name": "sourceToken",
|
36
|
+
"type": "address"
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"internalType": "address",
|
40
|
+
"name": "targetToken",
|
41
|
+
"type": "address"
|
42
|
+
},
|
43
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
44
|
+
],
|
45
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
46
|
+
"name": "withdraw",
|
47
|
+
"type": "tuple[]"
|
48
|
+
}
|
49
|
+
],
|
50
|
+
"indexed": false,
|
51
|
+
"internalType": "struct InteropXContractBeta.Position",
|
52
|
+
"name": "position",
|
53
|
+
"type": "tuple"
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"indexed": true,
|
57
|
+
"internalType": "uint32",
|
58
|
+
"name": "sourceChainId",
|
59
|
+
"type": "uint32"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"indexed": false,
|
63
|
+
"internalType": "uint32",
|
64
|
+
"name": "targetChainId",
|
65
|
+
"type": "uint32"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"indexed": true,
|
69
|
+
"internalType": "bytes32",
|
70
|
+
"name": "requestTransactionHash",
|
71
|
+
"type": "bytes32"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"indexed": false,
|
75
|
+
"internalType": "bytes",
|
76
|
+
"name": "metadata",
|
77
|
+
"type": "bytes"
|
78
|
+
}
|
79
|
+
],
|
80
|
+
"name": "LogBridgeCommitted",
|
81
|
+
"type": "event"
|
82
|
+
},
|
83
|
+
{
|
84
|
+
"anonymous": false,
|
85
|
+
"inputs": [
|
86
|
+
{
|
87
|
+
"indexed": true,
|
88
|
+
"internalType": "address",
|
89
|
+
"name": "bridger",
|
90
|
+
"type": "address"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"components": [
|
94
|
+
{
|
95
|
+
"components": [
|
96
|
+
{
|
97
|
+
"internalType": "address",
|
98
|
+
"name": "sourceToken",
|
99
|
+
"type": "address"
|
100
|
+
},
|
101
|
+
{
|
102
|
+
"internalType": "address",
|
103
|
+
"name": "targetToken",
|
104
|
+
"type": "address"
|
105
|
+
},
|
106
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
107
|
+
],
|
108
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
109
|
+
"name": "supply",
|
110
|
+
"type": "tuple[]"
|
111
|
+
},
|
112
|
+
{
|
113
|
+
"components": [
|
114
|
+
{
|
115
|
+
"internalType": "address",
|
116
|
+
"name": "sourceToken",
|
117
|
+
"type": "address"
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"internalType": "address",
|
121
|
+
"name": "targetToken",
|
122
|
+
"type": "address"
|
123
|
+
},
|
124
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
125
|
+
],
|
126
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
127
|
+
"name": "withdraw",
|
128
|
+
"type": "tuple[]"
|
129
|
+
}
|
130
|
+
],
|
131
|
+
"indexed": false,
|
132
|
+
"internalType": "struct InteropXContractBeta.Position",
|
133
|
+
"name": "position",
|
134
|
+
"type": "tuple"
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"indexed": false,
|
138
|
+
"internalType": "uint256",
|
139
|
+
"name": "sourceChainId",
|
140
|
+
"type": "uint256"
|
141
|
+
},
|
142
|
+
{
|
143
|
+
"indexed": true,
|
144
|
+
"internalType": "uint256",
|
145
|
+
"name": "targetChainId",
|
146
|
+
"type": "uint256"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"indexed": true,
|
150
|
+
"internalType": "bytes32",
|
151
|
+
"name": "requestTransactionHash",
|
152
|
+
"type": "bytes32"
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"indexed": false,
|
156
|
+
"internalType": "bytes32",
|
157
|
+
"name": "targetCommittedTransactionHash",
|
158
|
+
"type": "bytes32"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
"indexed": false,
|
162
|
+
"internalType": "bytes",
|
163
|
+
"name": "metadata",
|
164
|
+
"type": "bytes"
|
165
|
+
}
|
166
|
+
],
|
167
|
+
"name": "LogBridgeCompleted",
|
168
|
+
"type": "event"
|
169
|
+
},
|
170
|
+
{
|
171
|
+
"anonymous": false,
|
172
|
+
"inputs": [
|
173
|
+
{
|
174
|
+
"indexed": true,
|
175
|
+
"internalType": "address",
|
176
|
+
"name": "bridger",
|
177
|
+
"type": "address"
|
178
|
+
},
|
179
|
+
{
|
180
|
+
"components": [
|
181
|
+
{
|
182
|
+
"components": [
|
183
|
+
{
|
184
|
+
"internalType": "address",
|
185
|
+
"name": "sourceToken",
|
186
|
+
"type": "address"
|
187
|
+
},
|
188
|
+
{
|
189
|
+
"internalType": "address",
|
190
|
+
"name": "targetToken",
|
191
|
+
"type": "address"
|
192
|
+
},
|
193
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
194
|
+
],
|
195
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
196
|
+
"name": "supply",
|
197
|
+
"type": "tuple[]"
|
198
|
+
},
|
199
|
+
{
|
200
|
+
"components": [
|
201
|
+
{
|
202
|
+
"internalType": "address",
|
203
|
+
"name": "sourceToken",
|
204
|
+
"type": "address"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
"internalType": "address",
|
208
|
+
"name": "targetToken",
|
209
|
+
"type": "address"
|
210
|
+
},
|
211
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
212
|
+
],
|
213
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
214
|
+
"name": "withdraw",
|
215
|
+
"type": "tuple[]"
|
216
|
+
}
|
217
|
+
],
|
218
|
+
"indexed": false,
|
219
|
+
"internalType": "struct InteropXContractBeta.Position",
|
220
|
+
"name": "position",
|
221
|
+
"type": "tuple"
|
222
|
+
},
|
223
|
+
{
|
224
|
+
"indexed": false,
|
225
|
+
"internalType": "uint256",
|
226
|
+
"name": "sourceChainId",
|
227
|
+
"type": "uint256"
|
228
|
+
},
|
229
|
+
{
|
230
|
+
"indexed": true,
|
231
|
+
"internalType": "uint256",
|
232
|
+
"name": "targetChainId",
|
233
|
+
"type": "uint256"
|
234
|
+
},
|
235
|
+
{
|
236
|
+
"indexed": false,
|
237
|
+
"internalType": "bytes",
|
238
|
+
"name": "metadata",
|
239
|
+
"type": "bytes"
|
240
|
+
}
|
241
|
+
],
|
242
|
+
"name": "LogBridgeRequest",
|
243
|
+
"type": "event"
|
244
|
+
},
|
245
|
+
{
|
246
|
+
"anonymous": false,
|
247
|
+
"inputs": [
|
248
|
+
{
|
249
|
+
"indexed": true,
|
250
|
+
"internalType": "address",
|
251
|
+
"name": "bridger",
|
252
|
+
"type": "address"
|
253
|
+
},
|
254
|
+
{
|
255
|
+
"components": [
|
256
|
+
{
|
257
|
+
"components": [
|
258
|
+
{
|
259
|
+
"internalType": "address",
|
260
|
+
"name": "sourceToken",
|
261
|
+
"type": "address"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"internalType": "address",
|
265
|
+
"name": "targetToken",
|
266
|
+
"type": "address"
|
267
|
+
},
|
268
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
269
|
+
],
|
270
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
271
|
+
"name": "supply",
|
272
|
+
"type": "tuple[]"
|
273
|
+
},
|
274
|
+
{
|
275
|
+
"components": [
|
276
|
+
{
|
277
|
+
"internalType": "address",
|
278
|
+
"name": "sourceToken",
|
279
|
+
"type": "address"
|
280
|
+
},
|
281
|
+
{
|
282
|
+
"internalType": "address",
|
283
|
+
"name": "targetToken",
|
284
|
+
"type": "address"
|
285
|
+
},
|
286
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
287
|
+
],
|
288
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
289
|
+
"name": "withdraw",
|
290
|
+
"type": "tuple[]"
|
291
|
+
}
|
292
|
+
],
|
293
|
+
"indexed": false,
|
294
|
+
"internalType": "struct InteropXContractBeta.Position",
|
295
|
+
"name": "position",
|
296
|
+
"type": "tuple"
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"indexed": false,
|
300
|
+
"internalType": "uint32",
|
301
|
+
"name": "sourceChainId",
|
302
|
+
"type": "uint32"
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"indexed": true,
|
306
|
+
"internalType": "uint32",
|
307
|
+
"name": "targetChainId",
|
308
|
+
"type": "uint32"
|
309
|
+
},
|
310
|
+
{
|
311
|
+
"indexed": true,
|
312
|
+
"internalType": "bytes32",
|
313
|
+
"name": "requestTransactionHash",
|
314
|
+
"type": "bytes32"
|
315
|
+
},
|
316
|
+
{
|
317
|
+
"indexed": false,
|
318
|
+
"internalType": "bytes",
|
319
|
+
"name": "metadata",
|
320
|
+
"type": "bytes"
|
321
|
+
}
|
322
|
+
],
|
323
|
+
"name": "LogBridgeRequestSent",
|
324
|
+
"type": "event"
|
325
|
+
},
|
326
|
+
{
|
327
|
+
"inputs": [],
|
328
|
+
"name": "_vnonce",
|
329
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
330
|
+
"stateMutability": "view",
|
331
|
+
"type": "function"
|
332
|
+
},
|
333
|
+
{
|
334
|
+
"inputs": [
|
335
|
+
{ "internalType": "address", "name": "to_", "type": "address" },
|
336
|
+
{ "internalType": "address", "name": "sourceToken_", "type": "address" },
|
337
|
+
{ "internalType": "address", "name": "targetToken_", "type": "address" },
|
338
|
+
{ "internalType": "uint256", "name": "amount_", "type": "uint256" },
|
339
|
+
{ "internalType": "uint32", "name": "targetChainId_", "type": "uint32" },
|
340
|
+
{
|
341
|
+
"internalType": "bytes32",
|
342
|
+
"name": "transactionHash_",
|
343
|
+
"type": "bytes32"
|
344
|
+
},
|
345
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
346
|
+
],
|
347
|
+
"name": "completeBridge",
|
348
|
+
"outputs": [],
|
349
|
+
"stateMutability": "nonpayable",
|
350
|
+
"type": "function"
|
351
|
+
},
|
352
|
+
{
|
353
|
+
"inputs": [
|
354
|
+
{ "internalType": "address", "name": "sourceToken_", "type": "address" },
|
355
|
+
{ "internalType": "address", "name": "targetToken_", "type": "address" },
|
356
|
+
{ "internalType": "uint256", "name": "amount_", "type": "uint256" },
|
357
|
+
{ "internalType": "uint32", "name": "targetChainId_", "type": "uint32" },
|
358
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
359
|
+
],
|
360
|
+
"name": "requestWithdraw",
|
361
|
+
"outputs": [],
|
362
|
+
"stateMutability": "nonpayable",
|
363
|
+
"type": "function"
|
364
|
+
},
|
365
|
+
{
|
366
|
+
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
367
|
+
"name": "whitelistedMapping",
|
368
|
+
"outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
|
369
|
+
"stateMutability": "view",
|
370
|
+
"type": "function"
|
371
|
+
},
|
372
|
+
{
|
373
|
+
"inputs": [
|
374
|
+
{ "internalType": "address", "name": "user_", "type": "address" },
|
375
|
+
{ "internalType": "address", "name": "sourceToken_", "type": "address" },
|
376
|
+
{ "internalType": "address", "name": "targetToken_", "type": "address" },
|
377
|
+
{ "internalType": "uint256", "name": "amount_", "type": "uint256" },
|
378
|
+
{ "internalType": "uint32", "name": "chainId_", "type": "uint32" },
|
379
|
+
{
|
380
|
+
"internalType": "bytes32",
|
381
|
+
"name": "transactionHash_",
|
382
|
+
"type": "bytes32"
|
383
|
+
},
|
384
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
385
|
+
],
|
386
|
+
"name": "withdrawRequested",
|
387
|
+
"outputs": [],
|
388
|
+
"stateMutability": "nonpayable",
|
389
|
+
"type": "function"
|
390
|
+
}
|
391
|
+
]
|
package/src/alias.ts
ADDED
package/src/api/index.ts
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
import fastify from "fastify"
|
2
|
+
import cors from '@fastify/cors'
|
3
|
+
import Logger from "@/logger"
|
4
|
+
import { Transaction } from "@/db";
|
5
|
+
|
6
|
+
const logger = new Logger("RPC");
|
7
|
+
|
8
|
+
|
9
|
+
const server = fastify({ logger: false })
|
10
|
+
|
11
|
+
server.register(cors, {})
|
12
|
+
|
13
|
+
server.get('/', async () => 'Interop X API')
|
14
|
+
|
15
|
+
export const startApiServer = async () => {
|
16
|
+
const HOST = process.env.API_HOST || '0.0.0.0';
|
17
|
+
const PORT = process.env.API_PORT || '8080';
|
18
|
+
try {
|
19
|
+
server.get('/transactions', async (req) => {
|
20
|
+
return await Transaction.findAndCountAll({
|
21
|
+
limit: 20,
|
22
|
+
offset: 0,
|
23
|
+
order: [
|
24
|
+
['createdAt', 'DESC']
|
25
|
+
]
|
26
|
+
})
|
27
|
+
})
|
28
|
+
|
29
|
+
await server.listen(PORT, HOST)
|
30
|
+
|
31
|
+
logger.log(`RPC Server listening at http://${HOST}:${PORT}`)
|
32
|
+
} catch (err) {
|
33
|
+
logger.error(err.message)
|
34
|
+
process.exit(1)
|
35
|
+
}
|
36
|
+
}
|
package/src/config/index.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import { ethers, Wallet } from "ethers"
|
2
|
-
import { EventBus, EventBusType } from "
|
2
|
+
import { EventBus, EventBusType } from "@/types"
|
3
|
+
import fs from 'fs-extra'
|
4
|
+
import expandHomeDir from "expand-home-dir";
|
3
5
|
|
4
6
|
class Config {
|
5
7
|
public readonly events: EventBusType
|
@@ -7,18 +9,32 @@ class Config {
|
|
7
9
|
public readonly leadNodeAddress: string
|
8
10
|
public readonly privateKey: string
|
9
11
|
public readonly wallet: Wallet
|
12
|
+
public readonly staging: boolean
|
13
|
+
public readonly autoUpdate: boolean
|
14
|
+
public readonly baseConfigPath: string
|
10
15
|
|
11
16
|
constructor() {
|
12
17
|
this.events = new EventBus() as EventBusType
|
13
|
-
this.maxPeers =
|
18
|
+
this.maxPeers = 20
|
14
19
|
this.privateKey = process.env.PRIVATE_KEY as string;
|
20
|
+
this.staging = !! process.env.STAGING && process.env.STAGING === 'true';
|
21
|
+
this.autoUpdate = !! process.env.AUTO_UPDATE && process.env.AUTO_UPDATE === 'true';
|
15
22
|
this.wallet = new Wallet(this.privateKey);
|
16
23
|
this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E'
|
24
|
+
this.baseConfigPath = expandHomeDir(`~/.interop-x`);
|
25
|
+
}
|
26
|
+
|
27
|
+
get publicAddress(){
|
28
|
+
return this.wallet.address
|
17
29
|
}
|
18
30
|
|
19
31
|
isLeadNode() {
|
20
32
|
return ethers.utils.getAddress(this.leadNodeAddress) === ethers.utils.getAddress(this.wallet.address)
|
21
33
|
}
|
34
|
+
|
35
|
+
isMaintenanceMode(){
|
36
|
+
return fs.existsSync(this.baseConfigPath + '/maintenance')
|
37
|
+
}
|
22
38
|
}
|
23
39
|
|
24
40
|
export default new Config()
|
@@ -1,10 +1,17 @@
|
|
1
1
|
export const addresses = {
|
2
2
|
1: {
|
3
3
|
gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
|
4
|
-
multisend:
|
4
|
+
multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
|
5
|
+
interopXContract: '',
|
5
6
|
},
|
6
7
|
137: {
|
7
8
|
gnosisSafe: '0x5635d2910e51da33d9DC0422c893CF4F28B69A25',
|
8
|
-
multisend:
|
9
|
+
multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
|
10
|
+
interopXContract: '0x2189741c8cAc1cf51570932817A7d6390646C80e',
|
9
11
|
},
|
12
|
+
43114: {
|
13
|
+
gnosisSafe: '0x31d7a5194Fe60AC209Cf1Ce2d539C9A60662Ed6b',
|
14
|
+
multisend: '0x998739BFdAAdde7C933B942a68053933098f9EDa',
|
15
|
+
interopXContract: '0x1867DF97Ec24bb0bbD4AD464F0Be9C6713422EAE',
|
16
|
+
}
|
10
17
|
}
|
package/src/constants/index.ts
CHANGED
@@ -0,0 +1,104 @@
|
|
1
|
+
export const tokens = {
|
2
|
+
1: [
|
3
|
+
{
|
4
|
+
symbol: "ETH",
|
5
|
+
name: "Ethereum",
|
6
|
+
address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
|
7
|
+
decimals: 18,
|
8
|
+
},
|
9
|
+
{
|
10
|
+
symbol: "DAI",
|
11
|
+
name: "DAI Stable",
|
12
|
+
address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
|
13
|
+
decimals: 18,
|
14
|
+
},
|
15
|
+
{
|
16
|
+
symbol: "USDC",
|
17
|
+
name: "USD Coin",
|
18
|
+
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
19
|
+
decimals: 6,
|
20
|
+
},
|
21
|
+
{
|
22
|
+
symbol: "USDT",
|
23
|
+
name: "Tether USD Coin",
|
24
|
+
address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
|
25
|
+
decimals: 6,
|
26
|
+
},
|
27
|
+
{
|
28
|
+
symbol: "WBTC",
|
29
|
+
name: "Wrapped BTC",
|
30
|
+
address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
|
31
|
+
decimals: 8,
|
32
|
+
},
|
33
|
+
],
|
34
|
+
137: [
|
35
|
+
{
|
36
|
+
symbol: "ETH",
|
37
|
+
name: "Ethereum",
|
38
|
+
address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
|
39
|
+
decimals: 18,
|
40
|
+
},
|
41
|
+
{
|
42
|
+
symbol: "DAI",
|
43
|
+
name: "DAI Stable",
|
44
|
+
address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
|
45
|
+
decimals: 18,
|
46
|
+
},
|
47
|
+
{
|
48
|
+
symbol: "USDC",
|
49
|
+
name: "USD Coin",
|
50
|
+
address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
|
51
|
+
decimals: 6,
|
52
|
+
},
|
53
|
+
{
|
54
|
+
symbol: "USDT",
|
55
|
+
name: "Tether USD Coin",
|
56
|
+
address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
|
57
|
+
decimals: 6,
|
58
|
+
},
|
59
|
+
{
|
60
|
+
symbol: "WBTC",
|
61
|
+
name: "Wrapped BTC",
|
62
|
+
address: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
|
63
|
+
decimals: 8,
|
64
|
+
},
|
65
|
+
{
|
66
|
+
symbol: "AVAX",
|
67
|
+
name: "Avalanche Token",
|
68
|
+
address: "0x2C89bbc92BD86F8075d1DEcc58C7F4E0107f286b",
|
69
|
+
decimals: 18,
|
70
|
+
},
|
71
|
+
],
|
72
|
+
43114: [
|
73
|
+
{
|
74
|
+
symbol: "ETH",
|
75
|
+
name: "Ethereum",
|
76
|
+
address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
|
77
|
+
decimals: 18,
|
78
|
+
},
|
79
|
+
{
|
80
|
+
symbol: "DAI",
|
81
|
+
name: "DAI Stable",
|
82
|
+
address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
|
83
|
+
decimals: 18,
|
84
|
+
},
|
85
|
+
{
|
86
|
+
symbol: "USDC",
|
87
|
+
name: "USD Coin",
|
88
|
+
address: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",
|
89
|
+
decimals: 6,
|
90
|
+
},
|
91
|
+
{
|
92
|
+
symbol: "USDT",
|
93
|
+
name: "Tether USD Coin",
|
94
|
+
address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118",
|
95
|
+
decimals: 6,
|
96
|
+
},
|
97
|
+
{
|
98
|
+
symbol: "WBTC",
|
99
|
+
name: "Wrapped BTC",
|
100
|
+
address: "0x50b7545627a5162F82A992c33b87aDc75187B218",
|
101
|
+
decimals: 8,
|
102
|
+
},
|
103
|
+
],
|
104
|
+
};
|
package/src/db/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from "./models"
|
1
|
+
export * from "./models"
|
package/src/db/models/index.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export * from './
|
1
|
+
export * from './transaction';
|