RPC MethodsHTTPgetLatestBlockhash

Miscellaneous

getLatestBlockhash

Returns the latest blockhash.

Parameters

configobject optional

Configuration object.

commitmentstring

Commitment level.

minContextSlotnumber

The minimum slot.

Result

object

RpcResponse with value containing blockhash (string) and lastValidBlockHeight (u64).

Example

Request
JSON
curl "https://eu.fluxrpc.com?key=<your-API-key>" -s -X POST -H "Content-Type: application/json" -d '
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLatestBlockhash",
  "params": [{ "commitment": "finalized" }]
}'
Response
JSON
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 2792
},
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 3090
}
},
"id": 1
}