txpool_inspect - Ethereum

This method returns a compact, human-readable summary of the pending and queued transactions in the node's transaction pool. It uses the same sender-and-nonce nesting as txpool_content, but reduces each transaction to a single summary string instead of a full object, which makes the response dramatically smaller.

Parameters

This method takes no parameters.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "txpool_inspect",
    "params": [],
    "id": "getblock.io"
}'

example.js

javascriptconst axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'txpool_inspect',
    params: [],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

for (const [sender, byNonce] of Object.entries(response.data.result.pending)) {
    for (const [nonce, summary] of Object.entries(byNonce)) {
        console.log(`${sender} #${nonce} -> ${summary}`);
    }
}

example.py

pythonimport requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'txpool_inspect',
        'params': [],
        'id': 'getblock.io'
    }
)

pending = response.json()['result']['pending']
for sender, by_nonce in pending.items():
    for nonce, summary in by_nonce.items():
        print(f"{sender} #{nonce} -> {summary}")

example.rs

rustuse reqwest::Client;
use serde_json::{json, Value};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Client::new();
    
    let response = client
        .post("https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/")
        .header("Content-Type", "application/json")
        .json(&json!({
            "jsonrpc": "2.0",
            "method": "txpool_inspect",
            "params": [],
            "id": "getblock.io"
        }))
        .send()
        .await?
        .json::<Value>()
        .await?;
    
    println!("Pending senders: {}", response["result"]["pending"].as_object().unwrap().len());
    Ok(())
}

Response

json{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": {
        "pending": {
            "0x000025e01DB606436e2A658C765CcB78442b1c69": {
                "0": "0xdAC17F958D2ee523a2206206994597C13D831ec7: 0 wei + 23000 gas × 10080000 wei"
            },
            "0x00003968a75E1D8A6d13569F5B6ad7Ba5e710000": {
                "1": "0xdE992BAdD92aDaf9146255E9Bde6a70770973664: 1038330323400 wei + 21000 gas × 66132588 wei"
            }
        },
        "queued": {
            "0x000000084002Fb85b89bEc70045B9Ec77b3d4C38": {
                "74": "0xda3bD1fE1973470312db04551B65f401Bc8a92fD: 0 wei + 730875 gas × 27000000000 wei"
            }
        }
    }
}

Response Parameters

ParameterTypeDescription
jsonrpcstringJSON-RPC protocol version ("2.0")
idstringRequest identifier matching the request
pendingobjectTransactions eligible for inclusion, keyed by sender address, then by nonce
queuedobjectTransactions not yet processable, with the same nesting

Each leaf value is a string of the form <to>: <value> wei + <gas> gas × <gasPrice> wei. Unlike txpool_content, all numbers here are decimal rather than hex-encoded.

SegmentDescription
toRecipient address
valueETH transferred, in wei
gasGas limit of the transaction
gasPriceGas price offered, in wei

Use Cases

  • Lightweight Mempool Surveys: Read the shape of the pool without transferring tens of megabytes
  • Gas Price Monitoring: Spot senders bidding unusually high gas prices for inclusion
  • Queue Diagnostics: Identify nonce gaps that strand transactions in the queued set
  • Dashboards and Alerting: Feed cheap, frequent mempool snapshots into monitoring

Error Handling

Error CodeMessageDescription
-32601Method not foundThe txpool module is not enabled on this endpoint
-32603Internal errorNode failed to read the transaction pool

Web3 Integration

ethers-example.js

javascriptimport { ethers } from 'ethers';

const provider = new ethers.JsonRpcProvider('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/');

const inspect = await provider.send('txpool_inspect', []);
console.log(Object.keys(inspect.pending).length, 'senders with pending transactions');

viem-example.js

javascriptimport { createPublicClient, http } from 'viem';
import { mainnet } from 'viem/chains';

const client = createPublicClient({
    chain: mainnet,
    transport: http('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/'),
});

const inspect = await client.request({ method: 'txpool_inspect' });
console.log(Object.keys(inspect.pending).length, 'senders with pending transactions');