getTransactionCount — Solana JSON-RPC
Returns the total number of transactions processed by the Solana ledger as a single integer.
https://triport.io/sol- Network
- Solana
- Auth
- x-token: $TRIPORT_API_KEY (or Authorization: Bearer)
- Rate limit
- free+ — 20 rps (free) · 60 rps (basic) · 200 rps (pro) · 600 rps (business)
Endpoint and plans: Solana RPC endpoint.
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://triport.io/sol", {
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); // 268134591842Notes
- 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.