• Core
  • Actions
  • watchPendingTransactions


Action for subscribing to pending transactions in the Provider's transaction mempool.

import { watchPendingTransactions } from '@wagmi/core'

Only Providers that support the eth_newPendingTransactionFilter method will work with this Action.


The callback will be invoked when a new transactions enters the memory pool of the Provider.

import { watchPendingTransactions } from '@wagmi/core'
const unwatch = watchPendingTransactions({}, (transaction) =>

Return Value

unwatch is a function that can be called to unsubscribe from the pending transactions event.


chainId (optional)

Force a specific chain id for the request. The wagmi Client's ethers provider must be set up as a chain-aware function for this to work correctly.

import { watchPendingTransactions } from '@wagmi/core'
const unwatch = watchPendingTransactions(
    chainId: 1,
  (transaction) => console.log(transaction),,