# getTransaction

Returns transaction details for a confirmed transaction.

This method will use `30` [Compute Units](/v1/about/billing.md).

***

## **Parameters**

* `tx_sig` string. The transaction signature as base-58 encoded string.
* `object` *optional.* Configuration object containing the following fields:
  * `commitment` string. The level of commitment required for the query. The options include:
    * `finalized` string. 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` string. The node will query the most recent block that has been voted on by the supermajority of the cluster.
    * `processed` string. The node will query its most recent block. Note that the block may not be complete.
  * `maxSupportedTransactionVersion` integer. 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

`result` 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). Each object has the following fields:
    * `index` The index of the instruction in the transaction, which determines the order in which the operations were executed.
    * `instructions` An array of instructions that were executed in the block's transactions.
    * `parsed` An array of parsed instructions that were executed in the block's transactions.
      * `info` An array of information objects that provide additional details about the transactions in the block.
        * `lamports` The number of lamports assigned to this account as u64 (64-bit unsigned integer).
        * `newAccount` The new account created as part of the transaction.
        * `owner` The base-58 encoded Pubkey of the program this account has been assigned to.
        * `source` The source account that funded the transaction.
        * `space` The amount of storage space required to store a specific transaction.
      * `type` The type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
    * `program` The data associated with the program that was executed in the block's transactions.
    * `programId` The ID of the program that executed the instruction.
    * `stackHeight` The current depth of the execution stack.
  * `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 (omitted if inner instruction recording is not enabled).
    * `accountIndex` The index of an account within a transaction.
    * `mint` Provides information about the creation of new tokens.
    * `owner` The base-58 encoded Pubkey of the program this account has been assigned to.
    * `uiTokenAmount` The amount of a token transfer in a human-readable format.
      * `amount` The amount of a token transfer.
      * `decimals` The number of decimal places used by the token.
      * `uiAmount` The amount of a token transfer in the smallest unit of the token.
      * `uiAmountString` The amount of a token transfer as a string with the appropriate number of decimal places for the token.
  * `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 (omitted if inner instruction recording is not enabled).
    * `accountIndex` The index of an account within a transaction.
      * `mint` Provides information about the creation of new tokens.
      * `owner` The base-58 encoded Pubkey of the program this account has been assigned to.
      * `uiTokenAmount` The amount of a token transfer in a human-readable format.
        * `amount` The amount of a token transfer.
        * `decimals` The number of decimal places used by the token.
        * `uiAmount` The amount of a token transfer in the smallest unit of the token.
        * `uiAmountString` The amount of a token transfer as a string with the appropriate number of decimal places for the token.
  * `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.
  * `message` An array of transactions included in the block.
    * `accountKeys` An array of public keys associated with the accounts that were accessed during the execution of transactions in the block.
      * `pubkey` The Pubkey of program encoded as base-58 string.
      * `signer` Used to sign transactions in the block. Also used to identify the signers involved in the block's transactions and to verify the authenticity of the signatures.
      * `source` The source account that funded the transaction.
      * `writable` A boolean value that indicates whether the accounts associated with the given public keys were modified by the transactions or not.
    * `instructions` An array of instructions that were executed in the block's transactions.
      * `parsed` An array of parsed instructions that were executed in the block's transactions.
        * `info` An array of information objects that provide additional details about the transactions in the block.
          * `account` An address on the Solana blockchain that is used to store assets.
          * `mint` Provides information about the creation of new tokens.
          * `source` The source account that funded the transaction.
          * `systemProgram` The system program that executed the transaction.
          * `tokenProgram` Responsible for maintaining the supply and balance of the token, and for executing transfers of the token between accounts.
          * `wallet` Wallet is used for managing and storing assets.
        * `type` The type of the block. It can be used to differentiate between regular blocks and special blocks such as snapshot or transaction confirmation blocks.
      * `program` The data associated with the program that was executed in the block's transactions.
      * `programId` The ID of the program that executed the instruction.
    * `recentBlockhash` The recent block hash for the account's cluster.
  * `signatures` The list of transaction signatures contained within a particular block.
* `version` The transaction version. It's undefined if maxSupportedTransactionVersion is not set in the requested parameters.

```bash
// 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
}
```

{% tabs %}
{% tab title="mainnet" %}

<pre class="language-bash"><code class="lang-bash"><strong>curl https://mainnet.solana.validationcloud.io/v1/&#x3C;YOUR_API_KEY_HERE> \
</strong>    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
    
</code></pre>

{% endtab %}

{% tab title="devnet" %}

```bash
curl https://devnet.solana.validationcloud.io/v1/<YOUR_API_KEY_HERE> \
    -X POST \
    -H "Content-Type: application/json" \
    -d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["D13jTJYXoQBcRY9AfT5xRtsew7ENgCkNs6mwwwAcUCp4ZZCEM7YwZ7en4tVsoDa7Gu75Jjj2FgLXNUz8Zmgedff",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
    
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.validationcloud.io/v1/solana/http-methods/gettransaction.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
