UNPKG

@lixersdk/sdk

Version:

Official Lixer SDK for accessing real-time and historical DeFi swap data across all major DEXs

14 lines (11 loc) 284 B
module.exports = (client) => ({ async getUrl() { const res = await client.get('/websocket/url'); return res.data; }, async connect(wsURL) { const WebSocket = require('ws'); const url = wsURL || (await this.getUrl()).url; return new WebSocket(url); } });