getLatestBlockhash
Returns the latest blockhash. On Atlas, the blockhash is the state root of the chain at a particular slot.
Parameters
This method takes no parameters
Result
RpcResponse<object>
- RpcResponse JSON object with value
field set to a JSON
object including:
blockhash: <string>
- a Hash as base-58 encoded string. This is the most recent state root of the chain.lastValidBlockHeight: <u64>
- last block height at which the blockhash will be valid
Code sample
curl "https://testnet.atlas.xyz/?apikey=$ATLAS_API_KEY" -X POST -H "Content-Type: application/json" -d '
{
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"jsonrpc": "2.0",
"method": "getLatestBlockhash"
}
'
Response
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"result": {
"context": {
"slot": 11162324
},
"value": {
"blockhash": "5eJmfxjJAJKQ4sEAw5Bjdg68YTaJz5YFqpfK1tYdZRDJ",
"lastValidBlockHeight": 11162836
}
}
}