Documentation index

getTransaction

Returns the complete transaction details for a confirmed transaction given its signature. This is the primary method for retrieving transaction information, supporting both legacy and versioned transactions. It returns the full transaction message, metadata (including pre/post balances, log messages, and inner instructions), slot, and block time. This method is essential for block explorers, transaction debugging, and building detailed transaction history views.

Parameters

#TypeRequiredDescription
1stringYesTransaction signature (base-58 encoded)
2objectNoConfiguration object

Configuration object fields:

FieldTypeDescription
commitmentstringCommitment level: confirmed or finalized (default finalized)
encodingstringTransaction encoding: json, jsonParsed, base58, or base64 (default json)
maxSupportedTransactionVersionnumberMax transaction version to return. Set to 0 to support versioned transactions

Response

Returns null if the transaction is not found. Otherwise returns an object:

FieldTypeDescription
slotu64The slot the transaction was processed in
transactionobjectTransaction object (format depends on encoding)
blockTime`i64null`
meta`objectnull`
meta.feeu64Transaction fee in lamports
meta.err`objectnull`
meta.logMessages`array[string]null`
version`"legacy"number`

Code Examples

cURL

Terminal
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTransaction",
  "params": [
    "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
    {
      "encoding": "jsonParsed",
      "commitment": "confirmed",
      "maxSupportedTransactionVersion": 0
    }
  ]
}'

TypeScript

TypeScript
const response = await fetch("http://88.216.36.108:7999", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "getTransaction",
    params: [
      "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
      {
        encoding: "jsonParsed",
        commitment: "confirmed",
        maxSupportedTransactionVersion: 0
      }
    ]
  }),
});
const { result } = await response.json();
console.log("Fee:", result.meta.fee, "lamports, Status:", result.meta.err ? "Failed" : "Success");

Python

Python
import requests

response = requests.post("http://88.216.36.108:7999", json={
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransaction",
    "params": [
        "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
        {
            "encoding": "jsonParsed",
            "commitment": "confirmed",
            "maxSupportedTransactionVersion": 0
        }
    ]
})
result = response.json()["result"]
print(f"Fee: {result['meta']['fee']} lamports, Status: {'Failed' if result['meta']['err'] else 'Success'}")

Rust

Rust
use reqwest::Client;
use serde_json::json;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    let res = client.post("http://88.216.36.108:7999")
        .json(&json!({
            "jsonrpc": "2.0",
            "id": 1,
            "method": "getTransaction",
            "params": [
                "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW",
                {
                    "encoding": "jsonParsed",
                    "commitment": "confirmed",
                    "maxSupportedTransactionVersion": 0
                }
            ]
        }))
        .send().await?
        .text().await?;
    println!("{}", res);
    Ok(())
}

Example Response

JSON
{
  "jsonrpc": "2.0",
  "result": {
    "slot": 166974442,
    "transaction": {
      "message": {
        "accountKeys": [],
        "instructions": [],
        "recentBlockhash": "GJxqhuxcgfn5Tcj6y3f8X4FeCDd2RQ6SnEMo1AAxrPRZ"
      },
      "signatures": ["5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"]
    },
    "meta": {
      "fee": 5000,
      "err": null,
      "logMessages": ["Program 11111111111111111111111111111111 invoke [1]", "Program 11111111111111111111111111111111 success"]
    },
    "blockTime": 1681391935,
    "version": "legacy"
  },
  "id": 1
}