# getTransaction

> import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import CreditCost from '@site/src/components/CreditCost/CreditCostPrice.js'

# `getTransaction`

Returns transaction details for a confirmed transaction. <CreditCost network="solana" method="getTransaction" />

## Parameters

- `address`: (string) _[required]_ - The `base58` encoded program public key.
- `config`: (object) _[optional]_ - Configuration object with the following options:
  - `commitment`: (string) _[optional]_ - The commitment level to use for the query. The default is `finalized`. Possible values are:
    - `finalized` - Queries the most recent block confirmed by a super majority of the cluster as having
      reached maximum lockout, meaning the cluster has recognized this block as finalized.
    - `confirmed` - Queries the most recent block that has been voted on by a super majority of the cluster.
    - `processed` - Queries its most recent block. The block may still be skipped by the cluster.
  - `maxSupportedTransactionVersion`: (integer) _[optional]_ - The maximum supported transaction version to return.
    If the requested transaction contains a transaction with a higher version, an error will be returned. If this parameter
    is omitted, only legacy transactions will be returned, and any versioned transaction will return an error.
  - `encoding`: (string) _[optional]_ - The encoding format to use. Can be one of `base58`, `base64`, `json`, and `jsonParsed`. The
    default is `json`.

## Returns

`result`- `null` if the transaction is not found or not confirmed, otherwise returns an object containing:

- `slot` - The slot this transaction was processed in.
- `blockTime` - The block time of the transaction as Unix timestamp (seconds since the Unix epoch). `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 disabled). Each object has the following fields:
      - `logMessages` - An array of strings containing any log messages generated by the block's transactions
        (omitted if inner instruction recording is disabled).
      - `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 disabled):
        - `accountIndex` - The index of an account within a transaction.
        - `mint` - The mint address of the token.
        - `owner` - The `base58` encoded public key of the program this account has been assigned to.
        - `uiTokenAmount` - The amount of a token transfer.
          - `amount` - The amount of the token transferred.
          - `decimals` - The number of decimal places used by the token.
          - `uiAmount` - The amount of the token transferred in the smallest unit of the token.
          - `uiAmountString` - The amount of the token transferred 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 disabled):
        - `accountIndex` - The index of an account within a transaction.
        - `mint` - The mint address of the token.
        - `owner` - The `base58` encoded public key of the program this account has been assigned to.
        - `uiTokenAmount` - The amount of a token transfer.
          - `amount` - The amount of the token transferred.
          - `decimals` - The number of decimal places used by the token.
          - `uiAmount` - The amount of the token transferred in the smallest unit of the token.
          - `uiAmountString` - The amount of the token transferred 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). It has the following fields:
        - `pubkey` - The public key of the account that received the award encoded as a `base58` string.
        - `lamports` - The number of reward lamports credited or debited by the account.
        - `postBalance` - The account balance in lamports after the reward was applied.
        - `rewardType` - The type of reward. It could be `fee`, `rent`, `voting`, or `staking`.
        - `commission` - The vote account commission when the reward was credited, only present for voting and staking rewards.
      - `status` - The status of the transaction. It returns `Ok` if the transaction was successful, and `Err`
        if the transaction failed.
    - `transaction` - The transaction object. It could be either JSON format or encoded binary data, depending on the encoding parameter.
      - `message` - An array of transaction objects 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 public key associated with the block producer that created the block.
          - `signer` - Indicates if the account is a required transaction signer. It can also be used to identify the signers
            involved in the block's transactions and to verify the authenticity of the signatures.
          - `source` - Identifies the accounts that provided the funds for the block's transactions.
          - `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.
              - `clockSysvar` - Provides information about the current state of the blockchain.
              - `slotHashesSysvar` - Provides information about the hashes of recent slots.
              - `vote` - An array of vote accounts that were involved in the block's transactions.
                - `hash` - The hash of the block. It can be used to uniquely identify the block and to verify the authenticity
                  of the block's contents.
                - `slots` - An array of slot numbers that correspond to the transactions in the block.
                - `timestamp` - The Unix timestamp of the block's creation.
              - `voteAccount` - A vote account to identify the validator that produced the block and to verify the validity of their vote.
              - `voteAuthority` - An authority associated with the vote account used to produce the block.
            - `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 public key of the program that was executed in the block's transactions.
          - `stackHeight` - The current depth of the execution stack.
        - `recentBlockhash` - The recent block hash for the account's cluster.
      - `signatures` - The list of transaction signatures contained within a particular block.
- `version` - The version of the transaction. Returns `undefined` if `maxSupportedTransactionVersion` is not specified in the request.

### Request

<Tabs>
  <TabItem value="curl">

```bash
curl https://solana-mainnet.infura.io/v3/<YOUR-API-KEY> \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc": "2.0","id": 1,"method": "getTransaction","params": ["bVwuWqLs5wbHMHMavFfpK6zrg3mGY6AWVTNgdeDuWi1PxmFgvQYQJBMMcYp16fmJE9hwg4nNjDFok4rxmxQ6j5e",{"encoding": "jsonParsed","maxSupportedTransactionVersion":0}]}'
```

  </TabItem>
</Tabs>

### Response

<Tabs>
  <TabItem value="JSON">

```bash
{
  "jsonrpc": "2.0",
  "result": {
    "blockTime": 1744593547,
    "meta": {
      "computeUnitsConsumed": 52018,
      "err": null,
      "fee": 10000,
      "innerInstructions": [
        {
          "index": 2,
          "instructions": [
            {
              "parsed": {
                "info": {
                  "authority": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
                  "destination": "EXp2FCTRX9tPyyjLneE7K6YRgh9qpqKnQLecXdRFMQFL",
                  "mint": "So11111111111111111111111111111111111111112",
                  "source": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
                  "tokenAmount": {
                    "amount": "10",
                    "decimals": 9,
                    "uiAmount": 1e-8,
                    "uiAmountString": "0.00000001"
                  }
                },
                "type": "transferChecked"
              },
              "program": "spl-token",
              "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
              "stackHeight": 2
            },
            {
              "parsed": {
                "info": {
                  "authority": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
                  "destination": "HTADwVNDuSxnzYyuwhfNyZAkaVCABnbNFZzEdcR35idy",
                  "mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
                  "source": "CPg85jShyN1Tez437qgR1jYbF43i8aWhTMWpbPCJoJqE",
                  "tokenAmount": {
                    "amount": "2583",
                    "decimals": 6,
                    "uiAmount": 0.002583,
                    "uiAmountString": "0.002583"
                  }
                },
                "type": "transferChecked"
              },
              "program": "spl-token",
              "programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
              "stackHeight": 2
            }
          ]
        }
      ],
      "logMessages": [
        "Program 11111111111111111111111111111111 invoke [1]",
        "Program 11111111111111111111111111111111 success",
        "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
        ...
        "Program 11111111111111111111111111111111 success"
      ],
      "postBalances": [
        1160000,
        10799119391,
        ...
        5888160
      ],
      "postTokenBalances": [
        {
          "accountIndex": 3,
          "mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
          "owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
          "programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
          "uiTokenAmount": {
            "amount": "173576140",
            "decimals": 6,
            "uiAmount": 173.57614,
            "uiAmountString": "173.57614"
          }
        },
        {
          "accountIndex": 12,
          "mint": "So11111111111111111111111111111111111111112",
          "owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
          "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "uiTokenAmount": {
            "amount": "700864692413",
            "decimals": 9,
            "uiAmount": 700.864692413,
            "uiAmountString": "700.864692413"
          }
        },
        {
          "accountIndex": 13,
          "mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
          "owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
          "programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
          "uiTokenAmount": {
            "amount": "201175021191002",
            "decimals": 6,
            "uiAmount": 201175021.191002,
            "uiAmountString": "201175021.191002"
          }
        }
      ],
      "preBalances": [
        1170000,
        10799139401,
        ...
        5888160
      ],
      "preTokenBalances": [
        {
          "accountIndex": 3,
          "mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
          "owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
          "programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
          "uiTokenAmount": {
            "amount": "173573816",
            "decimals": 6,
            "uiAmount": 173.573816,
            "uiAmountString": "173.573816"
          }
        },
        {
          "accountIndex": 12,
          "mint": "So11111111111111111111111111111111111111112",
          "owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
          "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
          "uiTokenAmount": {
            "amount": "700864692403",
            "decimals": 9,
            "uiAmount": 700.864692403,
            "uiAmountString": "700.864692403"
          }
        },
        {
          "accountIndex": 13,
          "mint": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
          "owner": "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
          "programId": "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
          "uiTokenAmount": {
            "amount": "201175021193585",
            "decimals": 6,
            "uiAmount": 201175021.193585,
            "uiAmountString": "201175021.193585"
          }
        }
      ],
      "rewards": [],
      "status": {
        "Ok": null
      }
    },
    "slot": 333307946,
    "transaction": {
      "message": {
        "accountKeys": [
          {
            "pubkey": "AgkMbKTWCuiAaJ262TdpXhuMPvWa21GJmAmZfo6gLEPF",
            "signer": true,
            "source": "transaction",
            "writable": true
          },
          ...
          {
            "pubkey": "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
            "signer": false,
            "source": "lookupTable",
            "writable": false
          }
        ],
        "addressTableLookups": [
          {
            "accountKey": "CadRirmkx2CeeLd9LUtvF7D53822vrSt8PQULewPLm28",
            "readonlyIndexes": [
              2,
              0,
              5,
              4
            ],
            "writableIndexes": [
              1,
              9,
              10
            ]
          }
        ],
        "instructions": [
          {
            "parsed": {
              "info": {
                "base": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
                "lamports": 2039290,
                "newAccount": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
                "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                "seed": "3JgKrBB3sagy1HMXai5hKbRnsuZZDudR",
                "source": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
                "space": 165
              },
              "type": "createAccountWithSeed"
            },
            "program": "system",
            "programId": "11111111111111111111111111111111",
            "stackHeight": null
          },
          {
            "parsed": {
              "info": {
                "account": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
                "mint": "So11111111111111111111111111111111111111112",
                "owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
                "rentSysvar": "SysvarRent111111111111111111111111111111111"
              },
              "type": "initializeAccount"
            },
            "program": "spl-token",
            "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
            "stackHeight": null
          },
          {
            "accounts": [
              "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
              "GpMZbSM2GgvTKHJirzeGfMFoaZ8UR2X7F4v8vHTvxFbL",
              "D4FPEruKEHrG5TenZ2mpDGEfu1iUvTiqBxvpU8HLBvC2",
              "CLhjQNAdhn6qZiCpDmiQFVNrhfMumDGEGMBrnVmk7wTR",
              "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
              "HTADwVNDuSxnzYyuwhfNyZAkaVCABnbNFZzEdcR35idy",
              "EXp2FCTRX9tPyyjLneE7K6YRgh9qpqKnQLecXdRFMQFL",
              "CPg85jShyN1Tez437qgR1jYbF43i8aWhTMWpbPCJoJqE",
              "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
              "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb",
              "So11111111111111111111111111111111111111112",
              "EyzgnBfHGe9hh169B8993muBVcoeURCnSgPbddBeSybo",
              "d2jwtX1E47jw4EwxPK9VSVCmQsQpu4tzniNkzk43rF3"
            ],
            "data": "E73fXHPWvSR1nM1Tw5ZRioYHwnqN3caKH",
            "programId": "CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C",
            "stackHeight": null
          },
          {
            "parsed": {
              "info": {
                "account": "GscCpwDVJfJ9Qv1svzLWpend7hvJq3Syrfuwe5YzHbtp",
                "destination": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA",
                "owner": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA"
              },
              "type": "closeAccount"
            },
            "program": "spl-token",
            "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
            "stackHeight": null
          },
          {
            "parsed": {
              "info": {
                "destination": "ADuUkR4vqLUMWXxW9gh6D6L8pMSawimctcNZ5pGwDcEt",
                "lamports": 20000,
                "source": "6FwAyRbvKwY4uAzgeWaXUHEqfSDaFcdcZsbBh1TQtnuA"
              },
              "type": "transfer"
            },
            "program": "system",
            "programId": "11111111111111111111111111111111",
            "stackHeight": null
          }
        ],
        "recentBlockhash": "BRRXvTHndixZBzAacVfLkCfXX8X4jzrWdd9WKKsmTKG3"
      },
      "signatures": [
        "bVwuWqLs5wbHMHMavFfpK6zrg3mGY6AWVTNgdeDuWi1PxmFgvQYQJBMMcYp16fmJE9hwg4nNjDFok4rxmxQ6j5e",
        "3mSzNawWNP75KjSH3yyLyydBWaeEV7nJsWNHzJy5ThN4h2sv1vBbygwbLeRFU9zuoeBDVfqdU1tPpH2G9m8eFUFp"
      ]
    },
    "version": 0
  },
  "id": 1
}
```

  </TabItem>
</Tabs>
