Closed LinSays closed 2 years ago
No option to get the count, but you can define a step iterating one by one til no outputs.
const step = 20
let offest = 0
for(;;){
const outputs = await filter.apply(offset, step)
if (outputs.length==0){
break
}
offset += step
}
HI. I want to fetch all events from specific block to the latest one using connex. According to the documentation, I have to implement like this:
const currentBlockStatus = connex.thor.status; const filter = mpEvents.filter([]).range({ unit: 'block', from: FromBlock, to:currentBlockStatus.head.number }); filter.apply(offset, limit).then(logs=>{ console.log(logs); })
I've set the offset as 0 to get the events from the Block - FromBlock. But the problem is limit. I just can't get the number of events emitted with this abi. I can only specific number(limit) of the events emitted in the SC. Is there any way to solve this issue? Thanks in advance