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>"
}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>"
}eth_getFilterChanges to poll for pending transaction hashes.
noneresult — the filter ID, used to poll for pending transactions with eth_getFilterChanges.eth_newPendingTransactionFilter code examplesconst { 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();
eth_newPendingTransactionFilter is building mempool monitoring tools, MEV bots, or applications that need to track pending transactions before they are included in blocks.Was this page helpful?