Skip to main content

getTransaction RPC Method

Returns transaction details for a confirmed transaction.

Parameters

string required
Transaction signature
  • Base-58 encoded string
object optional
Configuration object containing the following fields:
commitment string optional
The level of commitment desired when querying state
  • processed is not supported
maxSupportedTransactionVersion number optional
Set the max transaction version to return in responses
  • If the requested transaction is a higher version, an error will be returned
  • If omitted, only legacy transactions will be returned
encoding string optional
Encoding for the returned Transaction
  • Default: json
Allowed Encoding Values:
  • json
  • jsonParsed
  • base64
  • base58

Code Sample

Response

Result Details

The result can be:
  • <null> - If transaction is not found or not confirmed
  • <object> - If transaction is confirmed, containing:
    • slot: <u64>
      • Slot where the transaction was processed
    • transaction: <object|[string,encoding]>
      • Transaction details
      • Format depends on selected encoding
    • blockTime: <i64|null>
      • Estimated production time
      • Unix timestamp of transaction processing
      • null if timestamp unavailable
    • meta: <object|null>
      • Transaction status metadata:
        • err: <object|null> - Transaction error details
        • fee: <u64> - Transaction fee
        • preBalances: <array> - Account balances before transaction
        • postBalances: <array> - Account balances after transaction
        • innerInstructions: <array|null> - Inner instructions
        • logMessages: <array|null> - Transaction log messages
        • rewards: <array|null> - Transaction-level rewards
    • loadedAddresses: <object|undefined>
      • Addresses loaded from address lookup tables
    • returnData: <object|undefined>
      • Most recent return data from transaction instructions
    • computeUnitsConsumed: <u64|undefined>
      • Compute units used by the transaction
    • version: <"legacy"|number|undefined>
      • Transaction version

Important Notes

  • Supports various encoding formats
  • Provides comprehensive transaction details
  • Optional parameters allow fine-tuned querying