60 KiB
coinex{docsify-ignore}
Kind: global class
Extends: Exchange
- fetchCurrencies
- fetchMarkets
- fetchTicker
- fetchTickers
- fetchTime
- fetchOrderBook
- fetchTrades
- fetchTradingFee
- fetchTradingFees
- fetchOHLCV
- fetchBalance
- createMarketBuyOrderWithCost
- createOrder
- createOrders
- cancelOrders
- editOrder
- cancelOrder
- cancelAllOrders
- fetchOrder
- fetchOrdersByStatus
- fetchOpenOrders
- fetchClosedOrders
- createDepositAddress
- fetchDepositAddress
- fetchMyTrades
- fetchPositions
- fetchPosition
- setMarginMode
- setLeverage
- fetchLeverageTiers
- addMargin
- reduceMargin
- fetchFundingHistory
- fetchFundingRate
- fetchFundingInterval
- fetchFundingRates
- withdraw
- fetchFundingRateHistory
- transfer
- fetchTransfers
- fetchWithdrawals
- fetchDeposits
- fetchIsolatedBorrowRate
- fetchBorrowInterest
- borrowIsolatedMargin
- repayIsolatedMargin
- fetchDepositWithdrawFee
- fetchDepositWithdrawFees
- fetchLeverage
- fetchPositionHistory
- closePosition
- fetchMarginAdjustmentHistory
- watchBalance
- watchMyTrades
- watchTicker
- watchTickers
- watchTrades
- watchTradesForSymbols
- watchOrderBookForSymbols
- watchOrderBook
- watchOrders
- watchBidsAsks
fetchCurrencies{docsify-ignore}
fetches all available currencies on an exchange
Kind: instance method of 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 |
coinex.fetchCurrencies ([params])
fetchMarkets{docsify-ignore}
retrieves data on all markets for coinex
Kind: instance method of 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 |
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
Returns: object - a 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 |
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
Returns: object - a dictionary of ticker structures
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 |
coinex.fetchTickers (symbols[, params])
fetchTime{docsify-ignore}
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of 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 |
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
Returns: object - A dictionary of order book structures 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 |
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
Returns: Array<Trade> - a list of trade structures
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 |
coinex.fetchTrades (symbol[, since, limit, params])
fetchTradingFee{docsify-ignore}
fetch the trading fees for a market
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchTradingFee (symbol[, params])
fetchTradingFees{docsify-ignore}
fetch the trading fees for multiple markets
Kind: instance method of coinex
Returns: object - a dictionary of fee structures 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 |
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
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 |
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
Returns: object - a 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' |
coinex.fetchBalance ([params])
createMarketBuyOrderWithCost{docsify-ignore}
create a market buy order by providing the symbol and cost
Kind: instance method of coinex
Returns: object - an 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 |
coinex.createMarketBuyOrderWithCost (symbol, cost[, params])
createOrder{docsify-ignore}
create a trade order
Kind: instance method of coinex
Returns: object - an 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 |
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
Returns: object - an 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 |
coinex.createOrders (orders[, params])
cancelOrders{docsify-ignore}
cancel multiple orders
Kind: instance method of coinex
Returns: object - a list of order structures
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 |
coinex.cancelOrders (ids, symbol[, params])
editOrder{docsify-ignore}
edit a trade order
Kind: instance method of coinex
Returns: object - an 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 |
coinex.editOrder (id, symbol, type, side, amount[, price, params])
cancelOrder{docsify-ignore}
cancels an open order
Kind: instance method of coinex
Returns: object - an 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 |
coinex.cancelOrder (id, symbol[, params])
cancelAllOrders{docsify-ignore}
cancel all open orders in a market
Kind: instance method of coinex
Returns: Array<object> - a list of order structures
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 |
coinex.cancelAllOrders (symbol[, params])
fetchOrder{docsify-ignore}
fetches information on an order made by the user
Kind: instance method of coinex
Returns: object - An 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 |
|---|---|---|---|
| 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 |
coinex.fetchOrder (id, symbol[, params])
fetchOrdersByStatus{docsify-ignore}
fetch a list of orders
Kind: instance method of coinex
Returns: Array<Order> - a list of order structures
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 |
|---|---|---|---|
| status | string |
Yes | order status to fetch for |
| 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 | boolean |
No | set to true for fetching trigger orders |
| params.marginMode | string |
No | 'cross' or 'isolated' for fetching spot margin orders |
coinex.fetchOrdersByStatus (status, symbol[, since, limit, params])
fetchOpenOrders{docsify-ignore}
fetch all unfilled currently open orders
Kind: instance method of coinex
Returns: Array<Order> - a list of order structures
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 |
coinex.fetchOpenOrders (symbol[, since, limit, params])
fetchClosedOrders{docsify-ignore}
fetches information on multiple closed orders made by the user
Kind: instance method of coinex
Returns: Array<Order> - a list of order structures
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 | 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 |
coinex.fetchClosedOrders (symbol[, since, limit, params])
createDepositAddress{docsify-ignore}
create a currency deposit address
Kind: instance method of coinex
Returns: object - an 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 |
coinex.createDepositAddress (code[, params])
fetchDepositAddress{docsify-ignore}
fetch the deposit address for a currency associated with this account
Kind: instance method of coinex
Returns: object - an 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 |
coinex.fetchDepositAddress (code[, params])
fetchMyTrades{docsify-ignore}
fetch all trades made by the user
Kind: instance method of coinex
Returns: Array<Trade> - a list of trade structures
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 |
coinex.fetchMyTrades (symbol[, since, limit, params])
fetchPositions{docsify-ignore}
fetch all open positions
Kind: instance method of coinex
Returns: Array<object> - a list of 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' |
coinex.fetchPositions ([symbols, params])
fetchPosition{docsify-ignore}
fetch data on a single open contract trade position
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchPosition (symbol[, params])
setMarginMode{docsify-ignore}
set margin mode to 'cross' or 'isolated'
Kind: instance method of 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 |
coinex.setMarginMode (marginMode, symbol[, params])
setLeverage{docsify-ignore}
set the level of leverage for a market
Kind: instance method of 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') |
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
Returns: object - 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 | Array<string>, undefined |
Yes | list of unified market symbols |
| params | object |
No | extra parameters specific to the exchange API endpoint |
coinex.fetchLeverageTiers (symbols[, params])
addMargin{docsify-ignore}
add margin
Kind: instance method of coinex
Returns: object - a 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 |
coinex.addMargin (symbol, amount[, params])
reduceMargin{docsify-ignore}
remove margin from a position
Kind: instance method of coinex
Returns: object - a 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 |
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
Returns: object - a 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 |
coinex.fetchFundingHistory (symbol[, since, limit, params])
fetchFundingRate{docsify-ignore}
fetch the current funding rate
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchFundingRate (symbol[, params])
fetchFundingInterval{docsify-ignore}
fetch the current funding rate interval
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchFundingInterval (symbol[, params])
fetchFundingRates{docsify-ignore}
fetch the current funding rates for multiple markets
Kind: instance method of coinex
Returns: Array<object> - 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 | Array<string> |
Yes | unified market symbols |
| params | object |
No | extra parameters specific to the exchange API endpoint |
coinex.fetchFundingRates (symbols[, params])
withdraw{docsify-ignore}
make a withdrawal
Kind: instance method of coinex
Returns: object - a 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 |
No | memo |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.network | string |
No | unified network code |
coinex.withdraw (code, amount, address[, tag, params])
fetchFundingRateHistory{docsify-ignore}
fetches historical funding rate prices
Kind: instance method of coinex
Returns: Array<object> - 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 | 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 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 |
| params.until | int |
No | timestamp in ms of the latest funding rate |
coinex.fetchFundingRateHistory (symbol[, since, limit, params])
transfer{docsify-ignore}
transfer currency internally between wallets on the same account
Kind: instance method of coinex
Returns: object - a 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 |
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
Returns: Array<object> - a list of transfer structures
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 |
coinex.fetchTransfers (code[, since, limit, params])
fetchWithdrawals{docsify-ignore}
fetch all withdrawals made from an account
Kind: instance method of coinex
Returns: Array<object> - a list of transaction structures
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 |
coinex.fetchWithdrawals ([code, since, limit, params])
fetchDeposits{docsify-ignore}
fetch all deposits made to an account
Kind: instance method of coinex
Returns: Array<object> - a list of transaction structures
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 |
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
Returns: object - 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 | 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 |
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
Returns: Array<object> - 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 | 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 |
coinex.fetchBorrowInterest ([code, symbol, since, limit, params])
borrowIsolatedMargin{docsify-ignore}
create a loan to borrow margin
Kind: instance method of coinex
Returns: object - a 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 |
coinex.borrowIsolatedMargin (symbol, code, amount[, params])
repayIsolatedMargin{docsify-ignore}
repay borrowed margin and interest
Kind: instance method of coinex
Returns: object - a 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 |
coinex.repayIsolatedMargin (symbol, code, amount[, params])
fetchDepositWithdrawFee{docsify-ignore}
fetch the fee for deposits and withdrawals
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchDepositWithdrawFee (code[, params])
fetchDepositWithdrawFees{docsify-ignore}
fetch the fees for deposits and withdrawals
Kind: instance method of coinex
Returns: object - 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 | object |
No | extra parameters specific to the exchange API endpoint |
coinex.fetchDepositWithdrawFees (codes[, params])
fetchLeverage{docsify-ignore}
fetch the set leverage for a market
Kind: instance method of coinex
Returns: object - a 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 |
coinex.fetchLeverage (symbol[, params])
fetchPositionHistory{docsify-ignore}
fetches historical positions
Kind: instance method of coinex
Returns: Array<object> - a list of position structures
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 |
coinex.fetchPositionHistory (symbol[, since, limit, params])
closePosition{docsify-ignore}
closes an open position for a market
Kind: instance method of coinex
Returns: object - an order structure
See: https://docs.coinex.com/api/v2/futures/position/http/close-position
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified CCXT market symbol |
| side | string |
No | buy or sell, not used by coinex |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.type | string |
Yes | required by coinex, one of: limit, market, maker_only, ioc or fok, default is market |
| params.price | string |
No | the price to fulfill the order, ignored in market orders |
| params.amount | string |
No | the amount to trade in units of the base currency |
| params.clientOrderId | string |
No | the client id of the order |
coinex.closePosition (symbol[, side, params])
fetchMarginAdjustmentHistory{docsify-ignore}
fetches the history of margin added or reduced from contract isolated positions
Kind: instance method of coinex
Returns: Array<object> - a list of margin structures
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 |
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
Returns: object - a 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 |
coinex.watchBalance ([params])
watchMyTrades{docsify-ignore}
watches information on multiple trades made by the user
Kind: instance method of coinex
Returns: Array<object> - a list of trade structures
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 |
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
Returns: object - a 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 |
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
Returns: object - a dictionary of ticker structures
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 |
coinex.watchTickers (symbols[, params])
watchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol
Kind: instance method of coinex
Returns: Array<object> - a list of trade structures
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 |
coinex.watchTrades (symbol[, since, limit, params])
watchTradesForSymbols{docsify-ignore}
watch the most recent trades for a list of symbols
Kind: instance method of coinex
Returns: Array<object> - a list of trade structures
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 |
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
Returns: object - A dictionary of order book structures 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 |
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
Returns: object - A dictionary of order book structures 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 |
coinex.watchOrderBook (symbol[, limit, params])
watchOrders{docsify-ignore}
watches information on multiple orders made by the user
Kind: instance method of coinex
Returns: Array<object> - a list of order structures
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 |
coinex.watchOrders (symbol[, since, limit, params])
watchBidsAsks{docsify-ignore}
watches best bid & ask for symbols
Kind: instance method of coinex
Returns: object - a 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 |
coinex.watchBidsAsks ([symbols, params])