I do have following config:
const chainConfig: CustomChainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: '0x' + base.id.toString(16),
rpcTarget: base.rpcUrls.default.http[0],
displayName: base.name,
tickerName: base.nativeCurrency?.name,
ticker: base.nativeCurrency?.symbol,
blockExplorerUrl: base.blockExplorers.default.url,
logo: 'https://web3auth.io/images/web3authlog.png',
};
export const wagmiConfig = createConfig({
chains: [base],
transports: {
[base.id]: http(),
},
connectors: [
Web3AuthConnectorInstance([base]),
],
});
and when i try to switch chain:
import { switchChain } from '@wagmi/core';
const checkAndSwitchChainIfNeeded = async () => {
if (chainId !== defaultChain.id) {
await switchChain(wagmiConfig, { chainId: base.id });
}
};
I do get following error:
inpage.js:1 MetaMask - RPC Error: Expected null or array with at least one valid string HTTPS URL 'blockExplorerUrl'. Received:
h
but when i log the config looks like this:
{
"chainNamespace": "eip155",
"chainId": "0x2105",
"rpcTarget": "https://mainnet.base.org",
"displayName": "Base",
"tickerName": "Ether",
"ticker": "ETH",
"blockExplorerUrl": "https://basescan.org",
"logo": "https://web3auth.io/images/web3authlog.png"
}