btc-markets-ws-api

1.1.0 • Public • Published

BTC Markets WebSocket Client

This exposes the websocket events available from the BTC Markets API.

Requirements

  • Nodejs >= 8.9.4

Install

yarn add btc-markets-ws-api

Documentation

Link to Documentation

Example

import BTCMarketsWS from "btc-markets-ws-api";
const wsClient = new BTCMarketsWS();
 
wsClient.subscribeTicker("BTC", "AUD");
wsClient.subscribeOrderBook("BTC", "AUD");
wsClient.subscribeTradeEvents("BTC", "AUD");
 
wsClient.on("ticker", (tickerResult) => {
  console.log("ticker", tickerResult);
});
wsClient.on("orderbook", (orderbookResult) => {
  console.log("orderbook", orderbookResult);
});
wsClient.on("trade", (tradeResult) => {
  console.log("trade", tradeResult);
});
wsClient.connect();
 
})();
 

Development

  • We use gulp with babel for source transpiling.
  • npm run test or jest to run test the test cases

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.1.01latest

Version History

VersionDownloads (Last 7 Days)Published
1.1.01
1.0.00

Package Sidebar

Install

npm i btc-markets-ws-api

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • matthew.m.mckenzie