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 thefromaddress to catch their activity before inclusion. - Sample pending transactions'
maxFeePerGasandmaxPriorityFeePerGasto 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
| Type | Description |
|---|---|
| string | Hex filter ID. When polled with eth_getFilterChanges, yields an array of new pending transaction hashes since the last poll. |
Example request
Try it live in the Ethereum playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32000 | filter not found | Provider 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_subscribewithnewPendingTransactionsover WebSocket scales better than this poll loop.
Supported networks
- Mainnet — Chain ID: 1
- Sepolia — Chain ID: 11155111