Solana Tracker
Solana RPC/Methods

getTransaction RPC Method

Description

Returns transaction details for a confirmed transaction.

Parameters

  1. tx_sig (string) - The transaction signature as base-58 encoded string
  2. object (array) - The configuration object with the following fields:
    • commitment (string, optional) - The level of commitment required for the query. The options include:
      • finalized - 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
      • confirmed - The node will query the most recent block that has been voted on by the supermajority of the cluster
      • processed - The node will query its most recent block. Note that the block may not be complete
    • maxSupportedTransactionVersion (integer, optional) - 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

Returns null if the specified block is not confirmed, otherwise RpcResponse JSON object with the following fields:

  • blockTime - The estimated production time, as Unix timestamp (seconds since the Unix epoch). It's null if not available
  • meta - The 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:
    • err - Error code if the transaction failed or null if the transaction succeeds
    • fee - The total fees paid by all transactions in the block encoded as u64 integer
    • innerInstructions - An array of objects representing the inner instructions of all transactions in the block (omitted if inner instruction recording is not enabled)
    • logMessages - An array of strings containing any log messages generated by the block's transactions (omitted if inner instruction recording is not enabled)
    • postBalances - An array of lamport balances for each account in the block after the transactions were processed
    • postTokenBalances - An array of token balances for each token account in the block after the transactions were processed
    • preBalances - An array of lamport balances for each account in the block before the transactions were processed
    • preTokenBalances - An array of token balances for each token account in the block before the transactions were processed
    • rewards - An object containing information about the rewards earned by the block's validators (only present if the rewards are requested)
    • status - The status of the transaction. If the transaction was successful, returns Ok and if the transaction failed with TransactionError, returns Err
  • slot - The slot number to retrieve block production information
  • transaction - The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter
  • version - The transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters

Code Examples

curl "https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE" \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'

On this page