Ethereum

Ethereum

eth_newPendingTransactionFilter

eth_newPendingTransactionFilter watches the mempool rather than the chain. It registers a server-side filter that records the hash of each pending transaction the node sees before that transaction is mined, and returns a hex filter ID. You poll eth_getFilterChanges with the ID to get the batch of new pending hashes since your last call. This is your window into transactions that are queued but not yet in a block, the same in-flight ETH transfers and contract calls that a validator will choose from for the next slot. Set up the filter at https://ethereum.therpc.io/YOUR_API_KEY on chain ID 1. Of the three new-filter methods, this one is the noisiest, since mempool churn far outpaces block production.

Use cases

  • Watch for a specific sender's transactions hitting the mempool: pull each new hash, resolve it with eth_getTransactionByHash, and match on the from address to catch their activity before inclusion.
  • Sample pending transactions' maxFeePerGas and maxPriorityFeePerGas to build a live gas tracker that reflects what senders are actually bidding for the next Ethereum block.

Parameters

This method takes no parameters. Pass an empty array [].

Response

TypeDescription
stringHex filter ID. When polled with eth_getFilterChanges, yields an array of new pending transaction hashes since the last poll.

Example request

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_newPendingTransactionFilter",
"params": [],
"id": 1
}'

Try it live in the Ethereum playground.

Errors & troubleshooting

CodeMessageCause
-32000filter not foundProvider rejected filter creation or the filter limit was reached.

Common pitfalls

  • You only receive hashes. To see the value, fee, or calldata of a pending transaction, resolve each hash through eth_getTransactionByHash.
  • A pending transaction is not a promise. It may be dropped, replaced by a same-nonce bump, or simply never mined, so never treat a hash from this filter as a confirmation.
  • During congestion the Ethereum mempool can churn through thousands of pending transactions, and a single poll may return a flood of hashes. For sustained real-time use, eth_subscribe with newPendingTransactions over WebSocket scales better than this poll loop.

Supported networks

  • Mainnet — Chain ID: 1
  • Sepolia — Chain ID: 11155111

See also

curl https://ethereum.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_newPendingTransactionFilter","params":[]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.