# getTransactionCount

Solana API method that returns the current transaction count from the ledger.

Parameters:

  • <object> — (optional) the configuration object containing the following fields:
    • commitment: <string> — (optional) the commitment.
    • minContextSlot: <number> — (optional) the minimum slot that the request can be evaluated at.

Returns:

  • <u64> — the count.

Example:

  • Solana web3.js
  • Solana.py
  • cURL
import { Connection } from "@solana/web3.js";

const nodeUrl = "CHAINSTACK_NODE_URL"
const connect = new Connection(nodeUrl);

(async () => {  
  console.log(await connect.getTransactionCount());
})();