Consensys / web3js-eea

EEA JavaScript libraries.
Mozilla Public License 2.0
35 stars 40 forks source link

Implement WebSocket pub-sub API for log subscriptions #106

Closed lucassaldanha closed 4 years ago

lucassaldanha commented 4 years ago

(replaces PR #102)

Currently, web3.priv.subscribe() uses polling to fetch new logs. If the user is using WebSockets, detect this, and use priv_subscribe and priv_unsubscribe behind the scenes instead of polling.

Addresses #101.

Add priv_subscribe and priv_unsubscribe Update PrivateSubscription to handle WebSockets Add example of subscribing with WebSockets