getTransaction RPC Method
Description
Returns transaction details for a confirmed transaction.
Parameters
tx_sig
(string) - The transaction signature as base-58 encoded stringobject
(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
maxSupportedTransactionVersion
(integer, 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 error
Returns
Returns null if the specified block is not confirmed, otherwise RpcResponse JSON object with the following fields:
blockTime
- The estimated production time, as Unix timestamp (seconds since the Unix epoch). It's null if not availablemeta
- The transaction status metadata object, which contains additional information about the block and its transactions. The meta object can be null, or it may contain the following fields:err
- Error code if the transaction failed or null if the transaction succeedsfee
- The total fees paid by all transactions in the block encoded as u64 integerinnerInstructions
- An array of objects representing the inner instructions of all transactions in the block (omitted if inner instruction recording is not enabled)logMessages
- An array of strings containing any log messages generated by the block's transactions (omitted if inner instruction recording is not enabled)postBalances
- An array of lamport balances for each account in the block after the transactions were processedpostTokenBalances
- An array of token balances for each token account in the block after the transactions were processedpreBalances
- An array of lamport balances for each account in the block before the transactions were processedpreTokenBalances
- An array of token balances for each token account in the block before the transactions were processedrewards
- An object containing information about the rewards earned by the block's validators (only present if the rewards are requested)status
- The status of the transaction. If the transaction was successful, returns Ok and if the transaction failed with TransactionError, returns Err
slot
- The slot number to retrieve block production informationtransaction
- The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameterversion
- The transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters