getTransaction
Returns transaction details for a confirmed transaction.
Parameters
Signature <string>
- Transaction signature, as base-58 encoded string
Configuration <object>
-
Configuration object containing the following fields:
-
encoding: <string>- encoding format for the Transaction["json", "jsonParsed", "base58", "base64"]Details
jsonParsedattempts to use program-specific instruction parsers to return more human-readable and explicit data in thetransaction.message.instructionslist. - IfjsonParsedis requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts,data, andprogramIdIndexfields).
-
maxSupportedTransactionVersion: <number>- the max transaction version to return in the response
-
Result
<null>- if transaction is not found or not confirmed<object>- if transaction is confirmed, an object with the following fields:slot: <u64>- the slot this transaction was processed intransaction: <object|[string,encoding]>- Transaction object, either in JSON format or encoded binary data, depending on encoding parameterblockTime: <u64|null>- estimated production time, as Unix timestamp ( milliseconds since the Unix epoch) of when the transaction was processed. null if not availablemeta: <object|null>- transaction status metadata object:err: <object|null>- Error if transaction failed, null if transaction succeededfee: <u64>- fee this transaction was charged, as u64 integerpreBalances: <array>- array of u64 account balances from before the transaction was processedpostBalances: <array>- array of u64 account balances after the transaction was processedinnerInstructions: <array|null>- List of inner instructions ornullif inner instruction recording was not enabled during this transactionpreTokenBalances: <array|undefined>- List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transactionpostTokenBalances: <array|undefined>- List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transactionlogMessages: <array|null>- array of string log messages ornullif log message recording was not enabled during this transaction- DEPRECATED:
status: <object>- Transaction status"Ok": <null>- Transaction was successful"Err": <ERR>- Transaction failed with TransactionError
loadedAddresses: <object|undefined>- Transaction addresses loaded from address lookup tables. Undefined ifmaxSupportedTransactionVersionis not set in request params, or ifjsonParsedencoding is set in request params.writable: <array[string]>- Ordered list of base-58 encoded addresses for writable loaded accountsreadonly: <array[string]>- Ordered list of base-58 encoded addresses for readonly loaded accounts
returnData: <object|undefined>- the most-recent return data generated by an instruction in the transaction, with the following fields:programId: <string>- the program that generated the return data, as base-58 encoded Pubkeydata: <[string, encoding]>- the return data itself, as base-64 encoded binary data
computeUnitsConsumed: <u64|undefined>- number of compute units consumed by the transaction
version: <"legacy"|number|undefined>- Transaction version. Undefined ifmaxSupportedTransactionVersionis not set in request params.
Code sample
curl "https://testnet.atlas.xyz" -X POST -H "Content-Type: application/json" -d '
{
"method": "getTransaction",
"jsonrpc": "2.0",
"params": [
"46UE2a3wQeyHU2WNvg96ZK49An89X4ZQEYQkZTCLd3LFoXBfBapt65Mdv9mMmYsuMdChdAzsMJx9re9hqKrqP4EW",
{
"maxSupportedTransactionVersion": 0
}
],
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38"
}
'
Response
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"result": {
"slot": 11130753,
"transaction": {
"signatures": [
"46UE2a3wQeyHU2WNvg96ZK49An89X4ZQEYQkZTCLd3LFoXBfBapt65Mdv9mMmYsuMdChdAzsMJx9re9hqKrqP4EW"
],
"message": {
"header": {
"numRequiredSignatures": 1,
"numReadonlySignedAccounts": 0,
"numReadonlyUnsignedAccounts": 1
},
"accountKeys": [
"BjQGKpja61BXh7ViCcWU32gBnHuP6Spev8SxMYDcydQZ",
"AHhkdcEyhkYaKJNm8tmoU9En7GDGfctkKShbVcbMv4y6",
"11111111111111111111111111111111"
],
"recentBlockhash": "CZaYQodHvCmTpbMz6JxbYGEuwDxPLgu52fLyHiSuEu41",
"instructions": [
{
"programIdIndex": 2,
"accounts": [0, 1],
"data": "3Bxs4BjHAruJ7qP5",
"stackHeight": null
}
]
}
},
"meta": {
"err": null,
"status": {
"Ok": null
},
"fee": 5000,
"preBalances": [99915745724, 99895108377, 1037040],
"postBalances": [99915740403, 99895108698, 1037040],
"innerInstructions": [],
"logMessages": [
"Program 11111111111111111111111111111111 invoke [1]",
"Program 11111111111111111111111111111111 success"
],
"preTokenBalances": null,
"postTokenBalances": null,
"rewards": null,
"loadedAddresses": {
"writable": [],
"readonly": []
},
"computeUnitsConsumed": 0
},
"version": "legacy",
"blockTime": 1724965624
}
}