TriportRPC

txpool_status

POSThttps://api.triport.io/v1/eth

Returns the number of transactions currently pending and queued in the node's transaction pool, as hex-encoded integers.

Ethereumeth_txpoolpro (1 rps) · business (2 rps)

txpool_status reports the current depth of the node's transaction pool: how many transactions are pending (ready to be included in the next block) and how many are queued (valid but not yet executable, e.g. waiting on a nonce gap or balance). Both counts are returned as hex-encoded integers.

Use it for lightweight monitoring of mempool pressure — dashboards, alerting on queue depth, or deciding whether to bump gas before submitting a transaction. It is the cheap counterpart to txpool_content: where txpool_content returns the full transaction objects (which can be very large), txpool_status returns only the two counts, so it is the right choice when you just need queue depth.

The counts reflect the state of the pool on the node that serves your request at the moment it is answered; they are a point-in-time snapshot and will vary between calls.

Parameters

This method takes no parameters. Pass an empty array.

_(none)_[]optional
The params array must be empty.

Response

Response fields

FieldTypeDescription
resultobjectThe transaction-pool status.
result.pendinghex stringCount of pending (executable) transactions, e.g. "0x1c" = 28.
result.queuedhex stringCount of queued (non-executable) transactions, e.g. "0x7" = 7.

Errors

CodeMeaningWhen it happens
-32002tier_insufficientYour API key's tier is below pro. This method requires the pro or business tier.
-32003rate_limitedYou exceeded the per-tier RPS limit (1 rps on pro, 2 rps on business). Retry after a short backoff.

Errors are returned in the standard JSON-RPC error envelope. See errors.md for the full structure and shared error codes.

Examples

JavaScript (fetch)

const res = await fetch("https://api.triport.io/v1/eth", {
  method: "POST",
  headers: {
    "Authorization": `Bearer ${process.env.TRIPORT_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "txpool_status",
    params: [],
  }),
});


const { result } = await res.json();
const pending = parseInt(result.pending, 16);
const queued = parseInt(result.queued, 16);
console.log(`pending=${pending} queued=${queued}`);

TypeScript SDK (@triport/sdk)

import { Triport } from "@triport/sdk";


const triport = new Triport({ apiKey: process.env.TRIPORT_API_KEY! });


const status = await triport.eth.rpc<{ pending: string; queued: string }>(
  "txpool_status",
  [],
);


console.log({
  pending: parseInt(status.pending, 16),
  queued: parseInt(status.queued, 16),
});

Python (triport-sdk)

import os
from triport import Triport


triport = Triport(api_key=os.environ["TRIPORT_API_KEY"])


status = triport.eth.rpc("txpool_status", [])
pending = int(status["pending"], 16)
queued = int(status["queued"], 16)
print(f"pending={pending} queued={queued}")

Notes

  • Hex decoding: both counts are hex strings ("0x1c"), not numbers. Decode with parseInt(value, 16) in JS/TS or int(value, 16) in Python before doing arithmetic or comparisons.
  • Lighter alternative to content: for the full pending/queued transaction objects use txpool_content. Prefer txpool_status whenever you only need counts — it is far cheaper to fetch and parse.
  • Tier gating: this is a pro-tier method. The free tier cannot call it; a request on an insufficient tier returns -32002.
  • Low rate limits: txpool methods are capped at 1–2 rps. For continuous monitoring, poll on an interval (e.g. once per second) rather than per-request, and handle -32003 with backoff.