-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Filter Support with Infura provider implementation for fetching events #1830
Conversation
Need this desperately. Any chance it can get merged? |
These methods are used internally in let filterId = await provider.send('eth_newFilter', [{ topics: [...] }]);
let updatedLogs = await provider.send('eth_getFilterChanges', [filterId]); |
I didn't add filter support in v5 (it is the default in v6), but I've made changes that should accomplish the same goal in v5.6. The main reason to hold off on switching to filter ID is that it affects how the FallbackProvider works. In v6, the entire event model has been redesigned so things like filter ID are more friendly. Please try it out and let me know if you still have any problems. :) |
Wow, thank you so much @ricmoo! Really appreciate it, and will try it out ASAP! |
Closing this now; the issue has been fixed by keeping a larger window to capture Thanks! :) |
This PR addresses #1814 & #1798
With regards to
getLogs
calls in general, Infura prefers clients usegetFilterChanges
it ends up being more efficient than the vanillagetLogs
and since it is cursor based it ends up being a more consistent set of data.The changes enable these methods to become generally available to the providers to use as:
Additionally, I've extended the Infura provider to utilize these methods in the event emitter system in order to better service the Contract convenience methods.