v1.4.20
Starting from this release, state changing functions in JavaScript contracts can now return 'event' object with some arbitrary data.
If such event is returned by the handle function, the SDK will dispatch it using warp.eventTarget
.
Example in contract code:
https://github.com/warp-contracts/warpy/blob/main/contracts/src/warpDiscordBot/points/write/addPoints.ts#L46
Example usage:
https://github.com/warp-contracts/warp/blob/main/src/__tests__/integration/basic/pst.test.ts#L121
One example use case is aggregating some data (i.e. within D.R.E. node) that you don't want to store in the state itself and/or notifying about some 'actions' (e.g. changing user role).
What's Changed
- feat: events by @ppedziwiatr in #463
Full Changelog: v1.4.19...v1.4.20