OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

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

ParameterTypeRequiredDescription
slot numberu64YesSlot number of the block to retrieve.
configobjectNoConfiguration object (see fields below). Also accepts a bare encoding string for backwards compatibility, but the object form is preferred.
config.commitmentstringNoconfirmed or finalized (default: finalized). processed is not accepted.
config.encodingstringNoTransaction encoding: json (default), jsonParsed, base64, base58, or binary (deprecated alias for base58).
config.transactionDetailsstringNoLevel of transaction detail: full (default), accounts, signatures, or none.
config.maxSupportedTransactionVersionnumberNoMaximum transaction version to return. Currently the only valid value is 0. Omitting this field causes versioned transactions to produce an error.
config.rewardsboolNoWhether to include the rewards array. Defaults to true.

Commitment levels

ValueDescription
processedReturn data from the highest slot this node has processed on the fork it currently considers best. Can still change if the cluster switches forks.
confirmedReturn 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.
finalizedReturn 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

EncodingTransaction formatNotes
jsonJSON objectDefault. Returns parsed transaction with message and signatures.
jsonParsedJSON objectUses 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 includes transactions, but each transactions[].transaction contains only signatures and an annotated accountKeys list. The meta field is limited to a subset of fields.
  • signatures — Omits transactions and returns only the signatures array for the block.
  • none — Omits both transactions and signatures.

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

FieldTypeDescription
blockHeightu64 | nullThe number of blocks beneath this block.
blockTimei64 | nullEstimated production time as a Unix timestamp (seconds since Unix epoch). null if not available.
blockhashstringThe blockhash of this block, as a base-58 encoded string.
parentSlotu64The slot index of this block's parent.
previousBlockhashstringThe 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.
transactionsarrayPresent if transactionDetails is "full" or "accounts". Array of transaction objects.
signaturesarrayPresent if transactionDetails is "signatures". Array of signature strings corresponding to the transaction order in the block.
rewardsarrayPresent if rewards are requested. Array of reward objects.
numRewardPartitionsu64 | nullThe number of reward partitions for this block if using partitioned rewards, or null.

transactions[] fields

FieldTypeDescription
transactionobject | 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.
metaobject | nullTransaction status metadata, or null if unavailable. For transactionDetails: "full", uses Transaction Status Metadata. For transactionDetails: "accounts", a simplified subset is returned.
version"legacy" | numberTransaction version. Omitted if maxSupportedTransactionVersion is not set in the request params.

transactions[].transaction fields (transactionDetails: "accounts")

FieldTypeDescription
signaturesarrayTransaction signatures in wire order.
accountKeysarrayObjects containing pubkey, signer, and writable metadata for each transaction account.

transactions[].transaction.accountKeys[] fields (transactionDetails: "accounts")

FieldTypeDescription
pubkeystringAccount address, as a base-58 encoded string.
signerboolWhether this account signed the transaction.
writableboolWhether the transaction marks this account writable.
sourcestring | nullSource of the account key. When present, the value is transaction or lookupTable.

transactions[].meta fields (transactionDetails: "accounts")

FieldTypeDescription
errobject | string | nullTransaction error. null indicates success.
statusobjectDeprecated status object mirroring err. "Ok": null for success or "Err": <ERR> for failure.
feeu64Fee charged for the transaction, in lamports.
preBalancesarrayLamport balances before execution, indexed to transaction.accountKeys.
postBalancesarrayLamport balances after execution, indexed to transaction.accountKeys.
preTokenBalancesarray | nullToken balances before execution. Each element uses the Token Balances structure.
postTokenBalancesarray | nullToken balances after execution. Each element uses the Token Balances structure.
rewardsarray | nullRewards applied while processing the transaction. Each element uses the Rewards structure.

rewards[] fields

FieldTypeDescription
pubkeystringRewarded account pubkey, as a base-58 encoded string.
lamportsi64Lamports credited or debited by this reward entry.
postBalanceu64Account balance after the reward was applied.
rewardTypestring | nullReward category. When present, the value is fee, rent, voting, or staking.
commissionu8 | nullVote-account commission at the time of the reward. Present only for voting and staking rewards.

Token balance fields

FieldTypeDescription
accountIndexu8Index into the transaction account list for the token account whose balance is reported.
mintstringToken mint pubkey, as a base-58 encoded string.
uiTokenAmountobjectToken amount object with raw and decimal-scaled representations.
ownerstringToken account owner pubkey, when the validator recorded it. This field may be omitted.
programIdstringSPL Token program pubkey for this account, when the validator recorded it. This field may be omitted.

Token balance uiTokenAmount fields

FieldTypeDescription
uiAmountnumber | nullDecimal-scaled amount as a floating-point number. Deprecated in favor of uiAmountString.
decimalsu8Number of decimal places configured on the mint.
amountstringRaw token amount, as a base-10 integer string.
uiAmountStringstringDecimal-scaled amount as a string.