binance-api-node
Advanced tools
Comparing version 0.10.34 to 0.10.35
@@ -236,2 +236,16 @@ "use strict"; | ||
var miniTickerTransform = function miniTickerTransform(m) { | ||
return { | ||
eventType: m.e, | ||
eventTime: m.E, | ||
symbol: m.s, | ||
curDayClose: m.c, | ||
open: m.o, | ||
high: m.h, | ||
low: m.l, | ||
volume: m.v, | ||
volumeQuote: m.q | ||
}; | ||
}; | ||
var tickerTransform = function tickerTransform(m) { | ||
@@ -331,2 +345,46 @@ return { | ||
var miniTicker = function miniTicker(payload, cb) { | ||
var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = (0, _openWebsocket.default)("".concat(endpoints.base, "/").concat(symbol.toLowerCase(), "@miniTicker")); | ||
w.onmessage = function (msg) { | ||
var obj = JSON.parse(msg.data); | ||
cb(transform ? miniTickerTransform(obj) : obj); | ||
}; | ||
return w; | ||
}); | ||
return function (options) { | ||
return cache.forEach(function (w) { | ||
return w.close(1000, 'Close handle was called', _objectSpread({ | ||
keepClosed: true | ||
}, options)); | ||
}); | ||
}; | ||
}; | ||
var allMiniTicker = function allMiniTicker(payload, cb) { | ||
var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = (0, _openWebsocket.default)("".concat(endpoints.base, "/!miniTicker@arr")); | ||
w.onmessage = function (msg) { | ||
var arr = JSON.parse(msg.data); | ||
cb(transform ? arr.map(function (m) { | ||
return miniTickerTransform(m); | ||
}) : arr); | ||
}; | ||
return w; | ||
}); | ||
return function (options) { | ||
return cache.forEach(function (w) { | ||
return w.close(1000, 'Close handle was called', _objectSpread({ | ||
keepClosed: true | ||
}, options)); | ||
}); | ||
}; | ||
}; | ||
var aggTradesTransform = function aggTradesTransform(m) { | ||
@@ -788,2 +846,4 @@ return { | ||
allTickers: allTickers, | ||
miniTicker: miniTicker, | ||
allMiniTicker: allMiniTicker, | ||
user: user(opts), | ||
@@ -790,0 +850,0 @@ marginUser: user(opts, 'margin'), |
{ | ||
"name": "binance-api-node", | ||
"version": "0.10.34", | ||
"version": "0.10.35", | ||
"description": "A node API wrapper for Binance", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
Sorry, the diff of this file is too big to display
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
167181
2645
3242