Skip to main content
POST
eth_newPendingTransactionFilter
Optimism API method that creates a filter in the node to notify when new pending transactions are received. To check if the state has changed, call eth_getFilterChanges with the filter ID returned by this method.
On Optimism Mainnet, this filter reports transactions as the sequencer includes them in subblocks, because the mempool is private to the sequencer. For the pre-confirmed transactions and state, poll the pending block tag as described in Track real-time transactions on Optimism with Subblocks.
Get your own node endpoint todayStart for free and get your app to production levels immediately. No credit card required.You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • none

Response

  • result — a string representing the filter ID. This ID should be used in subsequent calls to eth_getFilterChanges to retrieve new pending transactions.

Use case

The eth_newPendingTransactionFilter method is useful for applications that need to monitor the mempool for new transactions. Common use cases include:
  • Building transaction monitoring tools
  • Creating real-time transaction tracking interfaces
  • Implementing MEV (Maximal Extractable Value) strategies
  • Monitoring specific addresses for pending transactions
On Optimism Mainnet, eth_subscribe("newPendingTransactions") and eth_newPendingTransactionFilter report transactions as the sequencer includes them in subblocks, not from a public mempool, because the mempool is private to the sequencer. They suit tracking transactions as they are pre-confirmed, but not strategies that need to see a transaction before the sequencer includes it. To read the pre-confirmed transactions and state, poll eth_getBlockByNumber with the pending tag as described in Track real-time transactions on Optimism with Subblocks. Note: After creating the filter, you need to poll eth_getFilterChanges periodically to get updates. Filters timeout if they’re not used for a period of time, so applications should be prepared to recreate them if necessary.

Body

application/json
jsonrpc
string
default:2.0
method
string
default:eth_newPendingTransactionFilter
id
integer
default:1

Response

200 - application/json

The ID of the created pending transaction filter

jsonrpc
string
id
integer
result
string
Last modified on October 30, 2026