helios
helios copied to clipboard
feat: support tracking consensus updates in helios-ts
Support in some way tracking and getting notified when a new update is applied. The usecase I want to implement is setting a hook on new optimistic update, to do some action (For example, re-check a list of balances) when the update is applied.
Implementing something like https://nodejs.org/api/events.html#emitteroneventname-listener would be ideal, however even a function returning the current status (latest update applied, current block etc) would be great.
Would something that mimics the websocket block subscription api make sense here potentially?
@ncitron Yeah I suppose so, could you link an example of how that would look like?
The eth_subscribe
rpc method with the newHeads
subscription type I think would make sense. We don't support these right now, but would something sort of inspired by this where you get new head blocks as they come work?
https://docs.alchemy.com/reference/newheads
@ncitron Yes this seems perfect!