Parameters

slot
number
required

The slot number of the block to retrieve

config
object

Configuration object containing the following optional fields:

Response

result
object | null

Returns null if the block is not found. Otherwise, returns an object containing:

Code Examples

Basic Request

curl https://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlock",
  "params": [
    430,
    {
      "encoding": "json",
      "transactionDetails": "full",
      "rewards": true
    }
  ]
}'

Request with Parsed Transaction Data

curl https://rpc.orbitflare.com -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlock",
  "params": [
    430,
    {
      "encoding": "jsonParsed",
      "transactionDetails": "full",
      "rewards": true,
      "maxSupportedTransactionVersion": 0
    }
  ]
}'

Using web3.js

import { Connection } from '@solana/web3.js';

const connection = new Connection('https://rpc.orbitflare.com');
const slot = 430;

const block = await connection.getBlock(
  slot,
  {
    maxSupportedTransactionVersion: 0
  }
);

Notes

  1. Block production time is an estimate based on genesis block time and slots elapsed.
  2. Not all blocks include rewards.
  3. The jsonParsed encoding attempts to parse transaction instruction data based on known program layouts.
  4. Some blocks might be skipped (no leader assigned or failed block production).
  5. Block data may be pruned from the node based on ledger configuration.

Best Practices

  1. Use transactionDetails: "signatures" if you only need transaction signatures.
  2. Set rewards: false if reward data is not needed.
  3. Consider using getBlockHeight first if you need the latest block.
  4. For real-time updates, consider using websocket subscription instead.

Common Errors

CodeMessageSolution
-32004Block not available for slotThe block was pruned or skipped
-32602Invalid param: WrongSizeVerify the slot number is valid
-32602Invalid param: Too largeRequest a more recent block
-32009Transaction version unsupportedSpecify maxSupportedTransactionVersion