Network/blockhash

Fresh blockhash

$0.01per call after 25 free a day

A fresh blockhash and how many blocks (and about how many seconds) are left before it expires.

Run just before building a transaction to sign. Blockhashes expire in about 60-90 seconds; this says how long is left.

Saves money. Says how many seconds the blockhash has left. A transaction built on an expired one gets rejected after the agent has done all the work.

Call it

TransportHow
HTTPPOST /api/tools/blockhash with a JSON body of the inputs below.
MCPtools/call with name blockhash on /mcp.

Inputs

NameWhat it's looking forWhere to get it
network
"mainnet-beta" | "devnet", optional
Default "mainnet-beta" (real money)."devnet" only for test wallets.

Returned fields

Every field the tool returns, what it is, and exactly how it's worked out.

FieldWhat it isHow it's worked out
blockhash
string
The blockhash to put in your transaction.getLatestBlockhash.
valid_until_height
number
Once the chain passes this block height, the transaction is rejected.Returned with the blockhash.
current_height
number
The chain's block height right now.getBlockHeight.
blocks_left
number
Blocks left before the blockhash expires.valid_until_height minus current_height.
seconds_left
number
Rough time left to sign and send.blocks_left x 0.4 seconds (the target block time). Real times vary, so leave a margin.