getParsedBlock RPC Method
The getParsedTransaction method is only supported with the @solana/web3.js SDK. To use cURL or solana.py, check out the getBlock method examples where the encoding is set to jsonParsed.
Description
Returns identity and transaction information about a confirmed block in the ledger.
Parameters
slot_number
(string) - The slot number encoded as u64, 64-bit unsigned integerobject
(array) - The configuration object with the following fields:commitment
(string, optional) - The level of commitment required for the query. The options include: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 finalizedconfirmed
- The node will query the most recent block that has been voted on by the supermajority of the clusterprocessed
- The node will query its most recent block. Note that the block may not be complete
encoding
(string) - (default: json) The encoding format for account data. It can be base58 (slow), base64, base64+zstd or jsonParsedtransactionDetails
(string) - (default: full) It specifies the level of transaction details to include in the response. The possible values are full, signatures, and nonerewards
(boolean) - (default: true) It determines whether to populate the rewards array or not.maxSupportedTransactionVersion
(boolean, optional) - The maximum transaction version to return in responses. If the requested block contains a transaction with a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and a block containing any versioned transaction will prompt an errorlegacy
(boolean, optional) - The older transaction format with no additional benefit0
(boolean, optional) - The additional support for Address Lookup Tables
Returns
Returns null if the specified block is not confirmed, otherwise an object with the following fields:
blockhash
- The hash of the confirmed blockpreviousBlockhash
- The hash of the block's predecessorparentSlot
- The slot number of the block's parenttransactions
- An array of transaction objects within the block. Each transaction object contains:meta
- The transaction status metadata object with the following fields:err
- Error code if the transaction failed or null if the transaction succeedsfee
- The transaction feeinnerInstructions
- The list of inner instructions (omitted or null if inner instruction recording was not yet enabled during the transaction)loadedAddresses
- The list of loaded addresses objectslogMessages
- An array of string log messages (omitted or null if log message recording was not yet enabled during the transaction)postBalances
- An array of u64 account balances after the transaction was processedpostTokenBalances
- The list of token balances from after the transaction was processedpreBalances
- An array of u64 account balances from before the transaction was processedpreTokenBalances
- The list of token balances from before the transaction was processedrewards
- An array of reward objects detailing the rewards for this block (only present if rewards are requested)status
- The processing status of the transaction. It returns Ok if the transaction was successful and Err if the transaction failed with TransactionError
transaction
- The transaction object with the following fields:message
- The transaction message containing the following fields:accountKeys
- An array of public keys involved in the transactionheader
- An object containing the transaction's headerinstructions
- An array of instruction objects for the transaction
recentBlockhash
- The most recent blockhash used for the transactionsignatures
- An array of signatures strings corresponding to the transaction order in the block