htx
htx cryptocurrency exchange — CCXT unified API: methods, parameters and endpoints.
htx
Kind: global class
Extends: Exchange
- fetchStatus
- fetchTime
- fetchTradingFee
- fetchMarkets
- fetchTicker
- fetchTickers
- fetchLastPrices
- fetchOrderBook
- fetchOrderTrades
- fetchMyTrades
- fetchTrades
- fetchOHLCV
- fetchAccounts
- fetchAccountIdByType
- fetchCurrencies
- fetchBalance
- fetchOrder
- fetchOrders
- fetchClosedOrders
- fetchOpenOrders
- createMarketBuyOrderWithCost
- createTrailingPercentOrder
- createOrder
- createOrders
- cancelOrder
- cancelOrders
- cancelAllOrders
- cancelAllOrdersAfter
- fetchDepositAddressesByNetwork
- fetchDepositAddress
- fetchDeposits
- fetchWithdrawals
- withdraw
- transfer
- fetchIsolatedBorrowRates
- fetchFundingRateHistory
- fetchFundingRate
- fetchFundingRates
- fetchBorrowInterest
- fetchFundingHistory
- setLeverage
- fetchPositions
- fetchPosition
- fetchLedger
- fetchLeverageTiers
- fetchOpenInterestHistory
- fetchOpenInterests
- fetchOpenInterest
- borrowIsolatedMargin
- borrowCrossMargin
- repayIsolatedMargin
- repayCrossMargin
- fetchSettlementHistory
- fetchDepositWithdrawFees
- fetchLiquidations
- closePositions
- setPositionMode
- fetchPositionsADLRank
- watchTicker
- unWatchTicker
- watchTrades
- unWatchTrades
- watchOHLCV
- unWatchOHLCV
- watchOrderBook
- unWatchOrderBook
- watchMyTrades
- watchOrders
- watchPositions
- watchBalance
fetchStatus
the latest known information on the availability of the exchange API
Kind: instance method of htx
Returns: object - a status structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-system-status
- https://huobiapi.github.io/docs/dm/v1/en/#get-system-status
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-system-status
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#get-system-status
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#query-whether-the-system-is-available // contractPublicGetHeartbeat
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchStatus (params?)fetchTime
fetches the current integer timestamp in milliseconds from the exchange server
Kind: instance method of htx
Returns: int - the current integer timestamp in milliseconds from the exchange server
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-current-timestamp
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-current-system-timestamp
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchTime (params?)fetchTradingFee
fetch the trading fees for a market
Kind: instance method of htx
Returns: object - a fee structure
See: https://huobiapi.github.io/docs/spot/v1/en/#get-current-fee-rate-applied-to-the-user
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchTradingFee (symbol, params?)fetchMarkets
retrieves data on all markets for huobi
Kind: instance method of htx
Returns: Array<object> - an array of objects representing market data
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-trading-symbol-v1-deprecated
- https://huobiapi.github.io/docs/dm/v1/en/#get-contract-info
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-swap-info
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-swap-info
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchMarkets (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 htx
Returns: object - a ticker structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-latest-aggregated-ticker
- https://huobiapi.github.io/docs/dm/v1/en/#get-market-data-overview
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-data-overview
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-data-overview
| 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 |
htx.fetchTicker (symbol, params?)fetchTickers
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
Kind: instance method of htx
Returns: object - a dictionary of ticker structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-latest-tickers-for-all-pairs
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-a-batch-of-market-data-overview
- https://huobiapi.github.io/docs/dm/v1/en/#get-a-batch-of-market-data-overview
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-a-batch-of-market-data-overview-v2
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | 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 |
htx.fetchTickers (symbols?, params?)fetchLastPrices
fetches the last price for multiple markets
Kind: instance method of htx
Returns: object - a dictionary of lastprices structures
See
- https://www.htx.com/en-us/opend/newApiPages/?id=8cb81024-77b5-11ed-9966-0242ac110003 linear swap & linear future
- https://www.htx.com/en-us/opend/newApiPages/?id=28c2e8fc-77ae-11ed-9966-0242ac110003 inverse future
- https://www.htx.com/en-us/opend/newApiPages/?id=5d517ef5-77b6-11ed-9966-0242ac110003 inverse swap
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | unified symbols of the markets to fetch the last prices |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchLastPrices (symbols?, params?)fetchOrderBook
fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of htx
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-market-depth
- https://huobiapi.github.io/docs/dm/v1/en/#get-market-depth
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-market-depth
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-market-depth
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| limit | int | No | the maximum amount of order book entries to return |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchOrderBook (symbol, limit?, params?)fetchOrderTrades
fetch all the trades made from a single order
Kind: instance method of htx
Returns: Array<object> - a list of trade structures
See: https://huobiapi.github.io/docs/spot/v1/en/#get-the-match-result-of-an-order
| 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 |
htx.fetchOrderTrades (id, symbol, since?, limit?, params?)fetchMyTrades
fetch all trades made by the user
Kind: instance method of htx
Returns: Array<Trade> - a list of trade structures
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-match-results-via-multiple-fields-new
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-match-results-via-multiple-fields-new
- https://huobiapi.github.io/docs/spot/v1/en/#search-match-results
| 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 |
| 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 |
htx.fetchMyTrades (symbol, since?, limit?, params?)fetchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of htx
Returns: Array<Trade> - a list of trade structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-the-most-recent-trades
- https://huobiapi.github.io/docs/dm/v1/en/#query-a-batch-of-trade-records-of-a-contract
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-trade-records-of-a-contract
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-trade-records-of-a-contract
| 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 |
htx.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 htx
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-klines-candles
- https://huobiapi.github.io/docs/dm/v1/en/#get-kline-data
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-kline-data
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-kline-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.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
| params.useHistoricalEndpointForSpot | string | No | true/false - whether use the historical candles endpoint for spot markets or default klines endpoint |
htx.fetchOHLCV (symbol, timeframe, since?, limit?, params?)fetchAccounts
fetch all the accounts associated with a profile
Kind: instance method of htx
Returns: object - a dictionary of account structures indexed by the account type
See: https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchAccounts (params?)fetchAccountIdByType
fetch all the accounts by a type and marginModeassociated with a profile
Kind: instance method of htx
Returns: object - a dictionary of account structures indexed by the account type
See: https://huobiapi.github.io/docs/spot/v1/en/#get-all-accounts-of-the-current-user
| Param | Type | Required | Description |
|---|---|---|---|
| type | string | Yes | 'spot', 'swap' or 'future |
| marginMode | string | No | 'cross' or 'isolated' |
| symbol | string | No | unified ccxt market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchAccountIdByType (type, marginMode?, symbol?, params?)fetchCurrencies
fetches all available currencies on an exchange
Kind: instance method of htx
Returns: object - an associative dictionary of currencies
See: https://huobiapi.github.io/docs/spot/v1/en/#apiv2-currency-amp-chains
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchCurrencies (params?)fetchBalance
query for balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of htx
Returns: object - a balance structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-account-balance-of-a-specific-account
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec4b429-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=10000074-77b7-11ed-9966-0242ac110003
- https://huobiapi.github.io/docs/dm/v1/en/#query-asset-valuation
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-account-information
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-account-information
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-account-information
- https://www.htx.com/en-us/opend/newApiPages/?id=8cb89359-77b5-11ed-9966-19588469969
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.subType | string | No | linear or future |
| params.uta | bool | No | provide this parameter if you have a recent account with unified cross+isolated margin account |
| params.multiAssetMode | bool | No | set to true if you are using multi-asset mode for USDT-margined contracts |
htx.fetchBalance (params?)fetchOrder
fetches information on an order made by the user
Kind: instance method of htx
Returns: object - An order structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order-based-on-client-order-id
- https://huobiapi.github.io/docs/spot/v1/en/#get-the-order-detail-of-an-order
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-information-of-an-order
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-information-of-order
- https://huobiapi.github.io/docs/dm/v1/en/#get-information-of-an-order
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-information-of-an-order
| 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 |
htx.fetchOrder (id, symbol, params?)fetchOrders
fetches information on multiple orders made by the user
Kind: instance method of htx
Returns: Array<Order> - a list of order structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
- https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol of the market orders were made in |
| since | int | No | the earliest time in ms to fetch orders for |
| limit | int | No | the maximum number of order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | contract only if the orders are trigger trigger orders or not |
| params.stopLossTakeProfit | bool | No | contract only if the orders are stop-loss or take-profit orders |
| params.until | int | No | the latest time in ms to fetch entries for |
| params.trailing | boolean | No | contract only set to true if you want to fetch trailing stop orders |
htx.fetchOrders (symbol, since?, limit?, params?)fetchClosedOrders
fetches information on multiple closed orders made by the user
Kind: instance method of htx
Returns: Array<Order> - a list of order structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#search-past-orders
- https://huobiapi.github.io/docs/spot/v1/en/#search-historical-orders-within-48-hours
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-get-history-orders-new
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-get-history-orders-new
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-history-orders-new
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-history-orders-via-multiple-fields-new
| 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 entries for |
| 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 |
htx.fetchClosedOrders (symbol, since?, limit?, params?)fetchOpenOrders
fetch all unfilled currently open orders
Kind: instance method of htx
Returns: Array<Order> - a list of order structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#get-all-open-orders
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-current-unfilled-order-acquisition
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-current-unfilled-order-acquisition
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| since | int | No | the earliest time in ms to fetch open orders for |
| limit | int | No | the maximum number of open order structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.trigger | bool | No | contract only if the orders are trigger trigger orders or not |
| params.stopLossTakeProfit | bool | No | contract only if the orders are stop-loss or take-profit orders |
| params.trailing | boolean | No | contract only set to true if you want to fetch trailing stop orders |
htx.fetchOpenOrders (symbol, since?, limit?, params?)createMarketBuyOrderWithCost
create a market buy order by providing the symbol and cost
Kind: instance method of htx
Returns: object - an order structure
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec4ee16-7773-11ed-9966-0242ac110003
| 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 |
htx.createMarketBuyOrderWithCost (symbol, cost, params?)createTrailingPercentOrder
create a trailing order by providing the symbol, type, side, amount, price and trailingPercent
Kind: instance method of htx
Returns: object - an order structure
| 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, or number of contracts |
| price | float | No | the price for the order to be filled at, in units of the quote currency, ignored in market orders |
| trailingPercent | float | Yes | the percent to trail away from the current market price |
| trailingTriggerPrice | float | Yes | the price to activate a trailing order, default uses the price argument |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.createTrailingPercentOrder (symbol, type, side, amount, price?, trailingPercent, trailingTriggerPrice, params?)createOrder
create a trade order
Kind: instance method of htx
Returns: object - an order structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#place-a-new-order // spot, margin
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-an-order // coin-m swap
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-trigger-order // coin-m swap trigger
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-an-order // usdt-m swap cross
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-trigger-order // usdt-m swap cross trigger
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-an-order // usdt-m swap isolated
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-trigger-order // usdt-m swap isolated trigger
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-set-a-take-profit-and-stop-loss-order-for-an-existing-position
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-set-a-take-profit-and-stop-loss-order-for-an-existing-position
- https://huobiapi.github.io/docs/dm/v1/en/#place-an-order // coin-m futures
- https://huobiapi.github.io/docs/dm/v1/en/#place-trigger-order // coin-m futures contract trigger
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to create an order in |
| type | string | Yes | 'market' or 'limit' |
| side | string | Yes | 'buy' or 'sell' |
| amount | float | Yes | how much you want to trade in units of the base currency |
| price | float | No | the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.triggerPrice | float | No | the price a trigger order is triggered at |
| params.triggerType | string | No | contract trigger orders only ge: greater than or equal to, le: less than or equal to |
| params.stopLossPrice | float | No | contract only the price a stop-loss order is triggered at |
| params.takeProfitPrice | float | No | contract only the price a take-profit order is triggered at |
| params.operator | string | No | spot and margin only gte or lte, trigger price condition |
| params.offset | string | No | contract only 'both' (linear only), 'open', or 'close', required in hedge mode and for inverse markets |
| params.postOnly | bool | No | contract only true or false |
| params.leverRate | int | No | contract only required for all contract orders except tpsl, leverage greater than 20x requires prior approval of high-leverage agreement |
| params.timeInForce | string | No | supports 'IOC' and 'FOK' |
| params.cost | float | No | spot market buy only the quote quantity that can be used as an alternative for the amount |
| params.trailingPercent | float | No | contract only the percent to trail away from the current market price |
| params.trailingTriggerPrice | float | No | contract only the price to trigger a trailing order, default uses the price argument |
| params.hedged | bool | No | contract only true for hedged mode, false for one way mode, default is false |
htx.createOrder (symbol, type, side, amount, price?, params?)createOrders
create a list of trade orders
Kind: instance method of htx
Returns: object - an order structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#place-a-batch-of-orders
- https://huobiapi.github.io/docs/dm/v1/en/#place-a-batch-of-orders
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-a-batch-of-orders
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-a-batch-of-orders
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-a-batch-of-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 the exchange API endpoint |
htx.createOrders (orders, params?)cancelOrder
cancels an open order
Kind: instance method of htx
Returns: object - An order structure
| 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.trigger | boolean | No | contract only if the order is a trigger trigger order or not |
| params.stopLossTakeProfit | boolean | No | contract only if the order is a stop-loss or take-profit order |
| params.trailing | boolean | No | contract only set to true if you want to cancel a trailing order |
htx.cancelOrder (id, symbol, params?)cancelOrders
cancel multiple orders
Kind: instance method of htx
Returns: object - an list of order structures
| 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 |
| params.trigger | bool | No | contract only if the orders are trigger trigger orders or not |
| params.stopLossTakeProfit | bool | No | contract only if the orders are stop-loss or take-profit orders |
htx.cancelOrders (ids, symbol, params?)cancelAllOrders
cancel all open orders
Kind: instance method of htx
Returns: Array<object> - a list of order structures
| 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.trigger | boolean | No | contract only if the orders are trigger trigger orders or not |
| params.stopLossTakeProfit | boolean | No | contract only if the orders are stop-loss or take-profit orders |
| params.trailing | boolean | No | contract only set to true if you want to cancel all trailing orders |
htx.cancelAllOrders (symbol, params?)cancelAllOrdersAfter
dead man's switch, cancel all orders after the given timeout
Kind: instance method of htx
Returns: object - the api result
See: https://huobiapi.github.io/docs/spot/v1/en/#dead-man-s-switch
| Param | Type | Required | Description |
|---|---|---|---|
| timeout | number | Yes | time in milliseconds, 0 represents cancel the timer |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.cancelAllOrdersAfter (timeout, params?)fetchDepositAddressesByNetwork
fetch a dictionary of addresses for a currency, indexed by network
Kind: instance method of htx
Returns: object - a dictionary of address structures indexed by the network
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
| 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 |
htx.fetchDepositAddressesByNetwork (code, params?)fetchDepositAddress
fetch the deposit address for a currency associated with this account
Kind: instance method of htx
Returns: object - an address structure
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec50029-7773-11ed-9966-0242ac110003
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchDepositAddress (code, params?)fetchDeposits
fetch all deposits made to an account
Kind: instance method of htx
Returns: Array<object> - a list of transaction structures
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec4f050-7773-11ed-9966-0242ac110003
| 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 |
htx.fetchDeposits (code, since?, limit?, params?)fetchWithdrawals
fetch all withdrawals made from an account
Kind: instance method of htx
Returns: Array<object> - a list of transaction structures
See: https://huobiapi.github.io/docs/spot/v1/en/#search-for-existed-withdraws-and-deposits
| 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 |
htx.fetchWithdrawals (code, since?, limit?, params?)withdraw
make a withdrawal
Kind: instance method of htx
Returns: object - a transaction structure
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec4cc41-7773-11ed-9966-0242ac110003
| 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 |
htx.withdraw (code, amount, address, tag, params?)transfer
transfer currency internally between wallets on the same account
Kind: instance method of htx
Returns: object - a transfer structure
See
- https://huobiapi.github.io/docs/dm/v1/en/#transfer-margin-between-spot-account-and-future-account
- https://huobiapi.github.io/docs/spot/v1/en/#transfer-fund-between-spot-account-and-future-contract-account
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-transfer-margin-between-spot-account-and-usdt-margined-contracts-account
- https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-cross-margin-account-cross
- https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-spot-trading-account-to-isolated-margin-account-isolated
- https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-cross-margin-account-to-spot-trading-account-cross
- https://huobiapi.github.io/docs/spot/v1/en/#transfer-asset-from-isolated-margin-account-to-spot-trading-account-isolated
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| amount | float | Yes | amount to transfer |
| fromAccount | string | Yes | account to transfer from 'spot', 'future', 'swap' |
| toAccount | string | Yes | account to transfer to 'spot', 'future', 'swap' |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.symbol | string | No | used for isolated margin transfer |
| params.subType | string | No | 'linear' or 'inverse', only used when transfering to/from swap accounts |
htx.transfer (code, amount, fromAccount, toAccount, params?)fetchIsolatedBorrowRates
fetch the borrow interest rates of all currencies
Kind: instance method of htx
Returns: object - a list of isolated borrow rate structures
See: https://huobiapi.github.io/docs/spot/v1/en/#get-loan-interest-rate-and-quota-isolated
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchIsolatedBorrowRates (params?)fetchFundingRateHistory
fetches historical funding rate prices
Kind: instance method of htx
Returns: Array<object> - a list of funding rate structures
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-funding-rate
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-funding-rate
| 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 huobi, but filtered internally by ccxt |
| limit | int | No | not used by huobi, but filtered internally by ccxt |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.paginate | boolean | No | default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters |
htx.fetchFundingRateHistory (symbol, since?, limit?, params?)fetchFundingRate
fetch the current funding rate
Kind: instance method of htx
Returns: object - a funding rate structure
See
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-funding-rate
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-funding-rate
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchFundingRate (symbol, params?)fetchFundingRates
fetch the funding rate for multiple markets
Kind: instance method of htx
Returns: Array<object> - a list of funding rate structures, indexed by market symbols
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-a-batch-of-funding-rate
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-a-batch-of-funding-rate
| 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 |
htx.fetchFundingRates (symbols, params?)fetchBorrowInterest
fetch the interest owed by the user for borrowing currency for margin trading
Kind: instance method of htx
Returns: Array<object> - a list of borrow interest structures
See
- https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-cross
- https://huobiapi.github.io/docs/spot/v1/en/#search-past-margin-orders-isolated
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code |
| symbol | string | Yes | unified market symbol when fetch interest in isolated markets |
| since | int | No | the earliest time in ms to fetch borrrow interest for |
| limit | int | No | the maximum number of structures to retrieve |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchBorrowInterest (code, symbol, since?, limit?, params?)fetchFundingHistory
fetch the history of funding payments paid and received on this account
Kind: instance method of htx
Returns: object - a funding history structure
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-account-financial-records-via-multiple-fields-new // linear swaps
- https://huobiapi.github.io/docs/dm/v1/en/#query-financial-records-via-multiple-fields-new // coin-m futures
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-financial-records-via-multiple-fields-new // coin-m swaps
| 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 |
htx.fetchFundingHistory (symbol, since?, limit?, params?)setLeverage
set the level of leverage for a market
Kind: instance method of htx
Returns: object - response from the exchange
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-leverage
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-leverage
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#switch-leverage
- https://huobiapi.github.io/docs/dm/v1/en/#switch-leverage // Coin-m futures
| 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 |
htx.setLeverage (leverage, symbol, params?)fetchPositions
fetch all open positions
Kind: instance method of htx
Returns: Array<object> - a list of position structure
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-user-39-s-position-information
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-user-s-position-information
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-user-s-position-information
- https://huobiapi.github.io/docs/dm/v1/en/#query-user-s-position-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 |
| params.subType | string | No | 'linear' or 'inverse' |
| params.type | string | No | inverse only 'future', or 'swap' |
| params.marginMode | string | No | linear only 'cross' or 'isolated' |
htx.fetchPositions (symbols?, params?)fetchPosition
fetch data on a single open contract trade position
Kind: instance method of htx
Returns: object - a position structure
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-query-assets-and-positions
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-query-assets-and-positions
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-assets-and-positions
- https://huobiapi.github.io/docs/dm/v1/en/#query-assets-and-positions
| 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 |
htx.fetchPosition (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 htx
Returns: object - a ledger structure
See: https://huobiapi.github.io/docs/spot/v1/en/#get-account-history
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | No | unified currency code, default is undefined |
| since | int | No | timestamp in ms of the earliest ledger entry, default is undefined |
| limit | int | No | max number of ledger entries to return, default is undefined |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.until | int | No | the latest time in ms to fetch entries for |
| 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 |
htx.fetchLedger (code?, since?, limit?, params?)fetchLeverageTiers
retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
Kind: instance method of htx
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols
| 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 |
htx.fetchLeverageTiers (symbols, params?)fetchOpenInterestHistory
Retrieves the open interest history of a currency
Kind: instance method of htx
Returns: object - an array of open interest structures
See
- https://huobiapi.github.io/docs/dm/v1/en/#query-information-on-open-interest
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-information-on-open-interest
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-information-on-open-interest
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| timeframe | string | Yes | '1h', '4h', '12h', or '1d' |
| since | int | No | Not used by huobi api, but response parsed by CCXT |
| limit | int | No | Default:48,Data Range [1,200] |
| params | object | No | Exchange specific parameters |
| params.amount_type | int | No | required Open interest unit. 1-cont,2-cryptocurrency |
| params.pair | int | No | eg BTC-USDT Only for USDT-M |
htx.fetchOpenInterestHistory (symbol, timeframe, since?, limit?, params?)fetchOpenInterests
Retrieves the open interest for a list of symbols
Kind: instance method of htx
Returns: Array<object> - a list of open interest structures
See
- https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | a list of unified CCXT market symbols |
| params | object | No | exchange specific parameters |
htx.fetchOpenInterests (symbols?, params?)fetchOpenInterest
Retrieves the open interest of a currency
Kind: instance method of htx
Returns: object - an open interest structure/docs/manual#open-interest-structure
See
- https://huobiapi.github.io/docs/dm/v1/en/#get-contract-open-interest-information
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#get-swap-open-interest-information
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-get-swap-open-interest-information
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | Unified CCXT market symbol |
| params | object | No | exchange specific parameters |
htx.fetchOpenInterest (symbol, params?)borrowIsolatedMargin
create a loan to borrow margin
Kind: instance method of htx
Returns: object - a margin loan structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
- https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol, required for isolated margin |
| code | string | Yes | unified currency code of the currency to borrow |
| amount | float | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.borrowIsolatedMargin (symbol, code, amount, params?)borrowCrossMargin
create a loan to borrow margin
Kind: instance method of htx
Returns: object - a margin loan structure
See
- https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-isolated
- https://huobiapi.github.io/docs/spot/v1/en/#request-a-margin-loan-cross
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to borrow |
| amount | float | Yes | the amount to borrow |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.borrowCrossMargin (code, amount, params?)repayIsolatedMargin
repay borrowed margin and interest
Kind: instance method of htx
Returns: object - a margin loan structure
See: https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified market symbol |
| code | string | Yes | unified currency code of the currency to repay |
| amount | float | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.repayIsolatedMargin (symbol, code, amount, params?)repayCrossMargin
repay borrowed margin and interest
Kind: instance method of htx
Returns: object - a margin loan structure
See: https://huobiapi.github.io/docs/spot/v1/en/#repay-margin-loan-cross-isolated
| Param | Type | Required | Description |
|---|---|---|---|
| code | string | Yes | unified currency code of the currency to repay |
| amount | float | Yes | the amount to repay |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.repayCrossMargin (code, amount, params?)fetchSettlementHistory
Fetches historical settlement records
Kind: instance method of htx
Returns: Array<object> - a list of settlement history objects
See
- https://huobiapi.github.io/docs/dm/v1/en/#query-historical-settlement-records-of-the-platform-interface
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-historical-settlement-records-of-the-platform-interface
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-historical-settlement-records-of-the-platform-interface
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the settlement history for |
| since | int | No | timestamp in ms, value range = current time - 90 days,default = current time - 90 days |
| limit | int | No | page items, default 20, shall not exceed 50 |
| params | object | No | exchange specific params |
| params.until | int | No | timestamp in ms, value range = start_time -> current time,default = current time |
| params.page_index | int | No | page index, default page 1 if not filled |
| params.code | int | No | unified currency code, can be used when symbol is undefined |
htx.fetchSettlementHistory (symbol, since?, limit?, params?)fetchDepositWithdrawFees
fetch deposit and withdraw fees
Kind: instance method of htx
Returns: Array<object> - a list of fees structures
See: https://huobiapi.github.io/docs/spot/v1/en/#get-all-supported-currencies-v2
| Param | Type | Required | Description |
|---|---|---|---|
| codes | Array<string>, undefined | Yes | list of unified currency codes |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchDepositWithdrawFees (codes, params?)fetchLiquidations
retrieves the public liquidations of a trading pair
Kind: instance method of htx
Returns: object - an array of liquidation structures
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-query-liquidation-orders-new
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#query-liquidation-orders-new
- https://huobiapi.github.io/docs/dm/v1/en/#query-liquidation-order-information-new
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| since | int | No | the earliest time in ms to fetch liquidations for |
| limit | int | No | the maximum number of liquidation structures to retrieve |
| params | object | No | exchange specific parameters for the huobi api endpoint |
| params.until | int | No | timestamp in ms of the latest liquidation |
| params.tradeType | int | No | default 0, linear swap 0: all liquidated orders, 5: liquidated longs; 6: liquidated shorts, inverse swap and future 0: filled liquidated orders, 5: liquidated close orders, 6: liquidated open orders |
htx.fetchLiquidations (symbol, since?, limit?, params?)closePositions
closes open positions for a contract market, requires 'amount' in params, unlike other exchanges
Kind: instance method of htx
Returns: object - an order structure
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-place-lightning-close-order // USDT-M (isolated)
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-place-lightning-close-position // USDT-M (cross)
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#place-lightning-close-order // Coin-M swap
- https://huobiapi.github.io/docs/dm/v1/en/#place-flash-close-order // Coin-M futures
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified CCXT market symbol |
| side | string | Yes | 'buy' or 'sell', the side of the closing order, opposite side as position side |
| params | object | No | extra parameters specific to the okx api endpoint |
| params.clientOrderId | string | No | client needs to provide unique API and have to maintain the API themselves afterwards. [1, 9223372036854775807] |
| params.marginMode | object | No | 'cross' or 'isolated', required for linear markets EXCHANGE SPECIFIC PARAMETERS |
| params.amount | number | No | order quantity |
| params.order_price_type | string | No | 'lightning' by default, 'lightning_fok': lightning fok type, 'lightning_ioc': lightning ioc type 'market' by default, 'market': market order type, 'lightning_fok': lightning |
htx.closePositions (symbol, side, params?)setPositionMode
set hedged to true or false
Kind: instance method of htx
Returns: object - response from the exchange
See
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#isolated-switch-position-mode
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#cross-switch-position-mode
| Param | Type | Required | Description |
|---|---|---|---|
| hedged | bool | Yes | set to true to for hedged mode, must be set separately for each market in isolated margin mode, only valid for linear markets |
| symbol | string | No | unified market symbol, required for isolated margin mode |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.marginMode | string | No | "cross" (default) or "isolated" |
htx.setPositionMode (hedged, symbol?, params?)fetchPositionsADLRank
fetches the auto deleveraging rank and risk percentage for a list of symbols
Kind: instance method of htx
Returns: Array<object> - an array of auto de leverage structures
See
- https://www.htx.com/en-us/opend/newApiPages/?id=8cb81b5a-77b5-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=8cb81c49-77b5-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c2f164-77ae-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=5d518648-77b6-11ed-9966-0242ac110003
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | a list of unified market symbols |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.fetchPositionsADLRank (symbols?, 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 htx
Returns: object - a ticker structure
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
| 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 |
htx.watchTicker (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 htx
Returns: object - a ticker structure
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53561-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33ab2-77ae-11ed-9966-0242ac110003
| 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 |
htx.unWatchTicker (symbol, params?)watchTrades
get the list of most recent trades for a particular symbol
Kind: instance method of htx
Returns: Array<object> - a list of trade structures
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33cfe-77ae-11ed-9966-0242ac110003
| 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 |
htx.watchTrades (symbol, since?, limit?, params?)unWatchTrades
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 htx
Returns: object - a ticker structure
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53b69-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33c21-77ae-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33cfe-77ae-11ed-9966-0242ac110003
| 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 |
htx.unWatchTrades (symbol, params?)watchOHLCV
watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of htx
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33563-77ae-11ed-9966-0242ac110003
| 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 |
htx.watchOHLCV (symbol, timeframe, since?, limit?, params?)unWatchOHLCV
unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market
Kind: instance method of htx
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec53241-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c3346a-77ae-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c33563-77ae-11ed-9966-0242ac110003
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market |
| 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' |
htx.unWatchOHLCV (symbol, timeframe, params?)watchOrderBook
watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
Kind: instance method of htx
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
| 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 |
htx.watchOrderBook (symbol, limit?, params?)unWatchOrderBook
unsubscribe from the orderbook channel
Kind: instance method of htx
Returns: object - A dictionary of order book structures indexed by market symbols
See
- https://huobiapi.github.io/docs/dm/v1/en/#subscribe-market-depth-data
- https://huobiapi.github.io/docs/coin_margined_swap/v1/en/#subscribe-incremental-market-depth-data
- https://huobiapi.github.io/docs/usdt_swap/v1/en/#general-subscribe-incremental-market-depth-data
| Param | Type | Required | Description |
|---|---|---|---|
| symbol | string | Yes | unified symbol of the market to fetch the order book for |
| params | object | No | extra parameters specific to the exchange API endpoint |
| params.limit | int | No | orderbook limit, default is undefined |
htx.unWatchOrderBook (symbol, params?)watchMyTrades
watches information on multiple trades made by the user
Kind: instance method of htx
Returns: Array<object> - a list of trade structures
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec53dd5-7773-11ed-9966-0242ac110003
| 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 |
htx.watchMyTrades (symbol, since?, limit?, params?)watchOrders
watches information on multiple orders made by the user
Kind: instance method of htx
Returns: Array<object> - a list of order structures
See: https://www.htx.com/en-us/opend/newApiPages/?id=7ec53c8f-7773-11ed-9966-0242ac110003
| 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 |
htx.watchOrders (symbol, since?, limit?, params?)watchPositions
watch all open positions. Note: huobi has one channel for each marginMode and type
Kind: instance method of htx
Returns: Array<object> - a list of position structure
See
- https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7de1c-77b5-11ed-9966-0242ac110003
- https://www.huobi.com/en-in/opend/newApiPages/?id=8cb7df0f-77b5-11ed-9966-0242ac110003
- https://www.huobi.com/en-in/opend/newApiPages/?id=28c34a7d-77ae-11ed-9966-0242ac110003
- https://www.huobi.com/en-in/opend/newApiPages/?id=5d5156b5-77b6-11ed-9966-0242ac110003
| Param | Type | Required | Description |
|---|---|---|---|
| symbols | Array<string> | No | list of unified market symbols |
| since | int | No | timestamp in ms of the earliest position to fetch |
| limit | int | No | the maximum number of positions to fetch |
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.watchPositions (symbols?, since?, limit?, params?)watchBalance
watch balance and get the amount of funds available for trading or funds locked in orders
Kind: instance method of htx
Returns: object - a balance structure
See
- https://www.htx.com/en-us/opend/newApiPages/?id=7ec52e28-7773-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=10000084-77b7-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=8cb7dcca-77b5-11ed-9966-0242ac110003
- https://www.htx.com/en-us/opend/newApiPages/?id=28c34995-77ae-11ed-9966-0242ac110003
| Param | Type | Required | Description |
|---|---|---|---|
| params | object | No | extra parameters specific to the exchange API endpoint |
htx.watchBalance (params?)