3

Is it possible to only subscribe to a specific contract for pendingtransactions using web3.eth.subscribe? The docs dont show any parameters besides a callback function, so the result shows all pending transactions not just for a contract address like LINK for example.

Regards

1 Answer 1

0

You need to:

  1. use web3.eth.subscribe in order to get the list of tx hashes,
  2. feed the transaction hash to web3.eth.getTransaction to get the transaction object,
  3. inspect the resulting object via the to and input fields, which can be used to filter the specific contract & function.

More details here > https://ethereum.stackexchange.com/a/49431/89782

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.