Solana Tracker
Solana RPC/Methods

getRecentBlockhash RPC Method

Description

Returns a recent block hash from the ledger, and a fee schedule that can be used to compute the cost of submitting a transaction using it.

Please note that this method is deprecated, no longer available on Devnet and Testnet, and will be removed from Mainnet soon. For a similar method, you can use Solana's getLatestBlockhash RPC method.

Parameters

  1. object (array, optional) - The configuration object with the following fields:
    • commitment (string, optional) - The level of commitment required for the query. Options:
      • finalized - The node will query the most recent block confirmed by the 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 the supermajority of the cluster.
      • processed - The node will query its most recent block. Note that the block may not be complete.

Returns

  • result - An RpcResponse JSON object with the following fields:
    • context - Metadata about the current state of the Solana network at the time of processing:
      • apiVersion - The version number.
      • slot - The current slot in the Solana cluster when the request was processed.
    • value - An object containing:
      • blockhash - The blockhash as a base-58 encoded string, used to calculate transaction fees.
      • feeCalculator - A JSON object representing the fee calculator:
        • lamportsPerSignature - The number of lamports required to process each signature in the transaction, encoded as a u64 integer.

Code Examples

curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0","id":1, "method":"getRecentBlockhash"}'

On this page