@instadapp/avocado-base 0.0.0-dev.a80e59d → 0.0.0-dev.aeaa72b

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