Parameters
The slot number of the block to retrieve
Configuration object containing the following optional fields:
Encoding format for transaction data:
json - JSON format
jsonParsed - JSON format with parsed transaction data
base58 - Base-58 encoded binary data
base64 - Base-64 encoded binary data
Level of transaction detail to return:
full - Full transaction data
signatures - Only transaction signatures
none - No transaction data
Whether to populate the rewards array
Bank state to query:
processed - Latest block (unconfirmed)
confirmed - Confirmed by supermajority
finalized - Finalized by supermajority
maxSupportedTransactionVersion
The maximum transaction version to return in responses
Response
Returns null if the block is not found. Otherwise, returns an object containing:
The blockhash of this block (base-58)
The blockhash of the previous block (base-58)
The slot index of the parent block
Array of transaction information (if transactionDetails != “none”):
- For
full: Complete transaction objects
- For
signatures: Only transaction signatures
Array of reward objects (if rewards = true):
pubkey: string - The public key (base-58)
lamports: number - Number of reward lamports
postBalance: number - Account balance after reward
rewardType: string - Type of reward
commission: number - Vote account commission (vote only)
Estimated production time (Unix timestamp)
The number of blocks beneath this block
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
- Block production time is an estimate based on genesis block time and slots elapsed.
- Not all blocks include rewards.
- The
jsonParsed encoding attempts to parse transaction instruction data based on known program layouts.
- Some blocks might be skipped (no leader assigned or failed block production).
- Block data may be pruned from the node based on ledger configuration.
Best Practices
- Use
transactionDetails: "signatures" if you only need transaction signatures.
- Set
rewards: false if reward data is not needed.
- Consider using
getBlockHeight first if you need the latest block.
- For real-time updates, consider using websocket subscription instead.
Common Errors
| Code | Message | Solution |
|---|
| -32004 | Block not available for slot | The block was pruned or skipped |
| -32602 | Invalid param: WrongSize | Verify the slot number is valid |
| -32602 | Invalid param: Too large | Request a more recent block |
| -32009 | Transaction version unsupported | Specify maxSupportedTransactionVersion |