Links

eth_blockNumber

Returns the number of most recent block.

Parameters

None

Returns

QUANTITY(hex string) - integer of the current block number the client is on.

Example

Request

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)

Result

{
"jsonrpc": "2.0",
"id": 83,
"result": "0xe2483f"
}