UNPKG

ccxt

Version:

A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges

600 lines • 116 kB
import Exchange from './abstract/binance.js'; import type { TransferEntry, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface, MarginMode, MarginModes, Leverage, Leverages, Num, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRates, IsolatedBorrowRate, Dict, LeverageTier, LeverageTiers, int, LedgerEntry, FundingRate, FundingRates, DepositAddress, LongShortRatio, BorrowInterest, Position } from './base/types.js'; /** * @class binance * @augments Exchange */ export default class binance extends Exchange { describe(): any; isInverse(type: string, subType?: Str): boolean; isLinear(type: string, subType?: Str): boolean; setSandboxMode(enable: boolean): void; createExpiredOptionMarket(symbol: string): MarketInterface; market(symbol: string): MarketInterface; safeMarket(marketId?: Str, market?: Market, delimiter?: Str, marketType?: Str): MarketInterface; costToPrecision(symbol: any, cost: any): string; currencyToPrecision(code: any, fee: any, networkCode?: any): string; nonce(): number; /** * @method * @name binance#fetchTime * @description fetches the current integer timestamp in milliseconds from the exchange server * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#check-server-time // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Check-Server-time // future * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @returns {int} the current integer timestamp in milliseconds from the exchange server */ fetchTime(params?: {}): Promise<Int>; /** * @method * @name binance#fetchCurrencies * @description fetches all available currencies on an exchange * @see https://developers.binance.com/docs/wallet/capital/all-coins-info * @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an associative dictionary of currencies */ fetchCurrencies(params?: {}): Promise<Currencies>; /** * @method * @name binance#fetchMarkets * @description retrieves data on all markets for binance * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#exchange-information // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Exchange-Information // future * @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option * @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin * @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object[]} an array of objects representing market data */ fetchMarkets(params?: {}): Promise<Market[]>; parseMarket(market: Dict): Market; parseBalanceHelper(entry: any): import("./base/types.js").BalanceAccount; parseBalanceCustom(response: any, type?: any, marginMode?: any, isPortfolioMargin?: boolean): Balances; /** * @method * @name binance#fetchBalance * @description query for balance and get the amount of funds available for trading or funds locked in orders * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data // spot * @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin * @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin * @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/rest-api/Futures-Account-Balance // future * @see https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option * @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi' * @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null * @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account * @param {string} [params.subType] 'linear' or 'inverse' * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure} */ fetchBalance(params?: {}): Promise<Balances>; /** * @method * @name binance#fetchOrderBook * @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Order-Book // future * @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option * @param {string} symbol unified symbol of the market to fetch the order book for * @param {int} [limit] the maximum amount of order book entries to return * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols */ fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>; parseTicker(ticker: Dict, market?: Market): Ticker; /** * @method * @name binance#fetchStatus * @description the latest known information on the availability of the exchange API * @see https://developers.binance.com/docs/wallet/others/system-status * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure} */ fetchStatus(params?: {}): Promise<{ status: string; updated: any; eta: any; url: any; info: any; }>; /** * @method * @name binance#fetchTicker * @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics // spot * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // future * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option * @param {string} symbol unified symbol of the market to fetch the ticker for * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure} */ fetchTicker(symbol: string, params?: {}): Promise<Ticker>; /** * @method * @name binance#fetchBidsAsks * @description fetches the bid and ask price and volume for multiple markets * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // future * @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} */ fetchBidsAsks(symbols?: Strings, params?: {}): Promise<Tickers>; /** * @method * @name binance#fetchLastPrices * @description fetches the last price for multiple markets * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Symbol-Price-Ticker // future * @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @returns {object} a dictionary of lastprices structures */ fetchLastPrices(symbols?: Strings, params?: {}): Promise<import("./base/types.js").LastPrices>; parseLastPrice(entry: any, market?: Market): { symbol: string; timestamp: number; datetime: string; price: number; side: any; info: any; }; /** * @method * @name binance#fetchTickers * @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics // spot * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // future * @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} */ fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>; /** * @method * @name binance#fetchMarkPrice * @description fetches mark price for the market * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price * @param {string} symbol unified symbol of the market to fetch the ticker for * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} */ fetchMarkPrice(symbol: string, params?: {}): Promise<Ticker>; /** * @method * @name binance#fetchMarkPrices * @description fetches mark prices for multiple markets * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-and-Mark-Price * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price * @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.subType] "linear" or "inverse" * @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure} */ fetchMarkPrices(symbols?: Strings, params?: {}): Promise<Tickers>; parseOHLCV(ohlcv: any, market?: Market): OHLCV; /** * @method * @name binance#fetchOHLCV * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data * @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Premium-Index-Kline-Data * @param {string} symbol unified symbol of the market to fetch OHLCV data for * @param {string} timeframe the length of time each candle represents * @param {int} [since] timestamp in ms of the earliest candle to fetch * @param {int} [limit] the maximum amount of candles to fetch * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.price] "mark" or "index" for mark price and index price candles * @param {int} [params.until] timestamp in ms of the latest candle to fetch * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume */ fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>; parseTrade(trade: Dict, market?: Market): Trade; /** * @method * @name binance#fetchTrades * @description get the list of most recent trades for a particular symbol * Default fetchTradesMethod * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#compressedaggregate-trades-list // publicGetAggTrades (spot) * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap) * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future) * @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option) * Other fetchTradesMethod * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#recent-trades-list // publicGetTrades (spot) * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap) * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Recent-Trades-List // dapiPublicGetTrades (future) * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#old-trade-lookup // publicGetHistoricalTrades (spot) * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap) * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/rest-api/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future) * @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option) * @param {string} symbol unified symbol of the market to fetch trades for * @param {int} [since] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' * @param {int} [limit] default 500, max 1000 * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {int} [params.until] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades' * @param {int} [params.fetchTradesMethod] 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades' * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * * EXCHANGE SPECIFIC PARAMETERS * @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades' * @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades} */ fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>; /** * @method * @name binance#editSpotOrder * @ignore * @description edit a trade order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade * @param {string} id cancel order id * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of currency you want to trade in units of base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ editSpotOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>; editSpotOrderRequest(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any; editContractOrderRequest(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Dict; /** * @method * @name binance#editContractOrder * @description edit a trade order * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-UM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Modify-CM-Order * @param {string} id cancel order id * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of currency you want to trade in units of base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.portfolioMargin] set to true if you would like to edit an order in a portfolio margin account * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ editContractOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>; /** * @method * @name binance#editOrder * @description edit a trade order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Order * @param {string} id cancel order id * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of currency you want to trade in units of base currency * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>; /** * @method * @name binance#editOrders * @description edit a list of trade orders * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Multiple-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Modify-Multiple-Orders * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ editOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>; parseOrderStatus(status: Str): string; parseOrder(order: Dict, market?: Market): Order; /** * @method * @name binance#createOrders * @description *contract only* create a list of trade orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Place-Multiple-Orders * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>; /** * @method * @name binance#createOrder * @description create a trade 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/testnet/rest-api/trading-endpoints#test-new-order-trade * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api * @see https://developers.binance.com/docs/derivatives/option/trade/New-Order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#sor * @see https://developers.binance.com/docs/binance-spot-api-docs/testnet/rest-api/trading-endpoints#sor * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order * @param {string} symbol unified symbol of the market to create an order in * @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP' * @param {string} side 'buy' or 'sell' * @param {float} amount how much of you want to trade in units of the base currency * @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.reduceOnly] for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean. * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading * @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false * @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false * @param {float} [params.trailingPercent] the percent to trail away from the current market price * @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument * @param {float} [params.triggerPrice] the price that a trigger order is triggered at * @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at * @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at * @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account * @param {string} [params.selfTradePrevention] set unified value for stp (see .features for available values) * @param {float} [params.icebergAmount] set iceberg amount for limit orders * @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders * @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode * @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>; createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any; /** * @method * @name binance#createMarketOrderWithCost * @description create a market order by providing the symbol, side and cost * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @param {string} symbol unified symbol of the market to create an order in * @param {string} side 'buy' or 'sell' * @param {float} cost how much you want to trade in units of the quote currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ createMarketOrderWithCost(symbol: string, side: OrderSide, cost: number, params?: {}): Promise<Order>; /** * @method * @name binance#createMarketBuyOrderWithCost * @description create a market buy order by providing the symbol and cost * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @param {string} symbol unified symbol of the market to create an order in * @param {float} cost how much you want to trade in units of the quote currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ createMarketBuyOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>; /** * @method * @name binance#createMarketSellOrderWithCost * @description create a market sell order by providing the symbol and cost * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade * @param {string} symbol unified symbol of the market to create an order in * @param {float} cost how much you want to trade in units of the quote currency * @param {object} [params] extra parameters specific to the exchange API endpoint * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ createMarketSellOrderWithCost(symbol: string, cost: number, params?: {}): Promise<Order>; /** * @method * @name binance#fetchOrder * @description fetches information on an order made by the user * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Order * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order * @param {string} id the order id * @param {string} symbol unified symbol of the market the order was made in * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>; /** * @method * @name binance#fetchOrders * @description fetches information on multiple orders made by the user * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders * @param {string} symbol unified market symbol of the market orders were made in * @param {int} [since] the earliest time in ms to fetch orders for * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading * @param {int} [params.until] the latest time in ms to fetch orders for * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>; /** * @method * @name binance#fetchOpenOrders * @description fetch all unfilled currently open orders * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Current-All-Open-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders * @param {string} symbol unified market symbol * @param {int} [since] the earliest time in ms to fetch open orders for * @param {int} [limit] the maximum number of open orders structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account conditional orders * @param {string} [params.subType] "linear" or "inverse" * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>; /** * @method * @name binance#fetchOpenOrder * @description fetch an open order by the id * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Query-Current-Open-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order * @param {string} id order id * @param {string} symbol unified market symbol * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch for a portfolio margin account * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchOpenOrder(id: string, symbol?: Str, params?: {}): Promise<Order>; /** * @method * @name binance#fetchClosedOrders * @description fetches information on multiple closed orders made by the user * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders * @param {string} symbol unified market symbol of the market orders were made in * @param {int} [since] the earliest time in ms to fetch orders for * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders * @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>; /** * @method * @name binance#fetchCanceledOrders * @description fetches information on multiple canceled orders made by the user * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders * @param {string} symbol unified market symbol of the market the orders were made in * @param {int} [since] the earliest time in ms to fetch orders for * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>; /** * @method * @name binance#fetchCanceledAndClosedOrders * @description fetches information on multiple canceled orders made by the user * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/All-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History * @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders * @param {string} symbol unified market symbol of the market the orders were made in * @param {int} [since] the earliest time in ms to fetch orders for * @param {int} [limit] the maximum number of order structures to retrieve * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params) * @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to fetch portfolio margin account trigger or conditional orders * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure} */ fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>; /** * @method * @name binance#cancelOrder * @description cancels an open order * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-Order * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order * @param {string} id order id * @param {string} symbol unified symbol of the market the order was made in * @param {object} [params] extra parameters specific to the exchange API endpoint * @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account * @param {boolean} [params.trigger] set to true if you would like to cancel a portfolio margin account conditional order * @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure} */ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>; /** * @method * @name binance#cancelAllOrders * @description cancel all open orders in a market * @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade * @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders * @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/rest-api/Cancel-All-Open-Orders * @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol * @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders * @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol * @param {string} symbol unified market symbol of the market to cancel orders in * @param {object} [params] extra parameters specific to the exchan