## coinex{docsify-ignore} **Kind**: global class **Extends**: Exchange * [fetchCurrencies](#fetchcurrencies) * [fetchMarkets](#fetchmarkets) * [fetchTicker](#fetchticker) * [fetchTickers](#fetchtickers) * [fetchTime](#fetchtime) * [fetchOrderBook](#fetchorderbook) * [fetchTrades](#fetchtrades) * [fetchTradingFee](#fetchtradingfee) * [fetchTradingFees](#fetchtradingfees) * [fetchOHLCV](#fetchohlcv) * [fetchBalance](#fetchbalance) * [createMarketBuyOrderWithCost](#createmarketbuyorderwithcost) * [createOrder](#createorder) * [createOrders](#createorders) * [cancelOrders](#cancelorders) * [editOrder](#editorder) * [cancelOrder](#cancelorder) * [cancelAllOrders](#cancelallorders) * [fetchOrder](#fetchorder) * [fetchOrdersByStatus](#fetchordersbystatus) * [fetchOpenOrders](#fetchopenorders) * [fetchClosedOrders](#fetchclosedorders) * [createDepositAddress](#createdepositaddress) * [fetchDepositAddress](#fetchdepositaddress) * [fetchMyTrades](#fetchmytrades) * [fetchPositions](#fetchpositions) * [fetchPosition](#fetchposition) * [setMarginMode](#setmarginmode) * [setLeverage](#setleverage) * [fetchLeverageTiers](#fetchleveragetiers) * [addMargin](#addmargin) * [reduceMargin](#reducemargin) * [fetchFundingHistory](#fetchfundinghistory) * [fetchFundingRate](#fetchfundingrate) * [fetchFundingRates](#fetchfundingrates) * [withdraw](#withdraw) * [fetchFundingRateHistory](#fetchfundingratehistory) * [transfer](#transfer) * [fetchTransfers](#fetchtransfers) * [fetchWithdrawals](#fetchwithdrawals) * [fetchDeposits](#fetchdeposits) * [fetchIsolatedBorrowRate](#fetchisolatedborrowrate) * [fetchBorrowInterest](#fetchborrowinterest) * [borrowIsolatedMargin](#borrowisolatedmargin) * [repayIsolatedMargin](#repayisolatedmargin) * [fetchDepositWithdrawFee](#fetchdepositwithdrawfee) * [fetchLeverage](#fetchleverage) * [fetchPositionHistory](#fetchpositionhistory) * [fetchMarginAdjustmentHistory](#fetchmarginadjustmenthistory) * [watchBalance](#watchbalance) * [watchMyTrades](#watchmytrades) * [watchTicker](#watchticker) * [watchTickers](#watchtickers) * [watchTrades](#watchtrades) * [watchTradesForSymbols](#watchtradesforsymbols) * [watchOrderBookForSymbols](#watchorderbookforsymbols) * [watchOrderBook](#watchorderbook) * [watchOrders](#watchorders) * [watchBidsAsks](#watchbidsasks) ### fetchCurrencies{docsify-ignore} fetches all available currencies on an exchange **Kind**: instance method of [coinex](#coinex) **Returns**: object - an associative dictionary of currencies **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchCurrencies ([params]) ``` ### fetchMarkets{docsify-ignore} retrieves data on all markets for coinex **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - an array of objects representing market data **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market - https://docs.coinex.com/api/v2/futures/market/http/list-market | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchMarkets ([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 [coinex](#coinex) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker - https://docs.coinex.com/api/v2/futures/market/http/list-market-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 coinex.fetchTicker (symbol[, 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 [coinex](#coinex) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market-ticker - https://docs.coinex.com/api/v2/futures/market/http/list-market-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 coinex.fetchTickers (symbols[, params]) ``` ### fetchTime{docsify-ignore} fetches the current integer timestamp in milliseconds from the exchange server **Kind**: instance method of [coinex](#coinex) **Returns**: int - the current integer timestamp in milliseconds from the exchange server **See**: https://docs.coinex.com/api/v2/common/http/time | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchTime ([params]) ``` ### fetchOrderBook{docsify-ignore} fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinex](#coinex) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market-depth - https://docs.coinex.com/api/v2/futures/market/http/list-market-depth | 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 coinex.fetchOrderBook (symbol[, limit, params]) ``` ### fetchTrades{docsify-ignore} get the list of the most recent trades for a particular symbol **Kind**: instance method of [coinex](#coinex) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market-deals - https://docs.coinex.com/api/v2/futures/market/http/list-market-deals | 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 coinex.fetchTrades (symbol[, since, limit, params]) ``` ### fetchTradingFee{docsify-ignore} fetch the trading fees for a market **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [fee structure](https://docs.ccxt.com/#/?id=fee-structure) **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market - https://docs.coinex.com/api/v2/futures/market/http/list-market | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchTradingFee (symbol[, params]) ``` ### fetchTradingFees{docsify-ignore} fetch the trading fees for multiple markets **Kind**: instance method of [coinex](#coinex) **Returns**: object - a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market - https://docs.coinex.com/api/v2/futures/market/http/list-market | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchTradingFees ([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 [coinex](#coinex) **Returns**: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume **See** - https://docs.coinex.com/api/v2/spot/market/http/list-market-kline - https://docs.coinex.com/api/v2/futures/market/http/list-market-kline | 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 coinex.fetchOHLCV (symbol, timeframe[, since, limit, 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 [coinex](#coinex) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See** - https://docs.coinex.com/api/v2/assets/balance/http/get-spot-balance // spot - https://docs.coinex.com/api/v2/assets/balance/http/get-futures-balance // swap - https://docs.coinex.com/api/v2/assets/balance/http/get-marigin-balance // margin - https://docs.coinex.com/api/v2/assets/balance/http/get-financial-balance // financial | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | | params.type | string | No | 'margin', 'swap', 'financial', or 'spot' | ```javascript coinex.fetchBalance ([params]) ``` ### createMarketBuyOrderWithCost{docsify-ignore} create a market buy order by providing the symbol and cost **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://viabtc.github.io/coinex_api_en_doc/spot/#docsspot003_trade003_market_order - https://docs.coinex.com/api/v2/spot/order/http/put-order | 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 coinex.createMarketBuyOrderWithCost (symbol, cost[, params]) ``` ### createOrder{docsify-ignore} create a trade order **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/put-order - https://docs.coinex.com/api/v2/spot/order/http/put-stop-order - https://docs.coinex.com/api/v2/futures/order/http/put-order - https://docs.coinex.com/api/v2/futures/order/http/put-stop-order - https://docs.coinex.com/api/v2/futures/position/http/close-position - https://docs.coinex.com/api/v2/futures/position/http/set-position-stop-loss - https://docs.coinex.com/api/v2/futures/position/http/set-position-take-profit | 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 you want to trade in units of the 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 | price to trigger stop orders | | params.stopLossPrice | float | No | price to trigger stop loss orders | | params.takeProfitPrice | float | No | price to trigger take profit orders | | params.timeInForce | string | No | 'GTC', 'IOC', 'FOK', 'PO' | | params.postOnly | boolean | No | set to true if you wish to make a post only order | | params.reduceOnly | boolean | No | *contract only* indicates if this order is to reduce the size of a position | ```javascript coinex.createOrder (symbol, type, side, amount[, price, params]) ``` ### createOrders{docsify-ignore} create a list of trade orders (all orders should be of the same symbol) **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/put-multi-order - https://docs.coinex.com/api/v2/spot/order/http/put-multi-stop-order - https://docs.coinex.com/api/v2/futures/order/http/put-multi-order - https://docs.coinex.com/api/v2/futures/order/http/put-multi-stop-order | Param | Type | Required | Description | | --- | --- | --- | --- | | orders | Array | Yes | list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params | | params | object | No | extra parameters specific to the api endpoint | ```javascript coinex.createOrders (orders[, params]) ``` ### cancelOrders{docsify-ignore} cancel multiple orders **Kind**: instance method of [coinex](#coinex) **Returns**: object - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/cancel-batch-order - https://docs.coinex.com/api/v2/spot/order/http/cancel-batch-stop-order - https://docs.coinex.com/api/v2/futures/order/http/cancel-batch-order - https://docs.coinex.com/api/v2/futures/order/http/cancel-batch-stop-order | Param | Type | Required | Description | | --- | --- | --- | --- | | ids | Array<string> | Yes | order ids | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | | params.trigger | boolean | No | set to true for canceling stop orders | ```javascript coinex.cancelOrders (ids, symbol[, params]) ``` ### editOrder{docsify-ignore} edit a trade order **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/edit-order - https://docs.coinex.com/api/v2/spot/order/http/edit-stop-order - https://docs.coinex.com/api/v2/futures/order/http/edit-order - https://docs.coinex.com/api/v2/futures/order/http/edit-stop-order | Param | Type | Required | Description | | --- | --- | --- | --- | | id | string | Yes | order id | | 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 the currency you want to trade in units of the 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 | the price to trigger stop orders | ```javascript coinex.editOrder (id, symbol, type, side, amount[, price, params]) ``` ### cancelOrder{docsify-ignore} cancels an open order **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/cancel-order - https://docs.coinex.com/api/v2/spot/order/http/cancel-stop-order - https://docs.coinex.com/api/v2/spot/order/http/cancel-order-by-client-id - https://docs.coinex.com/api/v2/spot/order/http/cancel-stop-order-by-client-id - https://docs.coinex.com/api/v2/futures/order/http/cancel-order - https://docs.coinex.com/api/v2/futures/order/http/cancel-stop-order - https://docs.coinex.com/api/v2/futures/order/http/cancel-order-by-client-id - https://docs.coinex.com/api/v2/futures/order/http/cancel-stop-order-by-client-id | 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 | | params.clientOrderId | string | No | client order id, defaults to id if not passed | | params.trigger | boolean | No | set to true for canceling a trigger order | ```javascript coinex.cancelOrder (id, symbol[, params]) ``` ### cancelAllOrders{docsify-ignore} cancel all open orders in a market **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/cancel-all-order - https://docs.coinex.com/api/v2/futures/order/http/cancel-all-order | 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 canceling spot margin orders | ```javascript coinex.cancelAllOrders (symbol[, params]) ``` ### fetchOrder{docsify-ignore} fetches information on an order made by the user **Kind**: instance method of [coinex](#coinex) **Returns**: object - An [order structure](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/get-order-status - https://docs.coinex.com/api/v2/futures/order/http/get-order-status | Param | Type | Required | Description | | --- | --- | --- | --- | | 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 coinex.fetchOrder (symbol[, params]) ``` ### fetchOrdersByStatus{docsify-ignore} fetch a list of orders **Kind**: instance method of [coinex](#coinex) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/list-finished-order - https://docs.coinex.com/api/v2/spot/order/http/list-finished-stop-order - https://docs.coinex.com/api/v2/futures/order/http/list-finished-order - https://docs.coinex.com/api/v2/futures/order/http/list-finished-stop-order | 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.trigger | boolean | No | set to true for fetching trigger orders | | params.marginMode | string | No | 'cross' or 'isolated' for fetching spot margin orders | ```javascript coinex.fetchOrdersByStatus (symbol[, since, limit]) ``` ### fetchOpenOrders{docsify-ignore} fetch all unfilled currently open orders **Kind**: instance method of [coinex](#coinex) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/list-pending-order - https://docs.coinex.com/api/v2/spot/order/http/list-pending-stop-order - https://docs.coinex.com/api/v2/futures/order/http/list-pending-order - https://docs.coinex.com/api/v2/futures/order/http/list-pending-stop-order | 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 | | params.trigger | boolean | No | set to true for fetching trigger orders | | params.marginMode | string | No | 'cross' or 'isolated' for fetching spot margin orders | ```javascript coinex.fetchOpenOrders (symbol[, since, limit, params]) ``` ### fetchClosedOrders{docsify-ignore} fetches information on multiple closed orders made by the user **Kind**: instance method of [coinex](#coinex) **Returns**: Array<Order> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/http/list-finished-order - https://docs.coinex.com/api/v2/spot/order/http/list-finished-stop-order - https://docs.coinex.com/api/v2/futures/order/http/list-finished-order - https://docs.coinex.com/api/v2/futures/order/http/list-finished-stop-order | 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.trigger | boolean | No | set to true for fetching trigger orders | | params.marginMode | string | No | 'cross' or 'isolated' for fetching spot margin orders | ```javascript coinex.fetchClosedOrders (symbol[, since, limit]) ``` ### createDepositAddress{docsify-ignore} create a currency deposit address **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/update-deposit-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code of the currency for the deposit address | | params | object | No | extra parameters specific to the exchange API endpoint | | params.network | string | No | the blockchain network to create a deposit address on | ```javascript coinex.createDepositAddress (code[, params]) ``` ### fetchDepositAddress{docsify-ignore} fetch the deposit address for a currency associated with this account **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [address structure](https://docs.ccxt.com/#/?id=address-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-address | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | params | object | No | extra parameters specific to the exchange API endpoint | | params.network | string | No | the blockchain network to create a deposit address on | ```javascript coinex.fetchDepositAddress (code[, params]) ``` ### fetchMyTrades{docsify-ignore} fetch all trades made by the user **Kind**: instance method of [coinex](#coinex) **Returns**: Array<Trade> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See** - https://docs.coinex.com/api/v2/spot/deal/http/list-user-deals - https://docs.coinex.com/api/v2/futures/deal/http/list-user-deals | 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 trade structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.until | int | No | timestamp in ms of the latest trades | | params.side | string | No | the side of the trades, either 'buy' or 'sell', required for swap | ```javascript coinex.fetchMyTrades (symbol[, since, limit, params]) ``` ### fetchPositions{docsify-ignore} fetch all open positions **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [position structure](https://docs.ccxt.com/#/?id=position-structure) **See** - https://docs.coinex.com/api/v2/futures/position/http/list-pending-position - https://docs.coinex.com/api/v2/futures/position/http/list-finished-position | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | | params.method | string | No | the method to use 'v2PrivateGetFuturesPendingPosition' or 'v2PrivateGetFuturesFinishedPosition' default is 'v2PrivateGetFuturesPendingPosition' | ```javascript coinex.fetchPositions ([symbols, params]) ``` ### fetchPosition{docsify-ignore} fetch data on a single open contract trade position **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [position structure](https://docs.ccxt.com/#/?id=position-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/list-pending-position | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol of the market the position is held in | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchPosition (symbol[, params]) ``` ### setMarginMode{docsify-ignore} set margin mode to 'cross' or 'isolated' **Kind**: instance method of [coinex](#coinex) **Returns**: object - response from the exchange **See**: https://docs.coinex.com/api/v2/futures/position/http/adjust-position-leverage | Param | Type | Required | Description | | --- | --- | --- | --- | | marginMode | string | Yes | 'cross' or 'isolated' | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | | params.leverage | int | Yes | the rate of leverage | ```javascript coinex.setMarginMode (marginMode, symbol[, params]) ``` ### setLeverage{docsify-ignore} set the level of leverage for a market **Kind**: instance method of [coinex](#coinex) **Returns**: object - response from the exchange **See**: https://docs.coinex.com/api/v2/futures/position/http/adjust-position-leverage | 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 | | params.marginMode | string | No | 'cross' or 'isolated' (default is 'cross') | ```javascript coinex.setLeverage (leverage, symbol[, params]) ``` ### fetchLeverageTiers{docsify-ignore} retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes **Kind**: instance method of [coinex](#coinex) **Returns**: object - a dictionary of [leverage tiers structures](https://docs.ccxt.com/#/?id=leverage-tiers-structure), indexed by market symbols **See**: https://docs.coinex.com/api/v2/futures/market/http/list-market-position-level | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string>, undefined | Yes | list of unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchLeverageTiers (symbols[, params]) ``` ### addMargin{docsify-ignore} add margin **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [margin structure](https://docs.ccxt.com/#/?id=add-margin-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/adjust-position-margin | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | amount | float | Yes | amount of margin to add | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.addMargin (symbol, amount[, params]) ``` ### reduceMargin{docsify-ignore} remove margin from a position **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [margin structure](https://docs.ccxt.com/#/?id=reduce-margin-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/adjust-position-margin | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | amount | float | Yes | the amount of margin to remove | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.reduceMargin (symbol, amount[, params]) ``` ### fetchFundingHistory{docsify-ignore} fetch the history of funding fee payments paid and received on this account **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [funding history structure](https://docs.ccxt.com/#/?id=funding-history-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/list-position-funding-history | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | since | int | No | the earliest time in ms to fetch funding history for | | limit | int | No | the maximum number of funding history structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchFundingHistory (symbol[, since, limit, params]) ``` ### fetchFundingRate{docsify-ignore} fetch the current funding rate **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [funding rate structure](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://docs.coinex.com/api/v2/futures/market/http/list-market-funding-rate | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchFundingRate (symbol[, params]) ``` ### fetchFundingRates{docsify-ignore} fetch the current funding rates **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - an array of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-structure) **See**: https://docs.coinex.com/api/v2/futures/market/http/list-market-funding-rate | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified market symbols | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchFundingRates (symbols[, params]) ``` ### withdraw{docsify-ignore} make a withdrawal **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [transaction structure](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/withdrawal | 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 | | params.network | string | No | unified network code | ```javascript coinex.withdraw (code, amount, address, tag[, params]) ``` ### fetchFundingRateHistory{docsify-ignore} fetches historical funding rate prices **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure) **See**: https://docs.coinex.com/api/v2/futures/market/http/list-market-funding-rate-history | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the funding rate history for | | since | int | No | timestamp in ms of the earliest funding rate to fetch | | limit | int | No | the maximum amount of [funding rate structures](https://docs.ccxt.com/#/?id=funding-rate-history-structure) to fetch | | params | object | No | extra parameters specific to the exchange API endpoint | | params.paginate | boolean | No | 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) | | params.until | int | No | timestamp in ms of the latest funding rate | ```javascript coinex.fetchFundingRateHistory (symbol[, since, limit, params]) ``` ### transfer{docsify-ignore} transfer currency internally between wallets on the same account **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [transfer structure](https://docs.ccxt.com/#/?id=transfer-structure) **See**: https://docs.coinex.com/api/v2/assets/transfer/http/transfer | 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 | | params.symbol | string | No | unified ccxt symbol, required when either the fromAccount or toAccount is margin | ```javascript coinex.transfer (code, amount, fromAccount, toAccount[, params]) ``` ### fetchTransfers{docsify-ignore} fetch a history of internal transfers made on an account **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [transfer structures](https://docs.ccxt.com/#/?id=transfer-structure) **See**: https://docs.coinex.com/api/v2/assets/transfer/http/list-transfer-history | 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 transfer structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | | params.marginMode | string | No | 'cross' or 'isolated' for fetching transfers to and from your margin account | ```javascript coinex.fetchTransfers (code[, since, limit, params]) ``` ### fetchWithdrawals{docsify-ignore} fetch all withdrawals made from an account **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-withdrawal-history | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | No | unified currency code | | since | int | No | the earliest time in ms to fetch withdrawals for | | limit | int | No | the maximum number of withdrawal structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchWithdrawals ([code, since, limit, params]) ``` ### fetchDeposits{docsify-ignore} fetch all deposits made to an account **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [transaction structures](https://docs.ccxt.com/#/?id=transaction-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-deposit-history | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | No | unified currency code | | since | int | No | the earliest time in ms to fetch deposits for | | limit | int | No | the maximum number of deposit structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchDeposits ([code, since, limit, params]) ``` ### fetchIsolatedBorrowRate{docsify-ignore} fetch the rate of interest to borrow a currency for margin trading **Kind**: instance method of [coinex](#coinex) **Returns**: object - an [isolated borrow rate structure](https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure) **See**: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified symbol of the market to fetch the borrow rate for | | params | object | No | extra parameters specific to the exchange API endpoint | | params.code | string | Yes | unified currency code | ```javascript coinex.fetchIsolatedBorrowRate (symbol[, params]) ``` ### fetchBorrowInterest{docsify-ignore} fetch the interest owed by the user for borrowing currency for margin trading **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [borrow interest structures](https://docs.ccxt.com/#/?id=borrow-interest-structure) **See**: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-borrow-history | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | No | unified currency code | | symbol | string | No | unified market symbol when fetch interest in isolated markets | | since | int | No | the earliest time in ms to fetch borrrow interest for | | limit | int | No | the maximum number of structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchBorrowInterest ([code, symbol, since, limit, params]) ``` ### borrowIsolatedMargin{docsify-ignore} create a loan to borrow margin **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure) **See**: https://docs.coinex.com/api/v2/assets/loan-flat/http/margin-borrow | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol, required for coinex | | code | string | Yes | unified currency code of the currency to borrow | | amount | float | Yes | the amount to borrow | | params | object | No | extra parameters specific to the exchange API endpoint | | params.isAutoRenew | boolean | No | whether to renew the margin loan automatically or not, default is false | ```javascript coinex.borrowIsolatedMargin (symbol, code, amount[, params]) ``` ### repayIsolatedMargin{docsify-ignore} repay borrowed margin and interest **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [margin loan structure](https://docs.ccxt.com/#/?id=margin-loan-structure) **See**: https://docs.coinex.com/api/v2/assets/loan-flat/http/margin-repay | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol, required for coinex | | code | string | Yes | unified currency code of the currency to repay | | amount | float | Yes | the amount to repay | | params | object | No | extra parameters specific to the exchange API endpoint | | params.borrow_id | string | No | extra parameter that is not required | ```javascript coinex.repayIsolatedMargin (symbol, code, amount[, params]) ``` ### fetchDepositWithdrawFee{docsify-ignore} fetch the fee for deposits and withdrawals **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [fee structure](https://docs.ccxt.com/#/?id=fee-structure) **See**: https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/get-deposit-withdrawal-config | Param | Type | Required | Description | | --- | --- | --- | --- | | code | string | Yes | unified currency code | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.fetchDepositWithdrawFee (code[, params]) ``` ### fetchLeverage{docsify-ignore} fetch the set leverage for a market **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [leverage structure](https://docs.ccxt.com/#/?id=leverage-structure) **See**: https://docs.coinex.com/api/v2/assets/loan-flat/http/list-margin-interest-limit | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | params | object | No | extra parameters specific to the exchange API endpoint | | params.code | string | Yes | unified currency code | ```javascript coinex.fetchLeverage (symbol[, params]) ``` ### fetchPositionHistory{docsify-ignore} fetches historical positions **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [position structures](https://docs.ccxt.com/#/?id=position-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/list-finished-position | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified contract symbol | | since | int | No | the earliest time in ms to fetch positions for | | limit | int | No | the maximum amount of records to fetch, default is 10 | | params | object | No | extra parameters specific to the exchange api endpoint | | params.until | int | No | the latest time in ms to fetch positions for | ```javascript coinex.fetchPositionHistory (symbol[, since, limit, params]) ``` ### fetchMarginAdjustmentHistory{docsify-ignore} fetches the history of margin added or reduced from contract isolated positions **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [margin structures](https://docs.ccxt.com/#/?id=margin-loan-structure) **See**: https://docs.coinex.com/api/v2/futures/position/http/list-position-margin-history | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | Yes | unified market symbol | | type | string | No | not used by coinex fetchMarginAdjustmentHistory | | since | int | No | timestamp in ms of the earliest change to fetch | | limit | int | No | the maximum amount of changes to fetch, default is 10 | | params | object | Yes | extra parameters specific to the exchange api endpoint | | params.until | int | No | timestamp in ms of the latest change to fetch | | params.positionId | int | No | the id of the position that you want to retrieve margin adjustment history for | ```javascript coinex.fetchMarginAdjustmentHistory (symbol[, type, since, limit, params]) ``` ### watchBalance{docsify-ignore} watch balance and get the amount of funds available for trading or funds locked in orders **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [balance structure](https://docs.ccxt.com/#/?id=balance-structure) **See** - https://docs.coinex.com/api/v2/assets/balance/ws/spot_balance - https://docs.coinex.com/api/v2/assets/balance/ws/futures_balance | Param | Type | Required | Description | | --- | --- | --- | --- | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.watchBalance ([params]) ``` ### watchMyTrades{docsify-ignore} watches information on multiple trades made by the user **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=trade-structure) **See** - https://docs.coinex.com/api/v2/spot/deal/ws/user-deals - https://docs.coinex.com/api/v2/futures/deal/ws/user-deals | Param | Type | Required | Description | | --- | --- | --- | --- | | symbol | string | No | unified symbol of the market the trades were made in | | since | int | No | the earliest time in ms to watch trades | | limit | int | No | the maximum number of trade structures to retrieve | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.watchMyTrades ([symbol, since, limit, params]) ``` ### watchTicker{docsify-ignore} watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.coinex.com/api/v2/spot/market/ws/market - https://docs.coinex.com/api/v2/futures/market/ws/market-state | 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 coinex.watchTicker (symbol[, params]) ``` ### watchTickers{docsify-ignore} watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list **Kind**: instance method of [coinex](#coinex) **Returns**: object - a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.coinex.com/api/v2/spot/market/ws/market - https://docs.coinex.com/api/v2/futures/market/ws/market-state | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.watchTickers (symbols[, params]) ``` ### watchTrades{docsify-ignore} get the list of most recent trades for a particular symbol **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See** - https://docs.coinex.com/api/v2/spot/market/ws/market-deals - https://docs.coinex.com/api/v2/futures/market/ws/market-deals | 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 coinex.watchTrades (symbol[, since, limit, params]) ``` ### watchTradesForSymbols{docsify-ignore} watch the most recent trades for a list of symbols **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades) **See** - https://docs.coinex.com/api/v2/spot/market/ws/market-deals - https://docs.coinex.com/api/v2/futures/market/ws/market-deals | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified symbols of the markets 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 coinex.watchTradesForSymbols (symbols[, since, limit, params]) ``` ### watchOrderBookForSymbols{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinex](#coinex) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See** - https://docs.coinex.com/api/v2/spot/market/ws/market-depth - https://docs.coinex.com/api/v2/futures/market/ws/market-depth | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | Yes | unified array of symbols | | limit | int | No | the maximum amount of order book entries to return | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.watchOrderBookForSymbols (symbols[, limit, params]) ``` ### watchOrderBook{docsify-ignore} watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data **Kind**: instance method of [coinex](#coinex) **Returns**: object - A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols **See** - https://docs.coinex.com/api/v2/spot/market/ws/market-depth - https://docs.coinex.com/api/v2/futures/market/ws/market-depth | 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 coinex.watchOrderBook (symbol[, limit, params]) ``` ### watchOrders{docsify-ignore} watches information on multiple orders made by the user **Kind**: instance method of [coinex](#coinex) **Returns**: Array<object> - a list of [order structures](https://docs.ccxt.com/#/?id=order-structure) **See** - https://docs.coinex.com/api/v2/spot/order/ws/user-order - https://docs.coinex.com/api/v2/futures/order/ws/user-order | 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 | | params.trigger | bool | No | if the orders to watch are trigger orders or not | ```javascript coinex.watchOrders (symbol[, since, limit, params]) ``` ### watchBidsAsks{docsify-ignore} watches best bid & ask for symbols **Kind**: instance method of [coinex](#coinex) **Returns**: object - a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure) **See** - https://docs.coinex.com/api/v2/spot/market/ws/market-bbo - https://docs.coinex.com/api/v2/futures/market/ws/market-bbo | Param | Type | Required | Description | | --- | --- | --- | --- | | symbols | Array<string> | No | unified symbol of the market to fetch the ticker for | | params | object | No | extra parameters specific to the exchange API endpoint | ```javascript coinex.watchBidsAsks ([symbols, params]) ```