getConfirmedTransaction RPC Method

Returns transaction details for a confirmed transaction

Deprecated Method

This method is expected to be removed in solana-core v2.0. Please use getTransaction instead.

Parameters #

string required

transaction signature, as base-58 encoded string

object optional

Configuration object containing the following fields:

commitment string optional

encoding string optional

Default: json

Encoding format for Account data

Values: jsonbase58base64jsonParsed

  • base58 is slow and limited to less than 129 bytes of Account data.
  • 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).

Result #

  • <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

Code sample #

curl https://api.devnet.solana.com -s -X POST -H "Content-Type: application/json" -d '
  {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getConfirmedTransaction",
    "params": [
      "2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
      "base64"
    ]
  }
'

Response #

{
  "jsonrpc": "2.0",
  "result": {
    "meta": {
      "err": null,
      "fee": 5000,
      "innerInstructions": [],
      "postBalances": [499998932500, 26858640, 1, 1, 1],
      "postTokenBalances": [],
      "preBalances": [499998937500, 26858640, 1, 1, 1],
      "preTokenBalances": [],
      "status": {
        "Ok": null
      }
    },
    "slot": 430,
    "transaction": [
      "AVj7dxHlQ9IrvdYVIjuiRFs1jLaDMHixgrv+qtHBwz51L4/ImLZhszwiyEJDIp7xeBSpm/TX5B7mYzxa+fPOMw0BAAMFJMJVqLw+hJYheizSoYlLm53KzgT82cDVmazarqQKG2GQsLgiqktA+a+FDR4/7xnDX7rsusMwryYVUdixfz1B1Qan1RcZLwqvxvJl4/t3zHragsUp0L47E24tAFUgAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAAAHYUgdNXR0u3xNdiTr072z2DVec9EQQ/wNo1OAAAAAAAtxOUhPBp2WSjUNJEgfvy70BbxI00fZyEPvFHNfxrtEAQQEAQIDADUCAAAAAQAAAAAAAACtAQAAAAAAAAdUE18R96XTJCe+YfRfUp6WP+YKCy/72ucOL8AoBFSpAA==",
      "base64"
    ]
  },
  "id": 1
}