Skip to content

zenshubham/ftx-ws

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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();

About

websocket wrapper for FTX ws api.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%