November 2018
Intermediate to advanced
528 pages
13h 21m
English
In the smart contract, we have defined a few events. Each one will be represented in the smart contract wrapper with a method named identically, which takes the transaction receipt and returns a decoded result (event parameters) in an instance of the EventValues object. Given that, here's how to get the event data and display its content in our console:
for (CFutures.DepositEvEventResponse event : CFutureInstance.getDepositEvEvents(DepositReceipt)) { log.info("Depoist event detected:" + event.amount+"wei has been deposited");
log.info("The funds has been sent by: " + event.sender);}
Alternatively, you can use Observables (RxJava's observables), which will listen for events associated with the smart contract. Then use an EthFilter ...
Read now
Unlock full access