CCXT

mexc

mexc cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.

mexc

Kind: global class
Extends: Exchange

fetchStatus

the latest known information on the availability of the exchange API

Kind: instance method of mexc
Returns: object - a status structure

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchStatus (params?)

fetchTime

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchTime (params?)

fetchCurrencies

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchCurrencies (params?)

fetchMarkets

retrieves data on all markets for mexc

Kind: instance method of mexc
Returns: Array<object> - an array of objects representing market data

See

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchMarkets (params?)

fetchOrderBook

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchOrderBook (symbol, limit?, params?)

fetchTrades

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNospot only since must be defined the latest time in ms to fetch entries for
mexc.fetchTrades (symbol, since?, limit?, params?)

fetchOHLCV

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNotimestamp in ms of the latest candle to fetch
params.paginatebooleanNodefault 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?)

fetchTickers

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

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchTickers (symbols, params?)

fetchTicker

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchTicker (symbol, params?)

fetchBidsAsks

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

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYesunified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchBidsAsks (symbols, params?)

createMarketBuyOrderWithCost

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.createMarketBuyOrderWithCost (symbol, cost, params?)

createMarketSellOrderWithCost

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
costfloatYeshow much you want to trade in units of the quote currency
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.createMarketSellOrderWithCost (symbol, cost, params?)

createOrder

create a trade order

Kind: instance method of mexc
Returns: object - an order structure

See

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to create an order in
typestringYes'market' or 'limit'
sidestringYes'buy' or 'sell'
amountfloatYeshow much of currency you want to trade in units of base currency
pricefloatNothe price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNoonly 'isolated' is supported for spot-margin trading
params.triggerPricefloatNoThe price at which a trigger order is triggered at
params.postOnlyboolNoif true, the order will only be posted if it will be a maker order
params.reduceOnlyboolNocontract only indicates if this order is to reduce the size of a position
params.hedgedboolNoswap only true for hedged mode, false for one way mode, default is false
params.timeInForcestringNo'IOC' or 'FOK', default is 'GTC' EXCHANGE SPECIFIC PARAMETERS
params.leverageintNocontract only leverage is necessary on isolated margin
params.positionIdlongNocontract only it is recommended to fill in this parameter when closing a position
params.externalOidstringNocontract only external order ID
params.positionModeintNocontract only 1:hedge, 2:one-way, default: the user's current config
params.testbooleanNospot only whether to use the test endpoint or not, default is false
mexc.createOrder (symbol, type, side, amount, price?, params?)

createOrders

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

ParamTypeRequiredDescription
ordersArrayYeslist of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
paramsobjectNoextra parameters specific to api endpoint
mexc.createOrders (orders, params?)

fetchOrder

fetches information on an order made by the user

Kind: instance method of mexc
Returns: object - An order structure

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNoonly 'isolated' is supported, for spot-margin trading
mexc.fetchOrder (id, symbol, params?)

fetchOrders

fetches information on multiple orders made by the user

Kind: instance method of mexc
Returns: Array<Order> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch orders for
params.marginModestringNoonly 'isolated' is supported, for spot-margin trading
mexc.fetchOrders (symbol, since?, limit?, params?)

fetchOpenOrders

fetch all unfilled currently open orders

Kind: instance method of mexc
Returns: Array<Order> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch open orders for
limitintNothe maximum number of open orders structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNoonly 'isolated' is supported, for spot-margin trading
mexc.fetchOpenOrders (symbol, since?, limit?, params?)

fetchClosedOrders

fetches information on multiple closed orders made by the user

Kind: instance method of mexc
Returns: Array<Order> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchClosedOrders (symbol, since?, limit?, params?)

fetchCanceledOrders

fetches information on multiple canceled orders made by the user

Kind: instance method of mexc
Returns: object - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNotimestamp in ms of the earliest order, default is undefined
limitintNomax number of orders to return, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchCanceledOrders (symbol, since?, limit?, params?)

cancelOrder

cancels an open order

Kind: instance method of mexc
Returns: object - An order structure

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified symbol of the market the order was made in
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNoonly 'isolated' is supported for spot-margin trading
mexc.cancelOrder (id, symbol, params?)

cancelOrders

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

ParamTypeRequiredDescription
idsArray<string>Yesorder ids
symbolstringYesunified market symbol, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.cancelOrders (ids, symbol, params?)

cancelAllOrders

cancel all open orders

Kind: instance method of mexc
Returns: Array<object> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
params.marginModestringNoonly 'isolated' is supported for spot-margin trading
mexc.cancelAllOrders (symbol, params?)

fetchAccounts

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchAccounts (params?)

fetchTradingFee

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchTradingFee (symbol, params?)

fetchBalance

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
params.symbolsstringNo// required for margin, market id's separated by commas
mexc.fetchBalance (params?)

fetchMyTrades

fetch all trades made by the user

Kind: instance method of mexc
Returns: Array<Trade> - a list of trade structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.untilintNothe latest time in ms to fetch trades for
mexc.fetchMyTrades (symbol, since?, limit?, params?)

fetchOrderTrades

fetch all the trades made from a single order

Kind: instance method of mexc
Returns: Array<object> - a list of trade structures

See

ParamTypeRequiredDescription
idstringYesorder id
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trades to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchOrderTrades (id, symbol, since?, limit?, params?)

reduceMargin

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
amountfloatYesthe amount of margin to remove
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.reduceMargin (symbol, amount, params?)

addMargin

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
amountfloatYesamount of margin to add
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.addMargin (symbol, amount, params?)

setLeverage

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

ParamTypeRequiredDescription
leveragefloatYesthe rate of leverage
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.setLeverage (leverage, symbol, params?)

fetchFundingHistory

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
sinceintNothe earliest time in ms to fetch funding history for
limitintNothe maximum number of funding history structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchFundingHistory (symbol, since?, limit?, params?)

fetchFundingInterval

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchFundingInterval (symbol, params?)

fetchFundingRate

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchFundingRate (symbol, params?)

fetchFundingRateHistory

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the funding rate history for
sinceintNonot used by mexc, but filtered internally by ccxt
limitintNomexc limit is page_size default 20, maximum is 100
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchLeverageTiers

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

ParamTypeRequiredDescription
symbolsArray<string>Nolist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchLeverageTiers (symbols?, params?)

fetchDepositAddressesByNetwork

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

ParamTypeRequiredDescription
codestringYesunified currency code of the currency for the deposit address
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchDepositAddressesByNetwork (code, params?)

createDepositAddress

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

ParamTypeRequiredDescription
codestringYesunified currency code of the currency for the deposit address
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe blockchain network name
mexc.createDepositAddress (code, params?)

fetchDepositAddress

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

ParamTypeRequiredDescription
codestringYesunified currency code
paramsobjectNoextra parameters specific to the exchange API endpoint
params.networkstringNothe chain of currency, this only apply for multi-chain currency, and there is no need for single chain currency
mexc.fetchDepositAddress (code, params?)

fetchDeposits

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

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch deposits for
limitintNothe maximum number of deposits structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchDeposits (code, since?, limit?, params?)

fetchWithdrawals

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

ParamTypeRequiredDescription
codestringYesunified currency code
sinceintNothe earliest time in ms to fetch withdrawals for
limitintNothe maximum number of withdrawals structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchWithdrawals (code, since?, limit?, params?)

fetchPosition

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market the position is held in, default is undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchPosition (symbol, params?)

fetchPositions

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

ParamTypeRequiredDescription
symbolsArray<string>, undefinedYeslist of unified market symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchPositions (symbols, params?)

fetchTransfer

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

ParamTypeRequiredDescription
idstringYestransfer id
codestringNonot used by mexc fetchTransfer
paramsobjectYesextra parameters specific to the exchange api endpoint
mexc.fetchTransfer (id, code?, params)

fetchTransfers

fetch a history of internal transfers made on an account

Kind: instance method of mexc
Returns: Array<object> - a list of transfer structures

See

ParamTypeRequiredDescription
codestringNounified currency code of the currency transferred
sinceintNothe earliest time in ms to fetch transfers for
limitintNothe maximum number of transfers structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.fromAccountTypestringNo'SPOT' for spot wallet, 'FUTURES' for contract wallet
params.toAccountTypestringNo'SPOT' for spot wallet, 'FUTURES' for contract wallet
mexc.fetchTransfers (code?, since?, limit?, params?)

transfer

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

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesamount to transfer
fromAccountstringYesaccount to transfer from
toAccountstringYesaccount to transfer to
paramsobjectNoextra parameters specific to the exchange API endpoint
params.symbolstringNomarket symbol required for margin account transfers eg:BTCUSDT
mexc.transfer (code, amount, fromAccount, toAccount, params?)

withdraw

make a withdrawal

Kind: instance method of mexc
Returns: object - a transaction structure

See

ParamTypeRequiredDescription
codestringYesunified currency code
amountfloatYesthe amount to withdraw
addressstringYesthe address to withdraw to
tagstringYes
paramsobjectNoextra parameters specific to the exchange API endpoint
params.internalobjectNofalse by default, set to true for an "internal transfer"
params.toAccountTypeobjectNoskipped by default, set to 'EMAIL
mexc.withdraw (code, amount, address, tag, params?)

setPositionMode

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

ParamTypeRequiredDescription
hedgedboolYesset to true to use dualSidePosition
symbolstringYesnot used by mexc setPositionMode ()
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.setPositionMode (hedged, symbol, params?)

fetchPositionMode

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

ParamTypeRequiredDescription
symbolstringYesnot used by mexc fetchPositionMode
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchPositionMode (symbol, params?)

fetchTransactionFees

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

ParamTypeRequiredDescription
codesArray<string>, undefinedYesreturns fees for all currencies if undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchTransactionFees (codes, params?)

fetchDepositWithdrawFees

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

ParamTypeRequiredDescription
codesArray<string>, undefinedYesreturns fees for all currencies if undefined
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchDepositWithdrawFees (codes, params?)

fetchLeverage

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.fetchLeverage (symbol, params?)

fetchPositionsHistory

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

ParamTypeRequiredDescription
symbolsArray<string>Nounified contract symbols
sinceintNonot used by mexc fetchPositionsHistory
limitintNothe maximum amount of candles to fetch, default=1000
paramsobjectNoextra parameters specific to the exchange api endpoint EXCHANGE SPECIFIC PARAMETERS
params.typeintNoposition type,1: long, 2: short
params.page_numintNocurrent page number, default is 1
mexc.fetchPositionsHistory (symbols?, since?, limit?, params?)

setMarginMode

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

ParamTypeRequiredDescription
marginModestringYes'cross' or 'isolated'
symbolstringNorequired when there is no position, else provide params["positionId"]
paramsobjectNoextra parameters specific to the exchange API endpoint
params.positionIdstringNorequired when a position is set
params.directionstringNo"long" or "short" required when there is no position
mexc.setMarginMode (marginMode, symbol?, params?)

watchTicker

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.miniTickerbooleanNoset to true for using the miniTicker endpoint
mexc.watchTicker (symbol, params?)

watchTickers

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

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.miniTickerbooleanNoset to true for using the miniTicker endpoint
mexc.watchTickers (symbols, params?)

watchBidsAsks

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

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchBidsAsks (symbols, params?)

watchOHLCV

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
sinceintNotimestamp in ms of the earliest candle to fetch
limitintNothe maximum amount of candles to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchOHLCV (symbol, timeframe, since?, limit?, params?)

watchOrderBook

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the order book for
limitintNothe maximum amount of order book entries to return
paramsobjectNoextra parameters specific to the exchange API endpoint
params.frequencystringNothe frequency of the order book updates, default is '10ms', can be '100ms' or '10ms
mexc.watchOrderBook (symbol, limit?, params?)

watchTrades

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
sinceintNotimestamp in ms of the earliest trade to fetch
limitintNothe maximum amount of trades to fetch
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchTrades (symbol, since?, limit?, params?)

watchMyTrades

watches information on multiple trades made by the user

Kind: instance method of mexc
Returns: Array<object> - a list of trade structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market trades were made in
sinceintNothe earliest time in ms to fetch trades for
limitintNothe maximum number of trade structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchMyTrades (symbol, since?, limit?, params?)

watchOrders

watches information on multiple orders made by the user

Kind: instance method of mexc
Returns: Array<object> - a list of order structures

See

ParamTypeRequiredDescription
symbolstringYesunified market symbol of the market orders were made in
sinceintNothe earliest time in ms to fetch orders for
limitintNothe maximum number of order structures to retrieve
paramsobjectNoextra parameters specific to the exchange API endpoint
params.typestring, undefinedYesthe type of orders to retrieve, can be 'spot' or 'margin'
mexc.watchOrders (symbol, since?, limit?, params?)

watchBalance

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

ParamTypeRequiredDescription
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchBalance (params?)

watchFundingRate

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

ParamTypeRequiredDescription
symbolstringYesunified market symbol
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.watchFundingRate (symbol, params?)

unWatchFundingRate

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.unWatchFundingRate (symbol, params?)

unWatchTicker

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.unWatchTicker (symbol, params?)

unWatchTickers

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

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.unWatchTickers (symbols, params?)

unWatchBidsAsks

unWatches best bid & ask for symbols

Kind: instance method of mexc
Returns: object - a ticker structure

ParamTypeRequiredDescription
symbolsArray<string>Yesunified symbol of the market to fetch the ticker for
paramsobjectNoextra parameters specific to the exchange API endpoint
mexc.unWatchBidsAsks (symbols, params?)

unWatchOHLCV

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

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch OHLCV data for
timeframestringYesthe length of time each candle represents
paramsobjectNoextra parameters specific to the exchange API endpoint
params.timezoneobjectNoif provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
mexc.unWatchOHLCV (symbol, timeframe, params?)

unWatchOrderBook

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

ParamTypeRequiredDescription
symbolstringYesunified array of symbols
paramsobjectNoextra parameters specific to the exchange API endpoint
params.frequencystringNothe frequency of the order book updates, default is '10ms', can be '100ms' or '10ms
mexc.unWatchOrderBook (symbol, params?)

unWatchTrades

unsubscribes from the trades channel

Kind: instance method of mexc
Returns: Array<object> - a list of trade structures

ParamTypeRequiredDescription
symbolstringYesunified symbol of the market to fetch trades for
paramsobjectNoextra parameters specific to the exchange API endpoint
params.namestringNothe name of the method to call, 'trade' or 'aggTrade', default is 'trade'
mexc.unWatchTrades (symbol, params?)

On this page