xt
xt cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
🔌 Looking for raw exchange endpoints? See the xt implicit API — every endpoint in this exchange's API exposed as an implicit method.
xt
Kind: global class
Extends: Exchange
- fetchTime
- fetchCurrencies
- fetchMarkets
- fetchOHLCV
- fetchOrderBook
- fetchTicker
- fetchTickers
- fetchBidsAsks
- fetchTrades
- fetchMyTrades
- fetchBalance
- createMarketBuyOrderWithCost
- createOrder
- fetchOrder
- fetchOrders
- fetchOpenOrders
- fetchClosedOrders
- fetchCanceledOrders
- cancelOrder
- cancelAllOrders
- cancelOrders
- fetchLedger
- fetchDepositAddress
- fetchDeposits
- fetchWithdrawals
- withdraw
- setLeverage
- addMargin
- reduceMargin
- fetchLeverageTiers
- fetchMarketLeverageTiers
- fetchFundingRateHistory
- fetchFundingInterval
- fetchFundingRate
- fetchOpenInterest
- fetchFundingHistory
- fetchPosition
- fetchPositions
- transfer
- setMarginMode
- editOrder
fetchTime
fetches the current integer timestamp in milliseconds from the xt server
Kind: instance method of xt
Returns: int - the current integer timestamp in milliseconds from the xt server
See: https://doc.xt.com/docs/spot/Market/GetServerTime
| Param | Type | Description |
|---|---|---|
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchTime (params)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of xt
Returns: object - an associative dictionary of currencies
See: https://doc.xt.com/docs/spot/Deposit&Withdrawal/GetSupportedCurrencies
| Param | Type | Description |
|---|---|---|
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchCurrencies (params)fetchMarkets
retrieves data on all markets for xt
Kind: instance method of xt
Returns: Array<object> - an array of objects representing market data
See
- https://doc.xt.com/docs/spot/Market/GetSymbolInformation
- https://doc.xt.com/docs/futures/MarketData/get-configuration-information-for-listed-and-tradeable-symbols
| Param | Type | Description |
|---|---|---|
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchMarkets (params)fetchOHLCV
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of xt
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://doc.xt.com/docs/spot/Market/GetKlineData
- https://doc.xt.com/docs/futures/MarketData/get-trading-pair-information-of-kline
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch OHLCV data for |
| timeframe | string | Yes | the length of time each candle represents |
| since | int | No | timestamp in ms of the earliest candle to fetch |
| limit | int | No | the maximum amount of candles to fetch |
| params | object | Yes | 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 available parameters |
xt.fetchOHLCV (symbol, timeframe, since?, limit?, params)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of xt
Returns: object - an order book structure
See
- https://doc.xt.com/docs/spot/Market/GetDepthData
- https://doc.xt.com/docs/futures/MarketData/get-depth-data-of-trading-pairs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchOrderBook (symbol, limit?, 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 xt
Returns: object - a ticker structure
See
- https://doc.xt.com/docs/spot/Market/Get24hStatisticsTicker
- https://doc.xt.com/docs/futures/MarketData/get-aggregated-market-information-for-specific-trading-pair
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol to fetch the ticker for |
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchTicker (symbol, params)fetchTickers
fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
Kind: instance method of xt
Returns: object - an array of ticker structures
See
- https://doc.xt.com/docs/spot/Market/Get24hStatisticsTicker
- https://doc.xt.com/docs/futures/MarketData/get_aggregated_market_information_for_all_trading_pairs
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | string | No | unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchTickers (symbols?, params)fetchBidsAsks
fetches the bid and ask price and volume for multiple markets
Kind: instance method of xt
Returns: object - a dictionary of ticker structures
See
- https://doc.xt.com/docs/spot/Market/GetBestPendingOrderTicker
- https://doc.xt.com/docs/futures/MarketData/get-ask-bid-market-information-for-all-trading-pairs
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchBidsAsks (symbols?, params)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of xt
Returns: Array<object> - a list of trade structures
See
- https://doc.xt.com/docs/spot/Market/QueryRecentTransactions
- https://doc.xt.com/docs/futures/MarketData/get-latest-transaction-information-of-trading-pairs
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol 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 | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchTrades (symbol, since?, limit?, params)fetchMyTrades
fetch all trades made by the user
Kind: instance method of xt
Returns: Array<object> - a list of trade structures
See
- https://doc.xt.com/docs/spot/Trade/QueryTrade
- https://doc.xt.com/docs/futures/Order/see-transaction-details
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol 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 | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchMyTrades (symbol?, since?, limit?, params)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of xt
Returns: object - a balance structure
See
| Param | Type | Description |
|---|---|---|
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchBalance (params)createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance method of xt
Returns: object - an order structure
See: https://doc.xt.com/docs/spot/Order/SubmitOrder
| 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 |
xt.createMarketBuyOrderWithCost (symbol, cost, params?)createOrder
create a trade order
Kind: instance method of xt
Returns: object - an order structure
See
- https://doc.xt.com/docs/spot/Order/SubmitOrder
- https://doc.xt.com/docs/futures/Order/Create%20Orders
- https://doc.xt.com/docs/futures/Entrust/CreateTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/CreateStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price to fulfill the order, in units of the quote currency, can be ignored in market orders |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.timeInForce | string | No | 'GTC', 'IOC', 'FOK' or 'GTX' |
| params.entrustType | string | No | 'TAKE_PROFIT', 'STOP', 'TAKE_PROFIT_MARKET', 'STOP_MARKET', 'TRAILING_STOP_MARKET', required if stopPrice is defined, currently isn't functioning on xt's side |
| params.triggerPriceType | string | No | 'INDEX_PRICE', 'MARK_PRICE', 'LATEST_PRICE', required if stopPrice is defined |
| params.triggerPrice | float | No | price to trigger a stop order |
| params.stopPrice | float | No | alias for triggerPrice |
| params.stopLoss | float | No | price to set a stop-loss on an open position |
| params.takeProfit | float | No | price to set a take-profit on an open position |
xt.createOrder (symbol, type, side, amount, price?, params)fetchOrder
fetches information on an order made by the user
Kind: instance method of xt
Returns: object - An order structure
See
- https://doc.xt.com/docs/spot/Order/GetSingleOrder
- https://doc.xt.com/docs/futures/Order/see-orders-by-id
- https://doc.xt.com/docs/futures/Entrust/SeeTriggerOrdersByEntrustId
- https://doc.xt.com/docs/futures/Entrust/SeeStopLimitByProfitId
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified symbol of the market the order was made in |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.fetchOrder (id, symbol?, params)fetchOrders
fetches information on multiple orders made by the user
Kind: instance method of xt
Returns: Array<object> - a list of order structures
See
- https://doc.xt.com/docs/spot/Order/QueryHistoricalOrders
- https://doc.xt.com/docs/futures/Order/see-order-history
- https://doc.xt.com/docs/futures/Entrust/SeeTriggerOrdersHistory
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
xt.fetchOrders (symbol?, since?, limit?, params)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of xt
Returns: Array<object> - a list of order structures
See
- https://doc.xt.com/docs/spot/Order/QueryOpenOrders
- https://doc.xt.com/docs/futures/Order/see-orders
- https://doc.xt.com/docs/futures/Entrust/SeeTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/SeeStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the maximum number of open order structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.fetchOpenOrders (symbol?, since?, limit?, params)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of xt
Returns: Array<object> - a list of order structures
See
- https://doc.xt.com/docs/spot/Order/QueryHistoricalOrders
- https://doc.xt.com/docs/futures/Order/see-orders
- https://doc.xt.com/docs/futures/Entrust/SeeTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/SeeStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.fetchClosedOrders (symbol?, since?, limit?, params)fetchCanceledOrders
fetches information on multiple canceled orders made by the user
Kind: instance method of xt
Returns: object - a list of order structures
See
- https://doc.xt.com/docs/spot/Order/QueryHistoricalOrders
- https://doc.xt.com/docs/futures/Order/see-orders
- https://doc.xt.com/docs/futures/Entrust/SeeTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/SeeStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market the orders were made in |
| since | int | No | timestamp in ms of the earliest order |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.fetchCanceledOrders (symbol?, since?, limit?, params)cancelOrder
cancels an open order
Kind: instance method of xt
Returns: object - An order structure
See
- https://doc.xt.com/docs/spot/Order/CancelOrder
- https://doc.xt.com/docs/futures/Order/cancel-orders
- https://doc.xt.com/docs/futures/Entrust/CancelTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/CancelStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | No | unified symbol of the market the order was made in |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.cancelOrder (id, symbol?, params)cancelAllOrders
cancel all open orders in a market
Kind: instance method of xt
Returns: Array<object> - a list of order structures
See
- https://doc.xt.com/docs/spot/Order/CancelCurrentPendingOrder
- https://doc.xt.com/docs/futures/Order/cancel-all-orders
- https://doc.xt.com/docs/futures/Entrust/CancelAllTriggerOrders
- https://doc.xt.com/docs/futures/Entrust/CancelAllStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified market symbol of the market to cancel orders in |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | if the order is a trigger order or not |
| params.stopLossTakeProfit | bool | No | if the order is a stop-loss or take-profit order |
xt.cancelAllOrders (symbol?, params)cancelOrders
cancel multiple orders
Kind: instance method of xt
Returns: Array<object> - a list of order structures
See: https://doc.xt.com/docs/spot/Order/CancelBatchOrder
| Param | Type | Required | Description |
|---|---|---|---|
| ids | Array<string> | Yes | order ids |
| symbol | string | No | unified market symbol of the market to cancel orders in |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.cancelOrders (ids, symbol?, params)fetchLedger
fetch the history of changes, actions done by the user or operations that altered the balance of the user
Kind: instance method of xt
Returns: object - a ledger structure
See: https://doc.xt.com/docs/futures/User/Get%20User's%20Account%20Flow%20Information
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | timestamp in ms of the earliest ledger entry |
| limit | int | No | max number of ledger entries to return |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchLedger (code?, since?, limit?, params)fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance method of xt
Returns: object - an address structure
See: https://doc.xt.com/docs/spot/Deposit&Withdrawal/GetDepositAddress
| Param | Type | Description |
|---|---|---|
| code | string | unified currency code |
| params | object | extra parameters specific to the exchange API endpoint |
| params.network | string | required network id |
xt.fetchDepositAddress (code, params)fetchDeposits
fetch all deposits made to an account
Kind: instance method of xt
Returns: Array<object> - a list of transaction structures
See: https://doc.xt.com/docs/spot/Deposit&Withdrawal/GetDepositHistory
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | the earliest time in ms to fetch deposits for |
| limit | int | No | the maximum number of transaction structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchDeposits (code?, since?, limit?, params)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of xt
Returns: Array<object> - a list of transaction structures
See: https://doc.xt.com/docs/spot/Deposit&Withdrawal/WithdrawHistory
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code |
| since | int | No | the earliest time in ms to fetch withdrawals for |
| limit | int | No | the maximum number of transaction structures to retrieve |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchWithdrawals (code?, since?, limit?, params)withdraw
make a withdrawal
Kind: instance method of xt
Returns: object - a transaction structure
See: https://doc.xt.com/docs/spot/Deposit&Withdrawal/Withdraw
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | the amount to withdraw |
| address | string | Yes | the address to withdraw to |
| tag | string | No | |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.withdraw (code, amount, address, tag?, params)setLeverage
set the level of leverage for a market
Kind: instance method of xt
Returns: object - response from the exchange
See: https://doc.xt.com/docs/futures/User/Adjust%20Leverage
| Param | Type | Description |
|---|---|---|
| leverage | float | the rate of leverage |
| symbol | string | unified market symbol |
| params | object | extra parameters specific to the exchange API endpoint |
| params.positionSide | string | 'LONG' or 'SHORT' |
xt.setLeverage (leverage, symbol, params)addMargin
add margin to a position
Kind: instance method of xt
Returns: object - a margin structure
See: https://doc.xt.com/docs/futures/User/Alter%20Margin
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol |
| amount | float | amount of margin to add |
| params | object | extra parameters specific to the exchange API endpoint |
| params.positionSide | string | 'LONG' or 'SHORT' |
xt.addMargin (symbol, amount, params)reduceMargin
remove margin from a position
Kind: instance method of xt
Returns: object - a margin structure
See: https://doc.xt.com/docs/futures/User/Alter%20Margin
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol |
| amount | float | the amount of margin to remove |
| params | object | extra parameters specific to the exchange API endpoint |
| params.positionSide | string | 'LONG' or 'SHORT' |
xt.reduceMargin (symbol, amount, params)fetchLeverageTiers
retrieve information on the maximum leverage for different trade sizes
Kind: instance method of xt
Returns: object - a dictionary of leverage tiers structures
See: https://doc.xt.com/docs/futures/MarketData/see-leverage-stratification-of-single-trading-pair
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | string | No | a list of unified market symbols |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchLeverageTiers (symbols?, params)fetchMarketLeverageTiers
retrieve information on the maximum leverage for different trade sizes of a single market
Kind: instance method of xt
Returns: object - a leverage tiers structure
See: https://doc.xt.com/docs/futures/MarketData/see-leverage-stratification-of-single-trading-pair
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol |
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchMarketLeverageTiers (symbol, params)fetchFundingRateHistory
fetches historical funding rates
Kind: instance method of xt
Returns: Array<object> - a list of funding rate structures
See: https://doc.xt.com/docs/futures/MarketData/get-funding-rate-records
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | unified symbol of the market to fetch the funding rate history for |
| since | int | No | timestamp in ms of the earliest funding rate to fetch |
| limit | int | No | the maximum amount of [funding rate structures] to fetch |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
| params.paginate | bool | Yes | true/false whether to use the pagination helper to aumatically paginate through the results |
xt.fetchFundingRateHistory (symbol?, since?, limit?, params)fetchFundingInterval
fetch the current funding rate interval
Kind: instance method of xt
Returns: object - a funding rate structure
See: https://doc.xt.com/docs/futures/MarketData/get-funding-rate-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
xt.fetchFundingInterval (symbol, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of xt
Returns: object - a funding rate structure
See: https://doc.xt.com/docs/futures/MarketData/get-funding-rate-information
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol |
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchFundingRate (symbol, params)fetchOpenInterest
retrieves the open interest of a contract trading pair
Kind: instance method of xt
Returns: object - an open interest structure
See: https://doc.xt.com/docs/futures/MarketData/get-the-open-position-of-a-trading-pair
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
xt.fetchOpenInterest (symbol, params?)fetchFundingHistory
fetch the funding history
Kind: instance method of xt
Returns: Array<object> - a list of funding history structures
See: https://doc.xt.com/docs/futures/User/Get%20Fund%20Fee%20Information
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the starting timestamp in milliseconds |
| limit | int | No | the number of entries to return |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchFundingHistory (symbol, since?, limit?, params)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of xt
Returns: object - a position structure
See
- https://doc.xt.com/docs/futures/User/Get%20Position%20Information
- https://doc.xt.com/docs/futures/User/Get%20Margin%20Call%20Information
| Param | Type | Description |
|---|---|---|
| symbol | string | unified market symbol of the market the position is held in |
| params | object | extra parameters specific to the exchange API endpoint |
xt.fetchPosition (symbol, params)fetchPositions
fetch all open positions
Kind: instance method of xt
Returns: Array<object> - a list of position structure
See
- https://doc.xt.com/docs/futures/User/Get%20Position%20Information
- https://doc.xt.com/docs/futures/User/Get%20Margin%20Call%20Information
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | string | No | list of unified market symbols, not supported with xt |
| params | object | Yes | extra parameters specific to the exchange API endpoint |
xt.fetchPositions (symbols?, params)transfer
transfer currency internally between wallets on the same account
Kind: instance method of xt
Returns: object - a transfer structure
See: https://doc.xt.com/docs/spot/Transfer/TransferBetweenUserSystems
| Param | Type | Description |
|---|---|---|
| code | string | unified currency code |
| amount | float | amount to transfer |
| fromAccount | string | account to transfer from - spot, swap, leverage, finance |
| toAccount | string | account to transfer to - spot, swap, leverage, finance |
| params | object | extra parameters specific to the exchange API endpoint |
xt.transfer (code, amount, fromAccount, toAccount, params)setMarginMode
set margin mode to 'cross' or 'isolated'
Kind: instance method of xt
Returns: object - response from the exchange
See: https://doc.xt.com/docs/futures/User/Change%20Position%20Type
| Param | Type | Required | Description |
|---|---|---|---|
| marginMode | string | Yes | 'cross' or 'isolated' |
| symbol | string | No | required |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.positionSide | string | No | required "long" or "short" |
xt.setMarginMode (marginMode, symbol?, params?)editOrder
cancels an order and places a new order
Kind: instance method of xt
Returns: object - an order structure
See
- https://doc.xt.com/docs/spot/Order/UpdateOrderLimit
- https://doc.xt.com/docs/futures/Order/update-orders
- https://doc.xt.com/docs/futures/Entrust/AlterStopLimit
| Param | Type | Required | Description |
|---|---|---|---|
| id | string | Yes | order id |
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much of the currency you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.stopLoss | float | No | price to set a stop-loss on an open position |
| params.takeProfit | float | No | price to set a take-profit on an open position |
xt.editOrder (id, symbol, type, side, amount, price?, params?)