Closed sinzii closed 1 month ago
We're adding find & filter methods to api.events & contracts.events so it will be easier to find or filter a particular event.
find
filter
api.events
contracts.events
System Event:
// before const remarkEvent = events.map(({ event }) => event).find(api.events.system.Remarked.is); // after const remarkEvent = api.events.system.Remarked.find(events);
Contract Event:
// before const contractEventRecords = events.filter((r) => api.events.contracts.ContractEmitted.is(r.event)); const flippedEvent = contractEventRecords .map((e) => contract.decodeEvent(e)) .find(contract.events.Flipped.is); // after const flippedEvent = contract.events.Flipped.find(events);
Breaking changing as we're removing the as method in favor of the new ones.
as
We're adding
find
&filter
methods toapi.events
&contracts.events
so it will be easier to find or filter a particular event.System Event:
Contract Event:
Breaking changing as we're removing the
as
method in favor of the new ones.