Mainly

Get a blockhash

A fresh blockhash for building transactions manually.

GET /network/blockhash

Most apps never need this endpoint. Solana transactions embed a recent blockhash as an anti-replay timestamp, and it expires in roughly 60–90 seconds. If you build transactions with a standard SDK and submit them via send, blockhash handling is already done. This endpoint exists for advanced flows — offline signing, custom transaction builders, durable-nonce setups.

Example

curl https://api.sarg.am/v1/solana/network/blockhash \
  -H "Authorization: Bearer $MAINLY_API_KEY"
{
  "blockhash": "EkSnNWid2cvwEVnVx9aBqawnmiCNiDgp3gUdkDPTKN1N",
  "lastValidBlockHeight": 319842921,
  "expiresInSeconds": 62
}

Response fields

FieldTypeDescription
blockhashstringEmbed this in the transaction you're building.
lastValidBlockHeightnumberThe last block height at which a transaction using this blockhash can land.
expiresInSecondsnumberApproximate time remaining — a convenience derived from lastValidBlockHeight, so you don't have to know how block heights map to time.

Sign and submit within the window. If it lapses, you'll get blockhash_expired and need to rebuild.

Under the hood

Replaces getLatestBlockhash and the block-height-to-wall-clock estimation.

On this page