eth_blockNumber
Returns the number of most recent block.
None
QUANTITY(hex string)
- integer of the current block number the client is on.curl
TypeScript
curl https://api.blockvision.org/v1/<api key> \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"params": [],
"id": 83
}'
import { BlockVisionProvider, BvNetwork } from 'blockvision.js'
// Optional parameters, but default to eth-mainnet and default api-key.
const bv = new BlockVisionProvider(BvNetwork.OPT_MAINNET)
// Access standard Ethers.js JSON-RPC node request
bv.getBlockNumber().then(console.log)
{
"jsonrpc": "2.0",
"id": 83,
"result": "0xe2483f"
}
Last modified 1mo ago