1

I'm struggling to figure out how to add a filter to allEvents requests.

My current code:

const contract = getState().web3Reducer.get('contract');
          contract.getPastEvents('allEvents', {
              filter : { owner: '0x3333333....333' },
              fromBlock: currentBlock - 5760,
              toBlock: 'latest'
          }).then(transactions => dispatch(eventsFetched(events)));

It seems like web3 doesn't support such call, any idea how to get around this? I could fetch all events and filter in Javascript, but feels very wrong.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.