@instadapp/avocado-base 0.1.8 → 0.2.0

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