kiteconnect
Advanced tools
Comparing version 3.0.1 to 3.0.2
@@ -545,3 +545,3 @@ var WebSocket = require("ws"); | ||
var timestamp = buf2long(bin.slice(28, 32)); | ||
if (timestamp) tick.timestamp = new Date(timestamp); | ||
if (timestamp) tick.timestamp = new Date(timestamp * 1000); | ||
} | ||
@@ -548,0 +548,0 @@ |
{ | ||
"name": "kiteconnect", | ||
"version": "3.0.1", | ||
"version": "3.0.2", | ||
"description": "The official JS client library for the Kite Connect trading APIs", | ||
@@ -5,0 +5,0 @@ "main": "./lib/", |
@@ -18,23 +18,24 @@ // var KiteConnect = require("./lib/"); | ||
var KiteTicker = require("./lib").KiteTicker; | ||
var ticker = new KiteTicker("kitefront", "DV1973", "8a02cc7aa5fbe77bcd6fe21246515656"); | ||
ticker.autoReconnect(true, 5, 1) | ||
var ticker = new KiteTicker({ | ||
api_key: "kitefront", | ||
access_token: "iP8m4rya2nwOfUEw86tOUUXxZoaZnJMo" | ||
}); | ||
ticker.connect(); | ||
ticker.on("tick", setTick); | ||
ticker.on("ticks", onTicks); | ||
ticker.on("connect", subscribe); | ||
ticker.on("noreconnect", function() { | ||
console.log("noreconnect") | ||
}); | ||
ticker.on("error", onError); | ||
ticker.on("reconnecting", function(reconnect_interval, reconnections) { | ||
console.log("Reconnecting: attempe - ", reconnections, " innterval - ", reconnect_interval); | ||
}); | ||
function onTicks(ticks) { | ||
console.log("Ticks", ticks); | ||
} | ||
function setTick(ticks) { | ||
console.log("Ticks"); | ||
function onError(err) { | ||
console.log(err) | ||
} | ||
function subscribe() { | ||
console.log("onconnect") | ||
var items = [5097729]; | ||
var items = [256265]; | ||
ticker.subscribe(items); | ||
ticker.setMode(ticker.modeFull, items); | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8364415
31998