use-wallet icon indicating copy to clipboard operation
use-wallet copied to clipboard

Unknown chain id: 25

Open aclement-rally opened this issue 2 years ago • 5 comments

Trying to connect with the cronos chain and I am getting this error:

getChainInformation
src/chains.ts:282
  279 |   chainId: number
  280 | ): ChainInformation | ChainType {
  281 |   const chainInfo = CHAIN_INFORMATION.get(chainId)
> 282 |   if (!chainInfo) throw new ChainUnknownError(`Unknown chain id: ${chainId}`)
  283 |   return chainInfo
  284 | }
  285 | 

I suppose the chain file should be updated?

aclement-rally avatar Mar 24 '22 15:03 aclement-rally

#211 I created a PR for this , you can also clone the repo with my fix and use it in your project instead of using the npm live package, or just do what I did and move to web3Modal

humanshield89 avatar May 01 '22 02:05 humanshield89

#211 I created a PR for this , you can also clone the repo with my fix and use it in your project instead of using the npm live package, or just do what I did and more to web3Modal

Followed this and it works fine but when using wallet connect it doesn't recognise the correct chainid of 56 image

CHAIG200 avatar May 01 '22 18:05 CHAIG200

Have configured wallet connect correctly when initializing the useWalletProvider ?

    <UseWalletProvider
      chainId={process.env.CHAIN_ID}
      connectors={{
        walletconnect: { rpc: { 56: "https://bsc-dataseed.binance.org/" } }, {/* Set the rpc for chainid 56*/}
      }}
      pollBalanceInterval={2000}
      pollBlockNumberInterval={5000}
    >
        <App />
    </UseWalletProvider>

humanshield89 avatar May 01 '22 21:05 humanshield89

image

CHAIG200 avatar May 01 '22 22:05 CHAIG200

The error has nothing to do with chain id 25 , most likely the wallet you are connecting does not support chain id 25

humanshield89 avatar May 01 '22 23:05 humanshield89