getTransactionCount
Last updated:
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
| Name | Type | Required | Description |
|---|---|---|---|
| config | CommitmentConfig | No |
Returns
| Field | Type |
|---|---|
| result | integer |
Examples
curl https://triport.io/sol \
-X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer <api-key>' \
-d '{"id":1,"method":"getTransactionCount","params":["<config>"],"jsonrpc":"2.0"}'const res = await fetch("https://triport.io/sol", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: "Bearer <api-key>" },
body: JSON.stringify({
"id": 1,
"method": "getTransactionCount",
"params": [
"<config>"
],
"jsonrpc": "2.0"
}),
});
const data = await res.json();import requests
resp = requests.post(
"https://triport.io/sol",
headers={"Authorization": "Bearer <api-key>"},
json={"id":1,"method":"getTransactionCount","params":["<config>"],"jsonrpc":"2.0"},
)
print(resp.json())Usage
- Transport: HTTP (JSON-RPC).
- Networks: mainnet, devnet, testnet.
- Credit cost: 1 per call.
FAQ
- What does getTransactionCount do?
- Returns the total number of transactions processed by the Solana ledger as a single integer.
- How many credits does getTransactionCount cost?
- getTransactionCount costs 1 credit(s) per call on Triport by default.
- Is getTransactionCount available over WebSocket?
- getTransactionCount is an HTTP JSON-RPC method.