ftx-ws

0.0.1 • Public • Published

ftx-api-ws

npm install ftx-ws

API wrapper for the FTX WS API. Please refer to their documentation for eveything explained. Check out sample.js for lib usage.

Sample

const FTXWs = require('ftx-ws');

// including private channels:
// const ftx = new FTXWs({
//   key: 'x',
//   secret: 'y',
//   subaccount: 'z'
// })

// only public channels:
const ftx = new FTXWs();

const go = async () => {
  await ftx.connect();

  ftx.subscribe('ticker', 'BTC-PERP');
  ftx.on('BTC-PERP::ticker', console.log);

  if you passed api credentials:
  ftx.subscribe('fills');
  ftx.on('fills', console.log);

  if you want to know when the status of underlying socket changes
  ftx.on('statusChange', console.log);
}

go();

Package Sidebar

Install

npm i ftx-ws

Weekly Downloads

0

Version

0.0.1

License

MIT

Unpacked Size

8.47 kB

Total Files

5

Last publish

Collaborators

  • zenshubham