getChainId
Returns the chain ID associated with the current network
Usage
import { publicClient } from './client'
const chainId = await publicClient.getChainId()
// 1
Returns
number
The current chain ID.
JSON-RPC Method
- Calls
eth_chainId
.
Returns the chain ID associated with the current network
import { publicClient } from './client'
const chainId = await publicClient.getChainId()
// 1
number
The current chain ID.
eth_chainId
.