POSTgetLatestBlockhash

Returns the latest blockhash

Request Body
jsonrpcstringrequired
idintegerrequired
methodstringrequired
commitmentstring (enum)

The commitment describes how finalized a block is at that point in time.

  • finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
  • confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.
  • processed - the node will query its most recent block. Note that the block may still be skipped by the cluster.
minContextSlotstring

The minimum slot that the request can be evaluated at.

Responses
idinteger

The request ID

jsonrpcstring

The JSON-RPC version

contextobject

An object containing metadata about the current state of the Solana network at the time of the request.

apiVersionstring

The API version used for the request

slotinteger

The slot number at which the request was evaluated

valueobject
blockhashstring

The blockhash of the block, as base-58 encoded string

lastValidBlockHeightinteger (uint64)

Last block height at which the blockhash will be valid

X-API-KEY
RequestCU10
cURL
curl -X POST "https://solana-mainnet.nodit.io/" \
  -H "X-API-KEY: {YOUR_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLatestBlockhash",
  "params": [
    {
      "commitment": "processed"
    }
  ]
}'
Response
Example · 200
{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "apiVersion": "2.3.6",
      "slot": 405340750
    },
    "value": {
      "blockhash": "CQvDmVwMX2M7yUVpUJPAhyX4xnb7EUYXMWJucvvMNd6L",
      "lastValidBlockHeight": 393293415
    }
  },
  "id": 1
}