Is it possible to listen to transactions on a specific ethereum address? For example, if someone sends a certain amount of ETH to that address, the callback function would be triggered.
I read this: How to explore all transactions for a given account? but it seems to be about past transactions and not listening live.
Best Answer
You can use Web3.js 1.0 and WebSockets to accomplish this.
If you use the above code, simply update the
address
property.Working sample here: https://jsfiddle.net/h7nskoyu/11/
This looks at the CryptoKitties contract, and when looking at the console you see this:
The expanded transaction maps to this: https://etherscan.io/tx/0x3ccce0b8072649ca087a91f00bdbb475b36d03a9a8dd2cc54b9a03ac5826c255
Learn more about
web3.eth.subscribe
here.