binance-api-node
Advanced tools
Comparing version 0.9.15 to 0.9.16
@@ -265,2 +265,3 @@ "use strict"; | ||
aggId: trade.a, | ||
symbol: payload.symbol, | ||
price: trade.p, | ||
@@ -267,0 +268,0 @@ quantity: trade.q, |
@@ -231,5 +231,5 @@ "use strict"; | ||
var tradesInternal = function tradesInternal(payload, streamName, cb) { | ||
var aggTradesInternal = function aggTradesInternal(payload, cb) { | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = (0, _openWebsocket.default)("".concat(BASE, "/").concat(symbol.toLowerCase(), "@").concat(streamName)); | ||
var w = (0, _openWebsocket.default)("".concat(BASE, "/").concat(symbol.toLowerCase(), "@aggTrade")); | ||
@@ -240,8 +240,11 @@ w.onmessage = function (msg) { | ||
eventTime = _JSON$parse4.E, | ||
timestamp = _JSON$parse4.T, | ||
symbol = _JSON$parse4.s, | ||
price = _JSON$parse4.p, | ||
quantity = _JSON$parse4.q, | ||
maker = _JSON$parse4.m, | ||
isBuyerMaker = _JSON$parse4.M, | ||
tradeId = _JSON$parse4.a; | ||
isBuyerMaker = _JSON$parse4.m, | ||
wasBestPrice = _JSON$parse4.M, | ||
aggId = _JSON$parse4.a, | ||
firstId = _JSON$parse4.f, | ||
lastId = _JSON$parse4.l; | ||
@@ -251,8 +254,55 @@ cb({ | ||
eventTime: eventTime, | ||
aggId: aggId, | ||
price: price, | ||
quantity: quantity, | ||
firstId: firstId, | ||
lastId: lastId, | ||
timestamp: timestamp, | ||
symbol: symbol, | ||
isBuyerMaker: isBuyerMaker, | ||
wasBestPrice: wasBestPrice | ||
}); | ||
}; | ||
return w; | ||
}); | ||
return function (options) { | ||
return cache.forEach(function (w) { | ||
return w.close(1000, 'Close handle was called', _objectSpread({ | ||
keepClosed: true | ||
}, options)); | ||
}); | ||
}; | ||
}; | ||
var tradesInternal = function tradesInternal(payload, cb) { | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = (0, _openWebsocket.default)("".concat(BASE, "/").concat(symbol.toLowerCase(), "@trade")); | ||
w.onmessage = function (msg) { | ||
var _JSON$parse5 = JSON.parse(msg.data), | ||
eventType = _JSON$parse5.e, | ||
eventTime = _JSON$parse5.E, | ||
tradeTime = _JSON$parse5.T, | ||
symbol = _JSON$parse5.s, | ||
price = _JSON$parse5.p, | ||
quantity = _JSON$parse5.q, | ||
isBuyerMaker = _JSON$parse5.m, | ||
maker = _JSON$parse5.M, | ||
tradeId = _JSON$parse5.t, | ||
sellerOrderId = _JSON$parse5.a, | ||
buyerOrderId = _JSON$parse5.b; | ||
cb({ | ||
eventType: eventType, | ||
eventTime: eventTime, | ||
tradeTime: tradeTime, | ||
symbol: symbol, | ||
price: price, | ||
quantity: quantity, | ||
isBuyerMaker: isBuyerMaker, | ||
maker: maker, | ||
isBuyerMaker: isBuyerMaker, | ||
tradeId: tradeId | ||
tradeId: tradeId, | ||
buyerOrderId: buyerOrderId, | ||
sellerOrderId: sellerOrderId | ||
}); | ||
@@ -273,7 +323,7 @@ }; | ||
var aggTrades = function aggTrades(payload, cb) { | ||
return tradesInternal(payload, 'aggTrade', cb); | ||
return aggTradesInternal(payload, cb); | ||
}; | ||
var trades = function trades(payload, cb) { | ||
return tradesInternal(payload, 'trade', cb); | ||
return tradesInternal(payload, cb); | ||
}; | ||
@@ -338,5 +388,5 @@ | ||
return function (msg) { | ||
var _JSON$parse5 = JSON.parse(msg.data), | ||
type = _JSON$parse5.e, | ||
rest = _objectWithoutProperties(_JSON$parse5, ["e"]); | ||
var _JSON$parse6 = JSON.parse(msg.data), | ||
type = _JSON$parse6.e, | ||
rest = _objectWithoutProperties(_JSON$parse6, ["e"]); | ||
@@ -343,0 +393,0 @@ cb(userTransforms[type] ? userTransforms[type](rest) : _objectSpread({ |
@@ -70,2 +70,3 @@ // tslint:disable:interface-name | ||
aggId: number; | ||
symbol: string; | ||
price: string; | ||
@@ -72,0 +73,0 @@ quantity: string; |
{ | ||
"name": "binance-api-node", | ||
"version": "0.9.15", | ||
"version": "0.9.16", | ||
"description": "A node API wrapper for Binance", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
@@ -1,2 +0,2 @@ | ||
# binance-api-node [![build](https://img.shields.io/travis/Ashlar/binance-api-node.svg?style=flat-square)](https://travis-ci.org/Ashlar/binance-api-node) [![cover](https://img.shields.io/coveralls/Ashlar/binance-api-node.svg?style=flat-square)](https://coveralls.io/github/Ashlar/binance-api-node) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node) | ||
# binance-api-node [![build](https://img.shields.io/travis/Ashlar/binance-api-node/master.svg?style=flat-square)](https://travis-ci.org/Ashlar/binance-api-node) [![cover](https://img.shields.io/coveralls/Ashlar/binance-api-node.svg?style=flat-square)](https://coveralls.io/github/Ashlar/binance-api-node) [![bnb](https://img.shields.io/badge/binance-winner-yellow.svg?style=flat-square)](https://github.com/binance-exchange/binance-api-node) | ||
@@ -290,2 +290,3 @@ > A complete API wrapper for the [Binance](https://binance.com) API. | ||
aggId: 2107132, | ||
symbol: 'ETHBTC', | ||
price: '0.05390400', | ||
@@ -1653,7 +1654,11 @@ quantity: '1.31000000', | ||
eventTime: 1508614495052, | ||
tradeTime: 1508614495050, | ||
symbol: 'ETHBTC', | ||
price: '0.04923600', | ||
quantity: '3.43500000', | ||
maker: false, | ||
tradeId: 2148226 | ||
isBuyerMaker: true, | ||
maker: true, | ||
tradeId: 2148226, | ||
buyerOrderId: 390876, | ||
sellerOrderId: 390752 | ||
} | ||
@@ -1681,7 +1686,11 @@ ``` | ||
eventTime: 1508614495052, | ||
symbol: 'ETHBTC', | ||
aggId: 2148226, | ||
price: '0.04923600', | ||
quantity: '3.43500000', | ||
maker: false, | ||
tradeId: 2148226 | ||
firstId: 37856, | ||
lastId: 37904, | ||
timestamp: 1508614495050, | ||
symbol: 'ETHBTC', | ||
isBuyerMaker: false, | ||
wasBestPrice: true | ||
} | ||
@@ -1688,0 +1697,0 @@ ``` |
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
99143
1643
1749