Skip to content

Azerothian/btc-markets-ws-api

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published