Skip to main content

getTransaction

POST

Returns transaction details for a confirmed transaction
param[0]
transactionSignaturestringrequired
Transaction signature, as base-58 encoded string
param[1]
configurationObjectobjectrequired
commitmentstring
The commitment describes how finalized a block is at that point in time.
  • finalized - the node will query the most recent block confirmed by supermajority of the cluster as having reached maximum lockout, meaning the cluster has recognized this block as finalized
  • confirmed - the node will query the most recent block that has been voted on by supermajority of the cluster.
  • processed - the node will query its most recent block. Note that the block may still be skipped by the cluster.
maxSupportedTransactionVersioninteger
Currently, the only valid value for this parameter is 0. Setting it to 0 allows you to fetch all transactions, including both Versioned and legacy transactions.This parameter determines the maximum transaction version that will be returned in the response. If you request a transaction with a higher version than this value, an error will be returned. If you omit this parameter, only legacy transactions will be returned—any versioned transaction will result in an error.
transactionDetailsstring
Level of transaction detail to return.
  • If accounts are requested, transaction details only include signatures and an annotated list of accounts in each transaction.
  • Transaction metadata is limited to only: fee, err, pre_balances, post_balances, pre_token_balances, and post_token_balances.
Responses
idinteger
The request ID
jsonrpcstring
The JSON-RPC version
blockTimeinteger
Estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
Metadata for the transaction processing result.
errobject
Error if transaction failed, null if transaction succeeded.
feeinteger
fee this transaction was charged, as u64 integer
preBalancesarray
array of u64 account balances from before the transaction was processed
postBalancesarray
array of u64 account balances after the transaction was processed
List of inner instructions or null if inner instruction recording was not enabled during this transaction
indexnumber
Index of the transaction instruction from which the inner instruction(s) originated
instructionsarray
Ordered list of inner program instructions that were invoked during a single transaction instruction.
programIdIndexnumber
Index into the message.accountKeys array indicating the program account that executes this instruction.
accountsarray
List of ordered indices into the message.accountKeys array indicating which accounts to pass to the program.
datastring
The program input data encoded in a base-58 string.
List of token balances from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
accountIndexnumber
Index of the account in which the token balance is provided for.
mintstring
Pubkey of the token's mint.
ownerstring
Pubkey of token balance's owner.
programIdstring
Pubkey of the Token program that owns the account.
amountstring
Raw amount of tokens as a string, ignoring decimals.
decimalsnumber
Number of decimals configured for token's mint.
uiAmountnumber
DEPRECATED Token amount as a float, accounting for decimals.
uiAmountStringstring
Token amount as a string, accounting for decimals.
List of token balances from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction
accountIndexnumber
Index of the account in which the token balance is provided for.
mintstring
Pubkey of the token's mint.
ownerstring
Pubkey of token balance's owner.
programIdstring
Pubkey of the Token program that owns the account.
amountstring
Raw amount of tokens as a string, ignoring decimals.
decimalsnumber
Number of decimals configured for token's mint.
uiAmountnumber
DEPRECATED Token amount as a float, accounting for decimals.
uiAmountStringstring
Token amount as a string, accounting for decimals.
logMessagesarray
array of string log messages or null if log message recording was not enabled during this transaction
transaction-level rewards
pubkeystring
The public key, as base-58 encoded string, of the account that received the reward
lamportsinteger
number of reward lamports credited or debited by the account, as a i64
postBalanceinteger
account balance in lamports after the reward was applied
rewardTypestring
commissioninteger
vote account commission when the reward was credited, only present for voting and staking rewards
Transaction addresses loaded from address lookup tables. Undefined if maxSupportedTransactionVersion is not set in request params, or if jsonParsed encoding is set in request params.
writablearray
Ordered list of base-58 encoded addresses for writable loaded accounts
readonlyarray
Ordered list of base-58 encoded addresses for readonly loaded accounts
the most-recent return data generated by an instruction in the transaction, with the following fields:
programIdstring
the program that generated the return data, as base-58 encoded Pubkey
datastring
the return data itself, as base-64 encoded binary data
computeUnitsConsumedinteger
number of compute units consumed by the transaction
versiononeOf
Transaction version. Undefined if maxSupportedTransactionVersion is not set in request params.
signaturesarray
present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block
slotinteger
The slot this transaction was processed in
Transaction information.
accountKeysarrayrequired
List of base-58 encoded public keys used by the transaction, including by the instructions and for signatures. The first message.header.numRequiredSignatures public keys must sign the transaction.
Details the account types and signatures required by the transaction.
numRequiredSignaturesintegerrequired
The total number of signatures required to make the transaction valid. The signatures must match the first numRequiredSignatures of message.accountKeys.
numReadonlySignedAccountsintegerrequired
The last numReadonlySignedAccounts of the signed keys are read-only accounts. Programs may process multiple transactions that load read-only accounts within a single PoH entry, but are not permitted to credit or debit lamports or modify account data. Transactions targeting the same read-write account are evaluated sequentially.
numReadonlyUnsignedAccountsintegerrequired
The last numReadonlyUnsignedAccounts of the unsigned keys are read-only accounts.
recentBlockhashstringrequired
A base-58 encoded hash of a recent block in the ledger used to prevent transaction duplication and to give transactions lifetimes.
programIdIndexintegerrequired
Index into the message.accountKeys array indicating the program account that executes this instruction.
accountsarrayrequired
List of ordered indices into the message.accountKeys array indicating which accounts to pass to the program.
datastringrequired
The program input data encoded in a base-58 string.
accountKeystringrequired
Base-58 encoded public key for an address lookup table account.
writableIndexesarrayrequired
List of indices used to load addresses of writable accounts from a lookup table.
readonlyIndexesarrayrequired
List of indices used to load addresses of readonly accounts from a lookup table.
signaturesarrayrequired
A list of base-58 encoded signatures applied to the transaction. The list is always of length message.header.numRequiredSignatures and not empty. The signature at index i corresponds to the public key at index i in message.accountKeys. The first one is used as the transaction id.
versiononeOf
Transaction version. Undefined if maxSupportedTransactionVersion is not set in request params.
codestringrequired
Code identifying the cause of the failed request.
messagestringrequired
Detailed message including the name and value of the invalid parameter.
{
"code": "ERROR_CODE",
"message": "Bad Request"
}
cURL
curl -X POST 'https://solana-mainnet.nodit.io' \
-H 'Content-Type: application/json' \
-H 'X-API-KEY: nodit-demo' \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"5Pj5fCupXLUePYn18JkY8SrRaWFiUctuDTRwvUy2ML9yvkENLb1QMYbcBGcBXRrSVDjp7RjUwk9a3rLC6gpvtYpZ",
{
"commitment": "confirmed",
"maxSupportedTransactionVersion": 0,
"transactionDetails": "full"
}
]
}'