get Latest Blockhash
Returns a recent blockhash and the last block height it remains valid through.
getLatestBlockhash returns a blockhash for a transaction's recentBlockhash field, and the lastValidBlockHeight at which it expires. Every transaction must reference a recent blockhash so the network can detect and drop duplicates and stale transactions.
A blockhash is valid for about 150 blocks, roughly a minute; transaction-building flows typically fetch one immediately before signing rather than caching it.
Parameters
params is a JSON array, with values in this order: config.
Optional configuration.
Show propertiesProperties
Bank state to read the blockhash from. processed gives the newest possible blockhash but carries the highest risk of referencing a block that gets skipped.
finalizedconfirmedprocessedMinimum slot the node must have processed before answering.
Result
The blockhash and its expiry height, wrapped with context.
Show propertiesProperties
Show propertiesProperties
Show propertiesProperties
Base-58 encoded blockhash.
Last block height at which this blockhash will be accepted for fee calculation and transaction validity.
Notes
- A transaction's
lastValidBlockHeight, compared against the currentgetBlockHeight, indicates whether it is still safe to (re)broadcast. - Not available on the Free plan.