Listens for an event and calls a callback when it is triggered.
Example
// Assuming you have a valid ApiPromise instance (api) // and a callback function (callback) awaitlistenForEvent(api, "ProposalExecution", (data) => { console.log("ProposalExecution", data); constdataEvent = dataas { depositNonce: string; dataHash: string; }; console.log("ProposalExecution event is emmited. Transfer is finished") console.log(dataEvent) });
Returns
A promise that resolves when the event is triggered.
Listens for an event and calls a callback when it is triggered.
Example
Returns
A promise that resolves when the event is triggered.