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

0.6.1 • Public • Published

coin-bbo

A crawler to get realtime BBO messages from crypto exchanges.

How to use

const crawl = require('coin-bbo').default; // eslint-disable-line import/no-unresolved
 
function processMsgCallback(msg) {
  console.info(msg); // eslint-disable-line no-console
}
 
(async () => {
  await crawl('CoinbasePro', 'Spot', ['BTC_USD'], processMsgCallback);
})();

Quickstart

npx coin-bbo CoinbasePro --marketType Spot --pairs BTC_USD

Help

npx coin-bbo --help

API Manual

There is only one API in this library:

/**
 * Crawl BBO messages.
 *
 * @param exchange The crypto exchange name
 * @param pairs The pairs to crawl
 * @param bboMessageCallback The function to process BBO messages
 */
export default function crawlBbo(
  exchange: string,
  pairs?: string[], // empty means all
  bboMessageCallback?: BboMessageCallback,
): Promise<void>;

Related Projects

  • crypto-order, a library to place and cancel orders at crypto exchanges.

Readme

Keywords

Package Sidebar

Install

npm i coin-bbo

Weekly Downloads

5

Version

0.6.1

License

Apache-2.0

Unpacked Size

30 kB

Total Files

13

Last publish

Collaborators

  • soulmachine