Skip to main content

starknet_blockHashAndNumber

Get the most recent accepted block hash and number

Parameters#

This method does not accept parameters.

Request#

{
"jsonrpc": "2.0",
"method": "starknet_blockHashAndNumber",
"params": [],
"id": 1
}

Returns#

The latest block hash and number

Object with latest block hash and number

Errors#

CodeMessage
32There are no blocks

Examples#

curl -X POST https://api-starknet-mainnet.n.dwellir.com/YOUR_API_KEY \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "starknet_blockHashAndNumber",
"params": [],
"id": 1
}'