Skip to main content

getTransaction RPC Method

Returns transaction details for a confirmed transaction

params

string required Transaction signature, as base-58 encoded string object optional Configuration object containing the following fields:

commitment

The commitment describes how finalized a block is at that point in time. See Configuring State Commitment.

maxSupportedTransactionVersion

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.

encoding

Values: json, jsonParsed, base64, base58 Default: json

Encoding for the returned Transaction

  • jsonParsed encoding attempts to use program-specific state 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

object | nullReturns null if transaction is not found or not confirmed, otherwise returns an object containing:

slot

The slot this transaction was processed in

blockTime

Estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available

meta

Transaction status metadata object or null.

transaction

Transaction object, either in JSON format or encoded binary data, depending on encoding parameter

version

Transaction version. Undefined if maxSupportedTransactionVersion is not set in request params.

cURL

curl https://us-seattle.openverse.network/api -s -X \
POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getTransaction",
"params": [
"2nBhEBYYvfaAe16UMNqRHre4YNSskvuYgx3M6E4JP1oDYvZEJHvoPzyUidNgNX5r9sTyN1J9UxtbCXy2rqYcuyuv",
"json"
]
}
'

Response

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