Transactions & Fees
getTransactionCount
Returns the current transaction count from the ledger
Parameters
Configuration object containing:
Commitment level (processed, confirmed, finalized)
Response
The current transaction count
Code Examples
Basic Request
Using web3.js
Notes
- Returns the current transaction count from the ledger
- The count includes all transactions processed by the node
- The response is immediate as it reads from the current state
- The count can change with new transactions
- The count may vary between nodes due to network propagation
Best Practices
- Use appropriate commitment level based on your needs
- Cache results when appropriate to reduce RPC load
- Monitor for changes in transaction count
- Consider using websocket subscription for real-time updates
- Handle network errors and retry when appropriate
Common Errors
Code | Message | Solution |
---|---|---|
-32601 | Method not found | Verify you’re connected to a Solana RPC node |
-32602 | Invalid params | Check configuration parameters |
Use Cases
-
Transaction Count Analysis
-
Transaction Count Monitoring
-
Transaction Count Planning