getLatestBlockhash - Solana
getLatestBlockhash. Fetches the most recent blockhash, essential for developers to reference the latest state
getLatestBlockhash - solana [Value: 7CU]
Fetches the most recent blockhash
Use cases
- Obtain the latest blockhash for transaction processing
- Ensure transactions reference the most recent block
- Synchronize with the current state of the blockchain
Constraints
- Dependent on real-time data availability
- API call limits may restrict frequent access
- Potential delays due to network latency
Unlock Access to 50+ chains
Boost your app's speed and reliability with dRPC - get your access API key
Language
Request
Examples
curl https://solana.drpc.org \
-X POST \
-H "Content-Type: application/json" \
--data '{"jsonrpc":"2.0","id":1, "method":"getLatestBlockhash", "params": [{"commitment":"processed"}]}'
Response
200
{
"jsonrpc": "2.0",
"result": {
"context": {
"slot": 84768334
},
"value": {
"data": {
"parsed": {
"info": {
"owner": "11111111111111111111111111111111",
"lamports": 1000000000,
"rentEpoch": 23,
"data": []
},
"type": "account"
},
"program": "system",
"space": 0
},
"executable": false,
"lamports": 1000000000,
"owner": "11111111111111111111111111111111",
"rentEpoch": 23
}
},
"id": 1
}
Request params
idinteger
jsonrpcstring
methodstring
array
minContextSlotobject
The minimum slot number at which the request can be evaluated.
- 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 not be complete
commitmentstring
The level of commitment required for the query
- 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 not be complete
Response
200
Contains details about the fee calculator and blockhashResponse params
object
idinteger
jsonrpcstring
resultstring
object
contextobject
Contains information about the current state of the program
object
slotinteger
The slot number used to retrieve the fee calculator.
apiVersionstring
The version of the Solana RPC API being used
valueobject
Contains details about the blockhash
object
blockhashstring
The block hash, encoded as a base-58 string
lastValidBlockHeightinteger
The last block height at which the blockhash remains valid.