coinalist
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Coinalist

High level cryptocurrency exchange-agnostic framework for real time monitoring, trading and analytics. Based on easy to use "streams" and "observables" paradigm, as specified and implemented by ReactiveX.

Status: alpha

const coinalist = require('coinalist');
const { config, exchange: { ExchangeBinance } } = coinalist;
const { BTCUSD, BTCUSDT } = config.market.values;
const { BUY, SELL } = config.side.values;

const exchange = new ExchangeBinance();
exchange.init([BTCUSDT,]);

const marketBook = exchange.markets[0].books[BUY];
marketBook.subscribe(marketBook => {
  console.log('Order book (top etries):\n', marketBook.orders);
});

Expected output on the order book updates:

...
Order book (top etries):
 [ [ 7628, 4.238912 ],
  [ 7627, 27.943388 ],
  [ 7626.33, 0.07916 ],
  [ 7626.2, 0.655634 ],
  [ 7625.55, 0.001312 ],
  [ 7625.07, 0.011624 ],
  [ 7625.02, 0.0014 ],
  [ 7625, 0.334699 ] ]
Order book (top etries):
 [ [ 7628.34, 1 ],
  [ 7628, 4.238912 ],
  [ 7627, 27.943388 ],
  [ 7626.33, 0.07916 ],
  [ 7626.2, 0.655634 ],
  [ 7625.55, 0.001312 ],
  [ 7625.07, 0.011624 ],
  [ 7625.02, 0.0014 ],
  [ 7625, 0.334699 ],
  [ 7612.41, 1.5 ] ]
...

Package Sidebar

Install

npm i coinalist

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

116 kB

Total Files

46

Last publish

Collaborators

  • andrenerd
  • sigent