getTransaction

Returns transaction details for a confirmed transaction.

📘

Supported on Solana (mainnet) only.

Parameters

  • <string> - transaction signature as base-58 encoded string
  • (optional) <object> - Configuration object containing the following optional fields:
    • (optional) encoding: <string> - encoding for each returned Transaction, either "json", "jsonParsed", "base58" (slow), "base64". If parameter not provided, the default encoding is "json". "jsonParsed" encoding attempts to use program-specific instruction parsers to return more human-readable and explicit data in the transaction.message.instructions list. If "jsonParsed" is requested but a parser cannot be found, the instruction falls back to regular JSON encoding (accounts, data, and programIdIndex fields).
    • (optional) commitment: <string> - Commitment; "processed" is not supported. If parameter not provided, the default is "finalized".
    • (optional) maxSupportedTransactionVersion: <number> - set the max transaction version to return in responses. If the requested transaction is a higher version, an error will be returned. If this parameter is omitted, only legacy transactions will be returned, and any versioned transaction will prompt the error.

Returns

  • <null> - if transaction is not found or not confirmed
  • <object> - if transaction is confirmed, an object with the following fields:
    • slot: <u64> - the slot this transaction was processed in
    • transaction: <object|[string,encoding]> - Transaction object, either in JSON format or encoded binary data, depending on encoding parameter
    • blockTime: <i64|null> - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
    • meta: <object|null> - transaction status metadata object:
      • err: <object|null> - Error if transaction failed, null if transaction succeeded. TransactionError definitions
      • fee: <u64> - fee this transaction was charged, as u64 integer
      • preBalances: <array> - array of u64 account balances from before the transaction was processed
      • postBalances: <array> - array of u64 account balances after the transaction was processed
      • innerInstructions: <array|null> - List of inner instructions or null if inner instruction recording was not enabled during this transaction
      • preTokenBalances: <array|undefined> - List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
      • postTokenBalances: <array|undefined> - List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
      • logMessages: <array|null> - array of string log messages or null if log message recording was not enabled during this transaction
      • DEPRECATED: status: <object> - Transaction status
        • "Ok": <null> - Transaction was successful
        • "Err": <ERR> - Transaction failed with TransactionError
      • rewards: <array|null> - transaction-level rewards, populated if rewards are requested; an array of JSON objects containing:
        • pubkey: <string> - The public key, as base-58 encoded string, of the account that received the reward
        • lamports: <i64>number of reward lamports credited or debited by the account, as a i64
        • postBalance: <u64> - account balance in lamports after the reward was applied
        • rewardType: <string> - type of reward: currently only "rent", other types may be added in the future
        • commission: <u8|undefined> - vote account commission when the reward was credited, only present for voting and staking rewards
      • loadedAddresses: <object|undefined> - Transaction addresses loaded from address lookup tables. Undefined if maxSupportedTransactionVersion is not set in request params.
        • writable: <array[string]> - Ordered list of base-58 encoded addresses for writable loaded accounts
        • readonly: <array[string]> - Ordered list of base-58 encoded addresses for readonly loaded accounts
      • returnData: <object|undefined> - the most-recent return data generated by an instruction in the transaction, with the following fields:
        • programId: <string>, the program that generated the return data, as base-58 encoded Pubkey
        • data: <[string, encoding]>, the return data itself, as base-64 encoded binary data
      • computeUnitsConsumed: <u64|undefined>, number of compute units consumed by the transaction
    • version: <"legacy"|number|undefined> - Transaction version. Undefined if maxSupportedTransactionVersion is not set in request params.

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransaction",
    "params": [
      "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
      "json"
    ]
  }
'

Result

{
  "jsonrpc": "2.0",
  "result": {
    "meta": {
      "err": null,
      "fee": 5000,
      "innerInstructions": [],
      "postBalances": [499998932500, 26858640, 1, 1, 1],
      "postTokenBalances": [],
      "preBalances": [499998937500, 26858640, 1, 1, 1],
      "preTokenBalances": [],
      "rewards": [],
      "status": {
        "Ok": null
      }
    },
    "slot": 430,
    "transaction": {
      "message": {
        "accountKeys": [
          "3UVYmECPPMZSCqWKfENfuoTv51fTDTWicX9xmBD2euKe",
          "AjozzgE83A3x1sHNUR64hfH7zaEBWeMaFuAN9kQgujrc",
          "SysvarS1otHashes111111111111111111111111111",
          "SysvarC1ock11111111111111111111111111111111",
          "Vote111111111111111111111111111111111111111"
        ],
        "header": {
          "numReadonlySignedAccounts": 0,
          "numReadonlyUnsignedAccounts": 3,
          "numRequiredSignatures": 1
        },
        "instructions": [
          {
            "accounts": [1, 2, 3, 0],
            "data": "37u9WtQpcm6ULa3WRQHmj49EPs4if7o9f1jSRVZpm2dvihR9C8jY4NqEwXUbLwx15HBSNcP1",
            "programIdIndex": 4
          }
        ],
        "recentBlockhash": "mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B"
      },
      "signatures": [
        "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv"
      ]
    }
  },
  "blockTime": null,
  "id": 1
}