Skip to main content
The getTransaction method provides details about the specified transaction. Clients are expected to periodically query this method to ascertain when a transaction has been successfully recorded on the blockchain. The stellar-rpc system maintains a bounded history of recently processed transactions and events, configured by a single history-retention-window setting expressed in ledgers, with a stock default of 120960 ledgers (about 7 days, depending on ledger cadence). Operators of private stellar-rpc instances can adjust this value. The effective time span and the range of ledgers currently available can be inspected via the getHealth method (ledgerRetentionWindow, oldestLedger, latestLedger). For debugging needs that extend beyond the retained window, it is advisable to index this data yourself, employ a third-party indexer, or query Hubble (our public BigQuery data set).

Params (2)

Please note that parameter structure within the request must contain named parameters as a by-name object, and not as positional arguments in a by-position array
string
required
Transaction hash to query as a hex-encoded string. This transaction hash should correspond to transaction that has been previously submitted to the network.Transaction hash (as a hex-encoded string)
string
Lets the user choose the format in which the response should be returned - either as unpacked JSON or as base64-encoded XDR strings. Note that you should not rely on any schema for the JSON, as it will change when the underlying XDR changes.Specifies whether XDR should be encoded as Base64 (default or ‘base64’) or JSON (‘json’).

Result

(getTransactionResult)
string
required
The current status of the transaction by hashAvailable options: SUCCESS, NOT_FOUND, FAILED
string
required
The hex-encoded hash of the transaction.
number
required
The sequence number of the latest ledger known to Stellar RPC at the time it handled the request.
string
required
The unix timestamp (as a string) of the close time of the latest ledger known to Stellar RPC when it handled the request.
number
required
The sequence number of the oldest ledger ingested by Stellar RPC at the time it handled the request.
string
required
The unix timestamp (as a string) of the close time of the oldest ledger kept in history by Stellar RPC when it handled the request.
number
(optional) The sequence number of the ledger which included the transaction. This field is only present if status is SUCCESS or FAILED.
string
(optional) The unix timestamp (as a string) of when the transaction was included in the ledger. This field is only present if status is SUCCESS or FAILED.
number
(optional) The index of the transaction among all transactions included in the ledger. This field is only present if status is SUCCESS or FAILED.
boolean
(optional) Indicates whether the transaction was fee bumped. This field is only present if status is SUCCESS or FAILED.
string
(optional) A base64 encoded string of the raw TransactionEnvelope XDR struct for this transaction.
string
(optional) A base64 encoded string of the raw TransactionResult XDR struct for this transaction. This field is only present if status is SUCCESS or FAILED.
string
(optional) A base64 encoded string of the raw TransactionMeta XDR struct for this transaction.
string[]
(optional) A base64 encoded slice of xdr.DiagnosticEvent. This is only present if the ENABLE_SOROBAN_DIAGNOSTIC_EVENTS has been enabled on the RPC server.
object
Contains all events emitted during transaction execution.Note: Available only on RPC v23.x (currently testnet only).

Examples

Query for a transaction hash that returns SUCCESS from the RPC node.Request
Result

SDK Guide

The example above is querying details of a transaction using RPC methods directly. If you are using the Stellar SDK to build applications, you can use the native functions to get the same information.

Using the Lab

You can use the getTransaction method in the Stellar Laboratory to retrieve details about a specific transaction. This is especially useful for checking the status of a transaction to determine whether it has been successfully recorded on the blockchain. stellar-rpc retains a bounded, ledger-denominated history of recent transactions and events, configured by a single history-retention-window setting. The stock default is 120960 ledgers (about 7 days, depending on ledger cadence), and operators of private instances can adjust it. You can inspect the active window and the range of ledgers available on an instance with the getHealth method (ledgerRetentionWindow, oldestLedger, latestLedger). For transaction debugging beyond the retained window, consider indexing the data yourself, using a third-party indexer, or querying Hubble—Stellar’s public BigQuery dataset. 👉 View getTransaction on the Lab (The following transaction hash is a random one I picked from the latest at the time of writing this doc) Lab: getTransaction