-
Notifications
You must be signed in to change notification settings - Fork 13
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
feat: Added methods to handle new transactions #36
Conversation
Could you give me some feedback on supporting RPC functionality for transactional events? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for adding this missing functionality 🙏
I've left a few comments that should be addressed before merging this out. My primary concern is emitting an event in the fetcher for new txs, when we already emit a block event that contains the txs -> I think we should just stick to the block event, and in the FM construct individual tx events for the tx listeners
Tx filters aren't applied because Apply
is never called (the apply logic should happen in UpdateWith
). We're also missing handling tx filter options when the user creates a transaction filter
I think we're 80% there, these few things are the blockers 🙏
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a fan of our actual memory filters, created an issue (#38) to improve them.
They might not be even needed, the events JSON RPC API is using WebSockets, right? So we know when a client disconnects, so we might do the same we are doing on GraphQL API.
Yes, it can work like GraphQL's subscription feature. But it's also nice to provide familiar and accessible functionality. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for fixing this up 🙏
I apologize for the late reply on this, looks great now 💯
Description
This PR adds RPC feature support for new transactional events.
This is what works for this PR.
newTransactionFilter
method and creates a filter.getFilterChanges
method.newTransactions
parameter of the websocketsubscribe
method.Examples
Using Transaction filter to get transactional changes
Subscribe to transaction events with websockets