Get Chain Id

This method can be used to fetch current chain id

Below is an example code describing the way to fetch chain id.

// Fetch chain id
const chainId = await window.martian.getChainId();
console.log(chainId);
// above code output
{
    "chainId": 20
}

Last updated