Skip to main content
POST
/
eth_newPendingTransactionFilter
curl --request POST \
  --url https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800/ \
  --header 'Content-Type: application/json' \
  --data '{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "eth_newPendingTransactionFilter",
  "params": []
}'
{
  "jsonrpc": "<string>",
  "id": 123,
  "result": "<string>"
}
Monad API method that creates a filter in the node to notify when new pending transactions arrive. Use eth_getFilterChanges to poll for pending transaction hashes.
Get you 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 — the filter ID, used to poll for pending transactions with eth_getFilterChanges.

eth_newPendingTransactionFilter code examples

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("CHAINSTACK_NODE_URL");

async function createPendingTxFilter() {
  const filterId = await provider.send("eth_newPendingTransactionFilter", []);
  console.log("Filter ID:", filterId);

  // Poll for pending transactions
  setInterval(async () => {
    const txHashes = await provider.send("eth_getFilterChanges", [filterId]);
    if (txHashes.length > 0) {
      console.log("Pending transactions:", txHashes);
    }
  }, 1000);
}

createPendingTxFilter();

Use case

A practical use case for eth_newPendingTransactionFilter is building mempool monitoring tools, MEV bots, or applications that need to track pending transactions before they are included in blocks.

Body

application/json
id
integer
default:1
jsonrpc
string
default:2.0
method
string
default:eth_newPendingTransactionFilter
params
any[]

Response

200 - application/json

A filter ID that can be used with eth_getFilterChanges to poll for pending transactions

jsonrpc
string
id
integer
result
string

The filter ID