binance-api-node
Advanced tools
Comparing version 0.11.3 to 0.11.4
@@ -323,4 +323,2 @@ "use strict"; | ||
var _default = function _default(opts) { | ||
var _ref5; | ||
var endpoints = { | ||
@@ -340,3 +338,3 @@ base: opts && opts.httpBase || BASE, | ||
})); | ||
return _ref5 = { | ||
return { | ||
getInfo: function getInfo() { | ||
@@ -472,140 +470,201 @@ return info; | ||
return privCall('/sapi/v1/asset/transfer', payload); | ||
}, | ||
dustTransfer: function dustTransfer(payload) { | ||
return privCall('/sapi/v1/asset/dust', payload, 'POST'); | ||
}, | ||
accountCoins: function accountCoins(payload) { | ||
return privCall('/sapi/v1/capital/config/getall', payload); | ||
}, | ||
getBnbBurn: function getBnbBurn(payload) { | ||
return privCall('/sapi/v1/bnbBurn', payload); | ||
}, | ||
setBnbBurn: function setBnbBurn(payload) { | ||
return privCall('/sapi/v1/bnbBurn', payload, 'POST'); | ||
}, | ||
capitalConfigs: function capitalConfigs() { | ||
return privCall('/sapi/v1/capital/config/getall'); | ||
}, | ||
getDataStream: function getDataStream() { | ||
return privCall('/api/v3/userDataStream', null, 'POST', true); | ||
}, | ||
keepDataStream: function keepDataStream(payload) { | ||
return privCall('/api/v3/userDataStream', payload, 'PUT', false, true); | ||
}, | ||
closeDataStream: function closeDataStream(payload) { | ||
return privCall('/api/v3/userDataStream', payload, 'DELETE', false, true); | ||
}, | ||
marginGetDataStream: function marginGetDataStream() { | ||
return privCall('/sapi/v1/userDataStream', null, 'POST', true); | ||
}, | ||
marginKeepDataStream: function marginKeepDataStream(payload) { | ||
return privCall('/sapi/v1/userDataStream', payload, 'PUT', false, true); | ||
}, | ||
marginCloseDataStream: function marginCloseDataStream(payload) { | ||
return privCall('/sapi/v1/userDataStream', payload, 'DELETE', false, true); | ||
}, | ||
futuresGetDataStream: function futuresGetDataStream() { | ||
return privCall('/fapi/v1/listenKey', null, 'POST', true); | ||
}, | ||
futuresKeepDataStream: function futuresKeepDataStream(payload) { | ||
return privCall('/fapi/v1/listenKey', payload, 'PUT', false, true); | ||
}, | ||
futuresCloseDataStream: function futuresCloseDataStream(payload) { | ||
return privCall('/fapi/v1/listenKey', payload, 'DELETE', false, true); | ||
}, | ||
marginAllOrders: function marginAllOrders(payload) { | ||
return privCall('/sapi/v1/margin/allOrders', payload); | ||
}, | ||
marginOrder: function marginOrder(payload) { | ||
return _order(privCall, payload, '/sapi/v1/margin/order'); | ||
}, | ||
marginGetOrder: function marginGetOrder(payload) { | ||
return privCall('/sapi/v1/margin/order', payload); | ||
}, | ||
marginCancelOrder: function marginCancelOrder(payload) { | ||
return privCall('/sapi/v1/margin/order', payload, 'DELETE'); | ||
}, | ||
marginOpenOrders: function marginOpenOrders(payload) { | ||
return privCall('/sapi/v1/margin/openOrders', payload); | ||
}, | ||
marginAccountInfo: function marginAccountInfo(payload) { | ||
return privCall('/sapi/v1/margin/account', payload); | ||
}, | ||
marginMyTrades: function marginMyTrades(payload) { | ||
return privCall('/sapi/v1/margin/myTrades', payload); | ||
}, | ||
marginRepay: function marginRepay(payload) { | ||
return privCall('/sapi/v1/margin/repay', payload, 'POST'); | ||
}, | ||
marginLoan: function marginLoan(payload) { | ||
return privCall('/sapi/v1/margin/loan', payload, 'POST'); | ||
}, | ||
marginIsolatedAccount: function marginIsolatedAccount(payload) { | ||
return privCall('/sapi/v1/margin/isolated/account', payload); | ||
}, | ||
marginMaxBorrow: function marginMaxBorrow(payload) { | ||
return privCall('/sapi/v1/margin/maxBorrowable', payload); | ||
}, | ||
marginCreateIsolated: function marginCreateIsolated(payload) { | ||
return privCall('/sapi/v1/margin/isolated/create', payload, 'POST'); | ||
}, | ||
marginIsolatedTransfer: function marginIsolatedTransfer(payload) { | ||
return privCall('/sapi/v1/margin/isolated/transfer', payload, 'POST'); | ||
}, | ||
marginIsolatedTransferHistory: function marginIsolatedTransferHistory(payload) { | ||
return privCall('/sapi/v1/margin/isolated/transfer', payload); | ||
}, | ||
futuresPing: function futuresPing() { | ||
return pubCall('/fapi/v1/ping').then(function () { | ||
return true; | ||
}); | ||
}, | ||
futuresTime: function futuresTime() { | ||
return pubCall('/fapi/v1/time').then(function (r) { | ||
return r.serverTime; | ||
}); | ||
}, | ||
futuresExchangeInfo: function futuresExchangeInfo() { | ||
return pubCall('/fapi/v1/exchangeInfo'); | ||
}, | ||
futuresBook: function futuresBook(payload) { | ||
return _book(pubCall, payload, '/fapi/v1/depth'); | ||
}, | ||
futuresAggTrades: function futuresAggTrades(payload) { | ||
return _aggTrades(pubCall, payload, '/fapi/v1/aggTrades'); | ||
}, | ||
futuresMarkPrice: function futuresMarkPrice(payload) { | ||
return pubCall('/fapi/v1/premiumIndex', payload); | ||
}, | ||
futuresAllForceOrders: function futuresAllForceOrders(payload) { | ||
return pubCall('/fapi/v1/allForceOrders', payload); | ||
}, | ||
futuresLongShortRatio: function futuresLongShortRatio(payload) { | ||
return pubCall('/futures/data/globalLongShortAccountRatio', payload); | ||
}, | ||
futuresCandles: function futuresCandles(payload) { | ||
return _candles(pubCall, payload, '/fapi/v1/klines'); | ||
}, | ||
futuresTrades: function futuresTrades(payload) { | ||
return checkParams('trades', payload, ['symbol']) && pubCall('/fapi/v1/trades', payload); | ||
}, | ||
futuresDailyStats: function futuresDailyStats(payload) { | ||
return pubCall('/fapi/v1/ticker/24hr', payload); | ||
}, | ||
futuresPrices: function futuresPrices() { | ||
return pubCall('/fapi/v1/ticker/price').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur.price, out; | ||
}, {}); | ||
}); | ||
}, | ||
futuresAllBookTickers: function futuresAllBookTickers() { | ||
return pubCall('/fapi/v1/ticker/bookTicker').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur, out; | ||
}, {}); | ||
}); | ||
}, | ||
futuresFundingRate: function futuresFundingRate(payload) { | ||
return checkParams('fundingRate', payload, ['symbol']) && pubCall('/fapi/v1/fundingRate', payload); | ||
}, | ||
futuresOrder: function futuresOrder(payload) { | ||
return _order(privCall, payload, '/fapi/v1/order'); | ||
}, | ||
futuresBatchOrders: function futuresBatchOrders(payload) { | ||
return privCall(payload, '/fapi/v1/batchOrders'); | ||
}, | ||
futuresGetOrder: function futuresGetOrder(payload) { | ||
return privCall('/fapi/v1/order', payload); | ||
}, | ||
futuresCancelOrder: function futuresCancelOrder(payload) { | ||
return privCall('/fapi/v1/order', payload, 'DELETE'); | ||
}, | ||
futuresCancelAllOpenOrders: function futuresCancelAllOpenOrders(payload) { | ||
return privCall('/fapi/v1/allOpenOrders', payload, 'DELETE'); | ||
}, | ||
futuresOpenOrders: function futuresOpenOrders(payload) { | ||
return privCall('/fapi/v1/openOrders', payload); | ||
}, | ||
futuresAllOrders: function futuresAllOrders(payload) { | ||
return privCall('/fapi/v1/allOrders', payload); | ||
}, | ||
futuresPositionRisk: function futuresPositionRisk(payload) { | ||
return privCall('/fapi/v2/positionRisk', payload); | ||
}, | ||
futuresLeverageBracket: function futuresLeverageBracket(payload) { | ||
return privCall('/fapi/v1/leverageBracket', payload); | ||
}, | ||
futuresAccountBalance: function futuresAccountBalance(payload) { | ||
return privCall('/fapi/v2/balance', payload); | ||
}, | ||
futuresAccountInfo: function futuresAccountInfo(payload) { | ||
return privCall('/fapi/v2/account', payload); | ||
}, | ||
futuresUserTrades: function futuresUserTrades(payload) { | ||
return privCall('/fapi/v1/userTrades', payload); | ||
}, | ||
futuresPositionMode: function futuresPositionMode(payload) { | ||
return privCall('/fapi/v1/positionSide/dual', payload); | ||
}, | ||
futuresPositionModeChange: function futuresPositionModeChange(payload) { | ||
return privCall('/fapi/v1/positionSide/dual', payload, 'POST'); | ||
}, | ||
futuresLeverage: function futuresLeverage(payload) { | ||
return privCall('/fapi/v1/leverage', payload, 'POST'); | ||
}, | ||
futuresMarginType: function futuresMarginType(payload) { | ||
return privCall('/fapi/v1/marginType', payload, 'POST'); | ||
}, | ||
futuresPositionMargin: function futuresPositionMargin(payload) { | ||
return privCall('/fapi/v1/positionMargin', payload, 'POST'); | ||
}, | ||
futuresMarginHistory: function futuresMarginHistory(payload) { | ||
return privCall('/fapi/v1/positionMargin/history', payload); | ||
}, | ||
futuresIncome: function futuresIncome(payload) { | ||
return privCall('/fapi/v1/income', payload); | ||
} | ||
}, _defineProperty(_ref5, "assetDetail", function assetDetail(payload) { | ||
return privCall('/sapi/v1/asset/assetDetail', payload); | ||
}), _defineProperty(_ref5, "dustTransfer", function dustTransfer(payload) { | ||
return privCall('/sapi/v1/asset/dust', payload, 'POST'); | ||
}), _defineProperty(_ref5, "accountCoins", function accountCoins(payload) { | ||
return privCall('/sapi/v1/capital/config/getall', payload); | ||
}), _defineProperty(_ref5, "getBnbBurn", function getBnbBurn(payload) { | ||
return privCall('/sapi/v1/bnbBurn', payload); | ||
}), _defineProperty(_ref5, "setBnbBurn", function setBnbBurn(payload) { | ||
return privCall('/sapi/v1/bnbBurn', payload, 'POST'); | ||
}), _defineProperty(_ref5, "capitalConfigs", function capitalConfigs() { | ||
return privCall('/sapi/v1/capital/config/getall'); | ||
}), _defineProperty(_ref5, "getDataStream", function getDataStream() { | ||
return privCall('/api/v3/userDataStream', null, 'POST', true); | ||
}), _defineProperty(_ref5, "keepDataStream", function keepDataStream(payload) { | ||
return privCall('/api/v3/userDataStream', payload, 'PUT', false, true); | ||
}), _defineProperty(_ref5, "closeDataStream", function closeDataStream(payload) { | ||
return privCall('/api/v3/userDataStream', payload, 'DELETE', false, true); | ||
}), _defineProperty(_ref5, "marginGetDataStream", function marginGetDataStream() { | ||
return privCall('/sapi/v1/userDataStream', null, 'POST', true); | ||
}), _defineProperty(_ref5, "marginKeepDataStream", function marginKeepDataStream(payload) { | ||
return privCall('/sapi/v1/userDataStream', payload, 'PUT', false, true); | ||
}), _defineProperty(_ref5, "marginCloseDataStream", function marginCloseDataStream(payload) { | ||
return privCall('/sapi/v1/userDataStream', payload, 'DELETE', false, true); | ||
}), _defineProperty(_ref5, "futuresGetDataStream", function futuresGetDataStream() { | ||
return privCall('/fapi/v1/listenKey', null, 'POST', true); | ||
}), _defineProperty(_ref5, "futuresKeepDataStream", function futuresKeepDataStream(payload) { | ||
return privCall('/fapi/v1/listenKey', payload, 'PUT', false, true); | ||
}), _defineProperty(_ref5, "futuresCloseDataStream", function futuresCloseDataStream(payload) { | ||
return privCall('/fapi/v1/listenKey', payload, 'DELETE', false, true); | ||
}), _defineProperty(_ref5, "marginAllOrders", function marginAllOrders(payload) { | ||
return privCall('/sapi/v1/margin/allOrders', payload); | ||
}), _defineProperty(_ref5, "marginOrder", function marginOrder(payload) { | ||
return _order(privCall, payload, '/sapi/v1/margin/order'); | ||
}), _defineProperty(_ref5, "marginCancelOrder", function marginCancelOrder(payload) { | ||
return privCall('/sapi/v1/margin/order', payload, 'DELETE'); | ||
}), _defineProperty(_ref5, "marginOpenOrders", function marginOpenOrders(payload) { | ||
return privCall('/sapi/v1/margin/openOrders', payload); | ||
}), _defineProperty(_ref5, "marginAccountInfo", function marginAccountInfo(payload) { | ||
return privCall('/sapi/v1/margin/account', payload); | ||
}), _defineProperty(_ref5, "marginMyTrades", function marginMyTrades(payload) { | ||
return privCall('/sapi/v1/margin/myTrades', payload); | ||
}), _defineProperty(_ref5, "marginRepay", function marginRepay(payload) { | ||
return privCall('/sapi/v1/margin/repay', payload, 'POST'); | ||
}), _defineProperty(_ref5, "marginLoan", function marginLoan(payload) { | ||
return privCall('/sapi/v1/margin/loan', payload, 'POST'); | ||
}), _defineProperty(_ref5, "marginIsolatedAccount", function marginIsolatedAccount(payload) { | ||
return privCall('/sapi/v1/margin/isolated/account', payload); | ||
}), _defineProperty(_ref5, "marginMaxBorrow", function marginMaxBorrow(payload) { | ||
return privCall('/sapi/v1/margin/maxBorrowable', payload); | ||
}), _defineProperty(_ref5, "marginCreateIsolated", function marginCreateIsolated(payload) { | ||
return privCall('/sapi/v1/margin/isolated/create', payload, 'POST'); | ||
}), _defineProperty(_ref5, "marginIsolatedTransfer", function marginIsolatedTransfer(payload) { | ||
return privCall('/sapi/v1/margin/isolated/transfer', payload, 'POST'); | ||
}), _defineProperty(_ref5, "marginIsolatedTransferHistory", function marginIsolatedTransferHistory(payload) { | ||
return privCall('/sapi/v1/margin/isolated/transfer', payload); | ||
}), _defineProperty(_ref5, "futuresPing", function futuresPing() { | ||
return pubCall('/fapi/v1/ping').then(function () { | ||
return true; | ||
}); | ||
}), _defineProperty(_ref5, "futuresTime", function futuresTime() { | ||
return pubCall('/fapi/v1/time').then(function (r) { | ||
return r.serverTime; | ||
}); | ||
}), _defineProperty(_ref5, "futuresExchangeInfo", function futuresExchangeInfo() { | ||
return pubCall('/fapi/v1/exchangeInfo'); | ||
}), _defineProperty(_ref5, "futuresBook", function futuresBook(payload) { | ||
return _book(pubCall, payload, '/fapi/v1/depth'); | ||
}), _defineProperty(_ref5, "futuresAggTrades", function futuresAggTrades(payload) { | ||
return _aggTrades(pubCall, payload, '/fapi/v1/aggTrades'); | ||
}), _defineProperty(_ref5, "futuresMarkPrice", function futuresMarkPrice(payload) { | ||
return pubCall('/fapi/v1/premiumIndex', payload); | ||
}), _defineProperty(_ref5, "futuresAllForceOrders", function futuresAllForceOrders(payload) { | ||
return pubCall('/fapi/v1/allForceOrders', payload); | ||
}), _defineProperty(_ref5, "futuresLongShortRatio", function futuresLongShortRatio(payload) { | ||
return pubCall('/futures/data/globalLongShortAccountRatio', payload); | ||
}), _defineProperty(_ref5, "futuresCandles", function futuresCandles(payload) { | ||
return _candles(pubCall, payload, '/fapi/v1/klines'); | ||
}), _defineProperty(_ref5, "futuresTrades", function futuresTrades(payload) { | ||
return checkParams('trades', payload, ['symbol']) && pubCall('/fapi/v1/trades', payload); | ||
}), _defineProperty(_ref5, "futuresDailyStats", function futuresDailyStats(payload) { | ||
return pubCall('/fapi/v1/ticker/24hr', payload); | ||
}), _defineProperty(_ref5, "futuresPrices", function futuresPrices() { | ||
return pubCall('/fapi/v1/ticker/price').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur.price, out; | ||
}, {}); | ||
}); | ||
}), _defineProperty(_ref5, "futuresAllBookTickers", function futuresAllBookTickers() { | ||
return pubCall('/fapi/v1/ticker/bookTicker').then(function (r) { | ||
return (Array.isArray(r) ? r : [r]).reduce(function (out, cur) { | ||
return out[cur.symbol] = cur, out; | ||
}, {}); | ||
}); | ||
}), _defineProperty(_ref5, "futuresFundingRate", function futuresFundingRate(payload) { | ||
return checkParams('fundingRate', payload, ['symbol']) && pubCall('/fapi/v1/fundingRate', payload); | ||
}), _defineProperty(_ref5, "futuresOrder", function futuresOrder(payload) { | ||
return _order(privCall, payload, '/fapi/v1/order'); | ||
}), _defineProperty(_ref5, "futuresBatchOrders", function futuresBatchOrders(payload) { | ||
return privCall(payload, '/fapi/v1/batchOrders'); | ||
}), _defineProperty(_ref5, "futuresGetOrder", function futuresGetOrder(payload) { | ||
return privCall('/fapi/v1/order', payload); | ||
}), _defineProperty(_ref5, "futuresCancelOrder", function futuresCancelOrder(payload) { | ||
return privCall('/fapi/v1/order', payload, 'DELETE'); | ||
}), _defineProperty(_ref5, "futuresCancelAllOpenOrders", function futuresCancelAllOpenOrders(payload) { | ||
return privCall('/fapi/v1/allOpenOrders', payload, 'DELETE'); | ||
}), _defineProperty(_ref5, "futuresOpenOrders", function futuresOpenOrders(payload) { | ||
return privCall('/fapi/v1/openOrders', payload); | ||
}), _defineProperty(_ref5, "futuresAllOrders", function futuresAllOrders(payload) { | ||
return privCall('/fapi/v1/allOrders', payload); | ||
}), _defineProperty(_ref5, "futuresPositionRisk", function futuresPositionRisk(payload) { | ||
return privCall('/fapi/v2/positionRisk', payload); | ||
}), _defineProperty(_ref5, "futuresLeverageBracket", function futuresLeverageBracket(payload) { | ||
return privCall('/fapi/v1/leverageBracket', payload); | ||
}), _defineProperty(_ref5, "futuresAccountBalance", function futuresAccountBalance(payload) { | ||
return privCall('/fapi/v2/balance', payload); | ||
}), _defineProperty(_ref5, "futuresAccountInfo", function futuresAccountInfo(payload) { | ||
return privCall('/fapi/v2/account', payload); | ||
}), _defineProperty(_ref5, "futuresUserTrades", function futuresUserTrades(payload) { | ||
return privCall('/fapi/v1/userTrades', payload); | ||
}), _defineProperty(_ref5, "futuresPositionMode", function futuresPositionMode(payload) { | ||
return privCall('/fapi/v1/positionSide/dual', payload); | ||
}), _defineProperty(_ref5, "futuresPositionModeChange", function futuresPositionModeChange(payload) { | ||
return privCall('/fapi/v1/positionSide/dual', payload, 'POST'); | ||
}), _defineProperty(_ref5, "futuresLeverage", function futuresLeverage(payload) { | ||
return privCall('/fapi/v1/leverage', payload, 'POST'); | ||
}), _defineProperty(_ref5, "futuresMarginType", function futuresMarginType(payload) { | ||
return privCall('/fapi/v1/marginType', payload, 'POST'); | ||
}), _defineProperty(_ref5, "futuresPositionMargin", function futuresPositionMargin(payload) { | ||
return privCall('/fapi/v1/positionMargin', payload, 'POST'); | ||
}), _defineProperty(_ref5, "futuresMarginHistory", function futuresMarginHistory(payload) { | ||
return privCall('/fapi/v1/positionMargin/history', payload); | ||
}), _defineProperty(_ref5, "futuresIncome", function futuresIncome(payload) { | ||
return privCall('/fapi/v1/income', payload); | ||
}), _ref5; | ||
}; | ||
}; | ||
exports.default = _default; |
@@ -435,2 +435,9 @@ // tslint:disable:interface-name | ||
marginOrder(options: NewOrder): Promise<Order> | ||
marginGetOrder(options: { | ||
symbol: string | ||
isIsolated?: string | boolean | ||
orderId?: string | ||
origClientOrderId?: string | ||
recvWindow?: number | ||
}): Promise<Order> | ||
marginAllOrders(options: { | ||
@@ -480,3 +487,3 @@ symbol: string | ||
symbol: string | ||
isIsolated?: string | ||
isIsolated?: string | boolean | ||
startTime?: number | ||
@@ -734,3 +741,3 @@ endTime?: number | ||
newOrderRespType?: NewOrderRespType | ||
isIsolated?: boolean | ||
isIsolated?: string | boolean | ||
quoteOrderQty?: string | ||
@@ -789,3 +796,3 @@ sideEffectType?: SideEffectType | ||
timeInForce: TimeInForce | ||
transactTime: number | ||
transactTime?: number | ||
type: OrderType | ||
@@ -1321,4 +1328,5 @@ fills?: OrderFill[] | ||
export interface FuturesLeverageResult { | ||
code: number | ||
msg: string | ||
leverage: number; | ||
maxNotionalValue: number; | ||
symbol: string; | ||
} | ||
@@ -1325,0 +1333,0 @@ |
{ | ||
"name": "binance-api-node", | ||
"version": "0.11.3", | ||
"version": "0.11.4", | ||
"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
191903
2904
3781