getParsedTransaction RPC Method
Description
Returns transaction details for a confirmed transaction.
The getParsedTransaction method is only supported with the @solana/web3.js SDK. To use cURL or solana.py, check out the getTransaction method examples where the encoding is set to jsonParsed.
Parameters
slot
(string) - A base58-encoded transaction signature identifying the transaction to retrieve.object
(array) - The configuration object with the following fields:encoding
(string, optional) - The encoding format for account data. It can bejsonParsed
or not applicable if using JSgetParsedTransaction
.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 finalized.confirmed
- The node will query the most recent block that has been voted on by the supermajority of the cluster.processed
- It is not supported for this method.
maxSupportedTransactionVersion
(integer, optional) - The maximum transaction version to return in responses. If the requested transaction has a higher version, an error will be returned. If omitted, only legacy transactions will be returned, and any versioned transaction will prompt an error. Use0
for versioned transactions or omit for legacy only.
Returns
The result will be null
if the specified transaction is not confirmed; otherwise, an object with the following fields:
slot
- The slot number in which the transaction was processed.parsedTransaction
- The parsed transaction object with the following fields:signatures
- An array of signatures on the transaction.parsedMessage
- The parsed message of the transaction:accountKeys
- An array of public keys involved in the transaction.instructions
- An array of instructions executed in the transaction.recentBlockhash
- The recent blockhash from the transaction.addressTableLookups
- An array of address lookups performed during execution.
blockTime
- The estimated production time, as Unix timestamp (seconds since the Unix epoch). It’snull
if not available.meta
- The transaction status metadata object with the following fields:err
- Error code if the transaction failed, ornull
if it succeeds.fee
- The fee paid by the transaction, encoded as a u64 integer.preBalances
- An array of lamport balances for each account before the transaction was processed.postBalances
- An array of lamport balances for each account after the transaction was processed.parsedInnerInstructions
- List of inner instructions, omitted if inner instruction recording was not enabled.preTokenBalances
- An array of token balances before the transaction (omitted if inner instruction recording is not enabled).postTokenBalances
- An array of token balances after the transaction (omitted if inner instruction recording is not enabled).logMessages
- An array of log messages generated by the transaction (omitted if inner instruction recording is not enabled).rewards
- An object containing reward information (only present if rewards are requested):pubkey
- The public key of the account that received the reward, encoded as a base-58 string.lamports
- The number of reward lamports credited or debited.postBalance
- The account balance in lamports after the reward was applied.rewardType
- The type of reward (e.g.,fee
,rent
,voting
,staking
).commission
- The vote account commission for voting/staking rewards (if applicable).
loadedAddresses
- The list of loaded addresses:readonly
- Ordered list of base-58 encoded addresses for readonly loaded accounts.writable
- Ordered list of base-58 encoded addresses for writable loaded accounts.
version
- The transaction version, undefined ifmaxSupportedTransactionVersion
is not set.
Code Examples
Full Example Response