Returns the latest blockhash and the block height after which the blockhash expires. You must include a valid blockhash in every transaction before signing and submitting it.
Request
{
"jsonrpc": "2.0",
"id": 1,
"method": "getLatestBlockhash",
"params": [{ "commitment": "finalized" }]
}
Parameters
Commitment level for the query. One of processed, confirmed, or finalized. Defaults to finalized.
Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"context": { "slot": 2792 },
"value": {
"blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
"lastValidBlockHeight": 3090
}
}
}
The latest blockhash as a base-58 encoded string. Include this in the recentBlockhash field of your transaction.
value.lastValidBlockHeight
The last block height at which the blockhash is still valid. Transactions using this blockhash will be rejected after this height.
Example
curl "https://rpc.solami.fast/sol?api_key=YOUR_API_KEY" \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getLatestBlockhash",
"params": [{ "commitment": "finalized" }]
}'