Skip to main content
Tempo API method that returns the number of transactions currently pending or queued in the transaction pool.

Parameters

  • none

Response

  • result — an object with:
    • pending — number of pending transactions (hex)
    • queued — number of queued transactions (hex)

txpool_status code examples

const ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);

const getTxpoolStatus = async () => {
    const status = await provider.send("txpool_status", []);
    console.log(`Pending: ${parseInt(status.pending, 16)}`);
    console.log(`Queued: ${parseInt(status.queued, 16)}`);
  };

getTxpoolStatus();