getTransactionCount
https://api.triport.io/Returns the total number of transactions processed by the Solana ledger as a single integer.
getTransactionCount returns the current transaction count from the ledger — a
single u64 integer representing the total number of transactions the cluster
has processed since genesis. The number only ever increases, so it is useful as
a monotonic, cluster-wide activity counter.
The value you get back depends on the commitment level. With the default
(finalized) you receive the count as of the highest finalized slot; with
confirmed or processed you get a higher, more recent count that has had less
time to settle. Because the counter is global and grows continuously, treat the
result as a snapshot at the moment of the call rather than a stable value —
consecutive calls will normally return larger numbers.
Pair it with minContextSlot when you want the call to fail fast unless the
node has already progressed to at least a given slot, which avoids reading a
stale count from a lagging backend.
Parameters
A single optional positional parameter: a config object.
configobjectoptionalconfig fieldsobjectcommitmentstringoptionalprocessed, confirmed, or finalized. Defaults to finalized. Determines the slot the count is evaluated at.minContextSlotintegeroptionalResponse
Response fields
| Field | Type | Description |
|---|---|---|
result | integer (u64) | Total number of transactions processed by the ledger at the requested commitment level. |
Errors
getTransactionCount uses the standard JSON-RPC error envelope. See
errors for the full structure.
| Code | Meaning | When it happens |
|---|---|---|
-32602 | Invalid params | commitment is not one of processed / confirmed / finalized, or config is malformed. |
-32016 | Minimum context slot not reached | minContextSlot is higher than the node's current slot. |
401 | Unauthorized | Missing or invalid Authorization: Bearer token. |
429 | Rate limited | You exceeded your tier's RPS for sol_read_rpc. |
Examples
JavaScript (fetch)
const res = await fetch("https://api.triport.io/", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getTransactionCount",
params: [],
}),
});
const { result } = await res.json();
console.log("transactions processed:", result); // 268134591842TypeScript SDK (@triport/sdk)
import { TriportClient } from "@triport/sdk";
const client = new TriportClient({ apiKey: process.env.TRIPORT_API_KEY! });
const count: number = await client.solana.getTransactionCount({ commitment: "confirmed" });
console.log("transactions processed:", count);Python (triport-sdk)
import os
from triport import TriportClient
client = TriportClient(api_key=os.environ["TRIPORT_API_KEY"])
count = client.solana.get_transaction_count(commitment="confirmed")
print("transactions processed:", count)Notes
- Monotonic counter. The result is cluster-wide and only increases. Two successive calls will normally return different (larger) values — don't treat it as a stable identifier.
- Commitment matters. A
processedcount is ≥ aconfirmedcount, which is ≥ afinalizedcount. Don't compare counts taken at different commitment levels. - Related methods:
getSlot(current slot at a commitment level),getBlockHeight, andgetEpochInfo, which also surfaces atransactionCountfield scoped to the epoch context.