2

In web3JS, when I get past events, I can see the event and the tx hash, I can then do getTransaction on the corresponding tx hash and then see the sender address, but this is wasteful as I have to iterate over all the events and compare it with a desired address (say browser client address).

Is it possible through web3js to access who triggered the event in the filtering itself ?

Random
  • 203
  • 1
  • 2
  • 6

1 Answers1

1

I believe you're looking for the indexed keyword used in Events.

This allows searching and filtering on events.

See: What does the indexed keyword do?

Matt Swezey
  • 1,246
  • 6
  • 13
  • Yeah I was wondering if I were able to find that without adding another byte32 to every event emitted, but I guess that'll do, thanks :) – Random Jan 15 '18 at 20:45