Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

binance-api-node

Package Overview
Dependencies
Maintainers
1
Versions
180
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

binance-api-node - npm Package Compare versions

Comparing version 0.11.14 to 0.11.15

58

dist/websocket.js

@@ -367,3 +367,3 @@ "use strict";

var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) {
var cache = (Array.isArray(payload) ? payload : [payload]).map(function () {
var w = (0, _openWebsocket.default)("".concat(endpoints.base, "/!miniTicker@arr"));

@@ -747,2 +747,12 @@

exports.userEventHandler = userEventHandler;
var userErrorHandler = function userErrorHandler(cb) {
var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
return function (error) {
var _cb;
cb((_cb = {}, _defineProperty(_cb, transform ? 'eventType' : 'type', 'error'), _defineProperty(_cb, "error", error), _cb));
};
};
var STREAM_METHODS = ['get', 'keep', 'close'];

@@ -781,6 +791,8 @@

var w = null;
var keepClosed = false;
var errorHandler = userErrorHandler(cb, transform);
var keepAlive = function keepAlive(isReconnecting) {
if (currentListenKey) {
keepStreamAlive(keepDataStream, currentListenKey).catch(function () {
keepStreamAlive(keepDataStream, currentListenKey).catch(function (err) {
closeStream({}, true);

@@ -795,2 +807,6 @@

}
if (opts.emitStreamErrors) {
errorHandler(err);
}
});

@@ -800,3 +816,7 @@ }

var closeStream = function closeStream(options, catchErrors) {
var closeStream = function closeStream(options) {
var catchErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
var setKeepClosed = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
keepClosed = setKeepClosed;
if (currentListenKey) {

@@ -822,4 +842,13 @@ clearInterval(int);

var makeStream = function makeStream(isReconnecting) {
return getDataStream().then(function (_ref3) {
return !keepClosed && getDataStream().then(function (_ref3) {
var listenKey = _ref3.listenKey;
if (keepClosed) {
return closeDataStream({
listenKey: listenKey
}).catch(function (f) {
return f;
});
}
w = (0, _openWebsocket.default)("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(listenKey));

@@ -831,2 +860,9 @@

if (opts.emitSocketErrors) {
w.onerror = function (_ref4) {
var error = _ref4.error;
return errorHandler(error);
};
}
currentListenKey = listenKey;

@@ -838,9 +874,15 @@ int = setInterval(function () {

return function (options) {
return closeStream(options);
return closeStream(options, false, true);
};
}).catch(function (err) {
if (isReconnecting) {
setTimeout(function () {
return makeStream(true);
}, 30e3);
if (!keepClosed) {
setTimeout(function () {
return makeStream(true);
}, 30e3);
}
if (opts.emitStreamErrors) {
errorHandler(err);
}
} else {

@@ -847,0 +889,0 @@ throw err;

2

package.json
{
"name": "binance-api-node",
"version": "0.11.14",
"version": "0.11.15",
"description": "A node API wrapper for Binance",

@@ -5,0 +5,0 @@ "main": "dist",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc