How do I listen for trx events on tron network? (Tronweb) nodejs

Viewed 985

I already know that with this method "tronweb.contract().at(contractAddress).Transfer.watch()" I can listen to transfer events of a specific contract, but what I don`t know is that how can I listen for TRX intself?

1 Answers

There's no methods for that as mentioned in official docs you can use Kafka or Mongodb plugin and connect that to a node for this purpose, but there's also HTTP API,

event query http

you can create an interval to fetch the result and when the desired output came in hand clear that

note that TRON network produces new block every ~7 secs

Related