## cex{docsify-ignore}
**Kind**: global class
**Extends**: Exchange
* [fetchCurrencies](#fetchcurrencies)
* [fetchMarkets](#fetchmarkets)
* [fetchBalance](#fetchbalance)
* [fetchOrderBook](#fetchorderbook)
* [fetchOHLCV](#fetchohlcv)
* [fetchTickers](#fetchtickers)
* [fetchTicker](#fetchticker)
* [fetchTrades](#fetchtrades)
* [fetchTradingFees](#fetchtradingfees)
* [createOrder](#createorder)
* [cancelOrder](#cancelorder)
* [cancelAllOrders](#cancelallorders)
* [fetchOpenOrders](#fetchopenorders)
* [fetchClosedOrders](#fetchclosedorders)
* [fetchOrder](#fetchorder)
* [fetchOrders](#fetchorders)
* [editOrderWs](#editorderws)
* [fetchDepositAddress](#fetchdepositaddress)
* [watchBalance](#watchbalance)
* [watchTrades](#watchtrades)
* [watchTicker](#watchticker)
* [watchTickers](#watchtickers)
* [fetchTickerWs](#fetchtickerws)
* [fetchBalanceWs](#fetchbalancews)
* [watchOrders](#watchorders)
* [watchMyTrades](#watchmytrades)
* [watchOrderBook](#watchorderbook)
* [watchOHLCV](#watchohlcv)
* [fetchOrderWs](#fetchorderws)
* [fetchOpenOrdersWs](#fetchopenordersws)
* [createOrderWs](#createorderws)
* [editOrderWs](#editorderws)
* [cancelOrderWs](#cancelorderws)
* [cancelOrdersWs](#cancelordersws)
### fetchCurrencies{docsify-ignore}
fetches all available currencies on an exchange
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an associative dictionary of currencies
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchCurrencies ([params])
```
### fetchMarkets{docsify-ignore}
retrieves data on all markets for cex
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<object>
- an array of objects representing market data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchMarkets ([params])
```
### fetchBalance{docsify-ignore}
query for balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**: https://docs.cex.io/#account-balance
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchBalance ([params])
```
### fetchOrderBook{docsify-ignore}
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**: https://docs.cex.io/#orderbook
| 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
cex.fetchOrderBook (symbol[, limit, 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 [cex
](#cex)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://docs.cex.io/#historical-ohlcv-chart
| 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
cex.fetchOHLCV (symbol, timeframe[, since, limit, 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 [cex
](#cex)
**Returns**: object
- a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure)
| 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
cex.fetchTickers (symbols[, 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 [cex
](#cex)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.cex.io/#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
cex.fetchTicker (symbol[, params])
```
### fetchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Trade>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.cex.io/#trade-history
| 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
cex.fetchTrades (symbol[, since, limit, params])
```
### fetchTradingFees{docsify-ignore}
fetch the trading fees for multiple markets
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a dictionary of [fee structures](https://docs.ccxt.com/#/?id=fee-structure) indexed by market symbols
**See**: https://docs.cex.io/#get-my-fee
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchTradingFees ([params])
```
### createOrder{docsify-ignore}
create a trade order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**
- https://docs.cex.io/#place-order
- https://cex.io/rest-api#place-order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of currency you want to trade in units of base currency |
| price | float
| No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object
| No | extra parameters specific to the exchange API endpoint |
| params.cost | float
| No | the quote quantity that can be used as an alternative for the amount for market buy orders |
```javascript
cex.createOrder (symbol, type, side, amount[, price, params])
```
### cancelOrder{docsify-ignore}
cancels an open order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#cancel-order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | not used by cex cancelOrder () |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.cancelOrder (id, symbol[, params])
```
### cancelAllOrders{docsify-ignore}
cancel all open orders in a market
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<object>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#cancel-all-orders-for-given-pair
| 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 cex api endpoint |
| params.marginMode | string
| No | 'cross' or 'isolated', for spot margin trading |
```javascript
cex.cancelAllOrders (symbol[, params])
```
### fetchOpenOrders{docsify-ignore}
fetch all unfilled currently open orders
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#open-orders
| 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 orders structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchOpenOrders (symbol[, since, limit, params])
```
### fetchClosedOrders{docsify-ignore}
fetches information on multiple closed orders made by the user
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#archived-orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchClosedOrders (symbol[, since, limit, params])
```
### fetchOrder{docsify-ignore}
fetches information on an order made by the user
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/?python#get-order-details
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | the order id |
| symbol | string
| Yes | not used by cex fetchOrder |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchOrder (id, symbol[, params])
```
### fetchOrders{docsify-ignore}
fetches information on multiple orders made by the user
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#archived-orders
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified market symbol of the market orders were made in |
| since | int
| No | the earliest time in ms to fetch orders for |
| limit | int
| No | the maximum number of order structures to retrieve |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchOrders (symbol[, since, limit, params])
```
### editOrderWs{docsify-ignore}
edit a trade order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an [order structure](https://docs.ccxt.com/en/latest/manual.html#order-structure)
**See**: https://docs.cex.io/#cancel-replace-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
, undefined
| 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 cex api endpoint |
```javascript
cex.editOrderWs (id, symbol, type, side, amount[, price, params])
```
### fetchDepositAddress{docsify-ignore}
fetch the deposit address for a currency associated with this account
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an [address structure](https://docs.ccxt.com/#/?id=address-structure)
**See**: https://docs.cex.io/#get-crypto-address
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| code | string
| Yes | unified currency code |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.fetchDepositAddress (code[, params])
```
### watchBalance{docsify-ignore}
watch balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**: https://cex.io/websocket-api#get-balance
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.watchBalance ([params])
```
### watchTrades{docsify-ignore}
get the list of most recent trades for a particular symbol. Note: can only watch one symbol at a time.
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://cex.io/websocket-api#old-pair-room
| 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
cex.watchTrades (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 [cex
](#cex)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://cex.io/websocket-api#ticker-subscription
| 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 |
| params.method | string
| No | public or private |
```javascript
cex.watchTicker (symbol[, params])
```
### watchTickers{docsify-ignore}
watches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a dictionary of [ticker structures](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://cex.io/websocket-api#ticker-subscription
| 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
cex.watchTickers (symbols[, params])
```
### fetchTickerWs{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 [cex
](#cex)
**Returns**: object
- a [ticker structure](https://docs.ccxt.com/#/?id=ticker-structure)
**See**: https://docs.cex.io/#ws-api-ticker-deprecated
| 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 cex api endpoint |
```javascript
cex.fetchTickerWs (symbol[, params])
```
### fetchBalanceWs{docsify-ignore}
query for balance and get the amount of funds available for trading or funds locked in orders
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a [balance structure](https://docs.ccxt.com/#/?id=balance-structure)
**See**: https://docs.cex.io/#ws-api-get-balance
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| params | object
| No | extra parameters specific to the cex api endpoint |
```javascript
cex.fetchBalanceWs ([params])
```
### watchOrders{docsify-ignore}
get the list of orders associated with the user. Note: In CEX.IO system, orders can be present in trade engine or in archive database. There can be time periods (~2 seconds or more), when order is done/canceled, but still not moved to archive database. That means, you cannot see it using calls: archived-orders/open-orders.
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.cex.io/#ws-api-open-orders
| 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
cex.watchOrders (symbol[, since, limit, params])
```
### watchMyTrades{docsify-ignore}
get the list of trades associated with the user. Note: In CEX.IO system, orders can be present in trade engine or in archive database. There can be time periods (~2 seconds or more), when order is done/canceled, but still not moved to archive database. That means, you cannot see it using calls: archived-orders/open-orders.
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<object>
- a list of [trade structures](https://docs.ccxt.com/#/?id=public-trades)
**See**: https://docs.cex.io/#ws-api-open-orders
| 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
cex.watchMyTrades (symbol[, since, 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 [cex
](#cex)
**Returns**: object
- A dictionary of [order book structures](https://docs.ccxt.com/#/?id=order-book-structure) indexed by market symbols
**See**: https://cex.io/websocket-api#orderbook-subscribe
| 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
cex.watchOrderBook (symbol[, limit, params])
```
### watchOHLCV{docsify-ignore}
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market. It will return the last 120 minutes with the selected timeframe and then 1m candle updates after that.
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Array<int>>
- A list of candles ordered as timestamp, open, high, low, close, volume
**See**: https://cex.io/websocket-api#minute-data
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string
| Yes | the length of time each candle represents. |
| since | int
| No | timestamp in ms of the earliest candle to fetch |
| limit | int
| No | the maximum amount of candles to fetch |
| params | object
| No | extra parameters specific to the exchange API endpoint |
```javascript
cex.watchOHLCV (symbol, timeframe[, since, limit, params])
```
### fetchOrderWs{docsify-ignore}
fetches information on an order made by the user
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#ws-api-get-order
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | the order id |
| symbol | string
| Yes | not used by cex fetchOrder |
| params | object
| No | extra parameters specific to the cex api endpoint |
```javascript
cex.fetchOrderWs (id, symbol[, params])
```
### fetchOpenOrdersWs{docsify-ignore}
fetch all unfilled currently open orders
**Kind**: instance method of [cex
](#cex)
**Returns**: Array<Order>
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#ws-api-open-orders
| 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 orders structures to retrieve |
| params | object
| No | extra parameters specific to the cex api endpoint |
```javascript
cex.fetchOpenOrdersWs (symbol[, since, limit, params])
```
### createOrderWs{docsify-ignore}
create a trade order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an [order structure](https://docs.ccxt.com/en/latest/manual.html#order-structure)
**See**: https://docs.cex.io/#ws-api-order-placement
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| symbol | string
| Yes | unified symbol of the market to create an order in |
| type | string
| Yes | 'market' or 'limit' |
| side | string
| Yes | 'buy' or 'sell' |
| amount | float
| Yes | how much of currency you want to trade in units of base currency |
| price | float
| Yes | 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 kraken api endpoint |
| params.maker_only | boolean
| No | Optional, maker only places an order only if offers best sell (<= max) or buy(>= max) price for this pair, if not order placement will be rejected with an error - "Order is not maker" |
```javascript
cex.createOrderWs (symbol, type, side, amount, price[, params])
```
### editOrderWs{docsify-ignore}
edit a trade order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- an [order structure](https://docs.ccxt.com/en/latest/manual.html#order-structure)
**See**: https://docs.cex.io/#ws-api-cancel-replace
| 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
, undefined
| 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 cex api endpoint |
```javascript
cex.editOrderWs (id, symbol, type, side, amount[, price, params])
```
### cancelOrderWs{docsify-ignore}
cancels an open order
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- An [order structure](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#ws-api-order-cancel
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| id | string
| Yes | order id |
| symbol | string
| Yes | not used by cex cancelOrder () |
| params | object
| No | extra parameters specific to the cex api endpoint |
```javascript
cex.cancelOrderWs (id, symbol[, params])
```
### cancelOrdersWs{docsify-ignore}
cancel multiple orders
**Kind**: instance method of [cex
](#cex)
**Returns**: object
- a list of [order structures](https://docs.ccxt.com/#/?id=order-structure)
**See**: https://docs.cex.io/#ws-api-mass-cancel-place
| Param | Type | Required | Description |
| --- | --- | --- | --- |
| ids | Array<string>
| Yes | order ids |
| symbol | string
| Yes | not used by cex cancelOrders() |
| params | object
| No | extra parameters specific to the cex api endpoint |
```javascript
cex.cancelOrdersWs (ids, symbol[, params])
```