File tree Expand file tree Collapse file tree 1 file changed +18
-17
lines changed
Expand file tree Collapse file tree 1 file changed +18
-17
lines changed Original file line number Diff line number Diff line change 11import {
2+ type Chain ,
23 arbitrum ,
4+ arbitrumSepolia ,
35 avalanche ,
46 base ,
7+ baseSepolia ,
58 blast ,
69 bsc ,
710 celo ,
811 mainnet ,
912 optimism ,
1013 polygon ,
14+ sepolia ,
15+ unichain ,
16+ unichainSepolia ,
1117 worldchain ,
1218 zksync ,
1319 zora ,
1420} from "wagmi/chains" ;
15- // uniswap supported chains
16- /*
17- Ethereum
18- Arbitrum
19- Optimism
20- Polygon
21- Base
22- BNB
23- Avalanche C-Chain
24- CELO
25- Blast
26- ZKsync
27- Zora
28- WorldChain
29- */
3021
3122export const supportedChains = [
3223 arbitrum ,
@@ -40,11 +31,21 @@ export const supportedChains = [
4031 zksync ,
4132 zora ,
4233 worldchain ,
34+ unichain ,
4335 mainnet ,
4436] as const ;
4537
46- export const getChainById = ( chainId : number ) => {
47- const chain = supportedChains . find ( ( chain ) => chain . id === chainId ) ;
38+ export const testChains = [
39+ unichainSepolia ,
40+ sepolia ,
41+ baseSepolia ,
42+ arbitrumSepolia ,
43+ ] as const ;
44+
45+ export const getChainById = ( chainId : number ) : Chain => {
46+ const chain = [ ...supportedChains , ...testChains ] . find (
47+ ( chain ) => chain . id === chainId ,
48+ ) ;
4849 if ( ! chain ) {
4950 throw new Error ( `Chain with id ${ chainId } not found` ) ;
5051 }
You can’t perform that action at this time.
0 commit comments