@instadapp/interop-x 0.0.0-dev.67e7c3a → 0.0.0-dev.6a2c9c4
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/package.json +16 -14
- package/dist/src/abi/index.js +2 -4
- package/dist/src/abi/interopXContract.json +454 -0
- package/dist/src/alias.js +10 -0
- package/dist/src/api/index.js +6 -3
- package/dist/src/config/index.js +10 -1
- package/dist/src/constants/addresses.js +7 -7
- package/dist/src/constants/index.js +0 -1
- package/dist/src/constants/tokens.js +62 -39
- package/dist/src/db/models/transaction.js +27 -11
- package/dist/src/gnosis/actions/index.js +9 -0
- package/dist/src/gnosis/actions/withdraw/index.js +115 -0
- package/dist/src/gnosis/index.js +20 -0
- package/dist/src/index.js +39 -23
- package/dist/src/net/peer/index.js +2 -1
- package/dist/src/net/pool/index.js +7 -2
- package/dist/src/net/protocol/dial/SignatureDialProtocol.js +9 -10
- package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
- package/dist/src/net/protocol/index.js +26 -5
- package/dist/src/tasks/AutoUpdateTask.js +42 -16
- package/dist/src/tasks/BaseTask.js +11 -3
- package/dist/src/tasks/{InteropXGateway/ProcessDepositEvents.js → InteropXContract/ProcessBridgeRequestEvents.js} +61 -53
- package/dist/src/tasks/InteropXContract/SyncBridgeCommittedEvents.js +93 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
- package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +90 -0
- package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +57 -0
- package/dist/src/tasks/index.js +16 -17
- package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
- package/dist/src/typechain/factories/InteropXContract__factory.js +635 -0
- package/dist/src/typechain/factories/index.js +3 -5
- package/dist/src/typechain/index.js +3 -5
- package/dist/src/utils/index.js +57 -92
- package/package.json +16 -14
- package/src/abi/index.ts +2 -4
- package/src/abi/interopXContract.json +454 -0
- package/src/alias.ts +6 -0
- package/src/api/index.ts +5 -2
- package/src/config/index.ts +9 -1
- package/src/constants/addresses.ts +8 -8
- package/src/constants/index.ts +0 -1
- package/src/constants/tokens.ts +63 -40
- package/src/db/models/transaction.ts +76 -27
- 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 +52 -25
- package/src/net/peer/index.ts +2 -1
- package/src/net/pool/index.ts +7 -3
- package/src/net/protocol/dial/SignatureDialProtocol.ts +11 -13
- package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
- package/src/net/protocol/index.ts +28 -6
- package/src/tasks/AutoUpdateTask.ts +48 -20
- package/src/tasks/BaseTask.ts +13 -3
- package/src/tasks/{InteropBridge/ProcessWithdrawEvents.ts → InteropXContract/ProcessBridgeRequestEvents.ts} +88 -95
- package/src/tasks/InteropXContract/SyncBridgeCommittedEvents.ts +125 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +115 -0
- package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +121 -0
- package/src/tasks/Transactions/SyncTransactionStatusTask.ts +69 -0
- package/src/tasks/index.ts +21 -18
- package/src/typechain/InteropXContract.ts +680 -0
- package/src/typechain/factories/InteropXContract__factory.ts +642 -0
- package/src/typechain/factories/index.ts +1 -2
- package/src/typechain/index.ts +2 -4
- package/src/utils/index.ts +97 -129
- package/tsconfig.json +7 -2
- package/dist/src/abi/interopBridgeToken.json +0 -286
- package/dist/src/abi/interopXGateway.json +0 -184
- package/dist/src/constants/itokens.js +0 -13
- package/dist/src/tasks/InteropBridge/ProcessWithdrawEvents.js +0 -147
- package/dist/src/tasks/InteropBridge/SyncWithdrawEvents.js +0 -70
- package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -75
- package/dist/src/typechain/InteropXGateway.js +0 -2
- package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -459
- package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
- package/src/abi/interopBridgeToken.json +0 -286
- package/src/abi/interopXGateway.json +0 -184
- package/src/constants/itokens.ts +0 -10
- package/src/tasks/InteropBridge/SyncWithdrawEvents.ts +0 -121
- package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -245
- package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -126
- package/src/typechain/InteropBridgeToken.ts +0 -686
- package/src/typechain/InteropXGateway.ts +0 -407
- package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -466
- package/src/typechain/factories/InteropXGateway__factory.ts +0 -272
@@ -0,0 +1,454 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"anonymous": false,
|
4
|
+
"inputs": [
|
5
|
+
{
|
6
|
+
"indexed": false,
|
7
|
+
"internalType": "string",
|
8
|
+
"name": "actionId",
|
9
|
+
"type": "string"
|
10
|
+
},
|
11
|
+
{
|
12
|
+
"indexed": true,
|
13
|
+
"internalType": "address",
|
14
|
+
"name": "bridger",
|
15
|
+
"type": "address"
|
16
|
+
},
|
17
|
+
{
|
18
|
+
"components": [
|
19
|
+
{
|
20
|
+
"components": [
|
21
|
+
{
|
22
|
+
"internalType": "address",
|
23
|
+
"name": "sourceToken",
|
24
|
+
"type": "address"
|
25
|
+
},
|
26
|
+
{
|
27
|
+
"internalType": "address",
|
28
|
+
"name": "targetToken",
|
29
|
+
"type": "address"
|
30
|
+
},
|
31
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
32
|
+
],
|
33
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
34
|
+
"name": "supply",
|
35
|
+
"type": "tuple[]"
|
36
|
+
},
|
37
|
+
{
|
38
|
+
"components": [
|
39
|
+
{
|
40
|
+
"internalType": "address",
|
41
|
+
"name": "sourceToken",
|
42
|
+
"type": "address"
|
43
|
+
},
|
44
|
+
{
|
45
|
+
"internalType": "address",
|
46
|
+
"name": "targetToken",
|
47
|
+
"type": "address"
|
48
|
+
},
|
49
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
50
|
+
],
|
51
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
52
|
+
"name": "withdraw",
|
53
|
+
"type": "tuple[]"
|
54
|
+
}
|
55
|
+
],
|
56
|
+
"indexed": false,
|
57
|
+
"internalType": "struct InteropXContractBeta.Position",
|
58
|
+
"name": "position",
|
59
|
+
"type": "tuple"
|
60
|
+
},
|
61
|
+
{
|
62
|
+
"indexed": true,
|
63
|
+
"internalType": "uint32",
|
64
|
+
"name": "sourceChainId",
|
65
|
+
"type": "uint32"
|
66
|
+
},
|
67
|
+
{
|
68
|
+
"indexed": false,
|
69
|
+
"internalType": "uint32",
|
70
|
+
"name": "targetChainId",
|
71
|
+
"type": "uint32"
|
72
|
+
},
|
73
|
+
{
|
74
|
+
"indexed": true,
|
75
|
+
"internalType": "bytes32",
|
76
|
+
"name": "requestTransactionHash",
|
77
|
+
"type": "bytes32"
|
78
|
+
},
|
79
|
+
{
|
80
|
+
"indexed": false,
|
81
|
+
"internalType": "bytes",
|
82
|
+
"name": "metadata",
|
83
|
+
"type": "bytes"
|
84
|
+
}
|
85
|
+
],
|
86
|
+
"name": "LogBridgeCommitted",
|
87
|
+
"type": "event"
|
88
|
+
},
|
89
|
+
{
|
90
|
+
"anonymous": false,
|
91
|
+
"inputs": [
|
92
|
+
{
|
93
|
+
"indexed": false,
|
94
|
+
"internalType": "string",
|
95
|
+
"name": "actionId",
|
96
|
+
"type": "string"
|
97
|
+
},
|
98
|
+
{
|
99
|
+
"indexed": true,
|
100
|
+
"internalType": "address",
|
101
|
+
"name": "bridger",
|
102
|
+
"type": "address"
|
103
|
+
},
|
104
|
+
{
|
105
|
+
"components": [
|
106
|
+
{
|
107
|
+
"components": [
|
108
|
+
{
|
109
|
+
"internalType": "address",
|
110
|
+
"name": "sourceToken",
|
111
|
+
"type": "address"
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"internalType": "address",
|
115
|
+
"name": "targetToken",
|
116
|
+
"type": "address"
|
117
|
+
},
|
118
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
119
|
+
],
|
120
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
121
|
+
"name": "supply",
|
122
|
+
"type": "tuple[]"
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"components": [
|
126
|
+
{
|
127
|
+
"internalType": "address",
|
128
|
+
"name": "sourceToken",
|
129
|
+
"type": "address"
|
130
|
+
},
|
131
|
+
{
|
132
|
+
"internalType": "address",
|
133
|
+
"name": "targetToken",
|
134
|
+
"type": "address"
|
135
|
+
},
|
136
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
137
|
+
],
|
138
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
139
|
+
"name": "withdraw",
|
140
|
+
"type": "tuple[]"
|
141
|
+
}
|
142
|
+
],
|
143
|
+
"indexed": false,
|
144
|
+
"internalType": "struct InteropXContractBeta.Position",
|
145
|
+
"name": "position",
|
146
|
+
"type": "tuple"
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"indexed": false,
|
150
|
+
"internalType": "uint256",
|
151
|
+
"name": "sourceChainId",
|
152
|
+
"type": "uint256"
|
153
|
+
},
|
154
|
+
{
|
155
|
+
"indexed": true,
|
156
|
+
"internalType": "uint256",
|
157
|
+
"name": "targetChainId",
|
158
|
+
"type": "uint256"
|
159
|
+
},
|
160
|
+
{
|
161
|
+
"indexed": true,
|
162
|
+
"internalType": "bytes32",
|
163
|
+
"name": "requestTransactionHash",
|
164
|
+
"type": "bytes32"
|
165
|
+
},
|
166
|
+
{
|
167
|
+
"indexed": false,
|
168
|
+
"internalType": "bytes32",
|
169
|
+
"name": "targetCommittedTransactionHash",
|
170
|
+
"type": "bytes32"
|
171
|
+
},
|
172
|
+
{
|
173
|
+
"indexed": false,
|
174
|
+
"internalType": "bytes",
|
175
|
+
"name": "metadata",
|
176
|
+
"type": "bytes"
|
177
|
+
}
|
178
|
+
],
|
179
|
+
"name": "LogBridgeCompleted",
|
180
|
+
"type": "event"
|
181
|
+
},
|
182
|
+
{
|
183
|
+
"anonymous": false,
|
184
|
+
"inputs": [
|
185
|
+
{
|
186
|
+
"indexed": false,
|
187
|
+
"internalType": "string",
|
188
|
+
"name": "actionId",
|
189
|
+
"type": "string"
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"indexed": true,
|
193
|
+
"internalType": "address",
|
194
|
+
"name": "bridger",
|
195
|
+
"type": "address"
|
196
|
+
},
|
197
|
+
{
|
198
|
+
"components": [
|
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": "supply",
|
215
|
+
"type": "tuple[]"
|
216
|
+
},
|
217
|
+
{
|
218
|
+
"components": [
|
219
|
+
{
|
220
|
+
"internalType": "address",
|
221
|
+
"name": "sourceToken",
|
222
|
+
"type": "address"
|
223
|
+
},
|
224
|
+
{
|
225
|
+
"internalType": "address",
|
226
|
+
"name": "targetToken",
|
227
|
+
"type": "address"
|
228
|
+
},
|
229
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
230
|
+
],
|
231
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
232
|
+
"name": "withdraw",
|
233
|
+
"type": "tuple[]"
|
234
|
+
}
|
235
|
+
],
|
236
|
+
"indexed": false,
|
237
|
+
"internalType": "struct InteropXContractBeta.Position",
|
238
|
+
"name": "position",
|
239
|
+
"type": "tuple"
|
240
|
+
},
|
241
|
+
{
|
242
|
+
"indexed": false,
|
243
|
+
"internalType": "uint256",
|
244
|
+
"name": "sourceChainId",
|
245
|
+
"type": "uint256"
|
246
|
+
},
|
247
|
+
{
|
248
|
+
"indexed": true,
|
249
|
+
"internalType": "uint256",
|
250
|
+
"name": "targetChainId",
|
251
|
+
"type": "uint256"
|
252
|
+
},
|
253
|
+
{
|
254
|
+
"indexed": false,
|
255
|
+
"internalType": "bytes",
|
256
|
+
"name": "metadata",
|
257
|
+
"type": "bytes"
|
258
|
+
}
|
259
|
+
],
|
260
|
+
"name": "LogBridgeRequest",
|
261
|
+
"type": "event"
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"anonymous": false,
|
265
|
+
"inputs": [
|
266
|
+
{
|
267
|
+
"indexed": false,
|
268
|
+
"internalType": "string",
|
269
|
+
"name": "actionId",
|
270
|
+
"type": "string"
|
271
|
+
},
|
272
|
+
{
|
273
|
+
"indexed": true,
|
274
|
+
"internalType": "address",
|
275
|
+
"name": "bridger",
|
276
|
+
"type": "address"
|
277
|
+
},
|
278
|
+
{
|
279
|
+
"components": [
|
280
|
+
{
|
281
|
+
"components": [
|
282
|
+
{
|
283
|
+
"internalType": "address",
|
284
|
+
"name": "sourceToken",
|
285
|
+
"type": "address"
|
286
|
+
},
|
287
|
+
{
|
288
|
+
"internalType": "address",
|
289
|
+
"name": "targetToken",
|
290
|
+
"type": "address"
|
291
|
+
},
|
292
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
293
|
+
],
|
294
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
295
|
+
"name": "supply",
|
296
|
+
"type": "tuple[]"
|
297
|
+
},
|
298
|
+
{
|
299
|
+
"components": [
|
300
|
+
{
|
301
|
+
"internalType": "address",
|
302
|
+
"name": "sourceToken",
|
303
|
+
"type": "address"
|
304
|
+
},
|
305
|
+
{
|
306
|
+
"internalType": "address",
|
307
|
+
"name": "targetToken",
|
308
|
+
"type": "address"
|
309
|
+
},
|
310
|
+
{ "internalType": "uint256", "name": "amount", "type": "uint256" }
|
311
|
+
],
|
312
|
+
"internalType": "struct InteropXContractBeta.TokenInfo[]",
|
313
|
+
"name": "withdraw",
|
314
|
+
"type": "tuple[]"
|
315
|
+
}
|
316
|
+
],
|
317
|
+
"indexed": false,
|
318
|
+
"internalType": "struct InteropXContractBeta.Position",
|
319
|
+
"name": "position",
|
320
|
+
"type": "tuple"
|
321
|
+
},
|
322
|
+
{
|
323
|
+
"indexed": false,
|
324
|
+
"internalType": "uint32",
|
325
|
+
"name": "sourceChainId",
|
326
|
+
"type": "uint32"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
"indexed": true,
|
330
|
+
"internalType": "uint32",
|
331
|
+
"name": "targetChainId",
|
332
|
+
"type": "uint32"
|
333
|
+
},
|
334
|
+
{
|
335
|
+
"indexed": true,
|
336
|
+
"internalType": "bytes32",
|
337
|
+
"name": "requestTransactionHash",
|
338
|
+
"type": "bytes32"
|
339
|
+
},
|
340
|
+
{
|
341
|
+
"indexed": false,
|
342
|
+
"internalType": "bytes",
|
343
|
+
"name": "metadata",
|
344
|
+
"type": "bytes"
|
345
|
+
}
|
346
|
+
],
|
347
|
+
"name": "LogBridgeRequestSent",
|
348
|
+
"type": "event"
|
349
|
+
},
|
350
|
+
{
|
351
|
+
"inputs": [
|
352
|
+
{ "internalType": "string", "name": "actionId", "type": "string" },
|
353
|
+
{ "internalType": "address", "name": "to_", "type": "address" },
|
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": "sourceChainId_", "type": "uint32" },
|
358
|
+
{
|
359
|
+
"internalType": "bytes32",
|
360
|
+
"name": "transactionHash_",
|
361
|
+
"type": "bytes32"
|
362
|
+
},
|
363
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
364
|
+
],
|
365
|
+
"name": "completeBridge",
|
366
|
+
"outputs": [],
|
367
|
+
"stateMutability": "nonpayable",
|
368
|
+
"type": "function"
|
369
|
+
},
|
370
|
+
{
|
371
|
+
"inputs": [
|
372
|
+
{ "internalType": "address", "name": "user", "type": "address" },
|
373
|
+
{ "internalType": "address[]", "name": "tokens", "type": "address[]" }
|
374
|
+
],
|
375
|
+
"name": "getBridgeAmounts",
|
376
|
+
"outputs": [
|
377
|
+
{
|
378
|
+
"components": [
|
379
|
+
{ "internalType": "uint256", "name": "deposit", "type": "uint256" },
|
380
|
+
{ "internalType": "uint256", "name": "withdraw", "type": "uint256" }
|
381
|
+
],
|
382
|
+
"internalType": "struct InteropXContractBeta.UserData[]",
|
383
|
+
"name": "userData",
|
384
|
+
"type": "tuple[]"
|
385
|
+
}
|
386
|
+
],
|
387
|
+
"stateMutability": "view",
|
388
|
+
"type": "function"
|
389
|
+
},
|
390
|
+
{
|
391
|
+
"inputs": [
|
392
|
+
{ "internalType": "string", "name": "actionId", "type": "string" },
|
393
|
+
{ "internalType": "address", "name": "sourceToken_", "type": "address" },
|
394
|
+
{ "internalType": "address", "name": "targetToken_", "type": "address" },
|
395
|
+
{ "internalType": "uint256", "name": "amount_", "type": "uint256" },
|
396
|
+
{ "internalType": "uint32", "name": "targetChainId_", "type": "uint32" },
|
397
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
398
|
+
],
|
399
|
+
"name": "requestWithdraw",
|
400
|
+
"outputs": [],
|
401
|
+
"stateMutability": "nonpayable",
|
402
|
+
"type": "function"
|
403
|
+
},
|
404
|
+
{
|
405
|
+
"inputs": [
|
406
|
+
{ "internalType": "address", "name": "token", "type": "address" },
|
407
|
+
{ "internalType": "bool", "name": "toggle", "type": "bool" }
|
408
|
+
],
|
409
|
+
"name": "toggleWhitelist",
|
410
|
+
"outputs": [],
|
411
|
+
"stateMutability": "nonpayable",
|
412
|
+
"type": "function"
|
413
|
+
},
|
414
|
+
{
|
415
|
+
"inputs": [
|
416
|
+
{ "internalType": "address", "name": "", "type": "address" },
|
417
|
+
{ "internalType": "address", "name": "", "type": "address" }
|
418
|
+
],
|
419
|
+
"name": "userMapping",
|
420
|
+
"outputs": [
|
421
|
+
{ "internalType": "uint256", "name": "deposit", "type": "uint256" },
|
422
|
+
{ "internalType": "uint256", "name": "withdraw", "type": "uint256" }
|
423
|
+
],
|
424
|
+
"stateMutability": "view",
|
425
|
+
"type": "function"
|
426
|
+
},
|
427
|
+
{
|
428
|
+
"inputs": [{ "internalType": "address", "name": "", "type": "address" }],
|
429
|
+
"name": "whitelistedTokens",
|
430
|
+
"outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
|
431
|
+
"stateMutability": "view",
|
432
|
+
"type": "function"
|
433
|
+
},
|
434
|
+
{
|
435
|
+
"inputs": [
|
436
|
+
{ "internalType": "string", "name": "actionId", "type": "string" },
|
437
|
+
{ "internalType": "address", "name": "user_", "type": "address" },
|
438
|
+
{ "internalType": "address", "name": "sourceToken_", "type": "address" },
|
439
|
+
{ "internalType": "address", "name": "targetToken_", "type": "address" },
|
440
|
+
{ "internalType": "uint256", "name": "amount_", "type": "uint256" },
|
441
|
+
{ "internalType": "uint32", "name": "chainId_", "type": "uint32" },
|
442
|
+
{
|
443
|
+
"internalType": "bytes32",
|
444
|
+
"name": "transactionHash_",
|
445
|
+
"type": "bytes32"
|
446
|
+
},
|
447
|
+
{ "internalType": "bytes", "name": "metadata_", "type": "bytes" }
|
448
|
+
],
|
449
|
+
"name": "withdrawRequested",
|
450
|
+
"outputs": [],
|
451
|
+
"stateMutability": "nonpayable",
|
452
|
+
"type": "function"
|
453
|
+
}
|
454
|
+
]
|
package/src/alias.ts
ADDED
package/src/api/index.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import fastify from "fastify"
|
2
|
-
import cors from 'fastify
|
2
|
+
import cors from '@fastify/cors'
|
3
3
|
import Logger from "@/logger"
|
4
4
|
import { Transaction } from "@/db";
|
5
5
|
|
@@ -20,6 +20,9 @@ export const startApiServer = async () => {
|
|
20
20
|
return await Transaction.findAndCountAll({
|
21
21
|
limit: 20,
|
22
22
|
offset: 0,
|
23
|
+
order: [
|
24
|
+
['updatedAt', 'DESC']
|
25
|
+
]
|
23
26
|
})
|
24
27
|
})
|
25
28
|
|
@@ -27,7 +30,7 @@ export const startApiServer = async () => {
|
|
27
30
|
|
28
31
|
logger.log(`RPC Server listening at http://${HOST}:${PORT}`)
|
29
32
|
} catch (err) {
|
30
|
-
logger.error(err)
|
33
|
+
logger.error(err.message)
|
31
34
|
process.exit(1)
|
32
35
|
}
|
33
36
|
}
|
package/src/config/index.ts
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
import { ethers, Wallet } from "ethers"
|
2
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
|
@@ -9,15 +11,17 @@ class Config {
|
|
9
11
|
public readonly wallet: Wallet
|
10
12
|
public readonly staging: boolean
|
11
13
|
public readonly autoUpdate: boolean
|
14
|
+
public readonly baseConfigPath: string
|
12
15
|
|
13
16
|
constructor() {
|
14
17
|
this.events = new EventBus() as EventBusType
|
15
|
-
this.maxPeers =
|
18
|
+
this.maxPeers = 20
|
16
19
|
this.privateKey = process.env.PRIVATE_KEY as string;
|
17
20
|
this.staging = !! process.env.STAGING && process.env.STAGING === 'true';
|
18
21
|
this.autoUpdate = !! process.env.AUTO_UPDATE && process.env.AUTO_UPDATE === 'true';
|
19
22
|
this.wallet = new Wallet(this.privateKey);
|
20
23
|
this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E'
|
24
|
+
this.baseConfigPath = expandHomeDir(`~/.interop-x`);
|
21
25
|
}
|
22
26
|
|
23
27
|
get publicAddress(){
|
@@ -27,6 +31,10 @@ class Config {
|
|
27
31
|
isLeadNode() {
|
28
32
|
return ethers.utils.getAddress(this.leadNodeAddress) === ethers.utils.getAddress(this.wallet.address)
|
29
33
|
}
|
34
|
+
|
35
|
+
isMaintenanceMode(){
|
36
|
+
return fs.existsSync(this.baseConfigPath + '/maintenance')
|
37
|
+
}
|
30
38
|
}
|
31
39
|
|
32
40
|
export default new Config()
|
@@ -1,17 +1,17 @@
|
|
1
1
|
export const addresses = {
|
2
|
-
1: {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
},
|
2
|
+
// 1: {
|
3
|
+
// gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
|
4
|
+
// multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
|
5
|
+
// interopXContract: '',
|
6
|
+
// },
|
7
7
|
137: {
|
8
8
|
gnosisSafe: '0x5635d2910e51da33d9DC0422c893CF4F28B69A25',
|
9
9
|
multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
|
10
|
-
|
10
|
+
interopXContract: '0x65AcB77B5191CED1B1ae85B454D20E2d128fAfEe',
|
11
11
|
},
|
12
12
|
43114: {
|
13
13
|
gnosisSafe: '0x31d7a5194Fe60AC209Cf1Ce2d539C9A60662Ed6b',
|
14
14
|
multisend: '0x998739BFdAAdde7C933B942a68053933098f9EDa',
|
15
|
-
|
15
|
+
interopXContract: '0xd61f55C6d9deD35B9d13243b816c4BcC1d78592b',
|
16
16
|
}
|
17
|
-
}
|
17
|
+
} as Record<number, { gnosisSafe: string, multisend: string, interopXContract: string }>
|
package/src/constants/index.ts
CHANGED