Contracts
Listening to Events
The recommended way to listen to contract events is to use the getContractEvents
function and passing a prepared event with the Solidity event signature and the params. This is type-safe based on the Solidity event signature you define. You can get your desired contract event signature from the solidity code directly.
You can also use the standard event definitions from the SDK to define the events you want to listen to.
Using the CLI, you can generate optimized functions for all the possible calls to a contract. This saves you time and precomputes all the necessary encoding.
Read more on how to generate extension functions using the CLI.