-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
mexc
Kind: global class
Extends: Exchange
- fetchStatus
- fetchTime
- fetchCurrencies
- fetchMarkets
- fetchOrderBook
- fetchTrades
- fetchOHLCV
- fetchTickers
- fetchTicker
- fetchBidsAsks
- createMarketBuyOrderWithCost
- createMarketSellOrderWithCost
- createOrder
- createOrders
- fetchOrder
- fetchOrders
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- cancelOrder
- cancelOrders
- cancelAllOrders
- fetchAccounts
- fetchTradingFee
- fetchBalance
- fetchMyTrades
- fetchOrderTrades
- reduceMargin
- addMargin
- setLeverage
- fetchFundingHistory
- fetchFundingInterval
- fetchFundingRate
- fetchFundingRateHistory
- fetchLeverageTiers
- fetchDepositAddressesByNetwork
- createDepositAddress
- fetchDepositAddress
- fetchDeposits
- fetchWithdrawals
- fetchPosition
- fetchPositions
- fetchTransfer
- fetchTransfers
- transfer
- withdraw
- setPositionMode
- fetchPositionMode
- fetchTransactionFees
- fetchDepositWithdrawFees
- fetchLeverage
- fetchPositionsHistory
- setMarginMode
- watchTicker
- watchTickers
- watchBidsAsks
- watchOHLCV
- watchOrderBook
- watchTrades
- watchMyTrades
- watchOrders
- watchBalance
- watchFundingRate
- unWatchFundingRate
- unWatchTicker
- unWatchTickers
- unWatchBidsAsks
- unWatchOHLCV
- unWatchOrderBook
- unWatchTrades
the latest known information on the availability of the exchange API
Kind: instance method of mexc
Returns: object - a status structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchStatus (params?)fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of mexc
Returns: int - the current integer timestamp in milliseconds from the exchange server
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchTime (params?)fetches all available currencies on an exchange
Kind: instance method of mexc
Returns: object - an associative dictionary of currencies
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchCurrencies (params?)retrieves data on all markets for mexc
Kind: instance method of mexc
Returns: Array<object> - an array of objects representing market data
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchMarkets (params?)fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of mexc
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
| 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 |
mexc.fetchOrderBook (symbol, limit?, params?)get the list of most recent trades for a particular symbol
Kind: instance method of mexc
Returns: Array<Trade> - a list of trade structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
| 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 |
| params.until | int |
No | spot only since must be defined the latest time in ms to fetch entries for |
mexc.fetchTrades (symbol, since?, limit?, params?)fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of mexc
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.mexc.com/api-docs/spot-v3/market-data-endpoints#klinecandlestick-data
- https://www.mexc.com/api-docs/futures/market-endpoints#get-candlestick-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 |
| params.until | int |
No | timestamp in ms of the latest candle to fetch |
| params.paginate | boolean |
No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
mexc.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of mexc
Returns: object - a dictionary of ticker structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
| 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 |
mexc.fetchTickers (symbols, params?)fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of mexc
Returns: object - a ticker structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
| 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 |
mexc.fetchTicker (symbol, params?)fetches the bid and ask price and volume for multiple markets
Kind: instance method of mexc
Returns: object - a dictionary of ticker structures
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker
| Param | Type | Required | Description |
|---|---|---|---|
| symbols |
Array<string>, undefined
|
Yes | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchBidsAsks (symbols, params?)create a market buy order by providing the symbol and cost
Kind: instance method of mexc
Returns: object - an order structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-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 |
mexc.createMarketBuyOrderWithCost (symbol, cost, params?)create a market sell order by providing the symbol and cost
Kind: instance method of mexc
Returns: object - an order structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-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 |
mexc.createMarketSellOrderWithCost (symbol, cost, params?)create a trade order
Kind: instance method of mexc
Returns: object - an order structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
- https://www.mexc.com/api-docs/futures/account-and-trading-endpoints#place-order
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
| 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.marginMode | string |
No | only 'isolated' is supported for spot-margin trading |
| params.triggerPrice | float |
No | The price at which a trigger order is triggered at |
| params.postOnly | bool |
No | if true, the order will only be posted if it will be a maker order |
| params.reduceOnly | bool |
No | contract only indicates if this order is to reduce the size of a position |
| params.hedged | bool |
No | swap only true for hedged mode, false for one way mode, default is false |
| params.timeInForce | string |
No | 'IOC' or 'FOK', default is 'GTC' EXCHANGE SPECIFIC PARAMETERS |
| params.leverage | int |
No | contract only leverage is necessary on isolated margin |
| params.positionId | long |
No | contract only it is recommended to fill in this parameter when closing a position |
| params.externalOid | string |
No | contract only external order ID |
| params.positionMode | int |
No | contract only 1:hedge, 2:one-way, default: the user's current config |
| params.test | boolean |
No | spot only whether to use the test endpoint or not, default is false |
mexc.createOrder (symbol, type, side, amount, price?, params?)spot only all orders must have the same symbol create a list of trade orders
Kind: instance method of mexc
Returns: object - an order structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
| 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 api endpoint |
mexc.createOrders (orders, params?)fetches information on an order made by the user
Kind: instance method of mexc
Returns: object - An order structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-order
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
| 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.marginMode | string |
No | only 'isolated' is supported, for spot-margin trading |
mexc.fetchOrder (id, symbol, params?)fetches information on multiple orders made by the user
Kind: instance method of mexc
Returns: Array<Order> - a list of order structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
| 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.until | int |
No | the latest time in ms to fetch orders for |
| params.marginMode | string |
No | only 'isolated' is supported, for spot-margin trading |
mexc.fetchOrders (symbol, since?, limit?, params?)fetch all unfilled currently open orders
Kind: instance method of mexc
Returns: Array<Order> - a list of order structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#current-open-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
| 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 |
| params.marginMode | string |
No | only 'isolated' is supported, for spot-margin trading |
mexc.fetchOpenOrders (symbol, since?, limit?, params?)fetches information on multiple closed orders made by the user
Kind: instance method of mexc
Returns: Array<Order> - a list of order structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
| 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 |
mexc.fetchClosedOrders (symbol, since?, limit?, params?)fetches information on multiple canceled orders made by the user
Kind: instance method of mexc
Returns: object - a list of order structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol of the market orders were made in |
| since | int |
No | timestamp in ms of the earliest order, default is undefined |
| limit | int |
No | max number of orders to return, default is undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchCanceledOrders (symbol, since?, limit?, params?)cancels an open order
Kind: instance method of mexc
Returns: object - An order structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
| 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.marginMode | string |
No | only 'isolated' is supported for spot-margin trading |
mexc.cancelOrder (id, symbol, params?)cancel multiple orders
Kind: instance method of mexc
Returns: object - an list of order structures
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> |
Yes | order ids |
| symbol | string |
Yes | unified market symbol, default is undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.cancelOrders (ids, symbol, params?)cancel all open orders
Kind: instance method of mexc
Returns: Array<object> - a list of order structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-orders-under-a-contract-under-maintenance
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-trigger-orders-under-maintenance
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string |
No | only 'isolated' is supported for spot-margin trading |
mexc.cancelAllOrders (symbol, params?)fetch all the accounts associated with a profile
Kind: instance method of mexc
Returns: object - a dictionary of account structures indexed by the account type
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchAccounts (params?)fetch the trading fees for a market
Kind: instance method of mexc
Returns: object - a fee structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-mx-deduct-status
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchTradingFee (symbol, params?)query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of mexc
Returns: object - a balance structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#isolated-account
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.symbols | string |
No | // required for margin, market id's separated by commas |
mexc.fetchBalance (params?)fetch all trades made by the user
Kind: instance method of mexc
Returns: Array<Trade> - a list of trade structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
| 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 trades structures to retrieve |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.until | int |
No | the latest time in ms to fetch trades for |
mexc.fetchMyTrades (symbol, since?, limit?, params?)fetch all the trades made from a single order
Kind: instance method of mexc
Returns: Array<object> - a list of trade structures
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
| Param | Type | Required | Description |
|---|---|---|---|
| id | string |
Yes | order id |
| 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 trades to retrieve |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchOrderTrades (id, symbol, since?, limit?, params?)remove margin from a position
Kind: instance method of mexc
Returns: object - a margin structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-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 |
mexc.reduceMargin (symbol, amount, params?)add margin
Kind: instance method of mexc
Returns: object - a margin structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-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 |
mexc.addMargin (symbol, amount, params?)set the level of leverage for a market
Kind: instance method of mexc
Returns: object - response from the exchange
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-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 |
mexc.setLeverage (leverage, symbol, params?)fetch the history of funding payments paid and received on this account
Kind: instance method of mexc
Returns: object - a funding history structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
| 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 |
mexc.fetchFundingHistory (symbol, since?, limit?, params?)fetch the current funding rate interval
Kind: instance method of mexc
Returns: object - a funding rate structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchFundingInterval (symbol, params?)fetch the current funding rate
Kind: instance method of mexc
Returns: object - a funding rate structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchFundingRate (symbol, params?)fetches historical funding rate prices
Kind: instance method of mexc
Returns: Array<object> - a list of funding rate structures
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-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 | not used by mexc, but filtered internally by ccxt |
| limit | int |
No | mexc limit is page_size default 20, maximum is 100 |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchFundingRateHistory (symbol, since?, limit?, params?)retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes, if a market has a leverage tier of 0, then the leverage tiers cannot be obtained for this market
Kind: instance method of mexc
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> |
No | list of unified market symbols |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchLeverageTiers (symbols?, params?)fetch a dictionary of addresses for a currency, indexed by network
Kind: instance method of mexc
Returns: object - a dictionary of address structures indexed by the network
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
| 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 |
mexc.fetchDepositAddressesByNetwork (code, params?)create a currency deposit address
Kind: instance method of mexc
Returns: object - an address structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
| 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 name |
mexc.createDepositAddress (code, params?)fetch the deposit address for a currency associated with this account
Kind: instance method of mexc
Returns: object - an address structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
| 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 chain of currency, this only apply for multi-chain currency, and there is no need for single chain currency |
mexc.fetchDepositAddress (code, params?)fetch all deposits made to an account
Kind: instance method of mexc
Returns: Array<object> - a list of transaction structures
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
| Param | Type | Required | Description |
|---|---|---|---|
| code | string |
Yes | unified currency code |
| since | int |
No | the earliest time in ms to fetch deposits for |
| limit | int |
No | the maximum number of deposits structures to retrieve |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchDeposits (code, since?, limit?, params?)fetch all withdrawals made from an account
Kind: instance method of mexc
Returns: Array<object> - a list of transaction structures
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
| Param | Type | Required | Description |
|---|---|---|---|
| code | string |
Yes | unified currency code |
| since | int |
No | the earliest time in ms to fetch withdrawals for |
| limit | int |
No | the maximum number of withdrawals structures to retrieve |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchWithdrawals (code, since?, limit?, params?)fetch data on a single open contract trade position
Kind: instance method of mexc
Returns: object - a position structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol of the market the position is held in, default is undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchPosition (symbol, params?)fetch all open positions
Kind: instance method of mexc
Returns: Array<object> - a list of position structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
| 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 |
mexc.fetchPositions (symbols, params?)fetches a transfer
Kind: instance method of mexc
Returns: object - a transfer structure
See: https://mexcdevelop.github.io/apidocs/spot_v2_en/#internal-assets-transfer-order-inquiry
| Param | Type | Required | Description |
|---|---|---|---|
| id | string |
Yes | transfer id |
| code | string |
No | not used by mexc fetchTransfer |
| params | object |
Yes | extra parameters specific to the exchange api endpoint |
mexc.fetchTransfer (id, code?, params)fetch a history of internal transfers made on an account
Kind: instance method of mexc
Returns: Array<object> - a list of transfer structures
See
- https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
- https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string |
No | 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 transfers structures to retrieve |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.fromAccountType | string |
No | 'SPOT' for spot wallet, 'FUTURES' for contract wallet |
| params.toAccountType | string |
No | 'SPOT' for spot wallet, 'FUTURES' for contract wallet |
mexc.fetchTransfers (code?, since?, limit?, params?)transfer currency internally between wallets on the same account
Kind: instance method of mexc
Returns: object - a transfer structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-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 | market symbol required for margin account transfers eg:BTCUSDT |
mexc.transfer (code, amount, fromAccount, toAccount, params?)make a withdrawal
Kind: instance method of mexc
Returns: object - a transaction structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
- https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#internal-transfer
| Param | Type | Required | Description |
|---|---|---|---|
| code | string |
Yes | unified currency code |
| amount | float |
Yes | the amount to withdraw |
| address | string |
Yes | the address to withdraw to |
| tag | string |
Yes | |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.internal | object |
No | false by default, set to true for an "internal transfer" |
| params.toAccountType | object |
No | skipped by default, set to 'EMAIL |
mexc.withdraw (code, amount, address, tag, params?)set hedged to true or false for a market
Kind: instance method of mexc
Returns: object - response from the exchange
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#change-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool |
Yes | set to true to use dualSidePosition |
| symbol | string |
Yes | not used by mexc setPositionMode () |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.setPositionMode (hedged, symbol, params?)fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
Kind: instance method of mexc
Returns: object - an object detailing whether the market is in hedged or one-way mode
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | not used by mexc fetchPositionMode |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchPositionMode (symbol, params?)fetch deposit and withdrawal fees
Kind: instance method of mexc
Returns: Array<object> - a list of fee structures
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
| Param | Type | Required | Description |
|---|---|---|---|
| codes |
Array<string>, undefined
|
Yes | returns fees for all currencies if undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchTransactionFees (codes, params?)fetch deposit and withdrawal fees
Kind: instance method of mexc
Returns: Array<object> - a list of fee structures
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
| Param | Type | Required | Description |
|---|---|---|---|
| codes |
Array<string>, undefined
|
Yes | returns fees for all currencies if undefined |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchDepositWithdrawFees (codes, params?)fetch the set leverage for a market
Kind: instance method of mexc
Returns: object - a leverage structure
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.fetchLeverage (symbol, params?)fetches historical positions
Kind: instance method of mexc
Returns: Array<object> - a list of position structures
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> |
No | unified contract symbols |
| since | int |
No | not used by mexc fetchPositionsHistory |
| limit | int |
No | the maximum amount of candles to fetch, default=1000 |
| params | object |
No | extra parameters specific to the exchange api endpoint EXCHANGE SPECIFIC PARAMETERS |
| params.type | int |
No | position type,1: long, 2: short |
| params.page_num | int |
No | current page number, default is 1 |
mexc.fetchPositionsHistory (symbols?, since?, limit?, params?)set margin mode to 'cross' or 'isolated'
Kind: instance method of mexc
Returns: object - response from the exchange
See: https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string |
Yes | 'cross' or 'isolated' |
| symbol | string |
No | required when there is no position, else provide params["positionId"] |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.positionId | string |
No | required when a position is set |
| params.direction | string |
No | "long" or "short" required when there is no position |
mexc.setMarginMode (marginMode, symbol?, params?)watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
Kind: instance method of mexc
Returns: object - a ticker structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#miniticker
| 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.miniTicker | boolean |
No | set to true for using the miniTicker endpoint |
mexc.watchTicker (symbol, params?)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 mexc
Returns: object - a ticker structure
See
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#minitickers
| 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 |
| params.miniTicker | boolean |
No | set to true for using the miniTicker endpoint |
mexc.watchTickers (symbols, params?)watches best bid & ask for symbols
Kind: instance method of mexc
Returns: object - a ticker structure
See: https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
| 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 |
mexc.watchBidsAsks (symbols, params?)watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of mexc
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See: https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams
| 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 |
mexc.watchOHLCV (symbol, timeframe, since?, limit?, params?)watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of mexc
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
| 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 |
| params.frequency | string |
No | the frequency of the order book updates, default is '10ms', can be '100ms' or '10ms |
mexc.watchOrderBook (symbol, limit?, params?)get the list of most recent trades for a particular symbol
Kind: instance method of mexc
Returns: Array<object> - a list of trade structures
See
- https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
| 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 |
mexc.watchTrades (symbol, since?, limit?, params?)watches information on multiple trades made by the user
Kind: instance method of mexc
Returns: Array<object> - a list of trade structures
See
- https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-deals
- https://mexcdevelop.github.io/apidocs/contract_v1_en/#private-channels
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol of the market trades were made in |
| 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 |
mexc.watchMyTrades (symbol, since?, limit?, params?)watches information on multiple orders made by the user
Kind: instance method of mexc
Returns: Array<object> - a list of order structures
See
- https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-orders
- https://mexcdevelop.github.io/apidocs/spot_v3_en/#margin-account-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 |
| params.type |
string, undefined
|
Yes | the type of orders to retrieve, can be 'spot' or 'margin' |
mexc.watchOrders (symbol, since?, limit?, params?)watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of mexc
Returns: object - a balance structure
See: https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-update
| Param | Type | Required | Description |
|---|---|---|---|
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.watchBalance (params?)watch the current funding rate
Kind: instance method of mexc
Returns: object - a funding rate structure
See: https://www.mexc.com/api-docs/futures/websocket-api#funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified market symbol |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.watchFundingRate (symbol, params?)unWatches the current funding rate for a symbol
Kind: instance method of mexc
Returns: object - a funding rate structure
See: https://www.mexc.com/api-docs/futures/websocket-api#funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified symbol of the market |
| params | object |
No | extra parameters specific to the exchange API endpoint |
mexc.unWatchFundingRate (symbol, params?)unWatches 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 mexc
Returns: object - a ticker structure
| 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 |
mexc.unWatchTicker (symbol, params?)unWatches 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 mexc
Returns: object - a ticker structure
| 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 |
mexc.unWatchTickers (symbols, params?)unWatches best bid & ask for symbols
Kind: instance method of mexc
Returns: object - a ticker structure
| 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 |
mexc.unWatchBidsAsks (symbols, params?)unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of mexc
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
| 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 |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.timezone | object |
No | if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00' |
mexc.unWatchOHLCV (symbol, timeframe, params?)unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of mexc
Returns: object - A dictionary of order book structures indexed by market symbols
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified array of symbols |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.frequency | string |
No | the frequency of the order book updates, default is '10ms', can be '100ms' or '10ms |
mexc.unWatchOrderBook (symbol, params?)unsubscribes from the trades channel
Kind: instance method of mexc
Returns: Array<object> - a list of trade structures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string |
Yes | unified symbol of the market to fetch trades for |
| params | object |
No | extra parameters specific to the exchange API endpoint |
| params.name | string |
No | the name of the method to call, 'trade' or 'aggTrade', default is 'trade' |
mexc.unWatchTrades (symbol, params?)(If the page is not being rendered for you, you can refer to the mirror at https://docs.ccxt.com/)
- Install
- Examples
- Manual
- CCXT Pro
- Contributing
- Supported Exchanges
- Exchanges By Country
- API Spec By Method
- FAQ
- Changelog
- Awesome
- API Spec by Exchange
- fetchCurrencies
- alpaca
- apex
- ascendex
- aster
- backpack
- bigone
- binance
- bingx
- bit2c
- bitbank
- bitbns
- bitfinex
- bitflyer
- bitget
- bithumb
- bitmart
- bitmex
- bitopro
- bitrue
- bitso
- bitstamp
- bitteam
- bittrade
- bitvavo
- blockchaincom
- blofin
- btcbox
- btcmarkets
- btcturk
- bullish
- bybit
- bydfi
- cex
- coinbase
- coinbaseexchange
- coinbaseinternational
- coincheck
- coinex
- coinmate
- coinmetro
- coinone
- coinsph
- coinspot
- cryptocom
- cryptomus
- deepcoin
- delta
- deribit
- derive
- digifinex
- dydx
- exmo
- extended
- foxbit
- gate
- gemini
- grvt
- hashkey
- hibachi
- hitbtc
- hollaex
- htx
- hyperliquid
- independentreserve
- indodax
- kraken
- krakenfutures
- kucoin
- fetchBidsAsks
- latoken
- lbank
- lighter
- luno
- mercado
- mexc
- modetrade
- ndax
- novadax
- okx
- onetrading
- p2b
- pacifica
- paradex
- paymium
- phemex
- poloniex
- tokocrypto
- toobit
- upbit
- weex
- whitebit
- woo
- woofipro
- xt
- zaif
- fetchStatus