Solana
Solana
Solana
El plan gratuito cubre proyectos personales. El pago por uso escala sin necesidad de tarjeta.
isBlockhashValid tells you whether a given Solana blockhash is still recent enough to anchor a transaction. You pass a base-58 blockhash and the node replies with a boolean wrapped in an RpcResponse: true if a transaction built on it would still be accepted, false once it has aged out (after roughly 150 blocks at ~400ms slots). It is a cheap pre-flight check that saves you from spending a SOL fee broadcasting a transaction the cluster would reject. Call it on TheRPC at https://solana.therpc.io/YOUR_API_KEY.
getLatestBlockhash only when this returns false, avoiding a wasted broadcast.getFeeCalculatorForBlockhash validity check, which used to double as a way to test whether a blockhash was still alive.| # | Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|---|
| 1 | blockhash | string | Sí | Base-58 blockhash to check. |
| 2 | config | object | No | Options: commitment, minContextSlot. |
| Tipo | Descripción |
|---|---|
| object | RpcResponse wrapping a bool — true if the blockhash is still valid. |
| Código | Mensaje | Causa |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
false result means the blockhash has expired. Fetch a new one with getLatestBlockhash, rebuild and re-sign the transaction, then resend.RpcResponse under result.value. Read that nested field, not a bare top-level boolean.