getTransaction
Returns transaction details for a confirmed transaction.
This method will use 30 Compute Units.
Parameters
tx_sigstring. The transaction signature as base-58 encoded string.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.
maxSupportedTransactionVersioninteger. 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
result Null if the specified block is not confirmed otherwise RpcResponse JSON object with the following fields:
blockTimeThe estimated production time, as Unix timestamp (seconds since the Unix epoch). It's null if not available.metaThe 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: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.innerInstructionsAn array of objects representing the inner instructions of all transactions in the block (omitted if inner instruction recording is not enabled). Each object has the following fields:indexThe index of the instruction in the transaction, which determines the order in which the operations were executed.instructionsAn array of instructions that were executed in the block's transactions.parsedAn array of parsed instructions that were executed in the block's transactions.infoAn array of information objects that provide additional details about the transactions in the block.lamportsThe number of lamports assigned to this account as u64 (64-bit unsigned integer).newAccountThe new account created as part of the transaction.ownerThe base-58 encoded Pubkey of the program this account has been assigned to.sourceThe source account that funded the transaction.spaceThe amount of storage space required to store a specific transaction.
typeThe type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
programThe data associated with the program that was executed in the block's transactions.programIdThe ID of the program that executed the instruction.stackHeightThe current depth of the execution stack.
logMessagesAn array of strings containing any log messages generated by the block's transactions (omitted if inner instruction recording is not enabled).postBalancesAn array of lamport balances for each account in the block after the transactions were processed.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).accountIndexThe index of an account within a transaction.mintProvides information about the creation of new tokens.ownerThe base-58 encoded Pubkey of the program this account has been assigned to.uiTokenAmountThe amount of a token transfer in a human-readable format.amountThe amount of a token transfer.decimalsThe number of decimal places used by the token.uiAmountThe amount of a token transfer in the smallest unit of the token.uiAmountStringThe amount of a token transfer as a string with the appropriate number of decimal places for the token.
preBalancesAn array of lamport balances for each account in the block before the transactions were processed.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).accountIndexThe index of an account within a transaction.mintProvides information about the creation of new tokens.ownerThe base-58 encoded Pubkey of the program this account has been assigned to.uiTokenAmountThe amount of a token transfer in a human-readable format.amountThe amount of a token transfer.decimalsThe number of decimal places used by the token.uiAmountThe amount of a token transfer in the smallest unit of the token.uiAmountStringThe amount of a token transfer as a string with the appropriate number of decimal places for the token.
rewardsAn object containing information about the rewards earned by the block's validators (only present if the rewards are requested).statusThe status of the transaction. If the transaction was successful, returns Ok and if the transaction failed with TransactionError, returns Err.
slotThe slot number to retrieve block production information.transactionThe transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter.messageAn array of transactions included in the block.accountKeysAn array of public keys associated with the accounts that were accessed during the execution of transactions in the block.pubkeyThe Pubkey of program encoded as base-58 string.signerUsed to sign transactions in the block. Also used to identify the signers involved in the block's transactions and to verify the authenticity of the signatures.sourceThe source account that funded the transaction.writableA boolean value that indicates whether the accounts associated with the given public keys were modified by the transactions or not.
instructionsAn array of instructions that were executed in the block's transactions.parsedAn array of parsed instructions that were executed in the block's transactions.infoAn array of information objects that provide additional details about the transactions in the block.accountAn address on the Solana blockchain that is used to store assets.mintProvides information about the creation of new tokens.sourceThe source account that funded the transaction.systemProgramThe system program that executed the transaction.tokenProgramResponsible for maintaining the supply and balance of the token, and for executing transfers of the token between accounts.walletWallet is used for managing and storing assets.
typeThe type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
programThe data associated with the program that was executed in the block's transactions.programIdThe ID of the program that executed the instruction.
recentBlockhashThe recent block hash for the account's cluster.
signaturesThe list of transaction signatures contained within a particular block.
versionThe transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters.
// Result
{
"jsonrpc": "2.0",
"result": {
"meta": {
"err": null,
"fee": 5000,
"innerInstructions": [],
"postBalances": [499998932500, 26858640, 1, 1, 1],
"postTokenBalances": [],
"preBalances": [499998937500, 26858640, 1, 1, 1],
"preTokenBalances": [],
"rewards": [],
"status": {
"Ok": null
}
},
"slot": 430,
"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"
]
}
},
"blockTime": null,
"id": 1
}curl https://mainnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
curl https://devnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
Last updated
Was this helpful?