> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chainstack.com/llms.txt
> Use this file to discover all available pages before exploring further.

# eth_newPendingTransactionFilter | Monad

> Monad API method that creates a filter in the node to notify when new pending transactions arrive. Use it on Monad via Chainstack.

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.

## Parameters

* `none`

## Response

* `result` — the filter ID, used to poll for pending transactions with `eth_getFilterChanges`.

## `eth_newPendingTransactionFilter` code examples

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  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();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3
  import time

  node_url = "CHAINSTACK_NODE_URL"

  web3 = Web3(Web3.HTTPProvider(node_url))

  # Create the pending transaction filter
  filter_id = web3.eth.filter('pending').filter_id
  print(f'Filter ID: {filter_id}')

  # Poll for pending transactions
  while True:
      tx_hashes = web3.eth.get_filter_changes(filter_id)
      if tx_hashes:
          print(f'Pending transactions: {[tx.hex() for tx in tx_hashes]}')
      time.sleep(1)
  ```
</CodeGroup>

## 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.


## OpenAPI

````yaml openapi/monad_node_api/transaction_info/eth_newPendingTransactionFilter.json POST /
openapi: 3.0.0
info:
  title: Monad Node API
  version: 1.0.0
  description: This is an API for interacting with a Monad node.
servers:
  - url: https://monad-testnet.core.chainstack.com/9c5b265f20b3ea5df4f54f70eb74b800
security: []
paths:
  /:
    post:
      tags:
        - Transaction info
      summary: eth_newPendingTransactionFilter
      operationId: eth_newPendingTransactionFilter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                id:
                  type: integer
                  default: 1
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_newPendingTransactionFilter
                params:
                  type: array
                  default: []
      responses:
        '200':
          description: >-
            A filter ID that can be used with eth_getFilterChanges to poll for
            pending transactions
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: string
                    description: The filter ID

````