{% tabs %} {% tab title="TypeScript/JavaScript" %} {% code overflow="wrap" lineNumbers="true" %}
// yarn add @tatumio/tatum
import { TatumSDK, Polygon, Network } from '@tatumio/tatum'
const tatum = await TatumSDK.init<Polygon>({network: Network.POLYGON})
const status = await tatum.rpc.txPoolStatus()
await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
{% endcode %} {% endtab %} {% endtabs %}
The txpool_status
method returns statistics about the current state of the transaction pool. The transaction pool is a queue of pending transactions waiting to be included in the next block by miners.
This method can be useful for monitoring the health of the Polygon network and analysing the behavior of the miners. It can also be used to estimate the time it will take for a transaction to be processed, as well as to determine the gas price necessary to ensure prompt inclusion of a transaction in the next block.
{% embed url="https://codepen.io/tatum-devrel/pen/bGQzOyV" %}
This method does not take any parameters.
The txpool_status
method returns an object with the following fields:
pending
: Number of pending transactions in the poolqueued
: Number of queued transactions in the pool
{
"jsonrpc":"2.0",
"method":"txpool_status",
"params":[],
"id":1
}
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"pending": 4,
"queued": 10
}
}
In this example response, there are currently 4 pending transactions and 10 queued transactions waiting to be processed by miners.