Pending Transactions

Is there any way to get pending transactions of single contract instead of getting all pending transaction on node?

Hi @hussam.mustafa
I believe this thread would be quite useful for you

Hi @Lily,

I already read that thread. I am working with the code given below. It hits all my limit within 5-10 minutes. I just only want Pending Transaction for my Specific Contract not all transactions on mainnet.


web3.eth.subscribe(‘pendingTransactions’, function(error, result){
if (error)
console.log("Error: ",error);
.on(“data”,async function(TxHash) {
try {
let tx = await web3.eth.getTransaction(TxHash);

        if(tx &&{
            if ( === contractAddress) {
                console.log('Transaction Hash: ',TxHash );
                console.log('Transaction Confirmation Index: ',tx.transactionIndex );
                console.log('Transaction Received from: ',tx.from );
    } catch (error) {


Hello @hussam.mustafa
I would suggest using eth_subscribe with the newPendingTransactions parameter. Here is a link with more detailed information:

Here are also some examples of looking at a particular contract address.

HI @Lily,

newPendingTransactions” also give all transaction on node. I just want pending transactions for my contract address only.

@hussam.mustafa At the moment, there’s not a direct way to get the pendingTransactions of a specific contract without getting all transactions from the node first. We will look into adding this feature to our product roadmap.