kitemasterws

1.0.3 • Public • Published

The Kite Master Client Websocket

Client Websocket package for connection to Master kite websocket. Includes subscription and unsubscription of tokens to get data from master ws which gets communicated to kite and sends data downstream.

Requirements

  • NodeJS v8.0.0+

Installation

Install via npm

npm install kitemasterws

Getting started WebSocket client

const MasterWsClient = require("./masterWsClient");

const wsClient = new MasterWsClient(MASTER_WS_URL, botName);

wsClient.on("subscribe", subscribe);
wsClient.on("ticks", onTicks);

function subscribe() {
	wsClient.subscribe(tokens);
}

function unsubscribe(tokensArr) {
	wsClient.unsubscribe(tokensArr);
}

function onTicks(ticks) {
	for (const tick of ticks) {
    // tick data handling
	}
}

Author

Github

Package Sidebar

Install

npm i kitemasterws

Weekly Downloads

4

Version

1.0.3

License

ISC

Unpacked Size

4.35 kB

Total Files

3

Last publish

Collaborators

  • shaileshupadhyay