1.0.6 • Published 7 years ago
beast-api-node v1.0.6
beast-api-node
Node.js wrapper for the Beast framework master API server. All functions return promises.
Install
npm i beast-api-node
Setup
const beast = new BeastAPI({
  apiBase: 'http://localhost:3100/api/',
  wsBase: 'ws://localhost:3100/',
  debug: true
});Websockets
The subscribe function returns a promise that resolves with the websocket object, if the connection is successfully opened.
beast.subscribe('workers', message => {
  console.log('received message on channel workers: ', JSON.parse(message, null, 4));
});REST
All REST API methods return a promise that resolves with the result of the request.
const rangeInfo = {
  time: '90d',
  strategy: 'ts_rsi'
};
const symbols = 'XRPUSDT';
const timeframes = '4h';
const backfillResults = await beast.backfill(
  symbols,
  timeframes,
  rangeInfo
);