binance-api-node
Advanced tools
Comparing version 0.11.47 to 0.12.0
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.default = exports.candleFields = void 0; | ||
exports.deliveryCandleFields = exports.default = exports.candleFields = void 0; | ||
@@ -29,2 +29,3 @@ var _crypto = _interopRequireDefault(require("crypto")); | ||
var FUTURES = 'https://fapi.binance.com'; | ||
var COIN_FUTURES = 'https://dapi.binance.com'; | ||
@@ -37,3 +38,4 @@ var defaultGetTime = function defaultGetTime() { | ||
spot: {}, | ||
futures: {} | ||
futures: {}, | ||
delivery: {} | ||
}; | ||
@@ -68,3 +70,3 @@ /** | ||
var marketName = res.url.includes(FUTURES) || res.url.includes('future') ? 'futures' : 'spot'; | ||
var marketName = res.url.includes(FUTURES) ? 'futures' : res.url.includes(COIN_FUTURES) ? 'delivery' : 'spot'; | ||
Object.keys(headersMapping).forEach(function (key) { | ||
@@ -154,3 +156,3 @@ var outKey = headersMapping[key]; | ||
var headers = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | ||
return sendResult(fetch("".concat(!(path.includes('/fapi') || path.includes('/futures')) || path.includes('/sapi') ? endpoints.base : endpoints.futures).concat(path).concat(makeQueryString(data)), _objectSpread({ | ||
return sendResult(fetch("".concat(path.includes('/fapi') || path.includes('/futures') ? endpoints.futures : path.includes('/dapi') ? endpoints.delivery : endpoints.base).concat(path).concat(makeQueryString(data)), _objectSpread({ | ||
method: method, | ||
@@ -233,3 +235,3 @@ json: true, | ||
}); | ||
return sendResult(fetch("".concat(!(path.includes('/fapi') || path.includes('/futures')) || path.includes('/sapi') ? endpoints.base : endpoints.futures).concat(path).concat(noData ? '' : makeQueryString(newData)), _objectSpread({ | ||
return sendResult(fetch("".concat(path.includes('/fapi') || path.includes('/futures') ? endpoints.futures : path.includes('/dapi') ? endpoints.delivery : endpoints.base).concat(path).concat(noData ? '' : makeQueryString(newData)), _objectSpread({ | ||
method: method, | ||
@@ -248,2 +250,4 @@ headers: { | ||
var candleFields = ['openTime', 'open', 'high', 'low', 'close', 'volume', 'closeTime', 'quoteVolume', 'trades', 'baseAssetVolume', 'quoteAssetVolume']; | ||
exports.candleFields = candleFields; | ||
var deliveryCandleFields = ['openTime', 'open', 'high', 'low', 'close', 'volume', 'closeTime', 'baseVolume', 'trades', 'quoteAssetVolume', 'baseAssetVolume']; | ||
/** | ||
@@ -254,3 +258,3 @@ * Get candles for a specific pair and interval and convert response | ||
exports.candleFields = candleFields; | ||
exports.deliveryCandleFields = deliveryCandleFields; | ||
@@ -263,3 +267,3 @@ var _candles = function candles(pubCall, payload) { | ||
return candles.map(function (candle) { | ||
return (0, _lodash.default)(candleFields, candle); | ||
return (0, _lodash.default)(!endpoint.includes('dapi') ? candleFields : deliveryCandleFields, candle); | ||
}); | ||
@@ -329,3 +333,3 @@ }); | ||
return trades.map(function (trade) { | ||
return { | ||
var transformed = { | ||
aggId: trade.a, | ||
@@ -338,5 +342,6 @@ symbol: payload.symbol, | ||
timestamp: trade.T, | ||
isBuyerMaker: trade.m, | ||
wasBestPrice: trade.M | ||
isBuyerMaker: trade.m | ||
}; | ||
if (trade.M) transformed.wasBestPrice = trade.M; | ||
return transformed; | ||
}); | ||
@@ -349,3 +354,4 @@ }); | ||
base: opts && opts.httpBase || BASE, | ||
futures: opts && opts.httpFutures || FUTURES | ||
futures: opts && opts.httpFutures || FUTURES, | ||
delivery: opts && opts.httpDelivery || COIN_FUTURES | ||
}; | ||
@@ -355,2 +361,7 @@ var pubCall = publicCall(_objectSpread(_objectSpread({}, opts), {}, { | ||
})); | ||
var deliveryPubCall = publicCall(_objectSpread(_objectSpread({}, opts), {}, { | ||
endpoints: { | ||
futures: endpoints.delivery | ||
} | ||
})); | ||
var privCall = privateCall(_objectSpread(_objectSpread({}, opts), {}, { | ||
@@ -540,2 +551,11 @@ endpoints: endpoints, | ||
}, | ||
deliveryGetDataStream: function deliveryGetDataStream() { | ||
return privCall('/dapi/v1/listenKey', null, 'POST', true); | ||
}, | ||
deliveryKeepDataStream: function deliveryKeepDataStream(payload) { | ||
return privCall('/dapi/v1/listenKey', payload, 'PUT', false, true); | ||
}, | ||
deliveryCloseDataStream: function deliveryCloseDataStream(payload) { | ||
return privCall('/dapi/v1/listenKey', payload, 'DELETE', false, true); | ||
}, | ||
marginAllOrders: function marginAllOrders(payload) { | ||
@@ -715,2 +735,122 @@ return privCall('/sapi/v1/margin/allOrders', payload); | ||
}, | ||
deliveryPing: function deliveryPing() { | ||
return pubCall('/dapi/v1/ping').then(function () { | ||
return true; | ||
}); | ||
}, | ||
deliveryTime: function deliveryTime() { | ||
return pubCall('/dapi/v1/time').then(function (r) { | ||
return r.serverTime; | ||
}); | ||
}, | ||
deliveryExchangeInfo: function deliveryExchangeInfo() { | ||
return pubCall('/dapi/v1/exchangeInfo'); | ||
}, | ||
deliveryBook: function deliveryBook(payload) { | ||
return _book(pubCall, payload, '/dapi/v1/depth'); | ||
}, | ||
deliveryAggTrades: function deliveryAggTrades(payload) { | ||
return _aggTrades(pubCall, payload, '/dapi/v1/aggTrades'); | ||
}, | ||
deliveryMarkPrice: function deliveryMarkPrice(payload) { | ||
return pubCall('/dapi/v1/premiumIndex', payload); | ||
}, | ||
deliveryAllForceOrders: function deliveryAllForceOrders(payload) { | ||
return pubCall('/dapi/v1/allForceOrders', payload); | ||
}, | ||
deliveryLongShortRatio: function deliveryLongShortRatio(payload) { | ||
return deliveryPubCall('/futures/data/globalLongShortAccountRatio', payload); | ||
}, | ||
deliveryCandles: function deliveryCandles(payload) { | ||
return _candles(pubCall, payload, '/dapi/v1/klines'); | ||
}, | ||
deliveryMarkPriceCandles: function deliveryMarkPriceCandles(payload) { | ||
return _candles(pubCall, payload, '/dapi/v1/markPriceKlines'); | ||
}, | ||
deliveryIndexPriceCandles: function deliveryIndexPriceCandles(payload) { | ||
return _candles(pubCall, payload, '/dapi/v1/indexPriceKlines'); | ||
}, | ||
deliveryTrades: function deliveryTrades(payload) { | ||
return checkParams('trades', payload, ['symbol']) && pubCall('/dapi/v1/trades', payload); | ||
}, | ||
deliveryDailyStats: function deliveryDailyStats(payload) { | ||
return pubCall('/dapi/v1/ticker/24hr', payload); | ||
}, | ||
deliveryPrices: function deliveryPrices() { | ||
return pubCall('/dapi/v1/ticker/price').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur.price, out; | ||
}, {}); | ||
}); | ||
}, | ||
deliveryAllBookTickers: function deliveryAllBookTickers() { | ||
return pubCall('/dapi/v1/ticker/bookTicker').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur, out; | ||
}, {}); | ||
}); | ||
}, | ||
deliveryFundingRate: function deliveryFundingRate(payload) { | ||
return checkParams('fundingRate', payload, ['symbol']) && pubCall('/dapi/v1/fundingRate', payload); | ||
}, | ||
deliveryOrder: function deliveryOrder(payload) { | ||
return _order(privCall, payload, '/dapi/v1/order'); | ||
}, | ||
deliveryBatchOrders: function deliveryBatchOrders(payload) { | ||
return privCall('/dapi/v1/batchOrders', payload, 'POST'); | ||
}, | ||
deliveryGetOrder: function deliveryGetOrder(payload) { | ||
return privCall('/dapi/v1/order', payload); | ||
}, | ||
deliveryCancelOrder: function deliveryCancelOrder(payload) { | ||
return privCall('/dapi/v1/order', payload, 'DELETE'); | ||
}, | ||
deliveryCancelAllOpenOrders: function deliveryCancelAllOpenOrders(payload) { | ||
return privCall('/dapi/v1/allOpenOrders', payload, 'DELETE'); | ||
}, | ||
deliveryCancelBatchOrders: function deliveryCancelBatchOrders(payload) { | ||
return privCall('/dapi/v1/batchOrders', payload, 'DELETE'); | ||
}, | ||
deliveryOpenOrders: function deliveryOpenOrders(payload) { | ||
return privCall('/dapi/v1/openOrders', payload); | ||
}, | ||
deliveryAllOrders: function deliveryAllOrders(payload) { | ||
return privCall('/dapi/v1/allOrders', payload); | ||
}, | ||
deliveryPositionRisk: function deliveryPositionRisk(payload) { | ||
return privCall('/dapi/v1/positionRisk', payload); | ||
}, | ||
deliveryLeverageBracket: function deliveryLeverageBracket(payload) { | ||
return privCall('/dapi/v1/leverageBracket', payload); | ||
}, | ||
deliveryAccountBalance: function deliveryAccountBalance(payload) { | ||
return privCall('/dapi/v1/balance', payload); | ||
}, | ||
deliveryAccountInfo: function deliveryAccountInfo(payload) { | ||
return privCall('/dapi/v1/account', payload); | ||
}, | ||
deliveryUserTrades: function deliveryUserTrades(payload) { | ||
return privCall('/dapi/v1/userTrades', payload); | ||
}, | ||
deliveryPositionMode: function deliveryPositionMode(payload) { | ||
return privCall('/dapi/v1/positionSide/dual', payload); | ||
}, | ||
deliveryPositionModeChange: function deliveryPositionModeChange(payload) { | ||
return privCall('/dapi/v1/positionSide/dual', payload, 'POST'); | ||
}, | ||
deliveryLeverage: function deliveryLeverage(payload) { | ||
return privCall('/dapi/v1/leverage', payload, 'POST'); | ||
}, | ||
deliveryMarginType: function deliveryMarginType(payload) { | ||
return privCall('/dapi/v1/marginType', payload, 'POST'); | ||
}, | ||
deliveryPositionMargin: function deliveryPositionMargin(payload) { | ||
return privCall('/dapi/v1/positionMargin', payload, 'POST'); | ||
}, | ||
deliveryMarginHistory: function deliveryMarginHistory(payload) { | ||
return privCall('/dapi/v1/positionMargin/history', payload); | ||
}, | ||
deliveryIncome: function deliveryIncome(payload) { | ||
return privCall('/dapi/v1/income', payload); | ||
}, | ||
getMultiAssetsMargin: function getMultiAssetsMargin(payload) { | ||
@@ -717,0 +857,0 @@ return privCall('/fapi/v1/multiAssetsMargin', payload); |
@@ -66,2 +66,3 @@ "use strict"; | ||
INSUFFICIENT_BALANCE: -2010, | ||
CANCEL_REJECTED: -2011, | ||
CANCEL_ALL_FAIL: -2012, | ||
@@ -68,0 +69,0 @@ NO_SUCH_ORDER: -2013, |
@@ -52,3 +52,4 @@ "use strict"; | ||
base: 'wss://stream.binance.com:9443/ws', | ||
futures: 'wss://fstream.binance.com/ws' | ||
futures: 'wss://fstream.binance.com/ws', | ||
delivery: 'wss://dstream.binance.com/ws' | ||
}; | ||
@@ -95,2 +96,21 @@ var wsOptions = {}; | ||
var deliveryDepthTransform = function deliveryDepthTransform(m) { | ||
return { | ||
eventType: m.e, | ||
eventTime: m.E, | ||
transactionTime: m.T, | ||
symbol: m.s, | ||
pair: m.ps, | ||
firstUpdateId: m.U, | ||
finalUpdateId: m.u, | ||
prevFinalUpdateId: m.pu, | ||
bidDepth: m.b.map(function (b) { | ||
return (0, _lodash.default)(['price', 'quantity'], b); | ||
}), | ||
askDepth: m.a.map(function (a) { | ||
return (0, _lodash.default)(['price', 'quantity'], a); | ||
}) | ||
}; | ||
}; | ||
var depth = function depth(payload, cb) { | ||
@@ -105,3 +125,3 @@ var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(symbolName, "@depth").concat(updateSpeed ? "@".concat(updateSpeed) : '')); | ||
var w = openWebSocket("".concat(variator ? endpoints[variator] : endpoints.base, "/").concat(symbolName, "@depth").concat(updateSpeed ? "@".concat(updateSpeed) : '')); | ||
@@ -111,3 +131,3 @@ w.onmessage = function (msg) { | ||
cb(transform ? variator === 'futures' ? futuresDepthTransform(obj) : depthTransform(obj) : obj); | ||
cb(transform ? variator === 'futures' ? futuresDepthTransform(obj) : variator === 'delivery' ? deliveryDepthTransform(obj) : depthTransform(obj) : obj); | ||
}; | ||
@@ -159,2 +179,22 @@ | ||
var deliveryPartDepthTransform = function deliveryPartDepthTransform(level, m) { | ||
return { | ||
level: level, | ||
eventType: m.e, | ||
eventTime: m.E, | ||
transactionTime: m.T, | ||
symbol: m.s, | ||
pair: m.ps, | ||
firstUpdateId: m.U, | ||
finalUpdateId: m.u, | ||
prevFinalUpdateId: m.pu, | ||
bidDepth: m.b.map(function (b) { | ||
return (0, _lodash.default)(['price', 'quantity'], b); | ||
}), | ||
askDepth: m.a.map(function (a) { | ||
return (0, _lodash.default)(['price', 'quantity'], a); | ||
}) | ||
}; | ||
}; | ||
var partialDepth = function partialDepth(payload, cb) { | ||
@@ -172,3 +212,3 @@ var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(symbolName, "@depth").concat(level).concat(updateSpeed ? "@".concat(updateSpeed) : '')); | ||
var w = openWebSocket("".concat(variator ? endpoints[variator] : endpoints.base, "/").concat(symbolName, "@depth").concat(level).concat(updateSpeed ? "@".concat(updateSpeed) : '')); | ||
@@ -178,3 +218,3 @@ w.onmessage = function (msg) { | ||
cb(transform ? variator === 'futures' ? futuresPartDepthTransform(level, obj) : partialDepthTransform(symbol, level, obj) : obj); | ||
cb(transform ? variator === 'futures' ? futuresPartDepthTransform(level, obj) : variator === 'delivery' ? deliveryPartDepthTransform(level, obj) : partialDepthTransform(symbol, level, obj) : obj); | ||
}; | ||
@@ -193,2 +233,42 @@ | ||
var candleTransform = function candleTransform(m) { | ||
return { | ||
startTime: m.t, | ||
closeTime: m.T, | ||
firstTradeId: m.f, | ||
lastTradeId: m.L, | ||
open: m.o, | ||
high: m.h, | ||
low: m.l, | ||
close: m.c, | ||
volume: m.v, | ||
trades: m.n, | ||
interval: m.i, | ||
isFinal: m.x, | ||
quoteVolume: m.q, | ||
buyVolume: m.V, | ||
quoteBuyVolume: m.Q | ||
}; | ||
}; | ||
var deliveryCandleTransform = function deliveryCandleTransform(m) { | ||
return { | ||
startTime: m.t, | ||
closeTime: m.T, | ||
firstTradeId: m.f, | ||
lastTradeId: m.L, | ||
open: m.o, | ||
high: m.h, | ||
low: m.l, | ||
close: m.c, | ||
volume: m.v, | ||
trades: m.n, | ||
interval: m.i, | ||
isFinal: m.x, | ||
baseVolume: m.q, | ||
buyVolume: m.V, | ||
baseBuyVolume: m.Q | ||
}; | ||
}; | ||
var candles = function candles(payload, interval, cb) { | ||
@@ -203,3 +283,3 @@ var transform = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(symbol.toLowerCase(), "@kline_").concat(interval)); | ||
var w = openWebSocket("".concat(variator ? endpoints[variator] : endpoints.base, "/").concat(symbol.toLowerCase(), "@kline_").concat(interval)); | ||
@@ -213,37 +293,7 @@ w.onmessage = function (msg) { | ||
tick = obj.k; | ||
var startTime = tick.t, | ||
closeTime = tick.T, | ||
firstTradeId = tick.f, | ||
lastTradeId = tick.L, | ||
open = tick.o, | ||
high = tick.h, | ||
low = tick.l, | ||
close = tick.c, | ||
volume = tick.v, | ||
trades = tick.n, | ||
interval = tick.i, | ||
isFinal = tick.x, | ||
quoteVolume = tick.q, | ||
buyVolume = tick.V, | ||
quoteBuyVolume = tick.Q; | ||
cb(transform ? { | ||
cb(transform ? _objectSpread({ | ||
eventType: eventType, | ||
eventTime: eventTime, | ||
symbol: symbol, | ||
startTime: startTime, | ||
closeTime: closeTime, | ||
firstTradeId: firstTradeId, | ||
lastTradeId: lastTradeId, | ||
open: open, | ||
high: high, | ||
low: low, | ||
close: close, | ||
volume: volume, | ||
trades: trades, | ||
interval: interval, | ||
isFinal: isFinal, | ||
quoteVolume: quoteVolume, | ||
buyVolume: buyVolume, | ||
quoteBuyVolume: quoteBuyVolume | ||
} : obj); | ||
symbol: symbol | ||
}, variator === 'delivery' ? deliveryCandleTransform(tick) : candleTransform(tick)) : obj); | ||
}; | ||
@@ -287,2 +337,17 @@ | ||
var deliveryMiniTickerTransform = function deliveryMiniTickerTransform(m) { | ||
return { | ||
eventType: m.e, | ||
eventTime: m.E, | ||
symbol: m.s, | ||
pair: m.ps, | ||
curDayClose: m.c, | ||
open: m.o, | ||
high: m.h, | ||
low: m.l, | ||
volume: m.v, | ||
volumeBase: m.q | ||
}; | ||
}; | ||
var tickerTransform = function tickerTransform(m) { | ||
@@ -339,2 +404,26 @@ return { | ||
var deliveryTickerTransform = function deliveryTickerTransform(m) { | ||
return { | ||
eventType: m.e, | ||
eventTime: m.E, | ||
symbol: m.s, | ||
pair: m.ps, | ||
priceChange: m.p, | ||
priceChangePercent: m.P, | ||
weightedAvg: m.w, | ||
curDayClose: m.c, | ||
closeTradeQuantity: m.Q, | ||
open: m.o, | ||
high: m.h, | ||
low: m.l, | ||
volume: m.v, | ||
volumeBase: m.q, | ||
openTime: m.O, | ||
closeTime: m.C, | ||
firstTradeId: m.F, | ||
lastTradeId: m.L, | ||
totalTrades: m.n | ||
}; | ||
}; | ||
var bookTicker = function bookTicker(payload, cb) { | ||
@@ -366,3 +455,3 @@ var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(symbol.toLowerCase(), "@ticker")); | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : variator === 'delivery' ? endpoints.delivery : endpoints.base, "/").concat(symbol.toLowerCase(), "@ticker")); | ||
@@ -372,3 +461,3 @@ w.onmessage = function (msg) { | ||
cb(transform ? variator === 'futures' ? futuresTickerTransform(obj) : tickerTransform(obj) : obj); | ||
cb(transform ? variator === 'futures' ? futuresTickerTransform(obj) : variator === 'delivery' ? deliveryTickerTransform(obj) : tickerTransform(obj) : obj); | ||
}; | ||
@@ -390,3 +479,3 @@ | ||
var variator = arguments.length > 2 ? arguments[2] : undefined; | ||
var w = new openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/!ticker@arr")); | ||
var w = new openWebSocket("".concat(variator === 'futures' ? endpoints.futures : variator === 'delivery' ? endpoints.delivery : endpoints.base, "/!ticker@arr")); | ||
@@ -398,2 +487,4 @@ w.onmessage = function (msg) { | ||
return futuresTickerTransform(m); | ||
}) : variator === 'delivery' ? arr.map(function (m) { | ||
return deliveryTickerTransform(m); | ||
}) : arr.map(function (m) { | ||
@@ -413,2 +504,3 @@ return tickerTransform(m); | ||
var transform = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | ||
var variator = arguments.length > 3 ? arguments[3] : undefined; | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
@@ -420,3 +512,3 @@ var w = openWebSocket("".concat(endpoints.base, "/").concat(symbol.toLowerCase(), "@miniTicker")); | ||
cb(transform ? miniTickerTransform(obj) : obj); | ||
cb(transform ? variator === 'delivery' ? deliveryMiniTickerTransform(obj) : miniTickerTransform(obj) : obj); | ||
}; | ||
@@ -437,2 +529,3 @@ | ||
var transform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; | ||
var variator = arguments.length > 2 ? arguments[2] : undefined; | ||
var w = openWebSocket("".concat(endpoints.base, "/!miniTicker@arr")); | ||
@@ -443,5 +536,3 @@ | ||
cb(transform ? arr.map(function (m) { | ||
return miniTickerTransform(m); | ||
}) : arr); | ||
cb(transform ? arr.map(variator === 'delivery' ? deliveryMiniTickerTransform : miniTickerTransform) : arr); | ||
}; | ||
@@ -460,3 +551,3 @@ | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (sub) { | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(sub)); | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : variator === 'delivery' ? endpoints.delivery : endpoints.base, "/").concat(sub)); | ||
@@ -515,3 +606,3 @@ w.onmessage = function (msg) { | ||
var cache = (Array.isArray(payload) ? payload : [payload]).map(function (symbol) { | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(symbol.toLowerCase(), "@aggTrade")); | ||
var w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : variator === 'delivery' ? endpoints.delivery : endpoints.base, "/").concat(symbol.toLowerCase(), "@aggTrade")); | ||
@@ -521,3 +612,3 @@ w.onmessage = function (msg) { | ||
cb(transform ? variator === 'futures' ? futuresAggTradesTransform(obj) : aggTradesTransform(obj) : obj); | ||
cb(transform ? variator === 'futures' || variator === 'delivery' ? futuresAggTradesTransform(obj) : aggTradesTransform(obj) : obj); | ||
}; | ||
@@ -856,3 +947,3 @@ | ||
cb(variator === 'futures' ? transform && futuresUserTransforms[type] ? futuresUserTransforms[type](rest) : _objectSpread({ | ||
cb(variator === 'futures' || variator === 'delivery' ? transform && futuresUserTransforms[type] ? futuresUserTransforms[type](rest) : _objectSpread({ | ||
type: type | ||
@@ -977,3 +1068,3 @@ }, rest) : transform && userTransforms[type] ? userTransforms[type](rest) : _objectSpread({ | ||
w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : endpoints.base, "/").concat(listenKey)); | ||
w = openWebSocket("".concat(variator === 'futures' ? endpoints.futures : variator === 'delivery' ? endpoints.delivery : endpoints.base, "/").concat(listenKey)); | ||
@@ -1089,23 +1180,45 @@ w.onmessage = function (msg) { | ||
}, | ||
deliveryDepth: function deliveryDepth(payload, cb, transform) { | ||
return depth(payload, cb, transform, 'delivery'); | ||
}, | ||
futuresPartialDepth: function futuresPartialDepth(payload, cb, transform) { | ||
return partialDepth(payload, cb, transform, 'futures'); | ||
}, | ||
deliveryPartialDepth: function deliveryPartialDepth(payload, cb, transform) { | ||
return partialDepth(payload, cb, transform, 'delivery'); | ||
}, | ||
futuresCandles: function futuresCandles(payload, interval, cb, transform) { | ||
return candles(payload, interval, cb, transform, 'futures'); | ||
}, | ||
deliveryCandles: function deliveryCandles(payload, interval, cb, transform) { | ||
return candles(payload, interval, cb, transform, 'delivery'); | ||
}, | ||
futuresTicker: function futuresTicker(payload, cb, transform) { | ||
return ticker(payload, cb, transform, 'futures'); | ||
}, | ||
deliveryTicker: function deliveryTicker(payload, cb, transform) { | ||
return ticker(payload, cb, transform, 'delivery'); | ||
}, | ||
futuresAllTickers: function futuresAllTickers(cb, transform) { | ||
return allTickers(cb, transform, 'futures'); | ||
}, | ||
deliveryAllTickers: function deliveryAllTickers(cb, transform) { | ||
return allTickers(cb, transform, 'delivery'); | ||
}, | ||
futuresAggTrades: function futuresAggTrades(payload, cb, transform) { | ||
return aggTrades(payload, cb, transform, 'futures'); | ||
}, | ||
deliveryAggTrades: function deliveryAggTrades(payload, cb, transform) { | ||
return aggTrades(payload, cb, transform, 'delivery'); | ||
}, | ||
futuresLiquidations: futuresLiquidations, | ||
futuresAllLiquidations: futuresAllLiquidations, | ||
futuresUser: user(opts, 'futures'), | ||
deliveryUser: user(opts, 'delivery'), | ||
futuresCustomSubStream: function futuresCustomSubStream(payload, cb) { | ||
return customSubStream(payload, cb, 'futures'); | ||
}, | ||
deliveryCustomSubStream: function deliveryCustomSubStream(payload, cb) { | ||
return customSubStream(payload, cb, 'delivery'); | ||
}, | ||
futuresAllMarkPrices: function futuresAllMarkPrices(payload, cb) { | ||
@@ -1112,0 +1225,0 @@ return _futuresAllMarkPrices(payload, cb); |
{ | ||
"name": "binance-api-node", | ||
"version": "0.11.47", | ||
"version": "0.12.0", | ||
"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
275112
4080
5351