Skip to main content

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
      • jsonParsed attempts to use program-specific instruction parsers to return more human-readable and explicit data in the transaction.message.instructions list. - If jsonParsed is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts, data, and programIdIndex fields).
    • 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 in
    • transaction: <object|[string,encoding]> - Transaction object, either in JSON format or encoded binary data, depending on encoding parameter
    • blockTime: <i64|null> - estimated production time, as Unix timestamp ( milliseconds since the Unix epoch) of when the transaction was processed. null if not available
    • meta: <object|null> - transaction status metadata object:
      • err: <object|null> - Error if transaction failed, null if transaction succeeded. TransactionError definitions
      • fee: <u64> - fee this transaction was charged, as u64 integer
      • preBalances: <array> - array of u64 account balances from before the transaction was processed
      • postBalances: <array> - array of u64 account balances after the transaction was processed
      • innerInstructions: <array|null> - List of inner instructions or null if inner instruction recording was not enabled during this transaction
      • preTokenBalances: <array|undefined> - List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
      • postTokenBalances: <array|undefined> - List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
      • logMessages: <array|null> - array of string log messages or null if 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 if maxSupportedTransactionVersion is not set in request params, or if jsonParsed encoding is set in request params.
        • writable: <array[string]> - Ordered list of base-58 encoded addresses for writable loaded accounts
        • readonly: <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 Pubkey
        • data: <[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 if maxSupportedTransactionVersion is not set in request params.

Code sample

curl "https://testnet.atlas.xyz/?apikey=$ATLAS_API_KEY" -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
}
}