I am subscribing system events using the events api. After I got the specific event I am looking for, how should get the block hash of this event?
Thanks
api.query.system.events((events) => {
console.log(`\nReceived ${events.length} events:`);
// Loop through the Vec<EventRecord>
events.forEach((record) => {
const { event, phase } = record;
// found the one
if (event.section === 'SomeSection') {
// notify user the block hash
}
});
});