DecaneDocs
ReferenceCustom chains
Reference

Custom chains

Add any EVM chain (local Hardhat, private L2) or Solana network at runtime.

tsx
const { addChain, removeChain } = useDecane();

addChain({
  id: "eip155:31337", type: "evm", chainId: 31337,
  name: "Hardhat Local",
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
  rpcUrl: "http://localhost:8545", isCustom: true,
});
i

When addChain is called while a wallet is connected, it automatically calls wallet_addEthereumChain on the wallet so it knows about the network.