{ id, channel, confirmed?, filters? }. The id is your own string. The server sends it back on every event, so you can tell your subscriptions apart. channel is a channel name. confirmed defaults to true (the final on-chain feed); set it to false for the pending (mempool) feed of the same channel. filters are optional and run on the server.
id you already use, the new subscription replaces the old one on that id. To stop, unsubscribe with the same id.
Filters
ChannelFilters narrows a channel on the server:
| Filter | Type | Used by |
|---|---|---|
wallets | string[] | wallets (required); trading, fees, positions, combos, transfers, accounts |
market_ids | string[] | markets (one of market/token ids); trading, oracle, resolution, lifecycle, positions, combos |
token_ids | string[] | markets; trading, fees, lifecycle, positions, combos, transfers |
min_usd | number | trading |
Only the two filter channels need a filter.
wallets needs wallets.
markets needs at least one of market_ids / token_ids. If you subscribe
to either without its filter, you get an error. On
topic channels, filters are optional — an empty filter means the whole
channel.Pending feed
Setconfirmed: false on a subscription to get pending transactions before they land in a block. These are not final yet. Every event carries a confirmed flag, so you route on that (and tell subscriptions apart by id):