I would like to get discord message every time when address receive ERC20 token. Is there any way to stream Ethereum transactions?

I tried https://github.com/AlexanderC/ethereum-transaction-stream but it's not working as I want (it start scanning all transactions including old ones).


The code you show has an option to select the rnage of blocks to sear for the transactions:

// Creates a new stream.
  // Note that "startblock", "endblock", "ERC20TokenAddress" and "mintOnly" options
  // are only available for "EtherscanHTTP" provider. By including "ERC20TokenAddress"
  // there will be included transactions for ERC20 token only and enabling "mintOnly"
  // option will result in leaving only token minting events.
  // Important: "ERC20TokenAddress" and "mintOnly" options are available only when "includeLogs" enabled
  // Important: the result will INCLUDE transactions from the "startblock"
  const stream = await ets.stream(
    /*, startblock, endblock, ERC20TokenAddress, mintOnly */

if you are going to search block by block, set the start and end block to the block you are interested in.

Hope this helps

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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