CCXT

bitrue

bitrue cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

bitrue

Kind: global class
Extends: Exchange

fetchStatus

the latest known information on the availability of the exchange API

Kind: instance method of bitrue
Returns: object - a status structure

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#test-connectivity

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchStatus (params?)

fetchTime

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of 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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchTime (params?)

fetchCurrencies

fetches all available currencies on an exchange

Kind: instance method of bitrue
Returns: object - an associative dictionary of currencies

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchCurrencies (params?)

fetchMarkets

retrieves data on all markets for bitrue

Kind: instance method of bitrue
Returns: Array<object> - an array of objects representing market data

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange api endpoint
bitrue.fetchMarkets (params?)

fetchBalance

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of bitrue
Returns: object - a balance structure

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestringNo'future', 'delivery', 'spot', 'swap'
params.subTypestringNo'linear', 'inverse'
bitrue.fetchBalance (params?)

fetchOrderBook

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of bitrue
Returns: object - A dictionary of order book structures indexed by market symbols

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchOrderBook (symbol, limit?, params?)

fetchTicker

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
Returns: object - a ticker structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchTicker (symbol, params?)

fetchOHLCV

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of bitrue
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch transfers for
bitrue.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchBidsAsks

fetches the bid and ask price and volume for multiple markets

Kind: instance method of bitrue
Returns: object - a dictionary of ticker structures

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchBidsAsks (symbols, params?)

fetchTickers

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of bitrue
Returns: object - a dictionary of ticker structures

See

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchTickers (symbols, params?)

fetchTrades

get the list of most recent trades for a particular symbol

Kind: instance method of bitrue
Returns: Array<Trade> - a list of trade structures

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#recent-trades-list

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchTrades (symbol, since?, limit?, params?)

createMarketBuyOrderWithCost

create a market buy order by providing the symbol and cost

Kind: instance method of bitrue
Returns: object - an order structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.createMarketBuyOrderWithCost (symbol, cost, params?)

createOrder

create a trade order

Kind: instance method of bitrue
Returns: object - an order structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.triggerPricefloatNospot only the price at which a trigger order is triggered at
params.clientOrderIdstringNoa unique id for the order, automatically generated if not sent
params.leveragedecimalNoin future order, the leverage value of the order should consistent with the user contract configuration, default is 1
params.timeInForcestringNo'fok', 'ioc' or 'po'
params.postOnlyboolNodefault false
params.reduceOnlyboolNodefault false EXCHANGE SPECIFIC PARAMETERS
params.icebergQtydecimalNo
params.recvWindowlongNo
params.costfloatNoswap market buy only the quote quantity that can be used as an alternative for the amount
bitrue.createOrder (symbol, type, side, amount, price?, params?)

fetchOrder

fetches information on an order made by the user

Kind: instance method of bitrue
Returns: object - An order structure

See

ParamTypeRequiredDescription
idstringYesthe order id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchOrder (id, symbol, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

Kind: instance method of bitrue
Returns: Array<Order> - a list of order structures

See: https://www.bitrue.com/api_docs_includes_file/spot/index.html#all-orders-user_data

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchClosedOrders (symbol, since?, limit?, params?)

fetchOpenOrders

fetch all unfilled currently open orders

Kind: instance method of bitrue
Returns: Array<Order> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchOpenOrders (symbol, since?, limit?, params?)

cancelOrder

cancels an open order

Kind: instance method of bitrue
Returns: object - An order structure

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.cancelOrder (id, symbol, params?)

cancelAllOrders

cancel all open orders in a market

Kind: instance method of bitrue
Returns: Array<object> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market to cancel orders in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNo'cross' or 'isolated', for spot margin trading
bitrue.cancelAllOrders (symbol, params?)

fetchMyTrades

fetch all trades made by the user

Kind: instance method of bitrue
Returns: Array<Trade> - a list of trade structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchMyTrades (symbol, since?, limit?, params?)

fetchDeposits

fetch all deposits made to an account

Kind: instance method of bitrue
Returns: Array<object> - a list of transaction structures

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#deposit-history--withdraw_data

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchDeposits (code, since?, limit?, params?)

fetchWithdrawals

fetch all withdrawals made from an account

Kind: instance method of bitrue
Returns: Array<object> - a list of transaction structures

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-history--withdraw_data

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchWithdrawals (code, since?, limit?, params?)

withdraw

make a withdrawal

Kind: instance method of bitrue
Returns: object - a transaction structure

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#withdraw-commit--withdraw_data

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.withdraw (code, amount, address, tag, params?)

fetchDepositWithdrawFees

fetch deposit and withdraw fees

Kind: instance method of bitrue
Returns: object - a list of fee structures

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#exchangeInfo_endpoint

ParamTypeRequiredDescription
codesArray<string>, undefinedYeslist of unified currency codes
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.fetchDepositWithdrawFees (codes, params?)

fetchTransfers

fetch a history of internal transfers made on an account

Kind: instance method of bitrue
Returns: Array<object> - a list of transfer structures

See

ParamTypeRequiredDescription
codestringYesunified currency code of the currency transferred
sinceintNothe earliest time in ms to fetch transfers for
limitintNothe maximum number of transfers structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch transfers for
params.typestringNotransfer type wallet_to_contract or contract_to_wallet
bitrue.fetchTransfers (code, since?, limit?, params?)

transfer

transfer currency internally between wallets on the same account

Kind: instance method of bitrue
Returns: object - a transfer structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.transfer (code, amount, fromAccount, toAccount, params?)

setLeverage

set the level of leverage for a market

Kind: instance method of bitrue
Returns: object - response from the exchange

See

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.setLeverage (leverage, symbol, params?)

setMargin

Either adds or reduces margin in an isolated position in order to set the margin to a specific value

Kind: instance method of bitrue
Returns: object - A margin structure

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market to set margin in
amountfloatYesthe amount to set the margin to
paramsobjectNoparameters specific to the exchange API endpoint
bitrue.setMargin (symbol, amount, params?)

watchBalance

watch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of bitrue
Returns: object - a balance structure

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#balance-update

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.watchBalance (params?)

watchOrders

watches information on user orders

Kind: instance method of bitrue
Returns: object - A dictionary of order structure indexed by market symbols

See: https://github.com/Bitrue-exchange/Spot-official-api-docs#order-update

ParamTypeRequiredDescription
symbolstringYes
sinceintNotimestamp in ms of the earliest order
limitintNothe maximum amount of orders to return
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.watchOrders (symbol, since?, limit?, params?)

watchTrades

watches public trades for a swap (futures) market

Kind: instance method of bitrue
Returns: Array<object> - a list of trade structures

See: https://www.bitrue.com/api_docs_includes_file/futures/index.html#websocket-market-data

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.watchTrades (symbol, since?, limit?, params?)

watchOHLCV

watches OHLCV candles for a swap (futures) market

Kind: instance method of bitrue
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://www.bitrue.com/api_docs_includes_file/futures/index.html#websocket-market-data

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.watchOHLCV (symbol, timeframe, since?, limit?, params?)

watchTicker

watches a 24h ticker for a swap (futures) market

Kind: instance method of bitrue
Returns: object - a ticker structure

See: https://www.bitrue.com/api_docs_includes_file/futures/index.html#websocket-market-data

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
bitrue.watchTicker (symbol, params?)

On this page