getTransaction
https://api.triport.io/v1/solReturns the full details of a confirmed Solana transaction, looked up by its signature.
getTransaction fetches a single confirmed transaction by its base-58
signature and returns its decoded contents along with execution metadata —
fees, balance changes, inner instructions, log output, and compute units
consumed.
Use it to inspect the outcome of a transaction you have already submitted (for
example after sendTransaction), to confirm whether it succeeded, or to render
the details of any historical transaction. The method returns null when no
confirmed transaction matches the supplied signature — either because the
signature is unknown to the cluster or because it has not yet reached the
requested commitment.
Versioned transactions (those using Address Lookup Tables) are only returned
when you pass maxSupportedTransactionVersion. If you omit it and the
transaction is a versioned one, the request fails rather than returning the
transaction.
Parameters
JSON-RPC params is a positional array: [signature, config?].
signaturestring (base-58)requiredconfigobjectoptionalencodingstringoptionaltransaction: json, jsonParsed, base58, or base64.commitmentstringoptionalprocessed, confirmed, or finalized.maxSupportedTransactionVersionintegeroptional0 for current versioned transactions.Response
When no confirmed transaction matches the signature, result is null:
{ "jsonrpc": "2.0", "id": 1, "result": null }resultobject | nullnull if not found.result.slotintegerresult.blockTimeintegernull.result.versionstring | integer"legacy" or a version number (e.g. 0).result.transactionobjectencoding.result.metaobjectresult.meta.errobject | nullnull on success, or an error object describing why the transaction failed.result.meta.feeintegerresult.meta.preBalancesinteger[]accountKeys.result.meta.postBalancesinteger[]accountKeys.result.meta.innerInstructionsarrayresult.meta.logMessagesstring[]result.meta.computeUnitsConsumedintegerErrors
Errors are returned in the standard JSON-RPC error envelope. See the shared errors reference for the full envelope shape and shared codes.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | signature is missing or not a valid base-58 string, config is malformed, or the transaction is versioned and maxSupportedTransactionVersion was not supplied. |
401 | Unauthorized | Missing or invalid Authorization: Bearer key. |
429 | Rate limited | More than your tier's RPS for sol_read_rpc (20 / 60 / 200 / 600). |
A signature that simply does not match any confirmed transaction is not an
error — the call succeeds with result: null.
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/v1/sol", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getTransaction",
params: [
"4eEzpJ29YBE7iz6Lw5eVNqYpJEMRDM6kF1pPyDmwbDgTynxJgF6Th9oV66XSh1jKvxhqZpKjJqLBu7nGzrjnVqWv",
{ encoding: "jsonParsed", commitment: "finalized", maxSupportedTransactionVersion: 0 },
],
}),
});
const { result } = await res.json();
if (result === null) {
console.log("Transaction not found");
} else {
console.log(`Succeeded: ${result.meta.err === null}, fee: ${result.meta.fee} lamports`);
}TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY });
const tx = await client.solana.getTransaction(
"4eEzpJ29YBE7iz6Lw5eVNqYpJEMRDM6kF1pPyDmwbDgTynxJgF6Th9oV66XSh1jKvxhqZpKjJqLBu7nGzrjnVqWv",
{ encoding: "jsonParsed", commitment: "finalized", maxSupportedTransactionVersion: 0 }
);
if (tx === null) {
console.log("Transaction not found");
} else {
console.log(`Slot ${tx.slot}, fee ${tx.meta.fee} lamports, ok=${tx.meta.err === null}`);
}Python (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
tx = client.solana.get_transaction(
"4eEzpJ29YBE7iz6Lw5eVNqYpJEMRDM6kF1pPyDmwbDgTynxJgF6Th9oV66XSh1jKvxhqZpKjJqLBu7nGzrjnVqWv",
encoding="jsonParsed",
commitment="finalized",
max_supported_transaction_version=0,
)
if tx is None:
print("Transaction not found")
else:
print(f"Slot {tx['slot']}, fee {tx['meta']['fee']} lamports, ok={tx['meta']['err'] is None}")Notes
- Always handle
null. A successful response withresult: nullmeans the signature is unknown at the requested commitment — it is not an error. - Versioned transactions: pass
maxSupportedTransactionVersion: 0to fetch current versioned transactions. Omitting it causes versioned transactions to fail rather than return. - Confirmation lag: a freshly submitted transaction may not appear
immediately. Poll with
commitment: "confirmed"(orprocessed) for faster visibility, then re-read atfinalizedonce settled. - Related methods: use
sendTransactionto submit a transaction,getSignaturesForAddressto discover signatures for an account, andgetBlockto fetch every transaction in a slot.