getLatestBlockhash

Returns the latest blockhash.

📘

Supported on Solana (mainnet) only.

Parameters

  • (optional) <object> - Configuration object containing the following fields:
    • (optional) commitment: <string> - Commitment (used for retrieving blockhash)
    • (optional) minContextSlot: <number> - set the minimum slot that the request can be evaluated at.

Returns

  • RpcResponse<object> - RpcResponse JSON object with value field set to a JSON object including:
  • blockhash: <string> - a Hash as base-58 encoded string
  • lastValidBlockHeight: <u64> - last block height at which the blockhash will be valid

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "id":1,
    "jsonrpc":"2.0",
    "method":"getLatestBlockhash",
    "params":[
      {
        "commitment":"processed"
      }
    ]
  }
'

Result

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 2792
    },
    "value": {
      "blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
      "lastValidBlockHeight": 3090
    }
  },
  "id": 1
}