txpool_content

How to use it

// yarn add @tatumio/tatum

import { TatumSDK, Flare, Network } from '@tatumio/tatum'
  
const tatum = await TatumSDK.init<Flare>({network: Network.FLARE})

const content = await tatum.rpc.txPoolContent()

await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs

Overview

The txpool_content method provides information about the transactions currently pending in the transaction pool of the node. It can be helpful for developers and node operators to monitor and manage the transaction pool, especially in scenarios where it's necessary to analyze transaction congestion or prioritize specific transactions.

Use cases for the txpool_content method include:

  • Analyzing network congestion by inspecting the transaction pool

  • Prioritizing transactions by gas price

  • Monitoring transactions from specific addresses

  • Debugging and troubleshooting pending transactions

Parameters

This method does not require any parameters.

Return Object

The txpool_content method returns an object with two fields: pending and queued. Each field contains a nested object with addresses as keys and their respective transactions as values.

  • pending: An object containing transactions that are currently pending for inclusion in the next block(s).

  • queued: An object containing transactions that are currently queued (i.e., transactions that do not meet certain criteria for inclusion in the next block, like low gas price or nonce gaps).

Each transaction object includes the following information:

  • hash: The hash of the transaction (32 bytes).

  • nonce: The number of transactions sent by the sender prior to this one (integer).

  • blockHash: The hash of the block in which the transaction was included (32 bytes), or null if the transaction is not yet mined.

  • blockNumber: The block number in which the transaction was included (integer), or null if the transaction is not yet mined.

  • transactionIndex: The index of the transaction in the block (integer), or null if the transaction is not yet mined.

  • from: The address of the sender (20 bytes).

  • to: The address of the receiver (20 bytes), or null for contract creation transactions.

  • value: The value transferred in the transaction, in wei.

  • gasPrice: The price of gas for the transaction, in wei.

  • maxFeePerGas - The maximum fee per gas set in the transaction.

  • maxPriorityFeePerGas - The maximum priority gas fee set in the transaction.

  • gas: The maximum amount of gas the transaction is allowed to consume.

  • input: The data payload of the transaction (string), or 0x for simple value transfers.

JSON-RPC Request Example

jsonCopy code{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "txpool_content",
  "params": []
}

JSON-RPC Response Example

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
        "pending": {
            "0x01d3B93AaADE8A4066DAaBc8fd8482173A6aD120": {
                "197": {
                    "blockHash": null,
                    "blockNumber": null,
                    "from": "0x01d3b93aaade8a4066daabc8fd8482173a6ad120",
                    "gas": "0x1c9c380",
                    "gasPrice": "0x16cf917",
                    "maxFeePerGas": "0x16cf917",
                    "maxPriorityFeePerGas": "0x16cf917",
                    "hash": "0x1da9c2a8f0787bac4747c5ed1035e81f6a6745aeea43943e63635fc367b817f7",
                    "input": "0x00000000",
                    "nonce": "0xc5",
                    "to": "0x4f023eb8c6bc3116e35b67e03bf2c17f2e4f7e7e",
                    "transactionIndex": null,