You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncswitchChain(chainId: number){try{constchain=this.chains.find((x)=>x.id===chainId);if(!chain)thrownewSwitchChainError(newError("chain not found on connector."));awaitthis.web3AuthInstance.addChain({chainNamespace: CHAIN_NAMESPACES.EIP155,chainId: `0x${chain.id.toString(16)}`,rpcTarget: chain.rpcUrls.default.http[0],displayName: chain.name,// This returns the first character of the string URL since type change// chain.blockExplorers?.default is not an array. it is a stringblockExplorer: chain.blockExplorers?.default.url[0]||"",// blockExplorer: chain.blockExplorers?.default.url || "", // should be insteadticker: chain.nativeCurrency?.symbol||"ETH",tickerName: chain.nativeCurrency?.name||"Ethereum",decimals: chain.nativeCurrency.decimals||18,});log.info("Chain Added: ",chain.name);awaitthis.web3AuthInstance.switchChain({chainId: `0x${chain.id.toString(16)}`});log.info("Chain Switched to ",chain.name);returnchain;}catch(error: unknown){log.error("Error: Cannot change chain",error);thrownewSwitchChainError(errorasError);}}
On a side and related note, Wagmi's switchChain no longer works (at least in testnet) with Web3AuthConnector on versions:
Issue
On a side and related note, Wagmi's
switchChain
no longer works (at least intestnet
) withWeb3AuthConnector
on versions:The text was updated successfully, but these errors were encountered: