getBlock
Returns a confirmed block for a slot, including block metadata and transaction data in the requested encoding.
Request
{ "jsonrpc": "2.0", "id": 1, "method": "getBlock", "params": [ 378967388, { "commitment": "finalized", "encoding": "json", "transactionDetails": "full", "maxSupportedTransactionVersion": 0, "rewards": true } ]}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| slot number | u64 | Yes | Slot number of the block to retrieve. |
| config | object | No | Configuration object (see fields below). Also accepts a bare encoding string for backwards compatibility, but the object form is preferred. |
| config.commitment | string | No | confirmed or finalized (default: finalized). processed is not accepted. |
| config.encoding | string | No | Transaction encoding: json (default), jsonParsed, base64, base58, or binary (deprecated alias for base58). |
| config.transactionDetails | string | No | Level of transaction detail: full (default), accounts, signatures, or none. |
| config.maxSupportedTransactionVersion | number | No | Maximum transaction version to return. Currently the only valid value is 0. Omitting this field causes versioned transactions to produce an error. |
| config.rewards | bool | No | Whether to include the rewards array. Defaults to true. |
Commitment levels
| Value | Description |
|---|---|
| processed | Return data from the highest slot this node has processed on the fork it currently considers best. Can still change if the cluster switches forks. |
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but weaker than finalized. |
| finalized | Return data from the highest slot the cluster recognizes as finalized — reached maximum vote lockout and recognized by at least two-thirds of active stake. Strongest guarantee. |
This method does not accept processed as a commitment level.
Encoding options
| Encoding | Transaction format | Notes |
|---|---|---|
| json | JSON object | Default. Returns parsed transaction with message and signatures. |
| jsonParsed | JSON object | Uses program-specific parsers for transaction.message.instructions. Falls back to standard JSON fields (accounts, data, programIdIndex) if no parser found. |
| base64 | [data, "base64"] | Base64 encoded binary transaction. |
| base58 | [data, "base58"] | Slow. |
| binary | [data, "base58"] | Deprecated — legacy alias for base58, retained for backwards compatibility. |
For jsonParsed, instruction entries use one of two stable outer shapes: {program, programId, parsed, stackHeight} when the RPC node can parse the instruction, or {programId, accounts, data, stackHeight} when it falls back to a partially decoded form. The nested parsed payload remains program-specific.
transactionDetails values
full— Full transaction objects including all metadata (default).accounts— Response still includestransactions, but eachtransactions[].transactioncontains onlysignaturesand an annotatedaccountKeyslist. Themetafield is limited to a subset of fields.signatures— Omitstransactionsand returns only thesignaturesarray for the block.none— Omits bothtransactionsandsignatures.
maxSupportedTransactionVersion
Currently the only valid value is 0. Setting it to 0 allows fetching all transactions, including both Versioned and legacy transactions. If you request a transaction with a higher version than this value, an error is returned. If you omit this parameter, only legacy transactions are returned — any block containing a versioned transaction will result in an error.
Response
{ "jsonrpc": "2.0", "result": { "blockHeight": 428, "blockTime": null, "blockhash": "3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA", "parentSlot": 429, "previousBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B", "rewards": [], "numRewardPartitions": null, "transactions": [ { "meta": { "err": null, "fee": 5000, "innerInstructions": [], "logMessages": [], "postBalances": [499998932500, 26858640, 1, 1, 1], "postTokenBalances": [], "preBalances": [499998937500, 26858640, 1, 1, 1], "preTokenBalances": [], "rewards": null, "status": { "Ok": null } }, "transaction": { "message": { "accountKeys": [ "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe", "AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc", "SysvarS1otHashes111111111111111111111111111", "SysvarC1ock11111111111111111111111111111111", "Vote111111111111111111111111111111111111111" ], "header": { "numReadonlySignedAccounts": 0, "numReadonlyUnsignedAccounts": 3, "numRequiredSignatures": 1 }, "instructions": [ { "accounts": [1, 2, 3, 0], "data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1", "programIdIndex": 4 } ], "recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B" }, "signatures": [ "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv" ] } } ] }, "id": 1}Top-level result fields
| Field | Type | Description |
|---|---|---|
| blockHeight | u64 | null | The number of blocks beneath this block. |
| blockTime | i64 | null | Estimated production time as a Unix timestamp (seconds since Unix epoch). null if not available. |
| blockhash | string | The blockhash of this block, as a base-58 encoded string. |
| parentSlot | u64 | The slot index of this block's parent. |
| previousBlockhash | string | The blockhash of this block's parent, as a base-58 encoded string. Returns "11111111111111111111111111111111" if the parent block is not available due to ledger cleanup. |
| transactions | array | Present if transactionDetails is "full" or "accounts". Array of transaction objects. |
| signatures | array | Present if transactionDetails is "signatures". Array of signature strings corresponding to the transaction order in the block. |
| rewards | array | Present if rewards are requested. Array of reward objects. |
| numRewardPartitions | u64 | null | The number of reward partitions for this block if using partitioned rewards, or null. |
transactions[] fields
| Field | Type | Description |
|---|---|---|
| transaction | object | string | [string, encoding] | Encoded transaction payload. For transactionDetails: "full", uses the Encoded Transaction Responses structure. For transactionDetails: "accounts", uses the Accounts Only Transaction Responses structure. |
| meta | object | null | Transaction status metadata, or null if unavailable. For transactionDetails: "full", uses Transaction Status Metadata. For transactionDetails: "accounts", a simplified subset is returned. |
| version | "legacy" | number | Transaction version. Omitted if maxSupportedTransactionVersion is not set in the request params. |
transactions[].transaction fields (transactionDetails: "accounts")
| Field | Type | Description |
|---|---|---|
| signatures | array | Transaction signatures in wire order. |
| accountKeys | array | Objects containing pubkey, signer, and writable metadata for each transaction account. |
transactions[].transaction.accountKeys[] fields (transactionDetails: "accounts")
| Field | Type | Description |
|---|---|---|
| pubkey | string | Account address, as a base-58 encoded string. |
| signer | bool | Whether this account signed the transaction. |
| writable | bool | Whether the transaction marks this account writable. |
| source | string | null | Source of the account key. When present, the value is transaction or lookupTable. |
transactions[].meta fields (transactionDetails: "accounts")
| Field | Type | Description |
|---|---|---|
| err | object | string | null | Transaction error. null indicates success. |
| status | object | Deprecated status object mirroring err. "Ok": null for success or "Err": <ERR> for failure. |
| fee | u64 | Fee charged for the transaction, in lamports. |
| preBalances | array | Lamport balances before execution, indexed to transaction.accountKeys. |
| postBalances | array | Lamport balances after execution, indexed to transaction.accountKeys. |
| preTokenBalances | array | null | Token balances before execution. Each element uses the Token Balances structure. |
| postTokenBalances | array | null | Token balances after execution. Each element uses the Token Balances structure. |
| rewards | array | null | Rewards applied while processing the transaction. Each element uses the Rewards structure. |
rewards[] fields
| Field | Type | Description |
|---|---|---|
| pubkey | string | Rewarded account pubkey, as a base-58 encoded string. |
| lamports | i64 | Lamports credited or debited by this reward entry. |
| postBalance | u64 | Account balance after the reward was applied. |
| rewardType | string | null | Reward category. When present, the value is fee, rent, voting, or staking. |
| commission | u8 | null | Vote-account commission at the time of the reward. Present only for voting and staking rewards. |
Token balance fields
| Field | Type | Description |
|---|---|---|
| accountIndex | u8 | Index into the transaction account list for the token account whose balance is reported. |
| mint | string | Token mint pubkey, as a base-58 encoded string. |
| uiTokenAmount | object | Token amount object with raw and decimal-scaled representations. |
| owner | string | Token account owner pubkey, when the validator recorded it. This field may be omitted. |
| programId | string | SPL Token program pubkey for this account, when the validator recorded it. This field may be omitted. |
Token balance uiTokenAmount fields
| Field | Type | Description |
|---|---|---|
| uiAmount | number | null | Decimal-scaled amount as a floating-point number. Deprecated in favor of uiAmountString. |
| decimals | u8 | Number of decimal places configured on the mint. |
| amount | string | Raw token amount, as a base-10 integer string. |
| uiAmountString | string | Decimal-scaled amount as a string. |