getParsedTransaction
Returns transaction details for a confirmed transaction.
This method will use 30 Compute Units.
Parameters
slotinteger The slot number of the block to retrieve encoded as u64 (64-bit unsigned integer) integer.objectoptional. Configuration object containing the following fields:commitmentstring. The level of commitment required for the query. The options include:finalizedstring.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.
confirmedstring.The node will query the most recent block that has been voted on by the supermajority of the cluster.
processedstring.The node will query its most recent block. Note that the block may not be complete.
maxSupportedTransactionVersionboolean. 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.legacyboolean. The older transaction format with no additional benefit.0boolean. The additional support for Address Lookup Tables.
Returns
result The result will be null if the specified transaction is not confirmed otherwise an object with the following fields:
slotThe slot number in which the transaction was processed.parsedTransactionThe parsed transaction object with the following fields:signaturesAn array of signatures on the transaction.parsedMessageThe parsed message of the transaction.accountKeysAn array of public keys involved in the transaction.instructionsAn array of instructions that were executed in the block's transactions.recentBlockhashThe recent blockhash from the transaction.addressTableLookupsAn array of address lookups that were performed during the execution of transactions in the block.
blockTimeThe estimated production time, as Unix timestamp (seconds since the Unix epoch). It's null if not available.metaThe transaction status metadata object with the following fields:errError code if the transaction failed or null if the transaction succeeds.feeThe total fees paid by all transactions in the block encoded as u64 integer.preBalancesAn array of lamport balances for each account in the block before the transactions were processed.postBalancesAn array of lamport balances for each account in the block after the transactions were processed.parsedInnerInstructionsList of inner instructions or omitted if inner instruction recording was not yet enabled during this transaction.preTokenBalancesAn array of token balances for each token account in the block before the transactions were processed (omitted if inner instruction recording is not enabled).postTokenBalancesAn array of token balances for each token account in the block after the transactions were processed (omitted if inner instruction recording is not enabled).logMessagesAn array of strings containing any log messages generated by the block's transactions (omitted if inner instruction recording is not enabled).rewardsAn object containing information about the rewards earned by the block's validators (only present if the rewards are requested). It has the following fields:pubkeyThe public key of the account that received the award encoded as base-58 string.lamportsThe number of reward lamports credited or debited by the account.postBalanceThe account balance in lamports after the reward was applied.rewardTypeThe type of reward. It could be fee, rent, voting, staking.commissionThe vote account commission when the reward was credited, only present for voting and staking rewards.
loadedAddressesThe list of loaded addresses objects.readonlyThe ordered list of base-58 encoded addresses for readonly loaded accounts.writableThe ordered list of base-58 encoded addresses for writable loaded accounts.
versionThe transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters.
// Result
{
blockTime: 1739446039,
meta: {
computeUnitsConsumed: 3000,
err: null,
fee: 5300,
innerInstructions: [],
logMessages: [
'Program ComputeBudget111111111111111111111111111111 invoke [1]',
'Program ComputeBudget111111111111111111111111111111 success',
'Program ComputeBudget111111111111111111111111111111 invoke [1]',
'Program ComputeBudget111111111111111111111111111111 success',
...
],
postBalances: [
2767842760, 890980, 276098201,
212321371, 1000100, 187539928,
10461350, 3822790, 54747962,
5995100, 715210710, 98915954,
114402350, 14078660, 502821084,
925133340, 795109364, 13934364,
6377321, 1, 1
],
postTokenBalances: [],
preBalances: [
2767849860, 890880, 276098101,
212321271, 1000000, 187539828,
10461250, 3822690, 54747862,
5995000, 715210610, 98915854,
114402250, 14078560, 502820984,
925133240, 795109264, 13934264,
6377221, 1, 1
],
preTokenBalances: [],
rewards: [],
status: { Ok: null }
},
slot: 320370619,
transaction: {
message: {
accountKeys: [Array],
instructions: [Array],
recentBlockhash: 'C7KtDumDt16xKWx3vNzCmXVXoztnZge2GFa2zYHC53dZ'
},
signatures: [
'4tUuoRQUV42vAEGphy7bAXGqa6ZSK3zjHDyp4rrMzsAgQi1wvvcuKjZAVexGLnYmu9wNwfUf2jNvuEi9KmYG88jX'
]
},
version: 'legacy'
}const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://mainnet.solana.validationcloud.io/v1/<YOUR_API_KEY>");
console.log(
await solana.getParsedTransaction(
"4tUuoRQUV42vAEGphy7bAXGqa6ZSK3zjHDyp4rrMzsAgQi1wvvcuKjZAVexGLnYmu9wNwfUf2jNvuEi9KmYG88jX",
{ maxSupportedTransactionVersion: 0 }
)
);
})();const web3 = require("@solana/web3.js");
(async () => {
const solana = new web3.Connection("https://devnet.solana.validationcloud.io/v1/<YOUR_API_KEY>");
console.log(
await solana.getParsedTransaction(
"4tUuoRQUV42vAEGphy7bAXGqa6ZSK3zjHDyp4rrMzsAgQi1wvvcuKjZAVexGLnYmu9wNwfUf2jNvuEi9KmYG88jX",
{ maxSupportedTransactionVersion: 0 }
)
);
})();Last updated
Was this helpful?