Replies: 4 comments 3 replies
-
No reason! We have been meaning to add parity for that. Looking to do it soon, but also open to contributions. would be somewhat similar pattern to how we do it on |
Beta Was this translation helpful? Give feedback.
-
Made a PR for this: #985 |
Beta Was this translation helpful? Give feedback.
-
Hey @jxom I saw you merged in a change for this back in August, but I'm still having issues getting my websocket client to use subscriptions instead of polling. Your pr and the documentation make it look like if I'm calling My code looks like:
It looks like you are checking Anyway, seems like there's a bug with In the meantime I'm just manually creating a websocket client and that is working as expected with subscriptions by default:
|
Beta Was this translation helpful? Give feedback.
-
Any update re support for subscribing to events via websocket (without polling)? |
Beta Was this translation helpful? Give feedback.
-
I'm currently migrating an application from
[email protected]/ethers@5
to[email protected]/viem
. One internal difference I've noticed is how event subscriptions are handled. Withethers
, if you are using a websocket connection and subscribe to events,eth_subscribe
will be used with a list of topics, so that your provider can push events via WS to your application as soon as they become available.viem
on the other hand, uses expliciteth_newFilter
witheth_getFilterChanges
polling, even on WS connection.Both approaches have drawbacks, but I'm curious to hear if there's anything specific that pushed you to go for polling or if you foresee support for
eth_subscribe
in the futureBeta Was this translation helpful? Give feedback.
All reactions