11import { ChainId } from '@aave/contract-helpers' ;
2+ import {
3+ arbitrum ,
4+ arbitrumSepolia ,
5+ avalanche ,
6+ avalancheFuji ,
7+ base ,
8+ baseSepolia ,
9+ bsc ,
10+ Chain ,
11+ gnosis ,
12+ linea ,
13+ mainnet ,
14+ metis ,
15+ optimism ,
16+ optimismSepolia ,
17+ polygon ,
18+ scroll ,
19+ scrollSepolia ,
20+ sepolia ,
21+ zksync ,
22+ } from 'wagmi/chains' ;
223
324export type ExplorerLinkBuilderProps = {
425 tx ?: string ;
@@ -46,13 +67,14 @@ export type NetworkConfig = {
4667 name : string ;
4768 url : string ;
4869 } ;
70+ wagmiChain : Chain ;
4971} ;
5072
5173export type BaseNetworkConfig = Omit < NetworkConfig , 'explorerLinkBuilder' > ;
5274
5375const ratesHistoryApiUrl = `${ process . env . NEXT_PUBLIC_API_BASEURL } /data/rates-history` ;
5476
55- export const networkConfigs : Record < string , BaseNetworkConfig > = {
77+ export const testnetConfig : Record < string , BaseNetworkConfig > = {
5678 [ ChainId . sepolia ] : {
5779 name : 'Ethereum Sepolia' ,
5880 publicJsonRPCUrl : [
@@ -67,27 +89,96 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
6789 wrappedBaseAssetSymbol : 'WETH' ,
6890 baseAssetDecimals : 18 ,
6991 explorerLink : 'https://sepolia.etherscan.io' ,
70- // usdMarket: true,
7192 isTestnet : true ,
7293 networkLogoPath : '/icons/networks/ethereum.svg' ,
94+ wagmiChain : sepolia ,
7395 } ,
74- [ ChainId . goerli ] : {
75- name : 'Ethereum Görli ' ,
96+ [ ChainId . fuji ] : {
97+ name : 'Avalanche Fuji ' ,
7698 publicJsonRPCUrl : [
77- 'https://eth-goerli.public.blastapi.io ' ,
78- 'https://rpc.ankr.com/eth_goerli ' ,
79- 'https://goerli.prylabs.net ' ,
99+ 'https://api.avax-test.network/ext/bc/C/rpc ' ,
100+ 'https://rpc.ankr.com/avalanche_fuji ' ,
101+ 'https://ava-testnet.public.blastapi.io/ext/bc/C/rpc ' ,
80102 ] ,
81- publicJsonRPCWSUrl : 'wss://eth-goerli.public.blastapi.io' ,
103+ publicJsonRPCWSUrl : 'wss://api.avax-test.network/ext/bc/C/rpc' ,
104+ baseUniswapAdapter : '0x0' ,
105+ baseAssetSymbol : 'AVAX' ,
106+ wrappedBaseAssetSymbol : 'WAVAX' ,
107+ baseAssetDecimals : 18 ,
108+ explorerLink : 'https://cchain.explorer.avax-test.network' ,
109+ isTestnet : true ,
110+ networkLogoPath : '/icons/networks/avalanche.svg' ,
111+ bridge : {
112+ icon : '/icons/bridge/avalanche.svg' ,
113+ name : 'Avalanche Bridge' ,
114+ url : 'https://bridge.avax.network/' ,
115+ } ,
116+ wagmiChain : avalancheFuji ,
117+ } ,
118+ [ ChainId . arbitrum_sepolia ] : {
119+ name : 'Arbitrum Sepolia' ,
120+ publicJsonRPCUrl : [
121+ 'https://sepolia-rollup.arbitrum.io/rpc' ,
122+ 'https://public.stackup.sh/api/v1/node/arbitrum-sepolia' ,
123+ ] ,
124+ publicJsonRPCWSUrl : 'https://sepolia-rollup.arbitrum.io/rpc' ,
82125 baseUniswapAdapter : '0x0' ,
83126 baseAssetSymbol : 'ETH' ,
84127 wrappedBaseAssetSymbol : 'WETH' ,
85128 baseAssetDecimals : 18 ,
86- explorerLink : 'https://goerli.etherscan.io' ,
87- // usdMarket: true,
129+ explorerLink : 'https://sepolia.arbiscan.io' ,
88130 isTestnet : true ,
89- networkLogoPath : '/icons/networks/ethereum.svg' ,
131+ networkLogoPath : '/icons/networks/arbitrum.svg' ,
132+ wagmiChain : arbitrumSepolia ,
90133 } ,
134+ [ ChainId . base_sepolia ] : {
135+ name : 'Base Sepolia' ,
136+ publicJsonRPCUrl : [
137+ 'https://base-sepolia.blockpi.network/v1/rpc/public' ,
138+ 'https://sepolia.base.org' ,
139+ 'https://base-sepolia.gateway.tenderly.co' ,
140+ ] ,
141+ publicJsonRPCWSUrl : 'wss://base-sepolia-rpc.publicnode.com' ,
142+ baseUniswapAdapter : '0x0' ,
143+ baseAssetSymbol : 'ETH' ,
144+ wrappedBaseAssetSymbol : 'WETH' ,
145+ baseAssetDecimals : 18 ,
146+ explorerLink : 'https://sepolia.basescan.org' ,
147+ isTestnet : true ,
148+ networkLogoPath : '/icons/networks/base.svg' ,
149+ wagmiChain : baseSepolia ,
150+ } ,
151+ [ ChainId . optimism_sepolia ] : {
152+ name : 'Optimism Sepolia' ,
153+ publicJsonRPCUrl : [ 'https://sepolia.optimism.io' ] ,
154+ baseUniswapAdapter : '0x0' ,
155+ baseAssetSymbol : 'ETH' ,
156+ wrappedBaseAssetSymbol : 'WETH' ,
157+ baseAssetDecimals : 18 ,
158+ explorerLink : 'https://sepolia-optimistic.etherscan.io' ,
159+ isTestnet : true ,
160+ networkLogoPath : '/icons/networks/optimism.svg' ,
161+ wagmiChain : optimismSepolia ,
162+ } ,
163+ [ ChainId . scroll_sepolia ] : {
164+ name : 'Scroll Sepolia' ,
165+ publicJsonRPCUrl : [
166+ 'https://sepolia-rpc.scroll.io' ,
167+ 'https://scroll-sepolia.blockpi.network/v1/rpc/public' ,
168+ ] ,
169+ publicJsonRPCWSUrl : 'wss://sepolia-rpc.scroll.io' ,
170+ baseUniswapAdapter : '0x0' ,
171+ baseAssetSymbol : 'ETH' ,
172+ wrappedBaseAssetSymbol : 'WETH' ,
173+ baseAssetDecimals : 18 ,
174+ explorerLink : 'https://sepolia.scrollscan.dev' ,
175+ isTestnet : true ,
176+ networkLogoPath : '/icons/networks/scroll.svg' ,
177+ wagmiChain : scrollSepolia ,
178+ } ,
179+ } ;
180+
181+ export const prodNetworkConfig : Record < string , BaseNetworkConfig > = {
91182 [ ChainId . mainnet ] : {
92183 name : 'Ethereum' ,
93184 privateJsonRPCUrl : 'https://eth-mainnet.g.alchemy.com/v2/ZiMMq2478EVIEJdsxC5dMal_ccQwtb31' ,
@@ -105,6 +196,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
105196 explorerLink : 'https://etherscan.io' ,
106197 ratesHistoryApiUrl,
107198 networkLogoPath : '/icons/networks/ethereum.svg' ,
199+ wagmiChain : mainnet ,
108200 } ,
109201 [ ChainId . polygon ] : {
110202 name : 'Polygon POS' ,
@@ -127,28 +219,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
127219 url : 'https://wallet.polygon.technology/polygon/bridge' ,
128220 } ,
129221 ratesHistoryApiUrl,
130- } ,
131- [ ChainId . fuji ] : {
132- name : 'Avalanche Fuji' ,
133- publicJsonRPCUrl : [
134- 'https://api.avax-test.network/ext/bc/C/rpc' ,
135- 'https://rpc.ankr.com/avalanche_fuji' ,
136- 'https://ava-testnet.public.blastapi.io/ext/bc/C/rpc' ,
137- ] ,
138- publicJsonRPCWSUrl : 'wss://api.avax-test.network/ext/bc/C/rpc' ,
139- baseUniswapAdapter : '0x0' ,
140- baseAssetSymbol : 'AVAX' ,
141- wrappedBaseAssetSymbol : 'WAVAX' ,
142- baseAssetDecimals : 18 ,
143- explorerLink : 'https://cchain.explorer.avax-test.network' ,
144- // usdMarket: true,
145- isTestnet : true ,
146- networkLogoPath : '/icons/networks/avalanche.svg' ,
147- bridge : {
148- icon : '/icons/bridge/avalanche.svg' ,
149- name : 'Avalanche Bridge' ,
150- url : 'https://bridge.avax.network/' ,
151- } ,
222+ wagmiChain : polygon ,
152223 } ,
153224 [ ChainId . avalanche ] : {
154225 name : 'Avalanche' ,
@@ -164,50 +235,14 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
164235 wrappedBaseAssetSymbol : 'WAVAX' ,
165236 baseAssetDecimals : 18 ,
166237 explorerLink : 'https://cchain.explorer.avax.network' ,
167- // usdMarket: true,
168238 networkLogoPath : '/icons/networks/avalanche.svg' ,
169239 bridge : {
170240 icon : '/icons/bridge/avalanche.svg' ,
171241 name : 'Avalanche Bridge' ,
172242 url : 'https://bridge.avax.network/' ,
173243 } ,
174244 ratesHistoryApiUrl,
175- } ,
176- [ ChainId . arbitrum_goerli ] : {
177- name : 'Arbitrum Görli' ,
178- publicJsonRPCUrl : [
179- 'https://goerli-rollup.arbitrum.io/rpc' ,
180- 'https://arb-goerli.g.alchemy.com/v2/demo' ,
181- ] ,
182- publicJsonRPCWSUrl : 'wss://goerli-rollup.arbitrum.io/rpc' ,
183- baseUniswapAdapter : '0x0' ,
184- baseAssetSymbol : 'ETH' ,
185- wrappedBaseAssetSymbol : 'WETH' ,
186- baseAssetDecimals : 18 ,
187- explorerLink : 'https://goerli.arbiscan.io' ,
188- // usdMarket: true,
189- isTestnet : true ,
190- networkLogoPath : '/icons/networks/arbitrum.svg' ,
191- bridge : {
192- icon : '/icons/bridge/arbitrum.svg' ,
193- name : 'Arbitrum Bridge' ,
194- url : 'https://bridge.arbitrum.io' ,
195- } ,
196- } ,
197- [ ChainId . arbitrum_sepolia ] : {
198- name : 'Arbitrum Sepolia' ,
199- publicJsonRPCUrl : [
200- 'https://sepolia-rollup.arbitrum.io/rpc' ,
201- 'https://public.stackup.sh/api/v1/node/arbitrum-sepolia' ,
202- ] ,
203- publicJsonRPCWSUrl : 'https://sepolia-rollup.arbitrum.io/rpc' ,
204- baseUniswapAdapter : '0x0' ,
205- baseAssetSymbol : 'ETH' ,
206- wrappedBaseAssetSymbol : 'WETH' ,
207- baseAssetDecimals : 18 ,
208- explorerLink : 'https://sepolia.arbiscan.io' ,
209- isTestnet : true ,
210- networkLogoPath : '/icons/networks/arbitrum.svg' ,
245+ wagmiChain : avalanche ,
211246 } ,
212247 [ ChainId . arbitrum_one ] : {
213248 name : 'Arbitrum' ,
@@ -223,14 +258,14 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
223258 wrappedBaseAssetSymbol : 'WETH' ,
224259 baseAssetDecimals : 18 ,
225260 explorerLink : 'https://arbiscan.io' ,
226- // usdMarket: true,
227261 networkLogoPath : '/icons/networks/arbitrum.svg' ,
228262 bridge : {
229263 icon : '/icons/bridge/arbitrum.svg' ,
230264 name : 'Arbitrum Bridge' ,
231265 url : 'https://bridge.arbitrum.io' ,
232266 } ,
233267 ratesHistoryApiUrl,
268+ wagmiChain : arbitrum ,
234269 } ,
235270 [ ChainId . base ] : {
236271 name : 'Base' ,
@@ -246,75 +281,33 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
246281 wrappedBaseAssetSymbol : 'WETH' ,
247282 baseAssetDecimals : 18 ,
248283 explorerLink : 'https://basescan.org' ,
249- // usdMarket: true,
250284 networkLogoPath : '/icons/networks/base.svg' ,
251285 bridge : {
252286 icon : '/icons/networks/base.svg' ,
253287 name : 'Base Bridge' ,
254288 url : 'https://bridge.base.org/' ,
255289 } ,
256290 ratesHistoryApiUrl,
257- } ,
258- [ ChainId . base_sepolia ] : {
259- name : 'Base Sepolia' ,
260- publicJsonRPCUrl : [
261- 'https://base-sepolia.blockpi.network/v1/rpc/public' ,
262- 'https://sepolia.base.org' ,
263- 'https://base-sepolia.gateway.tenderly.co' ,
264- ] ,
265- publicJsonRPCWSUrl : 'wss://base-sepolia-rpc.publicnode.com' ,
266- baseUniswapAdapter : '0x0' ,
267- baseAssetSymbol : 'ETH' ,
268- wrappedBaseAssetSymbol : 'WETH' ,
269- baseAssetDecimals : 18 ,
270- explorerLink : 'https://sepolia.basescan.org' ,
271- isTestnet : true ,
272- networkLogoPath : '/icons/networks/base.svg' ,
291+ wagmiChain : base ,
273292 } ,
274293 [ ChainId . optimism ] : {
275294 name : 'OP' ,
276295 privateJsonRPCUrl : 'https://opt-mainnet.g.alchemy.com/v2/H8ZBGuz1LZbRsYnCBQHY4YMv_AUAVGeM' , //'https://optimism.rpc.grove.city/v1/62b3314e123e6f00397f19ca',
277296 publicJsonRPCUrl : [ 'https://optimism-mainnet.public.blastapi.io' , 'https://1rpc.io/op' ] ,
278297 publicJsonRPCWSUrl : 'wss://optimism-mainnet.public.blastapi.io' ,
279298 baseUniswapAdapter : '0x0' ,
280- baseAssetSymbol : 'ETH' , // OETH
299+ baseAssetSymbol : 'ETH' ,
281300 wrappedBaseAssetSymbol : 'WETH' ,
282301 baseAssetDecimals : 18 ,
283302 explorerLink : 'https://optimistic.etherscan.io' ,
284- // usdMarket: true,
285303 networkLogoPath : '/icons/networks/optimism.svg' ,
286304 bridge : {
287305 icon : '/icons/bridge/optimism.svg' ,
288306 name : 'OP Bridge' ,
289307 url : 'https://app.optimism.io/bridge' ,
290308 } ,
291309 ratesHistoryApiUrl,
292- } ,
293- [ ChainId . optimism_sepolia ] : {
294- name : 'Optimism Sepolia' ,
295- publicJsonRPCUrl : [ 'https://sepolia.optimism.io' ] ,
296- baseUniswapAdapter : '0x0' ,
297- baseAssetSymbol : 'ETH' ,
298- wrappedBaseAssetSymbol : 'WETH' ,
299- baseAssetDecimals : 18 ,
300- explorerLink : 'https://sepolia-optimistic.etherscan.io' ,
301- isTestnet : true ,
302- networkLogoPath : '/icons/networks/optimism.svg' ,
303- } ,
304- [ ChainId . scroll_sepolia ] : {
305- name : 'Scroll Sepolia' ,
306- publicJsonRPCUrl : [
307- 'https://sepolia-rpc.scroll.io' ,
308- 'https://scroll-sepolia.blockpi.network/v1/rpc/public' ,
309- ] ,
310- publicJsonRPCWSUrl : 'wss://sepolia-rpc.scroll.io' ,
311- baseUniswapAdapter : '0x0' ,
312- baseAssetSymbol : 'ETH' ,
313- wrappedBaseAssetSymbol : 'WETH' ,
314- baseAssetDecimals : 18 ,
315- explorerLink : 'https://sepolia.scrollscan.dev' ,
316- isTestnet : true ,
317- networkLogoPath : '/icons/networks/scroll.svg' ,
310+ wagmiChain : optimism ,
318311 } ,
319312 [ ChainId . metis_andromeda ] : {
320313 name : 'Metis Andromeda' ,
@@ -326,6 +319,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
326319 explorerLink : 'https://andromeda-explorer.metis.io' ,
327320 networkLogoPath : '/icons/networks/metis.svg' ,
328321 ratesHistoryApiUrl,
322+ wagmiChain : metis ,
329323 } ,
330324 [ ChainId . xdai ] : {
331325 name : 'Gnosis Chain' ,
@@ -345,6 +339,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
345339 url : 'https://bridge.gnosischain.com/' ,
346340 } ,
347341 ratesHistoryApiUrl,
342+ wagmiChain : gnosis ,
348343 } ,
349344 [ ChainId . bnb ] : {
350345 name : 'Binance Smart Chain' ,
@@ -362,6 +357,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
362357 url : 'https://www.bnbchain.org/en/bnb-chain-bridges' ,
363358 } ,
364359 ratesHistoryApiUrl,
360+ wagmiChain : bsc ,
365361 } ,
366362 [ ChainId . scroll ] : {
367363 name : 'Scroll' ,
@@ -379,6 +375,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
379375 url : 'https://scroll.io/bridge' ,
380376 } ,
381377 ratesHistoryApiUrl,
378+ wagmiChain : scroll ,
382379 } ,
383380 [ ChainId . zksync ] : {
384381 name : 'ZKsync' ,
@@ -395,6 +392,7 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
395392 url : 'https://portal.zksync.io/bridge/' ,
396393 } ,
397394 ratesHistoryApiUrl,
395+ wagmiChain : zksync ,
398396 } ,
399397 [ ChainId . linea ] : {
400398 name : 'Linea' ,
@@ -414,5 +412,12 @@ export const networkConfigs: Record<string, BaseNetworkConfig> = {
414412 name : 'Linea Bridge' ,
415413 url : 'https://bridge.linea.build/' ,
416414 } ,
415+ ratesHistoryApiUrl,
416+ wagmiChain : linea ,
417417 } ,
418- } as const ;
418+ } ;
419+
420+ export const networkConfigs = {
421+ ...testnetConfig ,
422+ ...prodNetworkConfig ,
423+ } ;
0 commit comments