@instadapp/avocado-base 0.0.0-dev.8d2b9ac → 0.0.0-dev.8ed8fca

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