window.phantom.ethereum.chainId
ThechainId
of the network you are currently connected to, returned as a hexadecimal string.
chainId
of the network you are currently connected to, returned as a hexadecimal string.
const chainId = window.phantom.ethereum.chainId;
console.log(chainId);
// "0x1"
// hexidecimal representation of Ethereum Mainnet
Was this page helpful?