Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd documentation for how to filter event logs #2962
Comments
|
Thanks for this @wbt! You're absolutely right that this should be improved in our docs. Feel free to take a stab at it, or we'll get to it as part of our normal (albeit slow) process to work through the backlog. |
|
Having found what should go in there and gotten it documented here, I'll probably be comparably slow towards a PR into the official documentation. Therefore if anyone else reading this wants to jump in, feel free! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Issue
The "Full Example" of using @truffle/contract to interact with contracts should include an example of listening to an event with a filter.
In the past, it used to be possible to pass a filter object on indexed event parameters when listening to an event, as seen for example here (filtering to a particular _candidateName). It is not clear how to do this in the latest version of @truffle/contract, especially since log filter options are no longer passed to web3.eth.filter.
This Issue proposes a documentation change to make this easier to understand.
If you came here looking for a solution, the way to do it is that what used to be the filter object passed in separately now goes in as an object member of the options object, named "filter". So in the linked StackExchange example,
would likely become
Possibly related issue with zero description: #2190