@instadapp/interop-x 0.0.0-dev.b8c571d → 0.0.0-dev.bfeca30

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.
Files changed (84) hide show
  1. package/dist/package.json +18 -16
  2. package/dist/src/abi/index.js +2 -4
  3. package/dist/src/abi/interopXContract.json +454 -0
  4. package/dist/src/alias.js +10 -0
  5. package/dist/src/api/index.js +6 -3
  6. package/dist/src/config/index.js +11 -1
  7. package/dist/src/constants/addresses.js +3 -3
  8. package/dist/src/constants/index.js +0 -1
  9. package/dist/src/constants/tokens.js +31 -1
  10. package/dist/src/db/models/transaction.js +27 -11
  11. package/dist/src/gnosis/actions/index.js +9 -0
  12. package/dist/src/gnosis/actions/withdraw/index.js +55 -0
  13. package/dist/src/gnosis/index.js +20 -0
  14. package/dist/src/index.js +75 -24
  15. package/dist/src/net/peer/index.js +2 -1
  16. package/dist/src/net/pool/index.js +18 -2
  17. package/dist/src/net/protocol/dial/SignatureDialProtocol.js +9 -10
  18. package/dist/src/net/protocol/dial/TransactionStatusDialProtocol.js +30 -0
  19. package/dist/src/net/protocol/index.js +51 -1
  20. package/dist/src/tasks/AutoUpdateTask.js +70 -0
  21. package/dist/src/tasks/BaseTask.js +11 -3
  22. package/dist/src/tasks/{InteropBridge/ProcessWithdrawEvents.js → InteropXContract/ProcessBridgeRequestEvents.js} +55 -48
  23. package/dist/src/tasks/InteropXContract/SyncBridgeCommittedEvents.js +92 -0
  24. package/dist/src/tasks/InteropXContract/SyncBridgeRequestEvents.js +78 -0
  25. package/dist/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.js +90 -0
  26. package/dist/src/tasks/Transactions/SyncTransactionStatusTask.js +55 -0
  27. package/dist/src/tasks/index.js +18 -17
  28. package/dist/src/typechain/{InteropBridgeToken.js → InteropXContract.js} +0 -0
  29. package/dist/src/typechain/factories/InteropXContract__factory.js +635 -0
  30. package/dist/src/typechain/factories/index.js +3 -5
  31. package/dist/src/typechain/index.js +3 -5
  32. package/dist/src/utils/index.js +55 -92
  33. package/package.json +18 -16
  34. package/src/abi/index.ts +2 -4
  35. package/src/abi/interopXContract.json +454 -0
  36. package/src/alias.ts +6 -0
  37. package/src/api/index.ts +5 -2
  38. package/src/config/index.ts +11 -1
  39. package/src/constants/addresses.ts +3 -3
  40. package/src/constants/index.ts +0 -1
  41. package/src/constants/tokens.ts +32 -2
  42. package/src/db/models/transaction.ts +76 -27
  43. package/src/gnosis/actions/index.ts +5 -0
  44. package/src/gnosis/actions/withdraw/index.ts +77 -0
  45. package/src/gnosis/index.ts +19 -0
  46. package/src/index.ts +96 -26
  47. package/src/net/peer/index.ts +2 -1
  48. package/src/net/pool/index.ts +25 -5
  49. package/src/net/protocol/dial/SignatureDialProtocol.ts +11 -13
  50. package/src/net/protocol/dial/TransactionStatusDialProtocol.ts +33 -0
  51. package/src/net/protocol/index.ts +67 -1
  52. package/src/tasks/AutoUpdateTask.ts +82 -0
  53. package/src/tasks/BaseTask.ts +13 -3
  54. package/src/tasks/{InteropBridge/ProcessWithdrawEvents.ts → InteropXContract/ProcessBridgeRequestEvents.ts} +78 -93
  55. package/src/tasks/InteropXContract/SyncBridgeCommittedEvents.ts +124 -0
  56. package/src/tasks/InteropXContract/SyncBridgeRequestEvents.ts +115 -0
  57. package/src/tasks/InteropXContract/SyncBridgeRequestSentEvents.ts +121 -0
  58. package/src/tasks/Transactions/SyncTransactionStatusTask.ts +67 -0
  59. package/src/tasks/index.ts +27 -21
  60. package/src/typechain/InteropXContract.ts +680 -0
  61. package/src/typechain/factories/InteropXContract__factory.ts +642 -0
  62. package/src/typechain/factories/index.ts +1 -2
  63. package/src/typechain/index.ts +2 -4
  64. package/src/utils/index.ts +96 -129
  65. package/tsconfig.json +7 -2
  66. package/dist/src/abi/interopBridgeToken.json +0 -286
  67. package/dist/src/abi/interopXGateway.json +0 -184
  68. package/dist/src/constants/itokens.js +0 -13
  69. package/dist/src/tasks/InteropBridge/SyncWithdrawEvents.js +0 -70
  70. package/dist/src/tasks/InteropXGateway/ProcessDepositEvents.js +0 -147
  71. package/dist/src/tasks/InteropXGateway/SyncDepositEvents.js +0 -75
  72. package/dist/src/typechain/InteropXGateway.js +0 -2
  73. package/dist/src/typechain/factories/InteropBridgeToken__factory.js +0 -459
  74. package/dist/src/typechain/factories/InteropXGateway__factory.js +0 -265
  75. package/src/abi/interopBridgeToken.json +0 -286
  76. package/src/abi/interopXGateway.json +0 -184
  77. package/src/constants/itokens.ts +0 -10
  78. package/src/tasks/InteropBridge/SyncWithdrawEvents.ts +0 -121
  79. package/src/tasks/InteropXGateway/ProcessDepositEvents.ts +0 -241
  80. package/src/tasks/InteropXGateway/SyncDepositEvents.ts +0 -126
  81. package/src/typechain/InteropBridgeToken.ts +0 -686
  82. package/src/typechain/InteropXGateway.ts +0 -407
  83. package/src/typechain/factories/InteropBridgeToken__factory.ts +0 -466
  84. 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
@@ -0,0 +1,6 @@
1
+ import moduleAlias from 'module-alias';
2
+ moduleAlias.addAliases({
3
+ "@": __dirname,
4
+ })
5
+
6
+ moduleAlias();
package/src/api/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import fastify from "fastify"
2
- import cors from 'fastify-cors'
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
+ ['createdAt', '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
  }
@@ -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
@@ -8,14 +10,18 @@ class Config {
8
10
  public readonly privateKey: string
9
11
  public readonly wallet: Wallet
10
12
  public readonly staging: boolean
13
+ public readonly autoUpdate: boolean
14
+ public readonly baseConfigPath: string
11
15
 
12
16
  constructor() {
13
17
  this.events = new EventBus() as EventBusType
14
- this.maxPeers = 10
18
+ this.maxPeers = 20
15
19
  this.privateKey = process.env.PRIVATE_KEY as string;
16
20
  this.staging = !! process.env.STAGING && process.env.STAGING === 'true';
21
+ this.autoUpdate = !! process.env.AUTO_UPDATE && process.env.AUTO_UPDATE === 'true';
17
22
  this.wallet = new Wallet(this.privateKey);
18
23
  this.leadNodeAddress = '0x910E413DBF3F6276Fe8213fF656726bDc142E08E'
24
+ this.baseConfigPath = expandHomeDir(`~/.interop-x`);
19
25
  }
20
26
 
21
27
  get publicAddress(){
@@ -25,6 +31,10 @@ class Config {
25
31
  isLeadNode() {
26
32
  return ethers.utils.getAddress(this.leadNodeAddress) === ethers.utils.getAddress(this.wallet.address)
27
33
  }
34
+
35
+ isMaintenanceMode(){
36
+ return fs.existsSync(this.baseConfigPath + '/maintenance')
37
+ }
28
38
  }
29
39
 
30
40
  export default new Config()
@@ -2,16 +2,16 @@ export const addresses = {
2
2
  1: {
3
3
  gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
4
4
  multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
5
- interopXGateway: '',
5
+ interopXContract: '',
6
6
  },
7
7
  137: {
8
8
  gnosisSafe: '0x5635d2910e51da33d9DC0422c893CF4F28B69A25',
9
9
  multisend: '0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761',
10
- interopXGateway: '',
10
+ interopXContract: '0x41bd77583674B3a5c073FBb4922C0C8dA91C43cF',
11
11
  },
12
12
  43114: {
13
13
  gnosisSafe: '0x31d7a5194Fe60AC209Cf1Ce2d539C9A60662Ed6b',
14
14
  multisend: '0x998739BFdAAdde7C933B942a68053933098f9EDa',
15
- interopXGateway: '0x8D27758751BA488690974B6Ccfcda771D462945f',
15
+ interopXContract: '0xCF391A3057eDba541c80307aC5E3Bc1E4a9471b7',
16
16
  }
17
17
  }
@@ -1,3 +1,2 @@
1
1
  export * from './addresses';
2
2
  export * from './tokens';
3
- export * from './itokens';
@@ -1,30 +1,42 @@
1
1
  export const tokens = {
2
2
  1: [
3
3
  {
4
+ aliases: ['eth'],
4
5
  symbol: "ETH",
5
6
  name: "Ethereum",
6
7
  address: "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
7
8
  decimals: 18,
8
9
  },
9
10
  {
11
+ aliases: ['weth'],
12
+ symbol: "WETH",
13
+ name: "Wrapped Ethereum",
14
+ address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
15
+ decimals: 18,
16
+ },
17
+ {
18
+ aliases: ['dai'],
10
19
  symbol: "DAI",
11
20
  name: "DAI Stable",
12
21
  address: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
13
22
  decimals: 18,
14
23
  },
15
24
  {
25
+ aliases: ['usdc'],
16
26
  symbol: "USDC",
17
27
  name: "USD Coin",
18
28
  address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
19
29
  decimals: 6,
20
30
  },
21
31
  {
32
+ aliases: ['usdt'],
22
33
  symbol: "USDT",
23
34
  name: "Tether USD Coin",
24
35
  address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
25
36
  decimals: 6,
26
37
  },
27
38
  {
39
+ aliases: ['wbtc'],
28
40
  symbol: "WBTC",
29
41
  name: "Wrapped BTC",
30
42
  address: "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
@@ -33,36 +45,42 @@ export const tokens = {
33
45
  ],
34
46
  137: [
35
47
  {
48
+ aliases: ['eth', 'weth'],
36
49
  symbol: "ETH",
37
50
  name: "Ethereum",
38
51
  address: "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
39
52
  decimals: 18,
40
53
  },
41
54
  {
55
+ aliases: ['dai'],
42
56
  symbol: "DAI",
43
57
  name: "DAI Stable",
44
58
  address: "0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",
45
59
  decimals: 18,
46
60
  },
47
61
  {
62
+ aliases: ['usdc'],
48
63
  symbol: "USDC",
49
64
  name: "USD Coin",
50
65
  address: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
51
66
  decimals: 6,
52
67
  },
53
68
  {
69
+ aliases: ['usdt'],
54
70
  symbol: "USDT",
55
71
  name: "Tether USD Coin",
56
72
  address: "0xc2132D05D31c914a87C6611C10748AEb04B58e8F",
57
73
  decimals: 6,
58
74
  },
59
75
  {
76
+ aliases: ['wbtc'],
60
77
  symbol: "WBTC",
61
78
  name: "Wrapped BTC",
62
79
  address: "0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",
63
80
  decimals: 8,
64
81
  },
65
82
  {
83
+ aliases: ['avax'],
66
84
  symbol: "AVAX",
67
85
  name: "Avalanche Token",
68
86
  address: "0x2C89bbc92BD86F8075d1DEcc58C7F4E0107f286b",
@@ -71,34 +89,46 @@ export const tokens = {
71
89
  ],
72
90
  43114: [
73
91
  {
92
+ aliases: ['eth', 'weth'],
74
93
  symbol: "ETH",
75
94
  name: "Ethereum",
76
95
  address: "0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB",
77
96
  decimals: 18,
78
97
  },
79
98
  {
99
+ aliases: ['dai'],
80
100
  symbol: "DAI",
81
101
  name: "DAI Stable",
82
102
  address: "0xd586E7F844cEa2F87f50152665BCbc2C279D8d70",
83
103
  decimals: 18,
84
104
  },
85
105
  {
106
+ aliases: ['usdc'],
86
107
  symbol: "USDC",
87
108
  name: "USD Coin",
88
109
  address: "0xA7D7079b0FEaD91F3e65f86E8915Cb59c1a4C664",
89
110
  decimals: 6,
90
111
  },
91
112
  {
92
- symbol: "USDT",
113
+ aliases: ['usdt'],
114
+ symbol: "USDt",
93
115
  name: "Tether USD Coin",
116
+ address: "0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",
117
+ decimals: 6,
118
+ },
119
+ {
120
+ aliases: ['usdt'],
121
+ symbol: "USDT.e",
122
+ name: "Tether USD",
94
123
  address: "0xc7198437980c041c805A1EDcbA50c1Ce5db95118",
95
124
  decimals: 6,
96
125
  },
97
126
  {
127
+ aliases: ["wbtc"],
98
128
  symbol: "WBTC",
99
129
  name: "Wrapped BTC",
100
130
  address: "0x50b7545627a5162F82A992c33b87aDc75187B218",
101
131
  decimals: 8,
102
132
  },
103
133
  ],
104
- };
134
+ } as Record<number, { aliases: string[], symbol: string, name: string, address: string, decimals: number }[]>;