@instadapp/avocado-base 0.0.0-dev.9853aa2 → 0.0.0-dev.9c7000a

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 (57) hide show
  1. package/.github/workflows/npm-publish-dev.yml +2 -5
  2. package/.vscode/settings.json +67 -0
  3. package/abi/avoFactoryProxy.json +1 -1
  4. package/abi/forwarder.json +1 -1
  5. package/abi/multisigAgnosticForwarder.json +937 -0
  6. package/abi/multisigForwarder.json +697 -0
  7. package/app.vue +9 -2
  8. package/assets/images/icons/change-threshold.svg +4 -0
  9. package/assets/images/icons/check.svg +3 -0
  10. package/assets/images/icons/copy.svg +9 -2
  11. package/assets/images/icons/cross-transfer.svg +7 -0
  12. package/assets/images/icons/dapp.svg +4 -0
  13. package/assets/images/icons/deploy.svg +12 -0
  14. package/assets/images/icons/gas.svg +12 -5
  15. package/assets/images/icons/hammer.svg +5 -0
  16. package/assets/images/icons/info-2.svg +12 -0
  17. package/assets/images/icons/instadapp-pro.svg +4 -0
  18. package/assets/images/icons/multi-send.svg +7 -0
  19. package/assets/images/icons/permit-sign.svg +11 -0
  20. package/assets/images/icons/plus-circle.svg +6 -0
  21. package/assets/images/icons/refresh.svg +4 -4
  22. package/assets/images/icons/reject-proposal.svg +6 -0
  23. package/assets/images/icons/stars.svg +4 -0
  24. package/assets/images/icons/transfer.svg +5 -0
  25. package/assets/images/icons/trash-2.svg +8 -0
  26. package/assets/images/icons/upgrade.svg +4 -0
  27. package/components/ActionLogo.vue +42 -0
  28. package/components/ActionMetadata.vue +56 -21
  29. package/components/Address.vue +74 -0
  30. package/components/AuthorityAvatar.vue +39 -0
  31. package/components/ChainLogo.vue +18 -563
  32. package/components/CopyClipboard.vue +42 -0
  33. package/components/metadata/Bridge.vue +33 -14
  34. package/components/metadata/CrossTransfer.vue +37 -28
  35. package/components/metadata/GasTopup.vue +17 -12
  36. package/components/metadata/Permit2.vue +14 -10
  37. package/components/metadata/Signers.vue +19 -0
  38. package/components/metadata/Swap.vue +45 -46
  39. package/components/metadata/Transfer.vue +27 -25
  40. package/contracts/MultisigAgnosticForwarder.ts +1423 -0
  41. package/contracts/MultisigForwarder.ts +859 -0
  42. package/contracts/factories/MultisigAgnosticForwarder__factory.ts +2135 -0
  43. package/contracts/factories/MultisigForwarder__factory.ts +721 -0
  44. package/contracts/factories/index.ts +2 -0
  45. package/contracts/index.ts +4 -0
  46. package/eslint.config.mjs +34 -0
  47. package/nuxt.config.ts +21 -12
  48. package/package.json +16 -14
  49. package/server/utils/index.ts +4 -4
  50. package/utils/avocado.ts +17 -17
  51. package/utils/bignumber.ts +47 -36
  52. package/utils/formatter.ts +55 -61
  53. package/utils/helper.ts +39 -28
  54. package/utils/metadata.ts +538 -361
  55. package/utils/network.ts +552 -184
  56. package/utils/services.ts +15 -10
  57. package/utils/utils.d.ts +146 -129
package/utils/network.ts CHANGED
@@ -1,331 +1,699 @@
1
- import { ethers } from "ethers";
1
+ import { ethers } from 'ethers'
2
+ import { defineChain } from 'viem'
3
+ import {
4
+ arbitrum,
5
+ aurora,
6
+ avalanche,
7
+ base,
8
+ blast,
9
+ bsc,
10
+ fantom,
11
+ fuse,
12
+ gnosis,
13
+ linea,
14
+ mainnet,
15
+ mode,
16
+ opBNB,
17
+ optimism,
18
+ polygon,
19
+ polygonZkEvm,
20
+ scroll,
21
+ } from 'viem/chains'
22
+ import {
23
+ AVO_PROD_CHAIN_ID,
24
+ AVO_PROD_CHAIN_NAME,
25
+ AVO_PROD_EXPLORER_URL,
26
+ AVO_PROD_RPC_URL,
27
+ AVO_STAGING_CHAIN_ID,
28
+ AVO_STAGING_CHAIN_NAME,
29
+ AVO_STAGING_EXPLORER_URL,
30
+ AVO_STAGING_RPC_URL,
31
+ } from './avocado'
2
32
 
3
- export const bridgeDisabledNetworks = [1101];
33
+ export const bridgeDisabledNetworks = []
34
+
35
+ export const networksSimulationNotSupported = [1313161554, 1101]
36
+
37
+ const avocado = defineChain({
38
+ id: AVO_PROD_CHAIN_ID,
39
+ name: AVO_PROD_CHAIN_NAME,
40
+ nativeCurrency: {
41
+ name: 'Avocado',
42
+ symbol: 'USDC',
43
+ decimals: 18,
44
+ },
45
+ rpcUrls: {
46
+ default: { http: [AVO_PROD_RPC_URL] },
47
+ },
48
+ blockExplorers: {
49
+ default: { name: 'Avoscan', url: AVO_PROD_EXPLORER_URL },
50
+ },
51
+ })
52
+
53
+ const avocadoStaging = defineChain({
54
+ id: AVO_STAGING_CHAIN_ID,
55
+ name: AVO_STAGING_CHAIN_NAME,
56
+ nativeCurrency: {
57
+ name: 'Avocado',
58
+ symbol: 'USDC',
59
+ decimals: 18,
60
+ },
61
+ rpcUrls: {
62
+ default: { http: [AVO_STAGING_RPC_URL] },
63
+ },
64
+ blockExplorers: {
65
+ default: { name: 'Avoscan', url: AVO_STAGING_EXPLORER_URL },
66
+ },
67
+ })
68
+
69
+ const sonic = defineChain({
70
+ id: 146,
71
+ name: 'Sonic',
72
+ nativeCurrency: {
73
+ decimals: 18,
74
+ name: 'Sonic',
75
+ symbol: 'S',
76
+ },
77
+ rpcUrls: {
78
+ default: { http: ['https://rpc.soniclabs.com'] },
79
+ },
80
+ blockExplorers: {
81
+ default: {
82
+ name: 'Sonic Explorer',
83
+ url: 'https://explorer.soniclabs.com',
84
+ },
85
+ },
86
+ testnet: false,
87
+ })
4
88
 
5
89
  export const networks: Network[] = [
6
90
  {
7
- name: "Ethereum",
8
- debankName: "eth",
9
- ankrName: "eth",
10
- zerionName: "ethereum",
11
- chainId: 1,
12
- explorerUrl: "https://etherscan.io",
13
- color: "#5D5FEF",
91
+ name: 'Polygon',
92
+ debankName: 'matic',
93
+ ankrName: 'polygon',
94
+ zerionName: 'polygon',
95
+ color: '#7A4ADD',
96
+ chainId: 137,
97
+ legacySupported: true,
98
+ viemChain: polygon,
99
+ balanceResolverAddress: '0x58632D23120b20650262b8A629a14e4F4043E0D9',
100
+ usdcAddress: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174',
101
+ explorerUrl: 'https://polygonscan.com',
102
+ apiURL: 'https://api.polygonscan.com/api',
103
+ fakeTransactionHash:
104
+ '0x906c551abd5873a428505b6530ac14d91367820706c7ee525f6d7313265d1c92',
14
105
  get serverRpcUrl() {
15
- return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0];
106
+ return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0]
16
107
  },
17
- balanceResolverAddress: "0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43",
18
- usdcAddress: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
19
108
  params: {
20
- rpcUrls: ["https://rpc.ankr.com/eth"],
109
+ chainName: 'Matic(Polygon) Mainnet',
21
110
  nativeCurrency: {
22
- name: "Ethereum",
23
- symbol: "ETH",
111
+ name: 'Matic',
112
+ symbol: 'MATIC',
24
113
  decimals: 18,
25
114
  },
115
+ rpcUrls: ['https://polygon-rpc.com'],
26
116
  },
27
117
  },
28
118
  {
29
- name: "Polygon",
30
- debankName: "matic",
31
- ankrName: "polygon",
32
- zerionName: "polygon",
33
- color: "#7A4ADD",
34
- chainId: 137,
35
- balanceResolverAddress: "0x58632D23120b20650262b8A629a14e4F4043E0D9",
36
- usdcAddress: "0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",
37
- explorerUrl: "https://polygonscan.com",
119
+ name: 'Arbitrum',
120
+ debankName: 'arb',
121
+ ankrName: 'arbitrum',
122
+ zerionName: 'arbitrum',
123
+ legacySupported: true,
124
+ viemChain: arbitrum,
125
+ color: '#2D374B',
126
+ chainId: 42161,
127
+ usdcAddress: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8',
128
+ balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
129
+ fakeTransactionHash:
130
+ '0x9fa291c3b09d31f19b1fa5dd05f30169d1364036d5f7c14b026410bc07bd8843',
131
+ explorerUrl: 'https://arbiscan.io',
132
+ apiURL: 'https://api.arbiscan.io/api',
38
133
  get serverRpcUrl() {
39
- return process.env?.POLYGON_RPC_URL || this.params.rpcUrls[0];
134
+ return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0]
40
135
  },
41
136
  params: {
42
- chainName: "Matic(Polygon) Mainnet",
137
+ chainName: 'Arbitrum One',
43
138
  nativeCurrency: {
44
- name: "Matic",
45
- symbol: "MATIC",
139
+ name: 'Ethereum',
140
+ symbol: 'ETH',
46
141
  decimals: 18,
47
142
  },
48
- rpcUrls: ["https://polygon-rpc.com"],
143
+ rpcUrls: ['https://arb1.arbitrum.io/rpc'],
49
144
  },
50
145
  },
51
146
  {
52
- name: "Arbitrum",
53
- debankName: "arb",
54
- ankrName: "arbitrum",
55
- zerionName: "arbitrum",
56
- color: "#2D374B",
57
- chainId: 42161,
58
- usdcAddress: "0xff970a61a04b1ca14834a43f5de4533ebddb5cc8",
59
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
60
- explorerUrl: "https://arbiscan.io",
147
+ name: 'Ethereum',
148
+ debankName: 'eth',
149
+ ankrName: 'eth',
150
+ zerionName: 'ethereum',
151
+ viemChain: mainnet,
152
+ chainId: 1,
153
+ explorerUrl: 'https://etherscan.io',
154
+ legacySupported: true,
155
+ fakeTransactionHash:
156
+ '0x13232dd32cef2f641ead890a507710c96560c8c9c3d5fab6facb5ec563c49433',
157
+ apiURL: 'https://api.etherscan.io/api',
158
+ color: '#5D5FEF',
159
+ get serverRpcUrl() {
160
+ return process.env?.MAINNET_RPC_URL || this.params.rpcUrls[0]
161
+ },
162
+ balanceResolverAddress: '0x5b7D61b389D12e1f5873d0cCEe7E675915AB5F43',
163
+ usdcAddress: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
164
+ params: {
165
+ rpcUrls: ['https://rpc.ankr.com/eth'],
166
+ nativeCurrency: {
167
+ name: 'Ethereum',
168
+ symbol: 'ETH',
169
+ decimals: 18,
170
+ },
171
+ },
172
+ },
173
+ {
174
+ name: 'Base',
175
+ chainId: 8453,
176
+ color: '#1E2024',
177
+ ankrName: 'base',
178
+ viemChain: base,
179
+ explorerUrl: 'https://basescan.org',
180
+ legacySupported: true,
181
+ fakeTransactionHash:
182
+ '0xf7833d80da33730c4fc5d4c64151f0eaa64c0c0535be022af0228a44cc4e9c8e',
183
+ apiURL: 'https://api.basescan.org/api',
61
184
  get serverRpcUrl() {
62
- return process.env?.ARBITRUM_RPC_URL || this.params.rpcUrls[0];
185
+ return process.env?.BASE_RPC_URL || this.params.rpcUrls[0]
63
186
  },
187
+ usdcAddress: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA',
188
+ balanceResolverAddress: '0x23c8EAb8a4373dD16b0947Ebe8bf76Ff7A49d13C',
64
189
  params: {
65
- chainName: "Arbitrum One",
190
+ rpcUrls: ['https://rpc.ankr.com/base'],
191
+ chainName: 'Base',
66
192
  nativeCurrency: {
67
- name: "Ethereum",
68
- symbol: "ETH",
193
+ name: 'Ethereum',
194
+ symbol: 'ETH',
69
195
  decimals: 18,
70
196
  },
71
- rpcUrls: ["https://arb1.arbitrum.io/rpc"],
72
197
  },
73
198
  },
74
199
  {
75
- name: "Optimism",
76
- debankName: "op",
77
- ankrName: "optimism",
78
- zerionName: "optimism",
79
- color: "#FF0420",
200
+ name: 'Optimism',
201
+ debankName: 'op',
202
+ ankrName: 'optimism',
203
+ zerionName: 'optimism',
204
+ color: '#FF0420',
205
+ legacySupported: true,
206
+ viemChain: optimism,
80
207
  chainId: 10,
81
- usdcAddress: "0x7f5c764cbc14f9669b88837ca1490cca17c31607",
82
- balanceResolverAddress: "0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2",
83
- explorerUrl: "https://optimistic.etherscan.io",
208
+ apiURL: 'https://api-optimistic.etherscan.io/api',
209
+ usdcAddress: '0x7f5c764cbc14f9669b88837ca1490cca17c31607',
210
+ balanceResolverAddress: '0xca5f37e6D8bB24c5A7958d5eccE7Bd9Aacc944f2',
211
+ fakeTransactionHash:
212
+ '0xee7311d68059732b05088f2144dfec6c7a4f5fd0433eb85306afcd6bdf17cebc',
213
+ explorerUrl: 'https://optimistic.etherscan.io',
84
214
  get serverRpcUrl() {
85
- return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0];
215
+ return process.env?.OPTIMISM_RPC_URL || this.params.rpcUrls[0]
86
216
  },
87
217
  params: {
88
- chainName: "Optimistic Ethereum",
218
+ chainName: 'Optimistic Ethereum',
89
219
  nativeCurrency: {
90
- name: "Ethereum",
91
- symbol: "ETH",
220
+ name: 'Ethereum',
221
+ symbol: 'ETH',
92
222
  decimals: 18,
93
223
  },
94
- rpcUrls: ["https://rpc.ankr.com/optimism"],
224
+ rpcUrls: ['https://rpc.ankr.com/optimism'],
95
225
  },
96
226
  },
97
227
  {
98
- name: "Avalanche",
99
- debankName: "avax",
100
- ankrName: "avalanche",
101
- zerionName: "avalanche",
102
- color: "#EB5757",
103
- chainId: 43114,
104
- usdcAddress: "0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",
105
- balanceResolverAddress: "0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E",
106
- explorerUrl: "https://snowtrace.io",
228
+ name: 'Polygon zkEVM',
229
+ chainId: 1101,
230
+ color: '#8544f6',
231
+ ankrName: 'polygon_zkevm',
232
+ viemChain: polygonZkEvm,
233
+ legacySupported: true,
234
+ explorerUrl: 'https://zkevm.polygonscan.com',
235
+ apiURL: 'https://api-zkevm.polygonscan.com/api',
236
+ balanceResolverAddress: '0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01',
237
+ fakeTransactionHash:
238
+ '0x1077130463ade91ad4e9c43c3195298e26a99970975238128912490eea12bf41',
239
+ usdcAddress: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035',
107
240
  get serverRpcUrl() {
108
- return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0];
241
+ return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0]
109
242
  },
110
243
  params: {
111
- chainName: "Avalanche Network",
244
+ chainName: 'polygon zkEVM',
245
+ rpcUrls: ['https://zkevm-rpc.com'],
112
246
  nativeCurrency: {
113
- name: "Avalanche",
114
- symbol: "AVAX",
247
+ name: 'Ethereum',
248
+ symbol: 'ETH',
115
249
  decimals: 18,
116
250
  },
117
- rpcUrls: ["https://rpc.ankr.com/avalanche"],
118
251
  },
119
252
  },
120
253
  {
121
- name: "BSC",
122
- debankName: "bsc",
123
- ankrName: "bsc",
124
- zerionName: "binance-smart-chain",
125
- color: "#F3BA2F",
254
+ name: 'BSC',
255
+ debankName: 'bsc',
256
+ ankrName: 'bsc',
257
+ zerionName: 'binance-smart-chain',
258
+ color: '#F3BA2F',
126
259
  chainId: 56,
127
- explorerUrl: "https://bscscan.com",
128
- usdcAddress: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
129
- balanceResolverAddress: "0xb808cff38706e267067b0af427726aa099f69f89",
260
+ legacySupported: true,
261
+ explorerUrl: 'https://bscscan.com',
262
+ viemChain: bsc,
263
+ fakeTransactionHash:
264
+ '0x897d54bf8e492f840bd4d8f1e743bfcab8226ab4d5a899e47ee433dcd6d6abf7',
265
+ apiURL: 'https://api.bscscan.com/api',
266
+ usdcAddress: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d',
267
+ balanceResolverAddress: '0xb808cff38706e267067b0af427726aa099f69f89',
130
268
  get serverRpcUrl() {
131
- return process.env?.BSC_RPC_URL || this.params.rpcUrls[0];
269
+ return process.env?.BSC_RPC_URL || this.params.rpcUrls[0]
132
270
  },
133
271
  params: {
134
- chainName: "Binance Smart Chain",
135
- rpcUrls: ["https://rpc.ankr.com/bsc"],
272
+ chainName: 'Binance Smart Chain',
273
+ rpcUrls: ['https://rpc.ankr.com/bsc'],
136
274
  nativeCurrency: {
137
- name: "Binance Coin",
138
- symbol: "BNB",
275
+ name: 'Binance Coin',
276
+ symbol: 'BNB',
139
277
  decimals: 18,
140
278
  },
141
279
  },
142
280
  },
143
281
  {
144
- name: "Gnosis",
145
- debankName: "xdai",
146
- zerionName: "xdai",
147
- color: "#04795C",
148
- chainId: 100,
149
- balanceResolverAddress: "0xfaa244e276b1597f663975ed007ee4ff70d27849",
150
- explorerUrl: "https://gnosisscan.io",
151
- usdcAddress: "0xddafbb505ad214d7b80b1f830fccc89b60fb7a83",
282
+ name: 'Avalanche',
283
+ debankName: 'avax',
284
+ ankrName: 'avalanche',
285
+ zerionName: 'avalanche',
286
+ color: '#EB5757',
287
+ viemChain: avalanche,
288
+ legacySupported: true,
289
+ chainId: 43114,
290
+ usdcAddress: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e',
291
+ balanceResolverAddress: '0x63009f31D054E0ac9F321Cf0D642375236A4Bf1E',
292
+ explorerUrl: 'https://snowtrace.io',
293
+ fakeTransactionHash:
294
+ '0x233aac7402558dd4e23f938a50f983e67f5c9604233981c7ac74e63737b8294e',
295
+ apiURL: 'https://api.routescan.io/v2/network/mainnet/evm/43114/etherscan/api',
152
296
  get serverRpcUrl() {
153
- return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0];
297
+ return process.env?.AVALANCHE_RPC_URL || this.params.rpcUrls[0]
154
298
  },
155
299
  params: {
156
- chainName: "Gnosis Safe",
157
- rpcUrls: ["https://rpc.ankr.com/gnosis"],
300
+ chainName: 'Avalanche Network',
158
301
  nativeCurrency: {
159
- name: "xdaistable",
160
- symbol: "xDAI",
302
+ name: 'Avalanche',
303
+ symbol: 'AVAX',
161
304
  decimals: 18,
162
305
  },
306
+ rpcUrls: ['https://rpc.ankr.com/avalanche'],
163
307
  },
164
308
  },
165
309
  {
166
- name: "Polygon zkEVM",
167
- chainId: 1101,
168
- color: "#8544f6",
169
- explorerUrl: "https://zkevm.polygonscan.com",
170
- balanceResolverAddress: "0x48D1Fa5Ee6691a1E0B45d2B515650997BEA27a01",
171
- usdcAddress: "0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035",
310
+ name: 'Fantom',
311
+ chainId: 250,
312
+ zerionName: 'fantom',
313
+ explorerUrl: 'https://ftmscan.com',
314
+ apiURL: 'https://api.ftmscan.com/api',
315
+ ankrName: 'fantom',
316
+ color: '#1969ff',
317
+ legacySupported: true,
318
+ viemChain: fantom,
172
319
  get serverRpcUrl() {
173
- return process.env?.POLYGON_ZKEVM_RPC_URL || this.params.rpcUrls[0];
320
+ return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0]
174
321
  },
322
+ usdcAddress: '0x04068da6c83afcfa0e13ba15a6696662335d5b75',
323
+ balanceResolverAddress: '0x929376c77a2fb8152375a089a4fccf84ff481479',
324
+ fakeTransactionHash:
325
+ '0x1e9a8405d660172314124e06896212c0786d7fb1550b89410d4bc87e9e8054e4',
175
326
  params: {
176
- chainName: "polygon zkEVM",
177
- rpcUrls: ["https://zkevm-rpc.com"],
178
-
327
+ rpcUrls: ['https://rpc.ankr.com/fantom'],
328
+ chainName: 'Fantom',
329
+ nativeCurrency: {
330
+ name: 'Fantom',
331
+ symbol: 'FTM',
332
+ decimals: 18,
333
+ },
334
+ },
335
+ },
336
+ {
337
+ name: 'Gnosis',
338
+ debankName: 'xdai',
339
+ zerionName: 'xdai',
340
+ color: '#04795C',
341
+ ankrName: 'gnosis',
342
+ viemChain: gnosis,
343
+ legacySupported: true,
344
+ chainId: 100,
345
+ balanceResolverAddress: '0xfaa244e276b1597f663975ed007ee4ff70d27849',
346
+ explorerUrl: 'https://gnosisscan.io',
347
+ fakeTransactionHash:
348
+ '0x1513033806310a2c3b29f2276f8aa7388461b0ef9f8499c297e68c12187c179b',
349
+ apiURL: 'https://api.gnosisscan.io/api',
350
+ usdcAddress: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83',
351
+ get serverRpcUrl() {
352
+ return process.env?.GNOSIS_RPC_URL || this.params.rpcUrls[0]
353
+ },
354
+ params: {
355
+ chainName: 'Gnosis Safe',
356
+ rpcUrls: ['https://rpc.ankr.com/gnosis'],
179
357
  nativeCurrency: {
180
- name: "Ethereum",
181
- symbol: "ETH",
358
+ name: 'xdaistable',
359
+ symbol: 'xDAI',
182
360
  decimals: 18,
183
361
  },
184
362
  },
185
363
  },
186
364
  {
187
- name: "Aurora",
365
+ name: 'Aurora',
188
366
  chainId: 1313161554,
189
- zerionName: "aurora",
190
- color: "#78d64b",
191
- explorerUrl: "https://explorer.mainnet.aurora.dev",
367
+ zerionName: 'aurora',
368
+ color: '#78d64b',
369
+ viemChain: aurora,
370
+ legacySupported: true,
371
+ explorerUrl: 'https://explorer.mainnet.aurora.dev',
372
+ apiURL: 'https://explorer.mainnet.aurora.dev/api/v2',
373
+ fakeTransactionHash:
374
+ '0x0923401c5a80c39a5cd57c098a6c4729edbefd0db6894def7d349493f4ff3ec6',
192
375
  get serverRpcUrl() {
193
- return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0];
376
+ return process.env?.AURORA_RPC_URL || this.params.rpcUrls[0]
194
377
  },
195
- usdcAddress: "0xB12BFcA5A55806AaF64E99521918A4bf0fC40802",
196
- balanceResolverAddress: "0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474",
378
+ usdcAddress: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
379
+ balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
197
380
  params: {
198
- rpcUrls: ["https://mainnet.aurora.dev"],
199
- chainName: "Aurora",
381
+ rpcUrls: ['https://mainnet.aurora.dev'],
382
+ chainName: 'Aurora',
200
383
  nativeCurrency: {
201
384
  decimals: 18,
202
- name: "Aurora ETH",
203
- symbol: "AETH",
385
+ name: 'Aurora ETH',
386
+ symbol: 'AETH',
204
387
  },
205
388
  },
206
389
  },
207
390
  {
208
- name: "Fantom",
209
- chainId: 250,
210
- zerionName: "fantom",
211
- explorerUrl: "https://ftmscan.com",
212
- ankrName: "fantom",
213
- color: "#1969ff",
391
+ name: 'Fuse',
392
+ chainId: 122,
393
+ zerionName: 'fuse',
394
+ color: '#78d64b',
395
+ explorerUrl: 'https://explorer.fuse.io',
396
+ apiURL: 'https://explorer.fuse.io/api/v2',
397
+ viemChain: fuse,
398
+ legacySupported: false,
399
+ fakeTransactionHash:
400
+ '0xf22a8031de9b978a57c728e18c6b54633356c39db4d0466e53b9b7c3ee7f8def',
401
+ get serverRpcUrl() {
402
+ return process.env?.FUSE_RPC_URL || this.params.rpcUrls[0]
403
+ },
404
+ usdcAddress: '',
405
+ balanceResolverAddress: '0xdF19Da523DA64bBE82eE0E4DFf00d676A8386474',
406
+ params: {
407
+ rpcUrls: ['https://fuse-mainnet.chainstacklabs.com'],
408
+ chainName: 'Fuse',
409
+ nativeCurrency: {
410
+ decimals: 18,
411
+ name: 'Fuse',
412
+ symbol: 'fuse',
413
+ },
414
+ },
415
+ },
416
+ {
417
+ name: 'Scroll',
418
+ chainId: 534352,
419
+ color: '#78d64b',
420
+ ankrName: 'scroll',
421
+ legacySupported: false,
422
+ explorerUrl: 'https://scrollscan.com',
423
+ apiURL: 'https://api.scrollscan.com/api',
424
+ viemChain: scroll,
425
+ fakeTransactionHash:
426
+ '0x6bf297c414264fc8cddd47224632b4426a02138df2f50fe891eca87f6aefea01',
427
+ get serverRpcUrl() {
428
+ return process.env?.SCROLL_RPC_URL || this.params.rpcUrls[0]
429
+ },
430
+ params: {
431
+ rpcUrls: ['https://rpc.scroll.io'],
432
+ chainName: 'Scroll',
433
+ nativeCurrency: {
434
+ name: 'Ethereum',
435
+ symbol: 'ETH',
436
+ decimals: 18,
437
+ },
438
+ },
439
+ },
440
+ {
441
+ name: 'opBNB',
442
+ chainId: 204,
443
+ color: '#78d64b',
444
+ explorerUrl: 'https://opbnbscan.com',
445
+ apiURL: null,
446
+ viemChain: opBNB,
447
+ legacySupported: false,
448
+ fakeTransactionHash:
449
+ '0xb9438a3eae61442bc7d419d79930370ce09ac0f46e0695025751e3bfe1a931e7',
450
+ get serverRpcUrl() {
451
+ return process.env?.OPBNB_RPC_URL || this.params.rpcUrls[0]
452
+ },
453
+ params: {
454
+ rpcUrls: ['https://opbnb-mainnet-rpc.bnbchain.org'],
455
+ chainName: 'opBNB',
456
+ nativeCurrency: {
457
+ name: 'BNB',
458
+ symbol: 'BNB',
459
+ decimals: 18,
460
+ },
461
+ },
462
+ },
463
+ {
464
+ chainId: 34443,
465
+ name: 'Mode',
466
+ color: '#d7ff00',
467
+ explorerUrl: 'https://explorer.mode.network',
468
+ legacySupported: false,
469
+ fakeTransactionHash: '0xb58002db3481f2c51855a91280ec940d0bebec075c4b362b9f90c21a2b14edbe',
470
+ apiURL: 'https://explorer.mode.network/api/v2',
471
+ params: {
472
+ rpcUrls: ['https://1rpc.io/mode'],
473
+ chainName: 'Mode',
474
+ nativeCurrency: {
475
+ name: 'Ethereum',
476
+ symbol: 'ETH',
477
+ decimals: 18,
478
+ },
479
+ },
214
480
  get serverRpcUrl() {
215
- return process.env?.FANTOM_RPC_URL || this.params.rpcUrls[0];
481
+ return process.env?.MODE_RPC_URL || this.params.rpcUrls[0]
216
482
  },
217
- usdcAddress: "0x04068da6c83afcfa0e13ba15a6696662335d5b75",
218
- balanceResolverAddress: "0x929376c77a2fb8152375a089a4fccf84ff481479",
483
+ viemChain: mode,
484
+ },
485
+ {
486
+ chainId: 81457,
487
+ name: 'Blast',
488
+ color: '#78d64b',
489
+ explorerUrl: 'https://blastscan.io',
490
+ apiURL: 'https://api.blastscan.io/api',
491
+ legacySupported: false,
492
+ fakeTransactionHash: '0x934ed8516242f8c08bb9e0e90bb1f989d92ceb6b0333e86ac2d555f25ac27e58',
219
493
  params: {
220
- rpcUrls: ["https://rpc.ankr.com/fantom"],
221
- chainName: "Fantom",
494
+ rpcUrls: ['https://rpc.ankr.com/blast'],
495
+ chainName: 'Blast',
222
496
  nativeCurrency: {
223
- name: "Fantom",
224
- symbol: "FTM",
497
+ name: 'Ethereum',
498
+ symbol: 'ETH',
225
499
  decimals: 18,
226
500
  },
227
501
  },
502
+ get serverRpcUrl() {
503
+ return process.env?.BLAST_RPC_URL || this.params.rpcUrls[0]
504
+ },
505
+ viemChain: blast,
506
+ },
507
+ {
508
+ chainId: 59144,
509
+ name: 'Linea',
510
+ apiURL: 'https://api.lineascan.build/api',
511
+ color: '#78d64b',
512
+ explorerUrl: 'https://lineascan.build',
513
+ legacySupported: false,
514
+ params: {
515
+ rpcUrls: ['https://linea-mainnet.public.blastapi.io'],
516
+ chainName: 'Linea',
517
+ nativeCurrency: {
518
+ name: 'Linea Ether',
519
+ symbol: 'ETH',
520
+ decimals: 18,
521
+ },
522
+ },
523
+ fakeTransactionHash: '0x62d068a66eb1515a09e993200e8a495c7fead512689ba78e50523c8e83bbf5b5',
524
+ get serverRpcUrl() {
525
+ return process.env?.LINEA_RPC_URL || this.params.rpcUrls[0]
526
+ },
527
+ viemChain: linea,
528
+ ankrName: 'linea',
529
+ },
530
+ {
531
+ name: sonic.name,
532
+ chainId: sonic.id,
533
+ explorerUrl: sonic.blockExplorers.default.url,
534
+ legacySupported: false,
535
+ viemChain: sonic,
536
+ color: '#78d64b',
537
+ apiURL: null,
538
+ fakeTransactionHash: '0xc8fe01a980987295c36e898b4681fa8c937eb8dfd48a3ae080956b36a66195ee',
539
+ get serverRpcUrl() {
540
+ return process.env?.SONIC_RPC_URL || this.params.rpcUrls[0]
541
+ },
542
+ params: {
543
+ rpcUrls: sonic.rpcUrls.default.http as any,
544
+ chainName: sonic.name,
545
+ nativeCurrency: sonic.nativeCurrency,
546
+ },
228
547
  },
548
+ // {
549
+ // name: "Manta Pacific",
550
+ // chainId: 169,
551
+ // explorerUrl: "https://pacific-explorer.manta.network",
552
+ // params: {
553
+ // rpcUrls: ["https://pacific-rpc.manta.network/http"],
554
+ // chainName: "Manta Pacific",
555
+ // nativeCurrency: {
556
+ // name: "Ethereum",
557
+ // symbol: "ETH",
558
+ // decimals: 18,
559
+ // },
560
+ // },
561
+ // color: "#78d64b",
562
+ // fakeTransactionHash: "0x3fB128aA5AC254C8539996B11C587E521AE0d3ab",
563
+ // get serverRpcUrl() {
564
+ // return process.env?.MANTA_RPC_URL || this.params.rpcUrls[0];
565
+ // },
566
+ // },
229
567
  {
230
568
  name: AVO_PROD_CHAIN_NAME,
231
569
  chainId: AVO_PROD_CHAIN_ID,
570
+ apiURL: null,
232
571
  isAvocado: true,
233
- balanceResolverAddress: "",
234
- color: "#16A34A",
235
- usdcAddress: "",
572
+ balanceResolverAddress: '',
573
+ fakeTransactionHash: '',
574
+ legacySupported: false,
575
+ viemChain: avocado,
576
+ color: '#16A34A',
577
+ usdcAddress: '',
236
578
  serverRpcUrl: AVO_PROD_RPC_URL,
237
579
  explorerUrl: AVO_PROD_EXPLORER_URL,
238
580
  params: {
239
581
  chainName: AVO_PROD_CHAIN_NAME,
240
582
  nativeCurrency: {
241
- name: "Avocado",
242
- symbol: "USDC",
583
+ name: 'Avocado',
584
+ symbol: 'USDC',
243
585
  decimals: 18,
244
586
  },
245
- iconUrls: ["https://avocado.instadapp.io/logo.svg"],
587
+ iconUrls: ['https://avocado.instadapp.io/logo.svg'],
246
588
  rpcUrls: [AVO_PROD_RPC_URL],
247
589
  },
248
590
  },
249
591
  {
250
592
  name: AVO_STAGING_CHAIN_NAME,
593
+ apiURL: null,
251
594
  chainId: AVO_STAGING_CHAIN_ID,
252
595
  serverRpcUrl: AVO_STAGING_RPC_URL,
253
- color: "#16A34A",
596
+ color: '#16A34A',
254
597
  explorerUrl: AVO_STAGING_EXPLORER_URL,
598
+ legacySupported: false,
599
+ viemChain: avocadoStaging,
600
+ fakeTransactionHash: '',
255
601
  isAvocado: true,
256
- balanceResolverAddress: "",
257
- usdcAddress: "",
602
+ balanceResolverAddress: '',
603
+ usdcAddress: '',
258
604
  params: {
259
605
  chainName: AVO_STAGING_CHAIN_NAME,
260
606
  nativeCurrency: {
261
- name: "Avocado",
262
- symbol: "USDC",
607
+ name: 'Avocado',
608
+ symbol: 'USDC',
263
609
  decimals: 18,
264
610
  },
265
- iconUrls: ["https://avocado.instadapp.io/logo.svg"],
611
+ iconUrls: ['https://avocado.instadapp.io/logo.svg'],
266
612
  rpcUrls: [AVO_STAGING_RPC_URL],
267
613
  },
268
614
  },
269
- ];
615
+ ]
270
616
 
271
- export const getNetworkByChainId = (
272
- chainId: ChainId | number | string
273
- ): Network => {
274
- return networks.find((i) => i.chainId == chainId)!;
275
- };
617
+ export const chainUsdcAddresses = [
618
+ { chainId: 1, address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' },
619
+ { chainId: 10, address: '0x7f5c764cbc14f9669b88837ca1490cca17c31607' },
620
+ { chainId: 56, address: '0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d' },
621
+ { chainId: 100, address: '0xddafbb505ad214d7b80b1f830fccc89b60fb7a83' },
622
+ { chainId: 137, address: '0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174' },
623
+ { chainId: 137, address: '0x3c499c542cef5e3811e1192ce70d8cc03d5c3359' },
624
+ { chainId: 250, address: '0x04068da6c83afcfa0e13ba15a6696662335d5b75' },
625
+ { chainId: 42161, address: '0xff970a61a04b1ca14834a43f5de4533ebddb5cc8' },
626
+ { chainId: 42161, address: '0xaf88d065e77c8cc2239327c5edb3a432268e5831' },
627
+ { chainId: 43114, address: '0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e' },
628
+ { chainId: 43114, address: '0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664' },
629
+ { chainId: 1101, address: '0xa8ce8aee21bc2a48a5ef670afcc9274c7bbbc035' },
630
+ {
631
+ chainId: 1313161554,
632
+ address: '0xB12BFcA5A55806AaF64E99521918A4bf0fC40802',
633
+ },
634
+ { chainId: 8453, address: '0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA' },
635
+ ]
636
+
637
+ export function getNetworkByChainId(chainId: ChainId | number | string): Network {
638
+ return networks.find(i => i.chainId == chainId)!
639
+ }
276
640
 
277
641
  export const availableNetworks = networks.filter(
278
- (network) => !network.isAvocado
279
- );
642
+ network => !network.isAvocado,
643
+ )
280
644
 
281
- export const chainIdToName = (chainId: ChainId | number | string) => {
282
- const network = getNetworkByChainId(chainId);
283
- return network.name;
284
- };
645
+ export function chainIdToName(chainId: ChainId | number | string) {
646
+ const network = getNetworkByChainId(chainId)
647
+ return network?.name
648
+ }
285
649
 
286
- export const getRpcURLByChainId = (chainId: ChainId | number | string) => {
287
- const network = getNetworkByChainId(chainId);
288
- return network.params.rpcUrls[0];
289
- };
650
+ export function getRpcURLByChainId(chainId: ChainId | number | string) {
651
+ try {
652
+ const network = getNetworkByChainId(chainId)
653
+ return network.params.rpcUrls[0]
654
+ }
655
+ catch {
656
+ return ''
657
+ }
658
+ }
290
659
 
291
660
  export const RPCMap = networks.reduce((acc, network) => {
292
- acc[network.chainId] = network.params.rpcUrls[0];
293
- return acc;
294
- }, {} as Record<number, string>);
661
+ acc[network.chainId] = network.params.rpcUrls[0]
662
+ return acc
663
+ }, {} as Record<number, string>)
295
664
 
296
- export const networkIds = networks.map((network) => network.chainId);
665
+ export const networkIds = networks.map(network => network.chainId)
297
666
 
298
- const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {};
667
+ const rpcInstances: Record<string, ethers.providers.StaticJsonRpcProvider> = {}
299
668
  const serverRpcInstances: Record<
300
669
  string,
301
670
  ethers.providers.StaticJsonRpcProvider
302
- > = {};
671
+ > = {}
303
672
 
304
- export const getServerRpcProvider = (chainId: number | string) => {
673
+ export function getServerRpcProvider(chainId: number | string) {
305
674
  if (!rpcInstances[chainId]) {
306
- const network = networks.find((n) => n.chainId == chainId);
675
+ const network = networks.find(n => n.chainId == chainId)
307
676
  serverRpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
308
- network?.serverRpcUrl
309
- );
677
+ network?.serverRpcUrl,
678
+ )
310
679
  }
311
680
 
312
- return serverRpcInstances[chainId];
313
- };
681
+ return serverRpcInstances[chainId]
682
+ }
314
683
 
315
- export const getRpcProvider = (chainId: number | string) => {
684
+ export function getRpcProvider(chainId: number | string) {
316
685
  if (!rpcInstances[chainId]) {
317
686
  rpcInstances[chainId] = new ethers.providers.StaticJsonRpcProvider(
318
- getRpcURLByChainId(Number(chainId))
319
- );
687
+ getRpcURLByChainId(Number(chainId)),
688
+ )
320
689
  }
321
690
 
322
- return rpcInstances[chainId];
323
- };
691
+ return rpcInstances[chainId]
692
+ }
324
693
 
325
- export const getExplorerUrl = (
326
- chainId: ChainId | number | string,
327
- suffix: `/${string}` = "/"
328
- ) => {
329
- const network = getNetworkByChainId(chainId);
330
- return `${network.explorerUrl}${suffix}`;
331
- };
694
+ export function getExplorerUrl(chainId: ChainId | number | string, suffix: `/${string}` = '/') {
695
+ const network = getNetworkByChainId(chainId)
696
+ if (!network)
697
+ return ''
698
+ return `${network.explorerUrl}${suffix}`
699
+ }