## bitrue{docsify-ignore} **Kind**: global class **Extends**: Exchange * [fetchStatus](#fetchstatus) * [fetchTime](#fetchtime) * [fetchCurrencies](#fetchcurrencies) * [fetchMarkets](#fetchmarkets) * [fetchBalance](#fetchbalance) * [fetchOrderBook](#fetchorderbook) * [fetchTicker](#fetchticker) * [fetchOHLCV](#fetchohlcv) * [fetchBidsAsks](#fetchbidsasks) * [fetchTickers](#fetchtickers) * [fetchTrades](#fetchtrades) * [createMarketBuyOrderWithCost](#createmarketbuyorderwithcost) * [createOrder](#createorder) * [fetchOrder](#fetchorder) * [fetchClosedOrders](#fetchclosedorders) * [fetchOpenOrders](#fetchopenorders) * [cancelOrder](#cancelorder) * [cancelAllOrders](#cancelallorders) * [fetchMyTrades](#fetchmytrades) * [fetchDeposits](#fetchdeposits) * [fetchWithdrawals](#fetchwithdrawals) * [withdraw](#withdraw) * [fetchDepositWithdrawFees](#fetchdepositwithdrawfees) * [fetchTransfers](#fetchtransfers) * [transfer](#transfer) * [setLeverage](#setleverage) * [setMargin](#setmargin) * [watchBalance](#watchbalance) * [watchOrders](#watchorders) ### fetchStatus{docsify-ignore} the latest known information on the availability of the exchange API **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [status structure](https://docs.ccxt.com/#/?id=exchange-status-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#test-connectivity | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchStatus ([params]) ``` ### fetchTime{docsify-ignore} fetches the current integer timestamp in milliseconds from the exchange server **Kind**: instance method of [bitrue](#bitrue) **Returns**: int - the current integer timestamp in milliseconds from the exchange server **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#check-server-time | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchTime ([params]) ``` ### fetchCurrencies{docsify-ignore} fetches all available currencies on an exchange **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - an associative dictionary of currencies | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchCurrencies ([params]) ``` ### fetchMarkets{docsify-ignore} retrieves data on all markets for bitrue **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<object> - an array of objects representing market data **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#exchangeInfo_endpoint - https://www.bitrue.com/api-docs#current-open-contract - https://www.bitrue.com/api_docs_includes_file/delivery.html#current-open-contract | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange api endpoint | ```javascript bitrue.fetchMarkets ([params]) ``` ### fetchBalance{docsify-ignore} query for balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#account-information-user_data - https://www.bitrue.com/api-docs#account-information-v2-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#account-information-v2-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'future', 'delivery', 'spot', 'swap' | | params.subType | string | No | 'linear', 'inverse' | ```javascript bitrue.fetchBalance ([params]) ``` ### fetchOrderBook{docsify-ignore} fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#order-book - https://www.bitrue.com/api-docs#order-book - https://www.bitrue.com/api_docs_includes_file/delivery.html#order-book | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the order book for | | limit | int | No | the maximum amount of order book entries to return | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchOrderBook (symbol[, limit, params]) ``` ### fetchTicker{docsify-ignore} fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#24hr-ticker-price-change-statistics - https://www.bitrue.com/api-docs#ticker - https://www.bitrue.com/api_docs_includes_file/delivery.html#ticker | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchTicker (symbol[, params]) ``` ### fetchOHLCV{docsify-ignore} fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#kline-data - https://www.bitrue.com/api-docs#kline-candlestick-data - https://www.bitrue.com/api_docs_includes_file/delivery.html#kline-candlestick-data | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch OHLCV data for | | timeframe | string | Yes | the length of time each candle represents | | since | int | No | timestamp in ms of the earliest candle to fetch | | limit | int | No | the maximum amount of candles to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchOHLCV (symbol, timeframe[, since, limit, params]) ``` ### fetchBidsAsks{docsify-ignore} fetches the bid and ask price and volume for multiple markets **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#symbol-order-book-ticker - https://www.bitrue.com/api-docs#ticker - https://www.bitrue.com/api_docs_includes_file/delivery.html#ticker | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchBidsAsks (symbols[, params]) ``` ### fetchTickers{docsify-ignore} fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#24hr-ticker-price-change-statistics - https://www.bitrue.com/api-docs#ticker - https://www.bitrue.com/api_docs_includes_file/delivery.html#ticker | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchTickers (symbols[, params]) ``` ### fetchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#recent-trades-list | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch trades for | | since | int | No | timestamp in ms of the earliest trade to fetch | | limit | int | No | the maximum amount of trades to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchTrades (symbol[, since, limit, params]) ``` ### createMarketBuyOrderWithCost{docsify-ignore} create a market buy order by providing the symbol and cost **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://www.bitrue.com/api-docs#new-order-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#new-order-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | cost | float | Yes | how much you want to trade in units of the quote currency | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.createMarketBuyOrderWithCost (symbol, cost[, params]) ``` ### createOrder{docsify-ignore} create a trade order **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#recent-trades-list - https://www.bitrue.com/api-docs#new-order-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#new-order-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to create an order in | | type | string | Yes | 'market' or 'limit' | | side | string | Yes | 'buy' or 'sell' | | amount | float | Yes | how much of currency you want to trade in units of base currency | | price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders | | params | object | No | extra parameters specific to the exchange API endpoint | | params.triggerPrice | float | No | *spot only* the price at which a trigger order is triggered at | | params.clientOrderId | string | No | a unique id for the order, automatically generated if not sent | | params.leverage | decimal | No | in future order, the leverage value of the order should consistent with the user contract configuration, default is 1 | | params.timeInForce | string | No | 'fok', 'ioc' or 'po' | | params.postOnly | bool | No | default false | | params.reduceOnly | bool | No | default false EXCHANGE SPECIFIC PARAMETERS | | params.icebergQty | decimal | No | | | params.recvWindow | long | No | | | params.cost | float | No | *swap market buy only* the quote quantity that can be used as an alternative for the amount | ```javascript bitrue.createOrder (symbol, type, side, amount[, price, params]) ``` ### fetchOrder{docsify-ignore} fetches information on an order made by the user **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#query-order-user_data - https://www.bitrue.com/api-docs#query-order-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#query-order-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | the order id | | symbol | string | Yes | unified symbol of the market the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchOrder (id, symbol[, params]) ``` ### fetchClosedOrders{docsify-ignore} fetches information on multiple closed orders made by the user **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#all-orders-user_data | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market orders were made in | | since | int | No | the earliest time in ms to fetch orders for | | limit | int | No | the maximum number of order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchClosedOrders (symbol[, since, limit, params]) ``` ### fetchOpenOrders{docsify-ignore} fetch all unfilled currently open orders **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#current-open-orders-user_data - https://www.bitrue.com/api-docs#current-all-open-orders-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#current-all-open-orders-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | since | int | No | the earliest time in ms to fetch open orders for | | limit | int | No | the maximum number of open order structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchOpenOrders (symbol[, since, limit, params]) ``` ### cancelOrder{docsify-ignore} cancels an open order **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#cancel-order-trade - https://www.bitrue.com/api-docs#cancel-order-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#cancel-order-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | symbol | string | Yes | unified symbol of the market the order was made in | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.cancelOrder (id, symbol[, params]) ``` ### cancelAllOrders{docsify-ignore} cancel all open orders in a market **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<object> - a list of [order structures](https://github.com/ccxt/ccxt/wiki/Manual#order-structure) **See** - https://www.bitrue.com/api-docs#cancel-all-open-orders-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#cancel-all-open-orders-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market to cancel orders in | | params | object | No | extra parameters specific to the exchange API endpoint | | params.marginMode | string | No | 'cross' or 'isolated', for spot margin trading | ```javascript bitrue.cancelAllOrders (symbol[, params]) ``` ### fetchMyTrades{docsify-ignore} fetch all trades made by the user **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See** - https://github.com/Bitrue-exchange/Spot-official-api-docs#account-trade-list-user_data - https://www.bitrue.com/api-docs#account-trade-list-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#account-trade-list-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | since | int | No | the earliest time in ms to fetch trades for | | limit | int | No | the maximum number of trades structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchMyTrades (symbol[, since, limit, params]) ``` ### fetchDeposits{docsify-ignore} fetch all deposits made to an account **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#deposit-history--withdraw_data | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | since | int | No | the earliest time in ms to fetch deposits for | | limit | int | No | the maximum number of deposits structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchDeposits (code[, since, limit, params]) ``` ### fetchWithdrawals{docsify-ignore} fetch all withdrawals made from an account **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-history--withdraw_data | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | since | int | No | the earliest time in ms to fetch withdrawals for | | limit | int | No | the maximum number of withdrawals structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchWithdrawals (code[, since, limit, params]) ``` ### withdraw{docsify-ignore} make a withdrawal **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-commit--withdraw_data | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | the amount to withdraw | | address | string | Yes | the address to withdraw to | | tag | string | Yes | | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.withdraw (code, amount, address, tag[, params]) ``` ### fetchDepositWithdrawFees{docsify-ignore} fetch deposit and withdraw fees **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a list of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#exchangeInfo_endpoint | Param | Type | Required | Description | | --- | --- | --- | --- | | codes | Array<string>, undefined | Yes | list of unified currency codes | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.fetchDepositWithdrawFees (codes[, params]) ``` ### fetchTransfers{docsify-ignore} fetch a history of internal transfers made on an account **Kind**: instance method of [bitrue](#bitrue) **Returns**: Array<object> - a list of [transfer structures](https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure) **See** - https://www.bitrue.com/api-docs#get-future-account-transfer-history-list-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#get-future-account-transfer-history-list-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency transferred | | since | int | No | the earliest time in ms to fetch transfers for | | limit | int | No | the maximum number of transfers structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | the latest time in ms to fetch transfers for | | params.type | string | No | transfer type wallet_to_contract or contract_to_wallet | ```javascript bitrue.fetchTransfers (code[, since, limit, params]) ``` ### transfer{docsify-ignore} transfer currency internally between wallets on the same account **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [transfer structure](https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure) **See** - https://www.bitrue.com/api-docs#new-future-account-transfer-user_data-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#user-commission-rate-user_data-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | amount | float | Yes | amount to transfer | | fromAccount | string | Yes | account to transfer from | | toAccount | string | Yes | account to transfer to | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.transfer (code, amount, fromAccount, toAccount[, params]) ``` ### setLeverage{docsify-ignore} set the level of leverage for a market **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - response from the exchange **See** - https://www.bitrue.com/api-docs#change-initial-leverage-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#change-initial-leverage-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | leverage | float | Yes | the rate of leverage | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.setLeverage (leverage, symbol[, params]) ``` ### setMargin{docsify-ignore} Either adds or reduces margin in an isolated position in order to set the margin to a specific value **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - A [margin structure](https://github.com/ccxt/ccxt/wiki/Manual#add-margin-structure) **See** - https://www.bitrue.com/api-docs#modify-isolated-position-margin-trade-hmac-sha256 - https://www.bitrue.com/api_docs_includes_file/delivery.html#modify-isolated-position-margin-trade-hmac-sha256 | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market to set margin in | | amount | float | Yes | the amount to set the margin to | | params | object | No | parameters specific to the exchange API endpoint | ```javascript bitrue.setMargin (symbol, amount[, params]) ``` ### watchBalance{docsify-ignore} watch balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#balance-update | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.watchBalance ([params]) ``` ### watchOrders{docsify-ignore} watches information on user orders **Kind**: instance method of [bitrue](#bitrue) **Returns**: object - A dictionary of [order structure](https://docs.ccxt.com/#/?id=order-structure) indexed by market symbols **See**: https://github.com/Bitrue-exchange/Spot-official-api-docs#order-update | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified symbols of the market to watch the orders for | | since | int | No | timestamp in ms of the earliest order | | limit | int | No | the maximum amount of orders to return | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript bitrue.watchOrders (symbols[, since, limit, params]) ```