- Published on
Drizzle Contract On Events
- Yair Mark
In a previous post I went through how to deal with errors and successes when using drizzle to call a contract. One thing that has stumped me with drizzle is how do you get the response from a contract method that mutates state but returns a value?
While I did not find the exact answer I did find a workaround where I get the event fired by that method and get the data from that method. Drizzle contracts have the
.on which can be used to get the transaction receipt which has the associated events in.
Based on here it looks like Drizzle contracts have the following
ons and associated callbacks for transactions:
And for events: