curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "txpool_content",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {
"pending": {},
"queued": {}
}
}curl --request POST \
--url https://rpc.testnet.tempo.xyz/ \
--header 'Content-Type: application/json' \
--data '
{
"jsonrpc": "2.0",
"method": "txpool_content",
"params": [],
"id": 1
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": {
"pending": {},
"queued": {}
}
}result — object containing pending and queued transactions:
pending — object mapping addresses to their pending transactions (keyed by nonce)queued — object mapping addresses to their queued transactions (keyed by nonce)hash — transaction hashnonce — sender’s noncefrom — sender addressto — recipient addressvalue — value in weigas — gas limitgasPrice — gas priceinput — transaction datatxpool_content code examplesconst ethers = require('ethers');
const NODE_URL = "CHAINSTACK_NODE_URL";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const getTxpoolContent = async () => {
const content = await provider.send("txpool_content", []);
const pendingAddresses = Object.keys(content.pending);
const queuedAddresses = Object.keys(content.queued);
console.log(`Pending transactions from ${pendingAddresses.length} addresses`);
console.log(`Queued transactions from ${queuedAddresses.length} addresses`);
// Show details for pending transactions
for (const [address, txs] of Object.entries(content.pending)) {
console.log(`\nPending from ${address}:`);
for (const [nonce, tx] of Object.entries(txs)) {
console.log(` Nonce ${nonce}: ${tx.hash}`);
console.log(` To: ${tx.to || 'Contract Creation'}`);
console.log(` Gas: ${parseInt(tx.gas, 16)}`);
}
}
};
getTxpoolContent();
Was this page helpful?