Solana Tracker
Solana RPC/Methods

getParsedTransaction RPC Method

Description

Returns transaction details for a confirmed transaction.

The getParsedTransaction method is only supported with the @solana/web3.js SDK. To use cURL or solana.py, check out the getTransaction method examples where the encoding is set to jsonParsed.

Parameters

  1. slot (string) - A base58-encoded transaction signature identifying the transaction to retrieve.
  2. object (array) - The configuration object with the following fields:
    • encoding (string, optional) - The encoding format for account data. It can be jsonParsed or not applicable if using JS getParsedTransaction.
    • 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 - It is not supported for this method.
    • maxSupportedTransactionVersion (integer, optional) - The maximum transaction version to return in responses. If the requested transaction has a higher version, an error will be returned. If omitted, only legacy transactions will be returned, and any versioned transaction will prompt an error. Use 0 for versioned transactions or omit for legacy only.

Returns

The result will be null if the specified transaction is not confirmed; otherwise, an object with the following fields:

  • slot - The slot number in which the transaction was processed.
  • parsedTransaction - The parsed transaction object with the following fields:
    • signatures - An array of signatures on the transaction.
    • parsedMessage - The parsed message of the transaction:
      • accountKeys - An array of public keys involved in the transaction.
      • instructions - An array of instructions executed in the transaction.
      • recentBlockhash - The recent blockhash from the transaction.
      • addressTableLookups - An array of address lookups performed during execution.
  • 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 with the following fields:
    • err - Error code if the transaction failed, or null if it succeeds.
    • fee - The fee paid by the transaction, encoded as a u64 integer.
    • preBalances - An array of lamport balances for each account before the transaction was processed.
    • postBalances - An array of lamport balances for each account after the transaction was processed.
    • parsedInnerInstructions - List of inner instructions, omitted if inner instruction recording was not enabled.
    • preTokenBalances - An array of token balances before the transaction (omitted if inner instruction recording is not enabled).
    • postTokenBalances - An array of token balances after the transaction (omitted if inner instruction recording is not enabled).
    • logMessages - An array of log messages generated by the transaction (omitted if inner instruction recording is not enabled).
    • rewards - An object containing reward information (only present if rewards are requested):
      • pubkey - The public key of the account that received the reward, encoded as a base-58 string.
      • lamports - The number of reward lamports credited or debited.
      • postBalance - The account balance in lamports after the reward was applied.
      • rewardType - The type of reward (e.g., fee, rent, voting, staking).
      • commission - The vote account commission for voting/staking rewards (if applicable).
    • loadedAddresses - The list of loaded addresses:
      • readonly - Ordered list of base-58 encoded addresses for readonly loaded accounts.
      • writable - Ordered list of base-58 encoded addresses for writable loaded accounts.
    • version - The transaction version, undefined if maxSupportedTransactionVersion is not set.

Code Examples

const web3 = require("@solana/web3.js");
(async () => {
  const solana = new web3.Connection("https://rpc-mainnet.solanatracker.io/?api_key=YOUR_API_KEY_HERE");
  console.log(
    await solana.getParsedTransaction(
      "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",
      { maxSupportedTransactionVersion: 0 }
    )
  );
})();

Full Example Response

{
  "slot": 12345678,
  "parsedTransaction": {
    "signatures": [
      "D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff"
    ],
    "parsedMessage": {
      "accountKeys": [
        "Vote111111111111111111111111111111111111111",
        "SysvarRent111111111111111111111111111111111"
      ],
      "instructions": [
        {
          "programId": "Vote111111111111111111111111111111111111111",
          "accounts": [
            "Vote111111111111111111111111111111111111111",
            "SysvarRent111111111111111111111111111111111"
          ],
          "data": "abc123"
        }
      ],
      "recentBlockhash": "7x8y9z0a1b2c3d4e5f6g7h8i9j0k",
      "addressTableLookups": []
    }
  },
  "blockTime": 1696440457,
  "meta": {
    "err": null,
    "fee": 5000,
    "preBalances": [1000000000, 2000000000],
    "postBalances": [999995000, 2000000000],
    "parsedInnerInstructions": [],
    "preTokenBalances": [],
    "postTokenBalances": [],
    "logMessages": ["Program Vote111111111111111111111111111111111111111 invoked"],
    "rewards": [],
    "loadedAddresses": {
      "readonly": [],
      "writable": []
    },
    "version": 0
  }
}```

On this page