Skip to main content

starknet_blockHashAndNumber

Get the most recent accepted block hash and number

Get the most recent accepted block hash and number

The starknet_blockHashAndNumber command is used to obtain the most recently accepted block hash and number.

Parameters

none

Returns

The latest block hash and number

Example Request and Result for starknet_blockHashAndNumber

Request

curl https://starknet-mainnet.blastapi.io/<project-id>
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"starknet_blockHashAndNumber","params":[],"id":0}'

Result

{
"jsonrpc": "2.0",
"result": {
"block_hash": "0x1ba5d3910676f8383a1c472f1092a77cbe438b108face7873e0407ceee8da1e",
"block_number": 4504
},
"id": 0
}