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