binance-api-node
Advanced tools
Comparing version 0.11.30 to 0.11.31
@@ -285,3 +285,3 @@ "use strict"; | ||
var _orderOco2 = function orderOco(privCall) { | ||
var _orderOco = function orderOco(privCall) { | ||
var payload = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
@@ -421,3 +421,3 @@ var url = arguments.length > 2 ? arguments[2] : undefined; | ||
orderOco: function orderOco(payload) { | ||
return _orderOco2(privCall, payload, '/api/v3/order/oco'); | ||
return _orderOco(privCall, payload, '/api/v3/order/oco'); | ||
}, | ||
@@ -424,0 +424,0 @@ orderTest: function orderTest(payload) { |
@@ -748,2 +748,16 @@ "use strict"; | ||
}; | ||
}, | ||
// https://binance-docs.github.io/apidocs/futures/en/#event-account-configuration-update-previous-leverage-update | ||
ACCOUNT_CONFIG_UPDATE: function ACCOUNT_CONFIG_UPDATE(m) { | ||
return _objectSpread({ | ||
eventType: 'ACCOUNT_CONFIG_UPDATE', | ||
eventTime: m.E, | ||
transactionTime: m.T, | ||
type: m.ac ? 'ACCOUNT_CONFIG' : 'MULTI_ASSETS' | ||
}, m.ac ? { | ||
symbol: m.ac.s, | ||
leverage: m.ac.l | ||
} : { | ||
multiAssets: m.ai.j | ||
}); | ||
} | ||
@@ -750,0 +764,0 @@ }; |
416
index.d.ts
// tslint:disable:interface-name | ||
declare module 'binance-api-node' { | ||
export default function (options?: { | ||
export default function(options?: { | ||
apiKey?: string | ||
@@ -10,11 +10,47 @@ apiSecret?: string | ||
wsBase?: string | ||
wsFutures?: string, | ||
wsFutures?: string | ||
proxy?: string | ||
}): Binance | ||
export type ErrorCodes_LT = -1000 | -1001 | -1002 | -1003 | -1006 | -1007 | -1013 | -1014 | ||
| -1015 | -1016 | -1020 | -1021 | -1022 | -1100 | -1101 | -1102 | ||
| -1103 | -1104 | -1105 | -1106 | -1112 | -1114 | -1115 | -1116 | ||
| -1117 | -1118 | -1119 | -1120 | -1121 | -1125 | -1127 | -1128 | ||
| -1130 | -2008 | -2009 | -2010 | -2012 | -2013 | -2014 | -2015 | ||
export type ErrorCodes_LT = | ||
| -1000 | ||
| -1001 | ||
| -1002 | ||
| -1003 | ||
| -1006 | ||
| -1007 | ||
| -1013 | ||
| -1014 | ||
| -1015 | ||
| -1016 | ||
| -1020 | ||
| -1021 | ||
| -1022 | ||
| -1100 | ||
| -1101 | ||
| -1102 | ||
| -1103 | ||
| -1104 | ||
| -1105 | ||
| -1106 | ||
| -1112 | ||
| -1114 | ||
| -1115 | ||
| -1116 | ||
| -1117 | ||
| -1118 | ||
| -1119 | ||
| -1120 | ||
| -1121 | ||
| -1125 | ||
| -1127 | ||
| -1128 | ||
| -1130 | ||
| -2008 | ||
| -2009 | ||
| -2010 | ||
| -2012 | ||
| -2013 | ||
| -2014 | ||
| -2015 | ||
@@ -125,5 +161,5 @@ export const enum ErrorCodes { | ||
asset: string | ||
free: string // available balance | ||
locked: string // locked asset | ||
freeze: string // freeze asset | ||
free: string // available balance | ||
locked: string // locked asset | ||
freeze: string // freeze asset | ||
withdrawing: string | ||
@@ -205,4 +241,4 @@ btcValuation: string | ||
export interface BNBBurn { | ||
spotBNBBurn: boolean; | ||
interestBNBBurn: boolean; | ||
spotBNBBurn: boolean | ||
interestBNBBurn: boolean | ||
} | ||
@@ -234,16 +270,26 @@ | ||
export type GetOrderOptions = | ||
| { symbol: string; orderId: number, useServerTime?: boolean } | ||
| { symbol: string; origClientOrderId: string, useServerTime?: boolean } | ||
| { symbol: string; orderId: number; useServerTime?: boolean } | ||
| { symbol: string; origClientOrderId: string; useServerTime?: boolean } | ||
export type CancelOrderOptions = | ||
| { symbol: string; orderId: number, useServerTime?: boolean, newClientOrderId?: string } | ||
| { symbol: string; origClientOrderId: string, useServerTime?: boolean, newClientOrderId?: string } | ||
| { symbol: string; orderId: number; useServerTime?: boolean; newClientOrderId?: string } | ||
| { | ||
symbol: string | ||
origClientOrderId: string | ||
useServerTime?: boolean | ||
newClientOrderId?: string | ||
} | ||
export type GetOrderOcoOptions = | ||
| { symbol: string, orderListId: number, useServerTime?: boolean } | ||
| { symbol: string, listClientOrderId: string, useServerTime?: boolean } | ||
| { symbol: string; orderListId: number; useServerTime?: boolean } | ||
| { symbol: string; listClientOrderId: string; useServerTime?: boolean } | ||
export type CancelOrderOcoOptions = | ||
| { symbol: string, orderListId: number, useServerTime?: boolean, newClientOrderId?: string } | ||
| { symbol: string, listClientOrderId: string, useServerTime?: boolean, newClientOrderId?: string } | ||
| { symbol: string; orderListId: number; useServerTime?: boolean; newClientOrderId?: string } | ||
| { | ||
symbol: string | ||
listClientOrderId: string | ||
useServerTime?: boolean | ||
newClientOrderId?: string | ||
} | ||
@@ -269,8 +315,20 @@ export type cancelOpenOrdersOptions = { | ||
export type TransferType_LT = 'MAIN_C2C' | 'MAIN_UMFUTURE' | 'MAIN_CMFUTURE' | ||
| 'MAIN_MARGIN' | 'MAIN_MINING' | 'C2C_MAIN' | ||
| 'C2C_UMFUTURE' | 'C2C_MINING' | 'UMFUTURE_MAIN' | ||
| 'UMFUTURE_C2C' | 'UMFUTURE_MARGIN' | 'CMFUTURE_MAIN' | ||
| 'MARGIN_MAIN' | 'MARGIN_UMFUTURE' | 'MINING_MAIN' | ||
| 'MINING_UMFUTURE' | 'MINING_C2C' | ||
export type TransferType_LT = | ||
| 'MAIN_C2C' | ||
| 'MAIN_UMFUTURE' | ||
| 'MAIN_CMFUTURE' | ||
| 'MAIN_MARGIN' | ||
| 'MAIN_MINING' | ||
| 'C2C_MAIN' | ||
| 'C2C_UMFUTURE' | ||
| 'C2C_MINING' | ||
| 'UMFUTURE_MAIN' | ||
| 'UMFUTURE_C2C' | ||
| 'UMFUTURE_MARGIN' | ||
| 'CMFUTURE_MAIN' | ||
| 'MARGIN_MAIN' | ||
| 'MARGIN_UMFUTURE' | ||
| 'MINING_MAIN' | ||
| 'MINING_UMFUTURE' | ||
| 'MINING_C2C' | ||
@@ -351,13 +409,13 @@ export const enum TransferType { | ||
export interface ApiPermission { | ||
ipRestrict: boolean, | ||
createTime: number, | ||
enableWithdrawals: boolean, | ||
enableInternalTransfer: boolean, | ||
permitsUniversalTransfer: boolean, | ||
enableVanillaOptions: boolean, | ||
enableReading: boolean, | ||
enableFutures: boolean, | ||
enableMargin: boolean, | ||
enableSpotAndMarginTrading: boolean, | ||
tradingAuthorityExpirationTime: number, | ||
ipRestrict: boolean | ||
createTime: number | ||
enableWithdrawals: boolean | ||
enableInternalTransfer: boolean | ||
permitsUniversalTransfer: boolean | ||
enableVanillaOptions: boolean | ||
enableReading: boolean | ||
enableFutures: boolean | ||
enableMargin: boolean | ||
enableSpotAndMarginTrading: boolean | ||
tradingAuthorityExpirationTime: number | ||
} | ||
@@ -380,4 +438,8 @@ | ||
lendingAccount(options?: { useServerTime: boolean }): Promise<LendingAccount> | ||
fundingWallet(options?: { asset?: string, needBtcValuation?: booleanString, useServerTime?: boolean }): Promise<FundingWallet[]> | ||
apiPermission(options?: {recvWindow?: number}): Promise<ApiPermission> | ||
fundingWallet(options?: { | ||
asset?: string | ||
needBtcValuation?: booleanString | ||
useServerTime?: boolean | ||
}): Promise<FundingWallet[]> | ||
apiPermission(options?: { recvWindow?: number }): Promise<ApiPermission> | ||
order(options: NewOrderSpot): Promise<Order> | ||
@@ -403,11 +465,15 @@ orderTest(options: NewOrderSpot): Promise<Order> | ||
cancelOpenOrders(options: cancelOpenOrdersOptions): Promise<CancelOrderResult[]> | ||
openOrders(options: { symbol?: string; recvWindow?: number; useServerTime?: boolean }): Promise<QueryOrderResult[]> | ||
openOrders(options: { | ||
symbol?: string | ||
recvWindow?: number | ||
useServerTime?: boolean | ||
}): Promise<QueryOrderResult[]> | ||
allOrders(options: { | ||
symbol?: string; | ||
orderId?: number; | ||
startTime?: number; | ||
endTime?: number; | ||
limit?: number; | ||
recvWindow?: number; | ||
timestamp?: number; | ||
symbol?: string | ||
orderId?: number | ||
startTime?: number | ||
endTime?: number | ||
limit?: number | ||
recvWindow?: number | ||
timestamp?: number | ||
useServerTime?: boolean | ||
@@ -614,8 +680,4 @@ }): Promise<QueryOrderResult[]> | ||
}): Promise<MyTrade[]> | ||
disableMarginAccount(options: { | ||
symbol: string, | ||
}): Promise<{ success: boolean, symbol: string }> | ||
enableMarginAccount(options: { | ||
symbol: string, | ||
}): Promise<{ success: boolean, symbol: string }> | ||
disableMarginAccount(options: { symbol: string }): Promise<{ success: boolean; symbol: string }> | ||
enableMarginAccount(options: { symbol: string }): Promise<{ success: boolean; symbol: string }> | ||
} | ||
@@ -633,2 +695,3 @@ | ||
| OutboundAccountPosition | ||
| MarginCall | ||
@@ -672,5 +735,3 @@ export interface WebSocket { | ||
) => ReconnectingWebSocketHandler | ||
allMiniTickers: ( | ||
callback: (ticker: MiniTicker[]) => void, | ||
) => ReconnectingWebSocketHandler | ||
allMiniTickers: (callback: (ticker: MiniTicker[]) => void) => ReconnectingWebSocketHandler | ||
futuresTicker: ( | ||
@@ -717,3 +778,11 @@ pair: string | string[], | ||
futuresUser: ( | ||
callback: (msg: OutboundAccountInfo | ExecutionReport | AccountUpdate | OrderUpdate) => void, | ||
callback: ( | ||
msg: | ||
| OutboundAccountInfo | ||
| ExecutionReport | ||
| AccountUpdate | ||
| OrderUpdate | ||
| AccountConfigUpdate | ||
| MarginCall, | ||
) => void, | ||
) => Promise<ReconnectingWebSocketHandler> | ||
@@ -730,4 +799,18 @@ } | ||
export type CandleChartInterval_LT = '1m' | '3m' | '5m' | '15m' | '30m' | '1h' | '2h' | '4h' | ||
| '6h' | '8h' | '12h' | '1d' | '3d' | '1w' | '1M' | ||
export type CandleChartInterval_LT = | ||
| '1m' | ||
| '3m' | ||
| '5m' | ||
| '15m' | ||
| '30m' | ||
| '1h' | ||
| '2h' | ||
| '4h' | ||
| '6h' | ||
| '8h' | ||
| '12h' | ||
| '1d' | ||
| '3d' | ||
| '1w' | ||
| '1M' | ||
@@ -793,4 +876,9 @@ export const enum CandleChartInterval { | ||
export type SymbolFilterType_LT = 'PRICE_FILTER' | 'PERCENT_PRICE' | 'LOT_SIZE' | ||
| 'MIN_NOTIONAL' | 'MAX_NUM_ORDERS' | 'MAX_ALGO_ORDERS' | ||
export type SymbolFilterType_LT = | ||
| 'PRICE_FILTER' | ||
| 'PERCENT_PRICE' | ||
| 'LOT_SIZE' | ||
| 'MIN_NOTIONAL' | ||
| 'MAX_NUM_ORDERS' | ||
| 'MAX_ALGO_ORDERS' | ||
@@ -801,2 +889,3 @@ export const enum SymbolFilterType { | ||
LOT_SIZE = 'LOT_SIZE', | ||
MARKET_LOT_SIZE = 'MARKET_LOT_SIZE', | ||
MIN_NOTIONAL = 'MIN_NOTIONAL', | ||
@@ -818,3 +907,3 @@ MAX_NUM_ORDERS = 'MAX_NUM_ORDERS', | ||
multiplierUp: string | ||
avgPriceMins: number | ||
multiplierDecimal: number | ||
} | ||
@@ -829,7 +918,12 @@ | ||
export interface SymbolMarketLotSizeFilter { | ||
filterType: SymbolFilterType.MARKET_LOT_SIZE | ||
minQty: string | ||
maxQty: string | ||
stepSize: string | ||
} | ||
export interface SymbolMinNotionalFilter { | ||
filterType: SymbolFilterType.MIN_NOTIONAL | ||
applyToMarket: boolean | ||
avgPriceMins: number | ||
minNotional: string | ||
notional: string | ||
} | ||
@@ -851,2 +945,3 @@ | ||
| SymbolLotSizeFilter | ||
| SymbolMarketLotSizeFilter | ||
| SymbolMinNotionalFilter | ||
@@ -936,3 +1031,3 @@ | SymbolMaxNumOrdersFilter | ||
timeInForce?: TimeInForce_LT | ||
useServerTime?: boolean; | ||
useServerTime?: boolean | ||
} | ||
@@ -1083,4 +1178,10 @@ | ||
export type OrderStatus_LT = 'CANCELED' | 'EXPIRED' | 'FILLED' | 'NEW' | 'PARTIALLY_FILLED' | 'PENDING_CANCEL' | ||
| 'REJECTED' | ||
export type OrderStatus_LT = | ||
| 'CANCELED' | ||
| 'EXPIRED' | ||
| 'FILLED' | ||
| 'NEW' | ||
| 'PARTIALLY_FILLED' | ||
| 'PENDING_CANCEL' | ||
| 'REJECTED' | ||
@@ -1097,4 +1198,12 @@ export const enum OrderStatus { | ||
export type OrderType_LT = 'LIMIT' | 'LIMIT_MAKER' | 'MARKET' | 'STOP' | 'STOP_MARKET' | 'STOP_LOSS_LIMIT' | ||
| 'TAKE_PROFIT_LIMIT' | 'TAKE_PROFIT_MARKET' | 'TRAILING_STOP_MARKET' | ||
export type OrderType_LT = | ||
| 'LIMIT' | ||
| 'LIMIT_MAKER' | ||
| 'MARKET' | ||
| 'STOP' | ||
| 'STOP_MARKET' | ||
| 'STOP_LOSS_LIMIT' | ||
| 'TAKE_PROFIT_LIMIT' | ||
| 'TAKE_PROFIT_MARKET' | ||
| 'TRAILING_STOP_MARKET' | ||
@@ -1129,6 +1238,14 @@ export const enum OrderType { | ||
export type OrderRejectReason_LT = 'ACCOUNT_CANNOT_SETTLE' | 'ACCOUNT_INACTIVE' | 'DUPLICATE_ORDER' | ||
| 'INSUFFICIENT_BALANCE' | 'MARKET_CLOSED' | 'NONE' | ||
| 'ORDER_WOULD_TRIGGER_IMMEDIATELY' | 'PRICE_QTY_EXCEED_HARD_LIMITS' | 'UNKNOWN_ACCOUNT' | ||
| 'UNKNOWN_INSTRUMENT' | 'UNKNOWN_ORDER' | ||
export type OrderRejectReason_LT = | ||
| 'ACCOUNT_CANNOT_SETTLE' | ||
| 'ACCOUNT_INACTIVE' | ||
| 'DUPLICATE_ORDER' | ||
| 'INSUFFICIENT_BALANCE' | ||
| 'MARKET_CLOSED' | ||
| 'NONE' | ||
| 'ORDER_WOULD_TRIGGER_IMMEDIATELY' | ||
| 'PRICE_QTY_EXCEED_HARD_LIMITS' | ||
| 'UNKNOWN_ACCOUNT' | ||
| 'UNKNOWN_INSTRUMENT' | ||
| 'UNKNOWN_ORDER' | ||
@@ -1149,4 +1266,3 @@ export const enum OrderRejectReason { | ||
export type ExecutionType_LT = 'NEW' | 'CANCELED' | 'REPLACED' | ||
| 'REJECTED' | 'TRADE' | 'EXPIRED' | ||
export type ExecutionType_LT = 'NEW' | 'CANCELED' | 'REPLACED' | 'REJECTED' | 'TRADE' | 'EXPIRED' | ||
@@ -1216,10 +1332,10 @@ export const enum ExecutionType { | ||
export interface MiniTicker { | ||
eventType: string, | ||
eventTime: number, | ||
symbol: string, | ||
curDayClose: string, | ||
open: string, | ||
high: string, | ||
low: string, | ||
volume: string, | ||
eventType: string | ||
eventTime: number | ||
symbol: string | ||
curDayClose: string | ||
open: string | ||
high: string | ||
low: string | ||
volume: string | ||
volumeQuote: string | ||
@@ -1273,4 +1389,10 @@ } | ||
export type EventType_LT = 'account' | 'balanceUpdate' | 'outboundAccountPosition' | ||
| 'executionReport' | 'ACCOUNT_UPDATE' | ||
export type EventType_LT = | ||
| 'account' | ||
| 'balanceUpdate' | ||
| 'outboundAccountPosition' | ||
| 'executionReport' | ||
| 'ACCOUNT_UPDATE' | ||
| 'MARGIN_CALL' | ||
| 'ACCOUNT_CONFIG_UPDATE' | ||
@@ -1284,4 +1406,24 @@ export const enum EventType { | ||
ORDER_TRADE_UPDATE = 'ORDER_TRADE_UPDATE', | ||
MARGIN_CALL = 'MARGIN_CALL', | ||
ACCOUNT_CONFIG_UPDATE = 'ACCOUNT_CONFIG_UPDATE', | ||
} | ||
export interface MarginCall { | ||
eventType: EventType.MARGIN_CALL | ||
eventTime: number | ||
crossWalletBalance: string | ||
positions: { | ||
symbol: string | ||
positionSide: PositionSide_LT | ||
positionAmount: string | ||
marginType: MarginType_LT | ||
isolatedWallet: string | ||
markPrice: string | ||
unrealizedPnL: string | ||
maintenanceMarginRequired: string | ||
}[] | ||
} | ||
export interface OutboundAccountInfo { | ||
@@ -1366,2 +1508,19 @@ balances: Balances | ||
export type EventReasonType = | ||
| 'DEPOSIT' | ||
| 'WITHDRAW' | ||
| 'ORDER' | ||
| 'FUNDING_FEE' | ||
| 'WITHDRAW_REJECT' | ||
| 'ADJUSTMENT' | ||
| 'INSURANCE_CLEAR' | ||
| 'ADMIN_DEPOSIT' | ||
| 'ADMIN_WITHDRAW' | ||
| 'MARGIN_TRANSFER' | ||
| 'MARGIN_TYPE_CHANGE' | ||
| 'ASSET_TRANSFER' | ||
| 'OPTIONS_PREMIUM_FEE' | ||
| 'OPTIONS_SETTLE_PROFIT' | ||
| 'AUTO_EXCHANGE' | ||
export interface AccountUpdate { | ||
@@ -1371,3 +1530,3 @@ eventTime: string | ||
transactionTime: number | ||
eventReasonType: string | ||
eventReasonType: EventReasonType | ||
balances: Balance[] | ||
@@ -1377,2 +1536,22 @@ positions: Position[] | ||
export interface AccountConfigUpdateBase { | ||
eventTime: string | ||
eventType: EventType.ACCOUNT_CONFIG_UPDATE | ||
transactionTime: number | ||
type: 'ACCOUNT_CONFIG' | 'MULTI_ASSETS' | ||
} | ||
export interface AccountConfigUpdateConfig extends AccountConfigUpdateBase { | ||
type: 'ACCOUNT_CONFIG' | ||
symbol: string | ||
leverage: number | ||
} | ||
export interface AccountConfigUpdateMultiAssets extends AccountConfigUpdateBase { | ||
type: 'MULTI_ASSETS' | ||
multiAssets: boolean | ||
} | ||
export type AccountConfigUpdate = AccountConfigUpdateConfig | AccountConfigUpdateMultiAssets | ||
export interface OrderUpdate { | ||
@@ -1583,3 +1762,3 @@ eventType: EventType.ORDER_TRADE_UPDATE | ||
export type IndexPriceCandlesOptions = Omit<CandlesOptions, "symbol"> & { pair: string }; | ||
export type IndexPriceCandlesOptions = Omit<CandlesOptions, 'symbol'> & { pair: string } | ||
@@ -1670,2 +1849,43 @@ export interface CandleChartResult { | ||
export type FuturesAssetType = | ||
| 'DOT' | ||
| 'BTC' | ||
| 'SOL' | ||
| 'BNB' | ||
| 'ETH' | ||
| 'ADA' | ||
| 'USDT' | ||
| 'XRP' | ||
| 'BUSD' | ||
export type FuturesAsset = { | ||
asset: FuturesAssetType | ||
walletBalance: string | ||
unrealizedProfit: string | ||
marginBalance: string | ||
maintMargin: string | ||
initialMargin: string | ||
positionInitialMargin: string | ||
openOrderInitialMargin: string | ||
maxWithdrawAmount: string | ||
crossWalletBalance: string | ||
crossUnPnl: string | ||
availableBalance: string | ||
marginAvailable: boolean | ||
updateTime: number | ||
} | ||
export interface FuturesAccountInfoResult { | ||
@@ -1688,3 +1908,3 @@ feeTier: number | ||
maxWithdrawAmount: string | ||
assets: { [key: string]: string }[] | ||
assets: FuturesAsset[] | ||
positions: FuturesAccountPosition[] | ||
@@ -1724,4 +1944,9 @@ } | ||
export type FuturesIncomeType_LT = 'TRANSFER' | 'WELCOME_BONUS' | 'REALIZED_PNL' | ||
| 'FUNDING_FEE' | 'COMMISSION' | 'INSURANCE_CLEAR' | ||
export type FuturesIncomeType_LT = | ||
| 'TRANSFER' | ||
| 'WELCOME_BONUS' | ||
| 'REALIZED_PNL' | ||
| 'FUNDING_FEE' | ||
| 'COMMISSION' | ||
| 'INSURANCE_CLEAR' | ||
@@ -1784,4 +2009,8 @@ export const enum FuturesIncomeType { | ||
export type MarginLevelStatus_LT = 'EXCESSIVE' | 'NORMAL' | 'MARGIN_CALL' | ||
| 'PRE_LIQUIDATION' | 'FORCE_LIQUIDATION' | ||
export type MarginLevelStatus_LT = | ||
| 'EXCESSIVE' | ||
| 'NORMAL' | ||
| 'MARGIN_CALL' | ||
| 'PRE_LIQUIDATION' | ||
| 'FORCE_LIQUIDATION' | ||
@@ -1919,2 +2148,1 @@ export const enum MarginLevelStatus { | ||
} | ||
{ | ||
"name": "binance-api-node", | ||
"version": "0.11.30", | ||
"version": "0.11.31", | ||
"description": "A node API wrapper for Binance", | ||
@@ -5,0 +5,0 @@ "main": "dist", |
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
224635
3602