import WebSocket from 'ws'; import { Interval, PositionRisk, Order, FuturesOrder, OrderType, Callback, IConstructorArgs, OrderSide, FundingRate, CancelOrder, AggregatedTrade, Trade, MyTrade, WithdrawHistoryResponse, DepositHistoryResponse, DepositAddress, WithdrawResponse, Candle, OrderBook, FuturesUserTrade, Account, FuturesAccountInfo, FuturesBalance, QueryOrder, HttpMethod, BookTicker, DailyStats, PremiumIndex, OpenInterest, IWebsocketsMethods, SymbolConfig, OCOOrder, FuturesAlgoOrder, CancelAlgoOrder } from './types.js'; export type * from './types.js'; export interface Dictionary { [key: string]: T; } export type Dict = Dictionary; export default class Binance { domain: string; base: string; baseTest: string; baseDemo: string; wapi: string; sapi: string; fapi: string; dapi: string; fapiTest: string; fapiDemo: string; dapiTest: string; dapiDemo: string; fstream: string; fstreamSingle: string; fstreamSingleTest: string; fstreamSingleDemo: string; fstreamTest: string; fstreamDemo: string; dstream: string; dstreamSingle: string; dstreamSingleTest: string; dstreamSingleDemo: string; dstreamTest: string; dstreamDemo: string; stream: string; streamTest: string; streamDemo: string; combineStream: string; combineStreamTest: string; combineStreamDemo: string; wsApi: string; wsApiTest: string; verbose: boolean; futuresListenKeyKeepAlive: number; spotListenKeyKeepAlive: number; heartBeatInterval: number; urlProxy: string; httpsProxy: string; socksProxy: string; nodeFetch: any; APIKEY: string; APISECRET: string; PRIVATEKEY: string; PRIVATEKEYPASSWORD: string; test: boolean; demo: boolean; timeOffset: number; userAgent: string; contentType: string; SPOT_PREFIX: string; CONTRACT_PREFIX: string; isAlive: boolean; socketHeartbeatInterval: any; reconnect: boolean; headers: Dict; subscriptions: Dict; futuresSubscriptions: Dict; wsApiConnections: Dict; wsApiPendingRequests: Dict; futuresInfo: Dict; futuresMeta: Dict; futuresTicks: Dict; futuresRealtime: Dict; futuresKlineQueue: Dict; deliverySubscriptions: Dict; deliveryInfo: Dict; deliveryMeta: Dict; deliveryTicks: Dict; deliveryRealtime: Dict; deliveryKlineQueue: Dict; depthCache: Dict; depthCacheContext: Dict; ohlcLatest: Dict; klineQueue: Dict; ohlc: Dict; info: Dict; websockets: IWebsocketsMethods; default_options: { recvWindow: number; useServerTime: boolean; reconnect: boolean; keepAlive: boolean; verbose: boolean; test: boolean; demo: boolean; hedgeMode: boolean; localAddress: boolean; family: number; log(...args: any[]): void; }; Options: any; constructor(userOptions?: Partial | string); options(opt?: {}): Binance; assignOptions(opt?: {}): void; setOptions(opt?: {}): Promise; extend: (...args: any[]) => any; getSpotUrl(): string; getSapiUrl(): string; getFapiUrl(): string; getDapiUrl(): string; getCombineStreamUrl(): string; getStreamUrl(): string; getWsApiUrl(): string; getDStreamSingleUrl(): string; /** * Classify a futures stream endpoint into public, market, or private category * per Binance USDⓈ-M Futures WebSocket URL split (2026-03-06) */ classifyFuturesStream(endpoint: string): 'public' | 'market' | 'private'; getFStreamSingleUrl(category?: 'public' | 'market' | 'private'): string; getFStreamUrl(category?: 'public' | 'market' | 'private'): string; getDStreamUrl(): string; uuid22(a?: any): any; getUrlProxy(): string; getHttpsProxy(): string; getSocksProxy(): string; /** * Replaces socks connection uri hostname with IP address * @param {string} connString - socks connection string * @return {string} modified string with ip address */ proxyReplacewithIp(connString: string): string; /** * Returns an array in the form of [host, port] * @param {string} connString - connection string * @return {array} array of host and port */ parseProxy(connString: string): string[]; /** * Checks to see of the object is iterable * @param {object} obj - The object check * @return {boolean} true or false is iterable */ isIterable(obj: any): boolean; addProxy(opt: any): any; reqHandler(response: any): Promise; proxyRequest(opt: any): Promise; reqObj(url: string, data?: Dict, method?: HttpMethod, key?: string): { url: string; qs: Dict; method: HttpMethod; family: any; localAddress: any; timeout: any; forever: any; headers: { 'User-Agent': string; 'Content-type': string; 'X-MBX-APIKEY': string; }; }; reqObjPOST(url: string, data: Dict, method: string, key: string): { url: string; form: Dict; method: string; family: any; localAddress: any; timeout: any; forever: any; qsStringifyOptions: { arrayFormat: string; }; headers: { 'User-Agent': string; 'Content-type': string; 'X-MBX-APIKEY': string; }; }; publicRequest(url: string, data?: Dict, method?: HttpMethod): Promise; /** * Used to make public requests to the futures (FAPI) API * @param path * @param data * @param method * @returns */ publicFuturesRequest(path: string, data?: Dict, method?: HttpMethod): Promise; /** * Used to make public requests to the delivery (DAPI) API * @param path * @param data * @param method * @returns */ publicDeliveryRequest(path: string, data?: Dict, method?: HttpMethod): Promise; /** * Used to make private requests to the futures (FAPI) API * @param path * @param data * @param method * @returns */ privateFuturesRequest(path: string, data?: Dict, method?: HttpMethod): Promise; /** * Used to make private requests to the delivery (DAPI) API * @param path * @param data * @param method * @returns */ privateDeliveryRequest(path: string, data?: Dict, method?: HttpMethod): Promise; /** * Used to make a request to the futures API, this is a generic function that can be used to make any request to the futures API * @param url * @param data * @param method * @param isPrivate * @returns */ futuresRequest(url: string, data?: Dict, method?: HttpMethod, isPrivate?: boolean): Promise; makeQueryString(q: any): string; /** * Create a http request to the public API * @param {string} url - The http endpoint * @param {object} data - The data to send * @param {function} callback - The callback method to call * @param {string} method - the http method * @return {undefined} */ apiRequest(url: string, data?: Dict, method?: HttpMethod): Promise; requireApiKey(source?: string, fatalError?: boolean): boolean; requireApiSecret(source?: string, fatalError?: boolean): boolean; /** * Create a public spot/margin request * @param {string} path - url path * @param {object} data - The data to send * @param {string} method - the http method * @param {boolean} noDataInSignature - Prevents data from being added to signature * @return {undefined} */ publicSpotRequest(path: string, data?: Dict, method?: HttpMethod): Promise; /** * Create a signed spot request * @param {string} path - url path * @param {object} data - The data to send * @param {string} method - the http method * @param {boolean} noDataInSignature - Prevents data from being added to signature * @return {undefined} */ privateSpotRequest(path: string, data?: Dict, method?: HttpMethod, noDataInSignature?: boolean): Promise; /** * Create a signed SAPI request */ privateSapiRequest(path: string, data?: Dict, method?: HttpMethod, noDataInSignature?: boolean): Promise; /** * Create a signed http request * @param {string} url - The http endpoint * @param {object} data - The data to send * @param {function} callback - The callback method to call * @param {string} method - the http method * @param {boolean} noDataInSignature - Prevents data from being added to signature * @return {undefined} */ signedRequest(url: string, data?: Dict, method?: HttpMethod, noDataInSignature?: boolean): Promise; generateSignature(query: string, encode?: boolean): string; /** * Create a signed spot order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {OrderType} type - LIMIT, MARKET, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT, LIMIT_MAKER, OCO * @param {OrderSide} side - BUY or SELL * @param {string} symbol - The symbol to buy or sell * @param {string} quantity - The quantity to buy or sell * @param {string} price - The price per unit to transact each unit at * @param {object} params - additional order settings * @param {number} [params.quoteOrderQty] - The quote order quantity, used for MARKET orders * @param {number} [params.stopPrice] - The stop price, used for STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT orders * @param {number} [params.trailingDelta] - Delta price * @return {undefined} */ order(type: OrderType, side: OrderSide, symbol: string, quantity: number, price?: number, params?: Dict): Promise; /** * Create an OCO spot order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {OrderSide} side - BUY or SELL * @param {string} symbol - The symbol to buy or sell * @param {string} quantity - The quantity to buy or sell * @param {string} price - The price per unit to transact each unit at * @param {object} params - additional order settings * @param {string} params.aboveType - The type of the above order * @param {string} params.belowType - The type of the below order * @param {string} params.abovePrice - The price of the above order * @param {string} params.aboveStopPrice - The stop price of the above order * @param {string} params.aboveTrailingDelta - The trailing delta of the above order * @param {string} params.aboveTimeInForce - The time in force of the above order * @param {string} params.belowPrice - The price of the below order * @param {string} params.belowStopPrice - The stop price of the below order * @param {string} params.belowTrailingDelta - The trailing delta of the below order * @param {string} params.belowTimeInForce - The time in force of the below order * @return {undefined} */ ocoOrder(side: OrderSide, symbol: string, quantity: number, params?: Dict): Promise; /** * Creates a buy order * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to pay for each unit * @param {object} flags - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ buy(symbol: string, quantity: number, price: number, flags?: {}): Promise; /** * Creates a sell order * @param {string} symbol - the symbol to sell * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to pay for each unit * @param {object} flags - additional buy order flags * @param {function} callback - the callback function * @return {promise or undefined} - omitting the callback returns a promise */ sell(symbol: string, quantity: number, price: number, flags?: {}): Promise; /** * Creates a market buy order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {object} params - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ marketBuy(symbol: string, quantity: number, params?: Dict): Promise; /** * Creates a spot limit order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {string} side - the side of the order (BUY or SELL) * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to pay for each unit * @param {object} params - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ limitOrder(side: OrderSide, symbol: string, quantity: number, price: number, params?: Dict): Promise; /** * Creates a market buy order using the cost instead of the quantity (eg: 100usd instead of 0.01btc) * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {object} params - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ marketBuyWithCost(symbol: string, cost: number, params?: Dict): Promise; /** * Creates a market sell order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {string} symbol - the symbol to sell * @param {numeric} quantity - the quantity required * @param {object} flags - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ marketSell(symbol: string, quantity: number, params?: Dict): Promise; /** * Creates a market sell order using the cost instead of the quantity (eg: 100usd instead of 0.01btc) * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade * @param {string} symbol - the symbol to sell * @param {numeric} quantity - the quantity required * @param {object} flags - additional buy order flags * @return {promise or undefined} - omitting the callback returns a promise */ marketSellWithCost(symbol: string, cost: number, params?: Dict): Promise; /** * Cancels an order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade * @param {string} symbol - the symbol to cancel * @param {string} orderid - the orderid to cancel * @return {promise or undefined} - omitting the callback returns a promise */ cancel(symbol: string, orderid: number | string, params?: Dict): Promise; /** * Cancels all orders * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade * @param {string} symbol - the symbol to cancel * @return {promise or undefined} - omitting the callback returns a promise */ cancelAll(symbol: string, params?: Dict): Promise; /** * Gets the status of an order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data * @param {string} symbol - the symbol to check * @param {string} orderid - the orderid to check if !orderid then use flags to search * @param {object} flags - any additional flags * @return {promise or undefined} - omitting the callback returns a promise */ orderStatus(symbol: string, orderid?: number | string, flags?: {}): Promise; /** * Gets open orders * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data * @param {string} symbol - the symbol to get * @return {promise or undefined} - omitting the callback returns a promise */ openOrders(symbol?: string, params?: Dict): Promise; /** * Cancels all orders of a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade * @param {string} symbol - the symbol to cancel all orders for * @return {promise or undefined} - omitting the callback returns a promise */ cancelAllOrders(symbol: string, params?: Dict): Promise; /** * Gets all order of a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data * @param {string} symbol - the symbol * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ allOrders(symbol: string, params?: Dict): Promise; /** * Create a signed margin order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} side - BUY or SELL * @param {string} symbol - The symbol to buy or sell * @param {string} quantity - The quantity to buy or sell * @param {string} price - The price per unit to transact each unit at * @param {object} params - additional order settings * @return {undefined} */ marginOrder(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order * @param type * @param side * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresOrder(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Algo-Order * @param type * @param side * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresAlgoOrder(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/option/trade/New-Order * @param type type of order to create * @param side side of the order (BUY or SELL) * @param symbol symbol of the market to trade * @param quantity quantity of the order to create * @param price price of the order to create * @param params extra parameters to be sent in the request * @returns */ deliveryOrder(type: OrderType, side: string, symbol: string, quantity: number, price?: number, params?: Dict): Promise; noop(): void; /** * Reworked Tuitio's heartbeat code into a shared single interval tick * @return {undefined} */ socketHeartbeat(): void; /** * Called when socket is opened, subscriptions are registered for later reference * @param {function} opened_callback - a callback function * @return {undefined} */ handleSocketOpen(wsBind: any, opened_callback: Callback): void; /** * Called when socket is closed, subscriptions are de-registered for later reference * @param {Function} reconnect - reconnect callback * @param {string} code - code associated with the socket * @param {string} reason - string with the response * @return {undefined} */ handleSocketClose(wsBind: any, reconnect: Function, code: any, reason: string): void; /** * Called when socket errors * @param {object} error - error object message * @return {undefined} */ handleSocketError(wsBind: any, error: any): void; /** * Called on each socket heartbeat * @return {undefined} */ handleSocketHeartbeat(wsBind: any): void; /** * Get Binance server time * @return {promise or undefined} - omitting the callback returns a promise */ time(): Promise; /** * Used to subscribe to a single websocket endpoint * @param {string} endpoint - endpoint to connect to * @param {function} callback - the function to call when information is received * @param {boolean} reconnect - whether to reconnect on disconnect * @param {object} opened_callback - the function to call when opened * @return {WebSocket} - websocket reference */ subscribe(endpoint: string, callback: Callback, reconnect?: Callback, opened_callback?: Callback): WebSocket; /** * Used to subscribe to a combined websocket endpoint * @param {string} streams - streams to connect to * @param {function} callback - the function to call when information is received * @param {boolean} reconnect - whether to reconnect on disconnect * @param {object} opened_callback - the function to call when opened * @return {WebSocket} - websocket reference */ subscribeCombined(streams: any, callback: Callback, reconnect?: Callback, opened_callback?: Callback): any; /** * Used to terminate a web socket * @param {string} endpoint - endpoint identifier associated with the web socket * @param {boolean} reconnect - auto reconnect after termination * @return {undefined} */ terminate(endpoint: string, reconnect?: boolean): void; /** * Connect to WebSocket API for bidirectional JSON-RPC communication * @param {string} connectionId - unique identifier for this connection * @param {function} messageHandler - callback for handling incoming messages/events * @param {function} reconnect - reconnect callback * @return {WebSocket} - WebSocket connection */ connectWsApi(connectionId: string, messageHandler: Callback, reconnect?: Callback): WebSocket; /** * Send a JSON-RPC request on the WebSocket API connection * @param {string} connectionId - connection identifier * @param {string} method - JSON-RPC method name * @param {object} params - method parameters * @return {Promise} - resolves with the result or rejects with error */ sendWsApiRequest(connectionId: string, method: string, params?: any): Promise; /** * Generate a unique request ID for JSON-RPC requests * @return {string} - unique request ID */ generateRequestId(): string; /** * Terminate a WebSocket API connection * @param {string} connectionId - connection identifier * @param {boolean} reconnect - whether to reconnect * @return {undefined} */ terminateWsApi(connectionId: string, reconnect?: boolean): void; /** * Futures heartbeat code with a shared single interval tick * @return {undefined} */ futuresSocketHeartbeat(): void; /** * Called when a futures socket is opened, subscriptions are registered for later reference * @param {function} openCallback - a callback function * @return {undefined} */ handleFuturesSocketOpen(wsBind: any, openCallback: Callback): void; /** * Called when futures websocket is closed, subscriptions are de-registered for later reference * @param {boolean} reconnect - true or false to reconnect the socket * @param {string} code - code associated with the socket * @param {string} reason - string with the response * @return {undefined} */ handleFuturesSocketClose(wsBind: any, reconnect: any, code: any, reason: any): void; /** * Called when a futures websocket errors * @param {object} error - error object message * @return {undefined} */ handleFuturesSocketError(wsBind: any, error: any): void; /** * Called on each futures socket heartbeat * @return {undefined} */ handleFuturesSocketHeartbeat(wsBind: any): void; /** * Used to subscribe to a single futures websocket endpoint * @param {string} endpoint - endpoint to connect to * @param {function} callback - the function to call when information is received * @param {object} params - Optional reconnect {boolean} (whether to reconnect on disconnect), openCallback {function}, id {string} * @return {WebSocket} - websocket reference */ futuresSubscribeSingle(endpoint: string, callback: Callback, params?: Dict): any; /** * Used to subscribe to a combined futures websocket endpoint * @param {string} streams - streams to connect to * @param {function} callback - the function to call when information is received * @param {object} params - Optional reconnect {boolean} (whether to reconnect on disconnect), openCallback {function}, id {string} * @return {WebSocket} - websocket reference */ futuresSubscribe(streams: any, callback: Callback, params?: Dict): any; /** * Used to terminate a futures websocket * @param {string} endpoint - endpoint identifier associated with the web socket * @param {boolean} reconnect - auto reconnect after termination * @return {undefined} */ futuresTerminate(endpoint: string, reconnect?: boolean): void; /** * Combines all futures OHLC data with the latest update * @param {string} symbol - the symbol * @param {string} interval - time interval * @return {array} - interval data for given symbol */ futuresKlineConcat(symbol: string, interval: Interval): any; /** * Used for websocket futures @kline * @param {string} symbol - the symbol * @param {object} kline - object with kline info * @param {string} firstTime - time filter * @return {undefined} */ futuresKlineHandler(symbol: string, kline: any, firstTime?: number): void; /** * Converts the futures liquidation stream data into a friendly object * @param {object} data - liquidation data callback data type * @return {object} - user friendly data type */ fLiquidationConvertData(data: any): { symbol: any; side: any; orderType: any; timeInForce: any; origAmount: any; price: any; avgPrice: any; orderStatus: any; lastFilledQty: any; totalFilledQty: any; eventType: any; tradeTime: any; eventTime: any; }; /** * Converts the futures ticker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fTickerConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; priceChange: any; percentChange: any; averagePrice: any; close: any; closeQty: any; open: any; high: any; low: any; volume: any; quoteVolume: any; openTime: any; closeTime: any; firstTradeId: any; lastTradeId: any; numTrades: any; }; /** * Converts the futures miniTicker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fMiniTickerConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; close: any; open: any; high: any; low: any; volume: any; quoteVolume: any; }; /** * Converts the futures bookTicker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fBookTickerConvertData(data: any): { updateId: any; symbol: any; bestBid: any; bestBidQty: any; bestAsk: any; bestAskQty: any; }; /** * Converts the futures UserData stream MARGIN_CALL data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fUserDataMarginConvertData(data: any): { eventType: any; eventTime: any; crossWalletBalance: any; positions: any; }; /** * Converts the futures UserData stream ACCOUNT_CONFIG_UPDATE into a friendly object * @param {object} data - user config callback data type * @return {object} - user friendly data type */ fUserConfigDataAccountUpdateConvertData(data: any): { eventType: any; eventTime: any; transactionTime: any; ac: { symbol: any; leverage: any; }; }; /** * Converts the futures UserData stream ACCOUNT_UPDATE data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fUserDataAccountUpdateConvertData(data: any): { eventType: any; eventTime: any; transaction: any; updateData: any; }; /** * Converts the futures UserData stream ORDER_TRADE_UPDATE data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fUserDataOrderUpdateConvertData(data: any): { eventType: any; eventTime: any; transaction: any; order: any; }; /** * Converts the futures markPrice stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fMarkPriceConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; markPrice: any; indexPrice: any; fundingRate: any; fundingTime: any; }; /** * Converts the futures aggTrade stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ fAggTradeConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; aggTradeId: any; price: any; amount: any; total: number; firstTradeId: any; lastTradeId: any; timestamp: any; maker: any; }; /** * Delivery heartbeat code with a shared single interval tick * @return {undefined} */ deliverySocketHeartbeat(): void; /** * Called when a delivery socket is opened, subscriptions are registered for later reference * @param {function} openCallback - a callback function * @return {undefined} */ handleDeliverySocketOpen(wsBind: any, openCallback: Callback): void; /** * Called when delivery websocket is closed, subscriptions are de-registered for later reference * @param {boolean} reconnect - true or false to reconnect the socket * @param {string} code - code associated with the socket * @param {string} reason - string with the response * @return {undefined} */ handleDeliverySocketClose(wsBind: any, reconnect: any, code: any, reason: any): void; /** * Called when a delivery websocket errors * @param {object} error - error object message * @return {undefined} */ handleDeliverySocketError(wsBind: any, error: any): void; /** * Called on each delivery socket heartbeat * @return {undefined} */ handleDeliverySocketHeartbeat(): void; /** * Used to subscribe to a single delivery websocket endpoint * @param {string} endpoint - endpoint to connect to * @param {function} callback - the function to call when information is received * @param {object} params - Optional reconnect {boolean} (whether to reconnect on disconnect), openCallback {function}, id {string} * @return {WebSocket} - websocket reference */ deliverySubscribeSingle(endpoint: string, callback: Callback, params?: Dict): any; /** * Used to subscribe to a combined delivery websocket endpoint * @param {string} streams - streams to connect to * @param {function} callback - the function to call when information is received * @param {object} params - Optional reconnect {boolean} (whether to reconnect on disconnect), openCallback {function}, id {string} * @return {WebSocket} - websocket reference */ deliverySubscribe(streams: any, callback: Callback, params?: Dict): any; /** * Used to terminate a delivery websocket * @param {string} endpoint - endpoint identifier associated with the web socket * @param {boolean} reconnect - auto reconnect after termination * @return {undefined} */ deliveryTerminate(endpoint: string, reconnect?: boolean): void; /** * Combines all delivery OHLC data with the latest update * @param {string} symbol - the symbol * @param {string} interval - time interval * @return {array} - interval data for given symbol */ deliveryKlineConcat(symbol: string, interval: Interval): any; /** * Used for websocket delivery @kline * @param {string} symbol - the symbol * @param {object} kline - object with kline info * @param {string} firstTime - time filter * @return {undefined} */ deliveryKlineHandler(symbol: string, kline: any, firstTime?: number): void; /** * Converts the delivery liquidation stream data into a friendly object * @param {object} data - liquidation data callback data type * @return {object} - user friendly data type */ dLiquidationConvertData(data: any): { symbol: any; side: any; orderType: any; timeInForce: any; origAmount: any; price: any; avgPrice: any; orderStatus: any; lastFilledQty: any; totalFilledQty: any; eventType: any; tradeTime: any; eventTime: any; }; /** * Converts the delivery ticker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dTickerConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; priceChange: any; percentChange: any; averagePrice: any; close: any; closeQty: any; open: any; high: any; low: any; volume: any; quoteVolume: any; openTime: any; closeTime: any; firstTradeId: any; lastTradeId: any; numTrades: any; }; /** * Converts the delivery miniTicker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dMiniTickerConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; close: any; open: any; high: any; low: any; volume: any; quoteVolume: any; }; /** * Converts the delivery bookTicker stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dBookTickerConvertData(data: any): { updateId: any; symbol: any; bestBid: any; bestBidQty: any; bestAsk: any; bestAskQty: any; }; /** * Converts the delivery markPrice stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dMarkPriceConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; markPrice: any; fundingRate: any; fundingTime: any; }; /** * Converts the delivery aggTrade stream data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dAggTradeConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; aggTradeId: any; price: any; amount: any; total: number; firstTradeId: any; lastTradeId: any; timestamp: any; maker: any; }; /** * Converts the delivery UserData stream ORDER_TRADE_UPDATE data into a friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ dUserDataOrderUpdateConvertData(data: any): { eventType: any; eventTime: any; transaction: any; order: any; }; /** * Used as part of the user data websockets callback * @param {object} data - user data callback data type * @return {undefined} */ userDataHandler(data: any): void; /** * Used as part of the user data websockets callback * @param {object} data - user data callback data type * @return {undefined} */ userMarginDataHandler(data: any): void; /** * Used as part of the user data websockets callback * @param {object} data - user data callback data type * @return {undefined} */ userFutureDataHandler(data: any): void; /** * Used as part of the user data websockets callback * @param {object} data - user data callback data type * @return {undefined} */ userDeliveryDataHandler(data: any): void; /** * Universal Transfer requires API permissions enabled * @param {string} type - ENUM , example MAIN_UMFUTURE for SPOT to USDT futures, see https://binance-docs.github.io/apidocs/spot/en/#user-universal-transfer * @param {string} asset - the asset - example :USDT * * @param {number} amount - the callback function * @return {promise} */ universalTransfer(type: string, asset: string, amount: number): Promise; /** * Transfer between main account and futures/delivery accounts * @param {string} asset - the asset * @param {number} amount - the asset * @param {object} options - additional options * @return {undefined} */ transferBetweenMainAndFutures(asset: string, amount: number, type: any): Promise; /** * Converts the previous day stream into friendly object * @param {object} data - user data callback data type * @return {object} - user friendly data type */ prevDayConvertData(data: any): any[] | { eventType: any; eventTime: any; symbol: any; priceChange: any; percentChange: any; averagePrice: any; prevClose: any; close: any; closeQty: any; bestBid: any; bestBidQty: any; bestAsk: any; bestAskQty: any; open: any; high: any; low: any; volume: any; quoteVolume: any; openTime: any; closeTime: any; firstTradeId: any; lastTradeId: any; numTrades: any; }; /** * Parses the previous day stream and calls the user callback with friendly object * @param {object} data - user data callback data type * @param {function} callback - user data callback data type * @return {undefined} */ prevDayStreamHandler(data: any, callback: Callback): void; /** * Gets the price of a given symbol or symbols * @param {array} data - array of symbols * @return {array} - symbols with their current prices */ priceData(data: any): { [key: string]: number; }; /** * Used by bookTickers to format the bids and asks given given symbols * @param {array} data - array of symbols * @return {object} - symbols with their bids and asks data */ bookPriceData(data: any): { [key: string]: BookTicker; }; /** * Used by balance to get the balance data * @param {array} data - account info object * @return {object} - balances hel with available, onorder amounts */ balanceData(data: any): {}; /** * Used by web sockets depth and populates OHLC and info * @param {string} symbol - symbol to get candlestick info * @param {string} interval - time interval, 1m, 3m, 5m .... * @param {array} ticks - tick array * @return {undefined} */ klineData(symbol: any, interval: any, ticks: any): void; /** * Combines all OHLC data with latest update * @param {string} symbol - the symbol * @param {string} interval - time interval, 1m, 3m, 5m .... * @return {array} - interval data for given symbol */ klineConcat(symbol: string, interval: Interval): any; /** * Used for websocket @kline * @param {string} symbol - the symbol * @param {object} kline - object with kline info * @param {string} firstTime - time filter * @return {undefined} */ klineHandler(symbol: any, kline: any, firstTime?: number): void; /** * Used by futures websockets chart cache * @param {string} symbol - symbol to get candlestick info * @param {string} interval - time interval, 1m, 3m, 5m .... * @param {array} ticks - tick array * @return {undefined} */ futuresKlineData(symbol: string, interval: Interval, ticks: any[]): void; /** * Used by delivery websockets chart cache * @param {string} symbol - symbol to get candlestick info * @param {string} interval - time interval, 1m, 3m, 5m .... * @param {array} ticks - tick array * @return {undefined} */ deliveryKlineData(symbol: any, interval: any, ticks: any): void; /** * Used for /depth endpoint * @param {object} data - containing the bids and asks * @return {undefined} */ depthData(data: any): { bids: any[]; asks: any[]; lastUpdateId?: undefined; } | { lastUpdateId: any; bids: {}; asks: {}; }; parseOrderBook(data: any, symbol: string): OrderBook; /** * Used for /depth endpoint * @param {object} depth - information * @return {undefined} */ depthHandler(depth: any): void; /** * Gets depth cache for given symbol * @param {string} symbol - the symbol to fetch * @return {object} - the depth cache object */ getDepthCache(symbol: string): any; /** * Calculate Buy/Sell volume from DepthCache * @param {string} symbol - the symbol to fetch * @return {object} - the depth volume cache object */ depthVolume(symbol: string): { bids: number; asks: number; bidQty: number; askQty: number; }; /** * Checks whether or not an array contains any duplicate elements * @param {array} array - the array to check * @return {boolean} - true or false */ isArrayUnique(array: any[]): boolean; /** * Count decimal places * @param {float} float - get the price precision point * @return {int} - number of place */ getPrecision(float: number): number; /** * rounds number with given step * @param {float} qty - quantity to round * @param {float} stepSize - stepSize as specified by exchangeInfo * @return {float} - number */ roundStep(qty: any, stepSize: any): any; /** * rounds price to required precision * @param {float} price - price to round * @param {float} tickSize - tickSize as specified by exchangeInfo * @return {float} - number */ roundTicks(price: any, tickSize: any): any; /** * Gets percentage of given numbers * @param {float} min - the smaller number * @param {float} max - the bigger number * @param {int} width - percentage width * @return {float} - percentage */ percent(min: any, max: any, width?: number): number; /** * Gets the sum of an array of numbers * @param {array} array - the number to add * @return {float} - sum */ sum(array: any): any; /** * Reverses the keys of an object * @param {object} object - the object * @return {object} - the object */ reverse(object: any): {}; /** * Converts an object to an array * @param {object} obj - the object * @return {array} - the array */ array(obj: any): any[][]; /** * Sorts bids * @param {string} symbol - the object * @param {int} max - the max number of bids * @param {string} baseValue - the object * @return {object} - the object */ sortBids(symbol: string, max?: number, baseValue?: string): {}; /** * Sorts asks * @param {string} symbol - the object * @param {int} max - the max number of bids * @param {string} baseValue - the object * @return {object} - the object */ sortAsks(symbol: string, max?: number, baseValue?: string): {}; /** * Returns the first property of an object * @param {object} object - the object to get the first member * @return {string} - the object key */ first(object: any): string; /** * Returns the last property of an object * @param {object} object - the object to get the first member * @return {string} - the object key */ last(object: any): string; /** * Returns an array of properties starting at start * @param {object} object - the object to get the properties form * @param {int} start - the starting index * @return {array} - the array of entires */ slice(object: any, start?: number): string[]; /** * Gets the minimum key form object * @param {object} object - the object to get the properties form * @return {string} - the minimum key */ min(object: any): any; /** * Gets the maximum key form object * @param {object} object - the object to get the properties form * @return {string} - the minimum key */ max(object: any): any; /** * Sets an option given a key and value * @param {string} key - the key to set * @param {object} value - the value of the key * @return {undefined} */ setOption(key: any, value: any): void; /** * Gets an option given a key * @param {string} key - the key to set * @return {undefined} */ getOption(key: string): any; /** * Returns the entire info object * @return {object} - the info object */ getInfo(): Dict; /** * Returns the used weight from the last request * @return {object} - 1m weight used */ usedWeight(): any; /** * Returns the status code from the last http response * @return {object} - status code */ statusCode(): any; /** * Returns the ping time from the last futures request * @return {object} - latency/ping (2ms) */ futuresLatency(): any; /** * Returns the complete URL from the last request * @return {object} - http address including query string */ lastURL(): any; /** * Returns the order count from the last request * @return {object} - orders allowed per 1m */ orderCount(): any; /** * Returns the entire options object * @return {object} - the options object */ getOptions(): any; /** * Gets the depth information for a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book * @param {string} symbol - the symbol * @param {int} limit - limit the number of returned orders * @return {promise or undefined} - omitting the callback returns a promise */ depth(symbol: string, limit?: number): Promise; /** * Gets the average prices of a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#current-average-price * @param {string} symbol - the symbol * @return {promise or undefined} - omitting the callback returns a promise */ avgPrice(symbol: string, params?: Dict): Promise; /** * Gets the prices of a given symbol(s) * @param {string} symbol - the symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker * @return {promise or undefined} - omitting the callback returns a promise */ prices(symbol?: string, params?: Dict): Promise<{ [key: string]: number; }>; /** * Gets the ticker price via WebSocket API (JSON-RPC) * @param {string} symbol - single symbol * @param {string[]} symbols - array of symbols * @param {object} options - additional options (e.g. symbolStatus) * @see https://developers.binance.com/docs/binance-spot-api-docs/web-socket-api/market-data-requests#symbol-price-ticker * @return {promise} - resolves with ticker price data */ tickerPrice(symbol?: string, symbols?: string[], options?: Dict): Promise; /** * Ensures a WebSocket API connection is open for the given connectionId * @param {string} connectionId - connection identifier * @return {promise} - resolves when the connection is open */ private ensureWsApiConnection; /** * Gets the book tickers of given symbol(s) * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/market-data-endpoints#symbol-order-book-ticker * @param {string} symbol - the symbol * @return {promise or undefined} - omitting the callback returns a promise */ bookTickers(symbol?: string, params?: Dict): Promise<{ [key: string]: BookTicker; }>; /** * Gets the prevday percentage change * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics * @param {string} symbol - the symbol or symbols * @return {promise or undefined} - omitting the callback returns a promise */ prevDay(symbol?: string, params?: Dict): Promise; /** * Gets the prevday percentage change * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics * @param {string} symbol - the symbol or symbols * @return {promise or undefined} - omitting the callback returns a promise */ ticker24h(symbol?: string, params?: Dict): Promise; /** * Gets the prevday percentage change * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics * @param {string} symbol - the symbol or symbols * @return {promise or undefined} - omitting the callback returns a promise */ dailyStats(symbol?: string, params?: Dict): Promise; /** * Gets the the exchange info * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#exchange-information * @return {promise or undefined} - omitting the callback returns a promise */ exchangeInfo(): Promise; /** * Gets the dust log for user * @return {promise or undefined} - omitting the callback returns a promise */ dustLog(): Promise; dustTransfer(assets: any): Promise; assetDividendRecord(params?: Dict): Promise; /** * Gets the the system status * @see https://developers.binance.com/docs/wallet/others/system-status * @return {promise or undefined} - omitting the callback returns a promise */ systemStatus(params?: Dict): Promise; /** * Withdraws asset to given wallet id * @see https://developers.binance.com/docs/wallet/capital/withdraw * @param {string} coin - the coin symbol * @param {string} address - the wallet to transfer it to * @param {number} amount - the amount to transfer * @param {string} addressTag - and addtional address tag * @param {string} name - the name to save the address as. Set falsy to prevent Binance saving to address book * @return {promise or undefined} - omitting the callback returns a promise */ withdraw(coin: string, address: string, amount: number, addressTag?: string, name?: string, params?: Dict): Promise; /** * Get the Withdraws history for a given asset * @see https://developers.binance.com/docs/wallet/capital/withdraw-history * @param {object} params - supports limit and fromId parameters * @return {promise or undefined} - omitting the callback returns a promise */ withdrawHistory(params?: Dict): Promise; /** * Get the deposit history * @see https://developers.binance.com/docs/wallet/capital/deposite-history#http-request * @param {object} params - additional params * @return {promise or undefined} - omitting the callback returns a promise */ depositHistory(asset?: string, params?: Dict): Promise; /** * Get the deposit address for given asset * @see https://developers.binance.com/docs/wallet/capital/deposite-address * @param {string} coin - the asset * @return {promise or undefined} - omitting the callback returns a promise */ depositAddress(asset: string, params?: Dict): Promise; /** * Get the deposit address list for given asset * @see https://developers.binance.com/docs/wallet/capital/fetch-deposit-address-list-with-network * @param {string} coin - the asset * @return {promise or undefined} - omitting the callback returns a promise */ depositAddressList(asset: string, params?: Dict): Promise; /** * Get the account status * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data * @return {promise or undefined} - omitting the callback returns a promise */ accountStatus(params?: Dict): Promise; /** * @return {promise or undefined} - omitting the callback returns a promise */ apiPermission(params?: Dict): Promise; /** * Get the trade fee * @see https://developers.binance.com/docs/wallet/asset/trade-fee * @param {string} symbol (optional) * @return {promise or undefined} - omitting the callback returns a promise */ tradeFee(symbol?: string): Promise; /** * Fetch asset detail (minWithdrawAmount, depositStatus, withdrawFee, withdrawStatus, depositTip) * @see https://developers.binance.com/docs/wallet/asset * @return {promise or undefined} - omitting the callback returns a promise */ assetDetail(params?: Dict): Promise; /** * Get the account * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints#account-information-user_data * @return {promise or undefined} - omitting the callback returns a promise */ account(params?: Dict): Promise; /** * Get the balance data * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints#account-information-user_data * @return {promise or undefined} - omitting the callback returns a promise */ balance(params?: Dict): Promise<{}>; /** * Get private trades for a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints#account-trade-list-user_data * @param {string} symbol - the symbol * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ trades(symbol: string, params?: Dict): Promise; /** * Get private trades for a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/account-endpoints#account-trade-list-user_data * @param {string} symbol - the symbol * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ myTrades(symbol: string, params?: Dict): Promise; /** * Tell api to use the server time to offset time indexes * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#check-server-time * @return {promise or undefined} - omitting the callback returns a promise */ useServerTime(): Promise; /** * Ping binance * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#test-connectivity * @return {promise or undefined} - omitting the callback returns a promise */ ping(): Promise; parseAggTrades(symbol: string, trades: any[]): AggregatedTrade[]; /** * Get agg trades for given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#compressedaggregate-trades-list * @param {string} symbol - the symbol * @param {object} options - additional optoins * @return {promise or undefined} - omitting the callback returns a promise */ aggTrades(symbol: string, params?: Dict): Promise; /** * Get the recent trades * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#old-trade-lookup * @param {string} symbol - the symbol * @param {int} limit - limit the number of items returned * @return {promise or undefined} - omitting the callback returns a promise */ recentTrades(symbol: string, limit?: number, params?: Dict): Promise; /** * Get the historical trade info * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#old-trade-lookup * @param {string} symbol - the symbol * @param {int} limit - limit the number of items returned * @param {int} fromId - from this id * @return {promise or undefined} - omitting the callback returns a promise */ historicalTrades(symbol: string, limit?: number, fromId?: number, params?: Dict): Promise; /** * Convert chart data to highstock array [timestamp,open,high,low,close] * @param {object} chart - the chart * @param {boolean} include_volume - to include the volume or not * @return {array} - an array */ highstock(chart: any, include_volume?: boolean): any[]; /** * Populates OHLC information * @param {object} chart - the chart * @return {object} - object with candle information */ populateOHLC(chart: any): { open: any[]; high: any[]; low: any[]; close: any[]; volume: any[]; }; /** * Gets the candles information for a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data * intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M * @param {string} symbol - the symbol * @param {function} interval - the callback function * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ candlesticks(symbol: string, interval?: Interval, params?: Dict): Promise; /** * Gets the candles information for a given symbol * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data * intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M * @param {string} symbol - the symbol * @param {function} interval - the callback function * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ candles(symbol: string, interval?: Interval, params?: Dict): Promise; parseCandles(candles: any[]): Candle[]; spotGetDataStream(params?: Dict): Promise; spotKeepDataStream(listenKey?: string | undefined, params?: Dict): Promise; spotCloseDataStream(listenKey?: string | undefined, params?: Dict): Promise; /** * Gets the market asset of given symbol * @param {string} symbol - the public api endpoint * @return {undefined} */ getMarket(symbol: string): "BTC" | "BNB" | "ETH" | "USDT" | "XRP" | "PAX" | "USDC" | "USDS" | "TUSD"; /** * Get the account binance lending information * @return {promise or undefined} - omitting the callback returns a promise */ lending(params?: Dict): Promise; futuresPing(params?: Dict): Promise; futuresTime(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information * @returns */ futuresExchangeInfo(params?: Dict): Promise; /** * Get the symbol configuration * @See https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config * @param params * @returns */ futuresSymbolConfig(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker-v2 * */ futuresPrices(symbol?: string, params?: Dict): Promise<{ [key: string]: number; }>; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics */ futuresDaily(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest */ futuresOpenInterest(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data */ futuresCandles(symbol: string, interval?: Interval, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data */ futuresCandlesticks(symbol: string, interval?: Interval, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price */ futuresMarkPrice(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresTrades(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup * @param symbol symbol if the market * @param param * @returns */ futuresHistoricalTrades(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List */ futuresAggTrades(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders * @param params extra parameters to be sent in the request * @returns */ futuresForceOrders(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-ADL-Quantile-Estimation * @param params extra parameters to be sent in the request * @returns */ futuresDeleverageQuantile(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List * @param params extra parameters to be sent in the request * @returns */ futuresUserTrades(symbol: string, params?: Dict): Promise; futuresGetDataStream(params?: Dict): Promise; futuresKeepDataStream(params?: Dict): Promise; futuresCloseDataStream(params?: Dict): Promise; /** * Get the account position risk (v3) * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3 * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2 * @return {promise or undefined} - omitting the callback returns a promise */ futuresPositionRisk(params?: Dict, useV2?: boolean): Promise; /** * Get the account position risk (v2) * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3 * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2 * @return {promise or undefined} - omitting the callback returns a promise */ futuresPositionRiskV2(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-Info * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresFundingRate(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets#http-request * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresLeverageBracket(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Trading-Quantitative-Rules-Indicators#http-request * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresTradingStatus(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate#http-request * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresCommissionRate(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage */ futuresLeverage(symbol: string, leverage: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type * @param symbol symbol if the market * @param marginType * @param params extra parameters to be sent in the request * @returns */ futuresMarginType(symbol: string, marginType: string, params?: Dict): Promise; futuresPositionMargin(symbol: string, amount: number, type?: number, params?: Dict): Promise; futuresPositionMarginHistory(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History */ futuresIncome(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 */ futuresBalance(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3 * @param params extra parameters to be sent in the request * @returns */ futuresAccount(params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresDepth(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker */ futuresQuote(symbol?: string, params?: Dict): Promise<{ [key: string]: BookTicker; }>; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker */ futuresBookTicker(symbol?: string, params?: Dict): Promise<{ [key: string]: BookTicker; }>; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresBuy(symbol: string, quantity: number, price: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresSell(symbol: string, quantity: number, price: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresMarketBuy(symbol: string, quantity: number, params?: Dict): Promise; /** * @description futures limit order * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @param side * @param symbol * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresLimitOrder(side: OrderSide, symbol: string, quantity: number, price: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @param symbol symbol if the market * @param quantity * @param price * @param params extra parameters to be sent in the request * @returns */ futuresMarketSell(symbol: string, quantity: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders */ futuresMultipleOrders(orders?: Dict[]): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders */ futuresCancelMultipleOrders(symbol: string, params?: Dict): Promise<(FuturesOrder | Response)[]>; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @param params.conditional set to true to query algo order * @returns */ futuresOrderStatus(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Algo-Order * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresAlgoOrderStatus(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order * @param symbol symbol if the market * @param orderId * @param params.conditional set to true to cancel algo order * @param params extra parameters to be sent in the request * @returns */ futuresCancel(symbol: string, orderId?: number | string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Algo-Order * @param symbol symbol if the market * @param orderId * @param params extra parameters to be sent in the request * @returns */ futuresCancelAlgoOrder(symbol: string, orderId?: number | string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @param params.conditional set to true to cancel algo order * @returns */ futuresCancelAll(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Algo-Open-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresCancelAllAlgo(symbol: string, params?: Dict): Promise; /** * * @param symbol symbol if the market * @param countdownTime * @param params extra parameters to be sent in the request * @returns */ futuresCountdownCancelAll(symbol: any, countdownTime?: number, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @param params.conditional set to true to query algo open orders * @returns */ futuresOpenOrders(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Algo-Open-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresOpenAlgoOrders(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresAllOrders(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-All-Algo-Orders * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresAllAlgoOrders(symbol?: string, params?: Dict): Promise; /** * * @param params extra parameters to be sent in the request * @returns */ futuresPositionSideDual(params?: Dict): Promise; /** * * @param dualSidePosition * @param params extra parameters to be sent in the request * @returns */ futuresChangePositionSideDual(dualSidePosition: any, params?: Dict): Promise; /** * * @param symbol symbol if the market * @param params extra parameters to be sent in the request * @returns */ futuresTransferAsset(asset: string, amount: number, type: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/futures-data/market-data * @param symbol * @param params * @returns */ futuresHistDataLink(symbol?: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Futures-Trade-Download-Link-by-Id * @param downloadId * @returns */ futuresTradeDownloadLink(downloadId: any): Promise; deliveryPing(params?: Dict): Promise; deliveryTime(params?: Dict): Promise; deliveryExchangeInfo(params?: Dict): Promise; deliveryPrices(params?: Dict): Promise; deliveryDaily(symbol?: string, params?: Dict): Promise; deliveryOpenInterest(symbol: string, params?: Dict): Promise; /** * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data * @param symbol * @param interval * @param params * @returns */ deliveryCandles(symbol: string, interval?: Interval, params?: Dict): Promise; deliveryContinuousKlines(pair: string, contractType?: string, interval?: Interval, params?: Dict): Promise; deliveryIndexKlines(pair: string, interval?: Interval, params?: Dict): Promise; deliveryMarkPriceKlines(symbol: string, interval?: Interval, params?: Dict): Promise; deliveryMarkPrice(symbol?: string, params?: Dict): Promise; deliveryTrades(symbol: string, params?: Dict): Promise; deliveryHistoricalTrades(symbol: string, params?: Dict): Promise; deliveryAggTrades(symbol: string, params?: Dict): Promise; deliveryUserTrades(symbol: string, params?: Dict): Promise; deliveryCommissionRate(symbol: string, params?: Dict): Promise; deliveryGetDataStream(params?: Dict): Promise; deliveryKeepDataStream(params?: Dict): Promise; deliveryCloseDataStream(params?: Dict): Promise; deliveryLiquidationOrders(symbol?: string, params?: Dict): Promise; deliveryPositionRisk(params?: Dict): Promise; deliveryLeverageBracket(symbol?: string, params?: Dict): Promise; deliveryLeverageBracketSymbols(symbol?: string, params?: Dict): Promise; deliveryLeverage(symbol: string, leverage: number, params?: Dict): Promise; deliveryMarginType(symbol: string, marginType: string, params?: Dict): Promise; deliveryPositionMargin(symbol: string, amount: number, type?: number, params?: Dict): Promise; deliveryPositionMarginHistory(symbol: string, params?: Dict): Promise; deliveryIncome(params?: Dict): Promise; deliveryBalance(params?: Dict): Promise; deliveryAccount(params?: Dict): Promise; deliveryDepth(symbol: string, params?: Dict): Promise; deliveryQuote(symbol?: string, params?: Dict): Promise; deliveryBuy(symbol: string, quantity: number, price: number, params?: Dict): Promise; deliverySell(symbol: string, quantity: number, price: number, params?: Dict): Promise; deliveryMarketBuy(symbol: string, quantity: number, params?: Dict): Promise; deliveryMarketSell(symbol: string, quantity: number, params?: Dict): Promise; deliveryOrderStatus(symbol: string, params?: Dict): Promise; deliveryCancel(symbol: string, params?: Dict): Promise; deliveryCancelAll(symbol: string, params?: Dict): Promise; deliveryCountdownCancelAll(symbol: string, countdownTime?: number, params?: Dict): Promise; deliveryOpenOrders(symbol?: string, params?: Dict): Promise; deliveryAllOrders(symbol?: string, params?: Dict): Promise; deliveryPositionSideDual(params?: Dict): Promise; deliveryChangePositionSideDual(dualSidePosition: any, params?: Dict): Promise; /** * Creates an order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} side - BUY or SELL * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to pay for each unit * @param {object} params - additional buy order flags * @param {string} isIsolated - the isolate margin option * @return {undefined} */ mgOrder(type: OrderType, side: string, symbol: string, quantity: number, price: number, params?: Dict, isIsolated?: string): Promise; /** * Creates a buy order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to pay for each unit * @param {object} params - additional buy order flags * @param {string} isIsolated - the isolate margin option * @return {undefined} */ mgBuy(symbol: string, quantity: number, price: number, params?: Dict, isIsolated?: string): Promise; /** * Creates a sell order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} symbol - the symbol to sell * @param {numeric} quantity - the quantity required * @param {numeric} price - the price to sell each unit for * @param {object} flags - additional order flags * @param {string} isIsolated - the isolate margin option * @return {undefined} */ mgSell(symbol: string, quantity: number, price: number, flags?: Dict, isIsolated?: string): Promise; /** * Creates a market buy order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} symbol - the symbol to buy * @param {numeric} quantity - the quantity required * @param {object} flags - additional buy order flags * @param {string} isIsolated - the isolate margin option * @return {undefined} */ mgMarketBuy(symbol: string, quantity: number, params?: Dict, isIsolated?: string): Promise; /** * Creates a market sell order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-New-Order * @param {string} symbol - the symbol to sell * @param {numeric} quantity - the quantity required * @param {object} flags - additional sell order flags * @param {string} isIsolated - the isolate margin option * @return {undefined} */ mgMarketSell(symbol: string, quantity: number, params?: Dict, isIsolated?: string): Promise; /** * Cancels an order * @param {string} symbol - the symbol to cancel * @param {string} orderid - the orderid to cancel * @return {undefined} */ mgCancel(symbol: string, orderid: number | string, isIsolated?: string): Promise; /** * Gets all order of a given symbol * @param {string} symbol - the symbol * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ mgAllOrders(symbol: string, params?: Dict): Promise; /** * Gets the status of an order * @param {string} symbol - the symbol to check * @param {string} orderid - the orderid to check * @param {object} flags - any additional flags * @return {undefined} */ mgOrderStatus(symbol: string, orderid: number | string, flags?: {}): Promise; /** * Gets open orders * @param {string} symbol - the symbol to get * @return {undefined} */ mgOpenOrders(symbol?: string, params?: Dict): Promise; /** * Cancels all order of a given symbol * @param {string} symbol - the symbol to cancel all orders for * @return {undefined} */ mgCancelOrders(symbol: string, params?: Dict): Promise; /** * Transfer from main account to margin account * @param {string} asset - the asset * @param {number} amount - the asset * @param {object} options - additional options * @return {undefined} */ mgTransferMainToMargin(asset: string, amount: number, params?: Dict): Promise; /** * Transfer from margin account to main account * @param {string} asset - the asset * @param {number} amount - the asset * @return {undefined} */ mgTransferMarginToMain(asset: string, amount: number, params?: Dict): Promise; /** * Get trades for a given symbol - margin account * @param {string} symbol - the symbol * @param {object} options - additional options * @return {promise or undefined} - omitting the callback returns a promise */ mgTrades(symbol: string, params?: Dict): Promise; /** * Transfer from main account to delivery account * @param {string} asset - the asset * @param {number} amount - the asset * @param {object} options - additional options * @return {undefined} */ transferMainToFutures(asset: string, amount: number): Promise; /** * Transfer from delivery account to main account * @param {string} asset - the asset * @param {number} amount - the asset (optionnal) * @return {undefined} */ transferFuturesToMain(asset: string, amount: number): Promise; /** * Transfer from main account to delivery account * @param {string} asset - the asset * @param {number} amount - the asset (optionnal) * @param {object} options - additional options * @return {undefined} */ transferMainToDelivery(asset: string, amount: number): Promise; /** * Transfer from delivery account to main account * @param {string} asset - the asset * @param {number} amount - the asset * @return {undefined} */ transferDeliveryToMain(asset: string, amount: number): Promise; /** * Get maximum transfer-out amount of an asset * @param {string} asset - the asset * @return {undefined} */ maxTransferable(asset: string): Promise; /** * Margin account borrow/loan * @param {string} asset - the asset * @param {number} amount - the asset * @param {string} isIsolated - the isolated option * @param {string} symbol - symbol for isolated margin * @return {undefined} */ mgBorrow(asset: string, amount: number, isIsolated?: string, symbol?: string, params?: Dict): Promise; /** * Margin account borrow/loan * @param {string} asset - the asset * @param {object} options - additional options * @return {undefined} */ mgQueryLoan(asset: string, options: any): Promise; /** * Margin account repay * @param {string} asset - the asset * @param {object} params - additional options * @return {undefined} */ mgQueryRepay(asset: string, params?: Dict): Promise; /** * Margin account repay * @param {string} asset - the asset * @param {number} amount - the asset * @param {string} isIsolated - the isolated option * @param {string} symbol - symbol for isolated margin * @return {undefined} */ mgRepay(asset: string, amount: number, isIsolated?: string, symbol?: string, params?: Dict): Promise; /** * Margin account details * @param {boolean} isIsolated - the callback function * @return {undefined} */ mgAccount(isIsolated?: boolean, params?: Dict): Promise; /** * Get maximum borrow amount of an asset * @param {string} asset - the asset * @return {undefined} */ maxBorrowable(asset: string, params?: Dict): Promise; /** * Returns the known futures websockets subscriptions * @return {array} array of futures websocket subscriptions */ getFuturesSubscriptions(): Dict; /** * Futures WebSocket aggregated trades * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresAggTradeStream(symbols: string[] | string, callback: Callback): any; /** * Futures WebSocket mark price * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @param {string} speed - 1 second updates. leave blank for default 3 seconds * @return {string} the websocket endpoint */ futuresMarkPriceStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }, speed?: string): any; /** * Futures WebSocket liquidations stream * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresLiquidationStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Futures WebSocket prevDay ticker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresTickerStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Futures WebSocket miniTicker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresMiniTickerStream(symbol?: string, callback?: Callback): any; /** * Futures WebSocket bookTicker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresBookTickerStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Websocket futures klines * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @param {int} limit - maximum results, no more than 1000 * @return {string} the websocket endpoint */ futuresChart(symbols: string[] | string, interval: Interval, callback: Callback, limit?: number): any; /** * Websocket futures candlesticks * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @return {string} the websocket endpoint */ futuresCandlesticksStream(symbols: string[] | string, interval: Interval, callback: Callback): any; /** * Subscribe to a single delivery websocket * @param {string} url - the delivery websocket endpoint * @param {function} callback - optional execution callback * @param {object} params - Optional reconnect {boolean} (whether to reconnect on disconnect), openCallback {function}, id {string} * @return {WebSocket} the websocket reference */ /** * Returns the known delivery websockets subscriptions * @return {array} array of delivery websocket subscriptions */ getDeliverySubscriptions(): Dict; /** * Delivery WebSocket aggregated trades * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryAggTradeStream(symbols: string[] | string, callback: Callback): any; /** * Delivery WebSocket mark price * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @param {string} speed - 1 second updates. leave blank for default 3 seconds * @return {string} the websocket endpoint */ deliveryMarkPriceStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }, speed?: string): any; /** * Delivery WebSocket liquidations stream * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryLiquidationStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Delivery WebSocket prevDay ticker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryTickerStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Delivery WebSocket miniTicker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryMiniTickerStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Delivery WebSocket bookTicker * @param {symbol} symbol name or false. can also be a callback * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryBookTickerStream(symbol?: string, callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Websocket delivery klines * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @param {int} limit - maximum results, no more than 1000 * @return {string} the websocket endpoint */ deliveryChart(symbols: string[] | string, interval: Interval, callback: Callback, limit?: number): any; /** * Websocket delivery candlesticks * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @return {string} the websocket endpoint */ deliveryCandlesticks(symbols: string[] | string, interval: Interval, callback: Callback): any; /** * Userdata websockets function * @param {function} all_updates_callback * @param {function} execution_callback - optional execution callback * @param {function} subscribed_callback - subscription callback * @param {function} list_status_callback - status callback * @return {undefined} */ userData(all_updates_callback?: Callback, balance_callback?: Callback, execution_callback?: Callback, subscribed_callback?: Callback, list_status_callback?: Callback): void; /** * Margin Userdata websockets function * @param {function} all_updates_callback * @param {function} execution_callback - optional execution callback * @param {function} subscribed_callback - subscription callback * @param {function} list_status_callback - status callback * @return {undefined} */ userMarginData(all_updates_callback?: Callback, balance_callback?: Callback, execution_callback?: Callback, subscribed_callback?: Callback, list_status_callback?: Callback): void; /** * Future Userdata websockets function * @param {function} all_updates_callback * @param {function} margin_call_callback * @param {function} account_update_callback * @param {function} order_update_callback * @param {Function} subscribed_callback - subscription callback */ userFutureData(all_updates_callback?: Callback, margin_call_callback?: Callback, account_update_callback?: Callback, order_update_callback?: Callback, subscribed_callback?: Callback, account_config_update_callback?: Callback): void; /** * Delivery Userdata websockets function * @param {function} margin_call_callback * @param {function} account_update_callback * @param {function} order_update_callback * @param {Function} subscribed_callback - subscription callback */ userDeliveryData(margin_call_callback: Callback, account_update_callback?: Callback, order_update_callback?: Callback, subscribed_callback?: Callback): void; getSubscriptions(): Dict; /** * Websocket depth chart * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint */ depthStream(symbols: string[] | string, callback: Callback): any; mapLimit(array: any, limit: any, asyncFn: any): Promise; /** * Websocket depth cache * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @param {int} limit - the number of entries * @return {string} the websocket endpoint */ depthCacheStream(symbols: string[] | string, callback: Callback, limit?: number): any; /** * Clear Websocket depth cache * @param {String|Array} symbols - a single symbol, or an array of symbols, to clear the cache of * @returns {void} */ clearDepthCache(symbols: string[] | string): void; /** * Websocket staggered depth cache * @param {array/string} symbols - an array of symbols to query * @param {function} callback - callback function * @param {int} limit - the number of entries * @param {int} stagger - ms between each depth cache * @return {Promise} the websocket endpoint */ depthCacheStaggered(symbols: string[] | string, callback: Callback, limit?: number, stagger?: number): any; /** * Websocket aggregated trades * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint */ aggTradesStream(symbols: string[] | string, callback: Callback): any; /** * Websocket raw trades * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @return {string} the websocket endpoint */ tradesStream(symbols: string[] | string, callback: Callback): any; /** * Websocket klines * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @param {int} limit - maximum results, no more than 1000 * @return {string} the websocket endpoint */ chart(symbols: string[] | string, interval: Interval, callback: Callback, limit?: number): any; /** * Websocket candle sticks * @param {array/string} symbols - an array or string of symbols to query * @param {string} interval - the time interval * @param {function} callback - callback function * @return {string} the websocket endpoint */ candlesticksStream(symbols: string[] | string, interval: Interval, callback: Callback): any; /** * Websocket mini ticker * @param {function} callback - callback function * @return {string} the websocket endpoint */ miniTicker(callback: any): any; /** * Spot WebSocket bookTicker (bid/ask quotes including price & amount) * @param {string | string[]} symbol symbol or array of symbols * @param {function} callback - callback function * @return {string} the websocket endpoint */ bookTickersStream(symbol: string | string[], callback?: { (...data: any[]): void; (message?: any, ...optionalParams: any[]): void; }): any; /** * Websocket prevday percentage * @param {array/string} symbols - an array or string of symbols to query * @param {function} callback - callback function * @param {boolean} singleCallback - avoid call one callback for each symbol in data array * @return {string} the websocket endpoint */ prevDayStream(symbols: string[] | string | undefined, callback?: Callback, singleCallback?: Callback): any; }