UNPKG

tardis-dev

Version:

Convenient access to tick-level historical and real-time cryptocurrency market data via Node.js

28 lines 907 B
import { RealTimeFeedBase } from "./realtimefeed.js"; export class PoloniexRealTimeFeed extends RealTimeFeedBase { wssURL = 'wss://ws.poloniex.com/ws/public'; mapToSubscribeMessages(filters) { return filters.flatMap((filter) => { if (!filter.symbols || filter.symbols.length === 0) { throw new Error('PoloniexRealTimeFeed requires explicitly specified symbols when subscribing to live feed'); } return { event: 'subscribe', channel: [filter.channel], symbols: filter.symbols }; }); } sendCustomPing = () => { this.send({ event: 'ping' }); }; messageIsHeartbeat(msg) { return msg.event === 'pong'; } messageIsError(message) { return message.event === 'error'; } } //# sourceMappingURL=poloniex.js.map