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

> Cronos API method that creates a filter that listens for new pending transactions on the blockchain. Use it on Cronos via Chainstack.

Cronos API method that creates a filter that listens for new pending transactions on the blockchain. It returns a filter ID, which can be used to retrieve the results using the `eth_getFilterChanges method`. The `eth_newBlockFilter` method is useful for developers who must be notified of new blocks on the blockchain in real-time.

<Check>
  **Get your own node endpoint today**

  [Start for free](https://console.chainstack.com/) and get your app to production levels immediately. No credit card required.

  You can sign up with your GitHub, X, Google, or Microsoft account.
</Check>

## Parameters

* `none`

## Response

* `result` — a hexadecimal string representing the ID of the newly created filter

## Code examples

<Warning>
  The filters created are stored on the blockchain client instance. The filter is automatically deleted if not polled within a certain time (5 minutes by default).
</Warning>

## `eth_newPendingTransactionFilter` code examples

<Note>
  Note that the `web3.eth.filter` methods have been deprecated and replaced with the `web3.eth.subscribe` in web3.js. See [web3.js subscriptions](/reference/ethereum-web3js-subscriptions-methods).
</Note>

<CodeGroup>
  ```javascript ethers.js theme={"system"}
  const ethers = require('ethers');
  const NODE_URL = "CHAINSTACK_NODE_URL";
  const provider = new ethers.JsonRpcProvider(NODE_URL);

  const createFilter = async () => {
    try {
      const filterId = await provider.send('eth_newPendingTransactionFilter', []);
      console.log(filterId); // the filter ID returned by eth_newFilter
      return filterId
    } catch (error) {
      console.log(error);
    }
  };

  createFilter();
  ```

  ```python web3.py theme={"system"}
  from web3 import Web3  
  node_url = "CHAINSTACK_NODE_URL" 
  web3 = Web3(Web3.HTTPProvider(node_url))

  def get_new_pending_transactions():
      try:
          blocks_filter = web3.eth.filter('pending')

          # Split the string at the space character
          parts = str(blocks_filter).split(' ')

          # Extract the filter value from the second part
          filter_id = parts[2]

          return filter_id
      except Exception as e:
          print(e)

  new_filter = get_new_pending_transactions()
  print(new_filter)
  ```
</CodeGroup>

## Use case

One way to use the `eth_newPendingTransactionFilter` method is to listen for new pending transactions at predefined intervals and extract specific data from them. For instance, a decentralized application might check for pending transactions every second and identify those that transfer a value greater than a certain amount of the CRO token. This could be useful for real-time monitoring high-value transactions or detecting potential fraud or security threats.


## OpenAPI

````yaml /openapi/cronos_node_api/eth_newPendingTransactionFilter.json POST /b9b0fb92029d58b396139a9e89cf479b
openapi: 3.0.0
info:
  title: Cronos Node API
  version: 1.0.0
  description: This is an API for interacting with a Cronos node.
servers:
  - url: https://nd-907-114-772.p2pify.com
security: []
paths:
  /b9b0fb92029d58b396139a9e89cf479b:
    post:
      summary: eth_newPendingTransactionFilter
      operationId: newPendingTransactionFilter
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                jsonrpc:
                  type: string
                  default: '2.0'
                method:
                  type: string
                  default: eth_newPendingTransactionFilter
                params:
                  type: array
                  default: []
                id:
                  type: integer
                  default: 1
      responses:
        '200':
          description: The new filter ID.
          content:
            application/json:
              schema:
                type: object
                properties:
                  jsonrpc:
                    type: string
                  id:
                    type: integer
                  result:
                    type: array
                    items:
                      type: string

````