oasislabs / oasis.js

🕸A web client for the Oasis platform

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow filtering events when subscribing to them

omitar opened this issue · comments

It looks like I can call service.addEventListener but there is no way to filter those events before sending them over the wire to the client. This means that for a busy service, this could send a lot of events to the client, even if client is interested only in a subset of events.

For example, in SimplePeg I would like to listen to events that conversion for a particular user is completed. But it looks like I have to listen for events for all users.

For now, if you want web3 filters, use the Web3Gateway's eth.subscribe method directly. See https://oasis-labs-oasis-client.readthedocs-hosted.com/en/latest/gateways.html#subscriptions.