Events
Last updated
Was this helpful?
Last updated
Was this helpful?
Events for each pallet emit during runtime operations and are defined in the medata. Available events are also exposed in ChainApi
interface so we can get information of an event through syntax client.events.<pallet>.<eventName>
. E.g: Events for Polkadot network can be found , similarly for other network as well.
This client.events
is helpful when we want quickly check if an event matches with an event that we're expecting in a list of events, the API also comes with type narrowing for the matched event, so event name & related data of the event are fully typed.
Example to list new accounts created in each block:
Check for a specific on-chain event or event record.
Find an on-chain event from a list of system event records.
Return a list of a specific on-chain event from a list of system event records.