HTX JavaScript SDK
Use @siebly/htx-api to read HTX market data, manage orders, and consume streams from Node.js. JavaScript and TypeScript use the same clients; request and response types are included.
Choose a client
- SpotClient
- Spot market data, accounts, orders, margin, transfers, Earn, subaccounts, and wallet operations
- FuturesClient
- USDT-M and Coin-M Futures market data, accounts, positions, orders, risk, and copy trading
- WebsocketClient
- Public and private Spot and Futures subscriptions
- WebsocketAPIClient
- Awaitable Spot and Futures order commands over WebSocket
Make a first public request
In a Node.js project, install the package once. The REST and WebSocket API examples below use .mjs files so Node.js can run their imports directly.
npm install @siebly/htx-api
REST walkthrough
Read public btcusdt Spot data with SpotClient. These public requests require no credentials.
Save the code as rest-public.mjs and run:
node rest-public.mjs
import { SpotClient } from '@siebly/htx-api'; const client = new SpotClient(); async function main() { try { const time = await client.getTimestamp(); console.log('Server time:', time.data); } catch (error) { console.error('Server time request failed:', error); } try { const symbols = await client.getTradingSymbols(); const btcUsdt = symbols.data.find((symbol) => symbol.sc === 'btcusdt'); console.log('BTC/USDT symbol:', btcUsdt); } catch (error) { console.error('Symbol request failed:', error); } try { const ticker = await client.getTicker({ symbol: 'btcusdt', }); console.log('BTC/USDT ticker:', ticker.tick); } catch (error) { console.error('Ticker request failed:', error); } try { const orderBook = await client.getMarketDepth({ symbol: 'btcusdt', depth: 5, type: 'step0', }); console.log('Best bid:', orderBook.tick.bids[0]); console.log('Best ask:', orderBook.tick.asks[0]); } catch (error) { console.error('Order-book request failed:', error); } try { const candles = await client.getKlines({ symbol: 'btcusdt', period: '1min', size: 10, }); console.log('Latest one-minute candle:', candles.data[0]); } catch (error) { console.error('Candle request failed:', error); }} main();Expected response
Market values change on each run. These are the fields to check in the logged output.
| Field | Expected result |
|---|---|
| Server time / symbol | A Unix-millisecond number and the BTC/USDT symbol metadata object. |
| Ticker / Best bid / Best ask | A ticker object and numeric [price, quantity] book levels. |
| Latest one-minute candle | An object with Unix seconds in id, numeric OHLC prices, amount, vol, and trade count. |
/* eslint-disable @typescript-eslint/no-unused-vars */import { DefaultLogger, LogParams, WebsocketClient, WS_KEY_MAP,} from '@siebly/htx-api'; // Install from npm in your own project:// import { WebsocketClient, WS_KEY_MAP, WSTopicRequest } from '@siebly/htx-api'; function isRecord(value: unknown): value is Record<string, unknown> { return typeof value === 'object' && value !== null;} function isMutedTrace(params: LogParams): boolean { const [message, details] = params; if (message === 'Received PING event') { return true; } if (message === 'onWsMessage().emit(message)') { return true; } if ( typeof message === 'string' && message.startsWith('getFinalEmittable()->pre()') ) { return true; } if ( message === 'Sending upstream ws message: ' && isRecord(details) && typeof details.wsMessage === 'string' ) { // return false; return !details.wsMessage.includes('"pong"'); } return false;} const customLogger: DefaultLogger = { trace: (...params: LogParams): void => { // if (isMutedTrace(params)) { // return; // } // console.log('trace', params); }, info: (...params: LogParams): void => { console.log('info', ...params); }, error: (...params: LogParams): void => { console.error('error', ...params); },}; async function start() { const account = { key: process.env.API_KEY || '', secret: process.env.API_SECRET || '', }; const client = new WebsocketClient( { apiKey: account.key, apiSecret: account.secret, }, customLogger, ); client .on('open', (data) => console.log('open:', data.wsKey)) .on('authenticated', (data) => console.log('authenticated:', data.wsKey)) .on('message', (data) => console.info('message:', JSON.stringify(data))) .on('response', (data) => console.info('response:', JSON.stringify(data))) .on('reconnecting', (data) => console.log('reconnecting:', data.wsKey)) .on('reconnected', (data) => console.log('reconnected:', data.wsKey)) .on('close', (data) => console.log('close:', data.wsKey)) .on('exception', (data) => console.error('exception:', data)); /** * Spot private websocket: wss://api-aws.huobi.pro/ws/v2 by default. * * The SDK signs and sends the auth request automatically before subscribing. */ client.subscribe( [ // not specifying "mode", Only update when account balance changed; 'accounts.update', // Specify "mode" as 0, Only update when account balance changed; 'accounts.update#0', // Specify "mode" as 1, Update when either account balance changed or available balance changed. 'accounts.update#1', // Specify "mode" as 2, Whenever account balance or available balance changed, it will be updated together. 'accounts.update#2', // Subscribe to order updates for all symbols (wildcard allowed) 'orders#*', // Subscribe to order updates for btcusdt only 'orders#btcusdt', // Subscribe to trade clearing for all symbols (wildcard allowed) (mode is optional) 'trade.clearing#*', // Subscribe to trade clearing for btcusdt only (mode is optional) 'trade.clearing#btcusdt', // Subscribe to trade clearing for all symbols, mode 0 (trade event only (default)) 'trade.clearing#*#0', // Subscribe to trade clearing for all symbols, mode 1 (trade & cancellation events) 'trade.clearing#*#1', ], WS_KEY_MAP.spotPrivateV2, );} start();WebSocket API walkthrough
WebSocket API commands require API credentials. Set the environment variables shown in the code using credentials for the live environment. This example only constructs the client; it sends no request and places no order. Continue with the maintained example below for supported commands and connection handling.
Save the code as ws-api-setup.mjs and run:
node ws-api-setup.mjs
import { WebsocketAPIClient } from '@siebly/htx-api'; const credentials = { apiKey: process.env.HTX_API_KEY, apiSecret: process.env.HTX_API_SECRET,}; if (Object.values(credentials).some((value) => !value)) { throw new Error('Set HTX_API_KEY, HTX_API_SECRET before running.');} const wsApi = new WebsocketAPIClient(credentials);console.log('Client configured. No request sent.');HTX API JavaScript Tutorial
A practical JavaScript guide to using @siebly/htx-api across HTX Spot and Futures REST API calls, public and private streams, production order workflows, WebSocket API commands, API hosts, proxies, and reconnect recovery.
Your app / service
bot, dashboard, worker
@siebly/htx-api
SpotClient, FuturesClient, WebsocketClient, WebsocketAPIClient
HTX APIs
Spot, USDT-M Futures, Coin-M Futures, WebSocket streams, and WebSocket API commands
Common HTX implementation tasks
Start from the behavior you need, not just from REST or WebSocket as a transport. Market-data driven systems should be event driven. Backfill via the REST API once and let WebSockets passively stream new data to you, as it becomes available.
REST API hydration or backfill
Start from the REST API quickstart and endpoint reference, then normalize exchange-specific IDs, timestamps, symbols, and product scope.
Open endpoint referenceWebSocket consumer
Start from the WebSocket quickstart that matches the task boundary, verify subscription acknowledgement semantics, and keep reconnect handling explicit.
Open WebSocket quickstartAgent prompt recipe
Use the AI prompt generator when the task combines REST API hydration, live streams, in-memory state, operational outputs, or strategy code.
Build an agent promptFor coding agents
Give these files to an agent before implementation so it can find the package, examples, task guidance, and safety rules from the normal SDK-page flow.
AI prompt framework
Prompt generator and task recipes for exchange API projects.
llms.txt
Compact discovery file for agents choosing where to start.
llms-full.txt
Full route and implementation guidance index for machine readers.
SDK catalog
Machine-readable package, docs, examples, and task guidance.
Agent skill
Reusable workflow rules for coding agents using exchange APIs.
Endpoint Function Reference
Endpoint maps
Each REST client is a JavaScript class, which provides functions individually mapped to each endpoint available in the exchange's API offering.
The following table shows all methods available in each REST client, whether the method requires authentication (automatically handled if API keys are provided), as well as the exact endpoint each method is connected to.
This can be used to easily find which method to call, once you have found which endpoint you're looking to use.
All REST clients are in the src folder. For usage examples, make sure to check the examples folder.
List of clients:
If anything is missing or wrong, please open an issue or let us know in our Node.js Traders telegram group!
How to use table
Table consists of 4 parts:
- Function name
- AUTH
- HTTP Method
- Endpoint
Function name is the name of the function that can be called through the SDK. Check examples folder in the repo for more help on how to use them!
AUTH is a boolean value that indicates if the function requires authentication - which means you need to pass your API key and secret to the SDK.
HTTP Method shows HTTP method that the function uses to call the endpoint. Sometimes endpoints can have same URL, but different HTTP method so you can use this column to differentiate between them.
Endpoint is the URL that the function uses to call the endpoint. Best way to find exact function you need for the endpoint is to search for URL in this table and find corresponding function name.
SpotClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in SpotClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getMarketStatus() | GET | /v2/market-status | |
| getTimestamp() | GET | /v1/common/timestamp | |
| getTradingSymbols() | GET | /v2/settings/common/symbols | |
| getCurrencies() | GET | /v2/settings/common/currencies | |
| getCurrencysSettings() | GET | /v1/settings/common/currencys | |
| getSymbolsSettings() | GET | /v1/settings/common/symbols | |
| getMarketSymbolsSettings() | GET | /v1/settings/common/market-symbols | |
| getChainsInfo() | GET | /v1/settings/common/chains | |
| getReferenceCurrencies() | GET | /v2/reference/currencies | |
| getKlines() | GET | /market/history/kline | |
| getTicker() | GET | /market/detail/merged | |
| getTickers() | GET | /market/tickers | |
| getMarketDepth() | GET | /market/depth | |
| getLastTrade() | GET | /market/trade | |
| getHistoryTrades() | GET | /market/history/trade | |
| get24hMarketSummary() | GET | /market/detail | |
| getFullOrderBook() | GET | /market/fullMbp | |
| getAccounts() | 🔐 | GET | /v1/account/accounts |
| getAccountBalance() | 🔐 | GET | /v1/account/accounts/{accountId}/balance |
| getAccountValuation() | 🔐 | GET | /v2/account/valuation |
| getAssetValuation() | 🔐 | GET | /v2/account/asset-valuation |
| submitTransfer() | 🔐 | POST | /v1/account/transfer |
| getAccountHistory() | 🔐 | GET | /v1/account/history |
| getAccountLedger() | 🔐 | GET | /v2/account/ledger |
| submitV2AccountTransfer() | 🔐 | POST | /v2/account/transfer |
| submitUniversalTransfer() | 🔐 | POST | /v5/account/universal_transfer |
| getUniversalTransferRecords() | 🔐 | GET | /v5/account/universal_transfer_records |
| submitFuturesTransfer() | 🔐 | POST | /v1/futures/transfer |
| getPointBalance() | 🔐 | GET | /v2/point/account |
| submitPointTransfer() | 🔐 | POST | /v2/point/transfer |
| getAccountSwitchUserInfo() | 🔐 | GET | /v1/account/switch/user/info |
| getAccountOverviewInfo() | 🔐 | GET | /v1/account/overview/info |
| updateFeeDeductionMethod() | 🔐 | POST | /v1/account/fee/switch |
| submitOrder() | 🔐 | POST | /v1/order/orders/place |
| submitBatchOrders() | 🔐 | POST | /v1/order/batch-orders |
| submitMarginOrder() | 🔐 | POST | /v1/order/auto/place |
| cancelOrderById() | 🔐 | POST | /v1/order/orders/{orderId}/submitcancel |
| cancelOrderByClientId() | 🔐 | POST | /v1/order/orders/submitCancelClientOrder |
| cancelAllOrders() | 🔐 | GET | /v1/order/cancelAllOrders |
| getOpenOrders() | 🔐 | GET | /v1/order/openOrders |
| batchCancelOpenOrders() | 🔐 | POST | /v1/order/orders/batchCancelOpenOrders |
| batchCancelOrders() | 🔐 | POST | /v1/order/orders/batchcancel |
| setCancelAllAfter() | 🔐 | POST | /v2/algo-orders/cancel-all-after |
| getOrder() | 🔐 | GET | /v1/order/orders/{orderId} |
| getOrderByClientId() | 🔐 | GET | /v1/order/orders/getClientOrder |
| getOrderMatch() | 🔐 | GET | /v1/order/orders/{orderId}/matchresults |
| getOrderHistory() | 🔐 | GET | /v1/order/orders |
| getOrderHistory48h() | 🔐 | GET | /v1/order/history |
| getMatchResults() | 🔐 | GET | /v1/order/matchresults |
| getFeeRate() | 🔐 | GET | /v2/reference/transact-fee-rate |
| placeConditionalOrder() | 🔐 | POST | /v2/algo-orders |
| cancelConditionalOrders() | 🔐 | POST | /v2/algo-orders/cancellation |
| getOpenConditionalOrders() | 🔐 | GET | /v2/algo-orders/opening |
| getConditionalOrderHistory() | 🔐 | GET | /v2/algo-orders/history |
| getConditionalOrder() | 🔐 | GET | /v2/algo-orders/specific |
| getRepaymentRecords() | 🔐 | GET | /v2/account/repayment |
| repayMarginLoan() | 🔐 | POST | /v2/account/repayment |
| transferSpotToIsolatedMargin() | 🔐 | POST | /v1/dw/transfer-in/margin |
| transferIsolatedMarginToSpot() | 🔐 | POST | /v1/dw/transfer-out/margin |
| getMarginLoanInfo() | 🔐 | GET | /v1/margin/loan-info |
| requestMarginLoan() | 🔐 | POST | /v1/margin/orders |
| repayMarginLoanIsolated() | 🔐 | POST | /v1/margin/orders/{orderId}/repay |
| getMarginLoanOrders() | 🔐 | GET | /v1/margin/loan-orders |
| getMarginAccountBalance() | 🔐 | GET | /v1/margin/accounts/balance |
| transferSpotToCrossMargin() | 🔐 | POST | /v1/cross-margin/transfer-in |
| transferCrossMarginToSpot() | 🔐 | POST | /v1/cross-margin/transfer-out |
| getCrossMarginLoanInfo() | 🔐 | GET | /v1/cross-margin/loan-info |
| requestCrossMarginLoan() | 🔐 | POST | /v1/cross-margin/orders |
| repayCrossMarginLoan() | 🔐 | POST | /v1/cross-margin/orders/{orderId}/repay |
| getCrossMarginLoanOrders() | 🔐 | GET | /v1/cross-margin/loan-orders |
| getCrossMarginBalance() | 🔐 | GET | /v1/cross-margin/accounts/balance |
| getCrossMarginLimit() | 🔐 | GET | /v2/margin/limit |
| getDepositAddress() | 🔐 | GET | /v2/account/deposit/address |
| getWithdrawQuota() | 🔐 | GET | /v2/account/withdraw/quota |
| getWithdrawAddress() | 🔐 | GET | /v2/account/withdraw/address |
| submitWithdraw() | 🔐 | POST | /v1/dw/withdraw/api/create |
| getWithdrawByClientId() | 🔐 | GET | /v1/query/withdraw/client-order-id |
| cancelWithdraw() | 🔐 | POST | /v1/dw/withdraw-virtual/{withdrawId}/cancel |
| getDepositWithdrawHistory() | 🔐 | GET | /v1/query/deposit-withdraw |
| getVaspList() | GET | /v1/query/vasp-list | |
| getBrokerUserRebateStatus() | 🔐 | GET | /broker/v1/user_rebate_status |
| setBrokerSubUserFeeRate() | 🔐 | POST | /broker/v1/sub-user/fee_rate/add |
| getBrokerAccountCapitalSnapshot() | 🔐 | POST | /broker/v1/account_capital_snapshot_everyday |
| updateSubUserDeductMode() | 🔐 | POST | /v2/sub-user/deduct-mode |
| getSubUserApiKey() | 🔐 | GET | /v2/user/api-key |
| getUserUid() | 🔐 | GET | /v2/user/uid |
| getSubUserList() | 🔐 | GET | /v2/sub-user/user-list |
| updateSubUserLockStatus() | 🔐 | POST | /v2/sub-user/management |
| getSubUserStatus() | 🔐 | GET | /v2/sub-user/user-state |
| setSubUserTradableMarket() | 🔐 | POST | /v2/sub-user/tradable-market |
| setSubUserTransferPermissions() | 🔐 | POST | /v2/sub-user/transferability |
| getSubUserAccounts() | 🔐 | GET | /v2/sub-user/account-list |
| createSubUserApiKey() | 🔐 | POST | /v2/sub-user/api-key-generation |
| updateSubUserApiKey() | 🔐 | POST | /v2/sub-user/api-key-modification |
| deleteSubUserApiKey() | 🔐 | POST | /v2/sub-user/api-key-deletion |
| submitSubUserTransfer() | 🔐 | POST | /v1/subuser/transfer |
| getSubUserDepositAddress() | 🔐 | GET | /v2/sub-user/deposit-address |
| getSubUserDepositHistory() | 🔐 | GET | /v2/sub-user/query-deposit |
| getSubUsersAggregatedBalance() | 🔐 | GET | /v1/subuser/aggregate-balance |
| getSubUserBalance() | 🔐 | GET | /v1/account/accounts/{subUid} |
| getSubUserEntrustUserList() | 🔐 | GET | /v2/sub-user/entrust-user-list |
| getSubUserManagedTransferHistory() | 🔐 | GET | /v2/sub-user/managed-transfer-history |
| getReferralRebateDetail() | 🔐 | GET | /v2/invitee/rebate/detail |
| getReferralRebateHistory() | 🔐 | GET | /v2/invitee/rebate/history |
| getReferralAllRebateDetail() | 🔐 | GET | /v2/invitee/rebate/all_rebate/detail |
| getReferralMultipleRebateDetail() | 🔐 | GET | /v2/invitee/rebate/batcher_rebate/detail |
| getReferralInvitedUserList() | 🔐 | GET | /v2/invitee/rebate/referrals |
| getP2POrderHistory() | GET | /v1/api/c2c/order/history | |
| getEarnProjectList() | 🔐 | GET | /v1/earn/project/queryEarnProjectList |
| earnSubscribe() | 🔐 | POST | /v1/earn/order/demand/add |
| earnRedeem() | 🔐 | POST | /v1/earn/order/demand/redeem-order |
| getEarnUserAssets() | 🔐 | GET | /v1/earn/order/user/assets/list |
FuturesClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in FuturesClient.ts.
| Function | AUTH | HTTP Method | Endpoint |
|---|---|---|---|
| getTimestamp() | GET | /api/v1/timestamp | |
| getHeartbeat() | GET | /heartbeat/ | |
| getLinearSwapAccountType() | 🔐 | GET | /linear-swap-api/v3/swap_unified_account_type |
| updateLinearSwapAccountType() | 🔐 | POST | /linear-swap-api/v3/swap_switch_account_type |
| getLinearSwapFundingRate() | GET | /linear-swap-api/v1/swap_funding_rate | |
| getLinearSwapFundingRates() | GET | /linear-swap-api/v1/swap_batch_funding_rate | |
| getLinearSwapHistoricalFundingRate() | GET | /linear-swap-api/v1/swap_historical_funding_rate | |
| getLinearSwapLiquidationOrders() | GET | /linear-swap-api/v3/swap_liquidation_orders | |
| getLinearSwapSettlementRecords() | GET | /linear-swap-api/v1/swap_settlement_records | |
| getLinearSwapNetAccountRatio() | GET | /linear-swap-api/v1/swap_elite_account_ratio | |
| getLinearSwapNetPositionRatio() | GET | /linear-swap-api/v1/swap_elite_position_ratio | |
| getLinearSwapIsolatedSystemStatus() | GET | /linear-swap-api/v1/swap_api_state | |
| getLinearSwapCrossTieredMargin() | GET | /linear-swap-api/v1/swap_cross_ladder_margin | |
| getLinearSwapIsolatedTieredMargin() | GET | /linear-swap-api/v1/swap_ladder_margin | |
| getLinearSwapEstimatedSettlementPrice() | GET | /linear-swap-api/v1/swap_estimated_settlement_price | |
| getLinearSwapIsolatedAdjustFactor() | GET | /linear-swap-api/v1/swap_adjustfactor | |
| getLinearSwapCrossAdjustFactor() | GET | /linear-swap-api/v1/swap_cross_adjustfactor | |
| getLinearSwapRiskReserveBalance() | GET | /v1/insurance_fund_info | |
| getLinearSwapRiskReserveHistory() | GET | /v1/insurance_fund_history | |
| getLinearSwapContractPriceLimit() | GET | /linear-swap-api/v1/swap_price_limit | |
| getLinearSwapOpenInterest() | GET | /linear-swap-api/v1/swap_open_interest | |
| getLinearSwapContractInfo() | GET | /linear-swap-api/v1/swap_contract_info | |
| getLinearSwapIndexPrice() | GET | /linear-swap-api/v1/swap_index | |
| getLinearSwapIndexConstituents() | GET | /linear-swap-api/market/swap_contract_constituents | |
| getLinearSwapContractElements() | GET | /linear-swap-api/v1/swap_query_elements | |
| getLinearSwapMarketDepth() | GET | /linear-swap-ex/market/depth | |
| getLinearSwapMarketBbo() | GET | /linear-swap-ex/market/bbo | |
| getLinearSwapKlines() | GET | /linear-swap-ex/market/history/kline | |
| getLinearSwapMarkKlines() | GET | /index/market/history/linear_swap_mark_price_kline | |
| getLinearSwapTicker() | GET | /linear-swap-ex/market/detail/merged | |
| getLinearSwapTickers() | GET | /v2/linear-swap-ex/market/detail/batch_merged | |
| getLinearSwapLastTrade() | GET | /linear-swap-ex/market/trade | |
| getLinearSwapTradeHistory() | GET | /linear-swap-ex/market/history/trade | |
| getLinearSwapHistoricalOpenInterest() | GET | /linear-swap-api/v1/swap_his_open_interest | |
| getLinearSwapPremiumIndexKlines() | GET | /index/market/history/linear_swap_premium_index_kline | |
| getLinearSwapFundingRateKlines() | GET | /index/market/history/linear_swap_estimated_rate_kline | |
| getLinearSwapBasisData() | GET | /index/market/history/linear_swap_basis | |
| getLinearSwapAssetValuation() | 🔐 | POST | /linear-swap-api/v1/swap_balance_valuation |
| getLinearSwapIsolatedAccountInfo() | 🔐 | POST | /linear-swap-api/v1/swap_account_info |
| getLinearSwapCrossAccountInfo() | 🔐 | POST | /linear-swap-api/v1/swap_cross_account_info |
| getLinearSwapIsolatedPositions() | 🔐 | POST | /linear-swap-api/v1/swap_position_info |
| getLinearSwapCrossPositions() | 🔐 | POST | /linear-swap-api/v1/swap_cross_position_info |
| getLinearSwapIsolatedAccountFull() | 🔐 | POST | /linear-swap-api/v1/swap_account_position_info |
| getLinearSwapCrossAccountFull() | 🔐 | POST | /linear-swap-api/v1/swap_cross_account_position_info |
| updateLinearSwapSubPermissions() | 🔐 | POST | /linear-swap-api/v1/swap_sub_auth |
| getLinearSwapSubPermissions() | 🔐 | GET | /linear-swap-api/v1/swap_sub_auth_list |
| getLinearSwapIsolatedSubAccounts() | 🔐 | POST | /linear-swap-api/v1/swap_sub_account_list |
| getLinearSwapCrossSubAccounts() | 🔐 | POST | /linear-swap-api/v1/swap_cross_sub_account_list |
| getLinearSwapIsolatedSubAccountsAssets() | 🔐 | POST | /linear-swap-api/v1/swap_sub_account_info_list |
| getLinearSwapCrossSubAccountsAssets() | 🔐 | POST | /linear-swap-api/v1/swap_cross_sub_account_info_list |
| getLinearSwapIsolatedSubAccountAssets() | 🔐 | POST | /linear-swap-api/v1/swap_sub_account_info |
| getLinearSwapCrossSubAccountAssets() | 🔐 | POST | /linear-swap-api/v1/swap_cross_sub_account_info |
| getLinearSwapIsolatedSubPositions() | 🔐 | POST | /linear-swap-api/v1/swap_sub_position_info |
| getLinearSwapCrossSubPositions() | 🔐 | POST | /linear-swap-api/v1/swap_cross_sub_position_info |
| getLinearSwapFinancialRecords() | 🔐 | POST | /linear-swap-api/v3/swap_financial_record |
| getLinearSwapFinancialRecordsExact() | 🔐 | POST | /linear-swap-api/v3/swap_financial_record_exact |
| getLinearSwapIsolatedAvailableLeverage() | 🔐 | POST | /linear-swap-api/v1/swap_available_level_rate |
| getLinearSwapCrossAvailableLeverage() | 🔐 | POST | /linear-swap-api/v1/swap_cross_available_level_rate |
| getLinearSwapOrderLimit() | 🔐 | POST | /linear-swap-api/v1/swap_order_limit |
| getLinearSwapFee() | 🔐 | POST | /linear-swap-api/v1/swap_fee |
| getLinearSwapIsolatedTransferLimit() | 🔐 | POST | /linear-swap-api/v1/swap_transfer_limit |
| getLinearSwapCrossTransferLimit() | 🔐 | POST | /linear-swap-api/v1/swap_cross_transfer_limit |
| getLinearSwapIsolatedPositionLimit() | 🔐 | POST | /linear-swap-api/v1/swap_position_limit |
| getLinearSwapCrossPositionLimit() | 🔐 | POST | /linear-swap-api/v1/swap_cross_position_limit |
| getLinearSwapIsolatedLeverageLimits() | 🔐 | POST | /linear-swap-api/v1/swap_lever_position_limit |
| getLinearSwapCrossLeverageLimits() | 🔐 | POST | /linear-swap-api/v1/swap_cross_lever_position_limit |
| transferLinearSwapMasterSub() | 🔐 | POST | /linear-swap-api/v1/swap_master_sub_transfer |
| getLinearSwapMasterSubTransfers() | 🔐 | POST | /linear-swap-api/v1/swap_master_sub_transfer_record |
| transferLinearSwapInner() | 🔐 | POST | /linear-swap-api/v1/swap_transfer_inner |
| setLinearSwapCancelAfter() | 🔐 | POST | /linear-swap-api/v1/linear-cancel-after |
| getLinearSwapCrossTradeState() | 🔐 | GET | /linear-swap-api/v1/swap_cross_trade_state |
| getLinearSwapCrossTransferState() | 🔐 | GET | /linear-swap-api/v1/swap_cross_transfer_state |
| updateLinearSwapIsolatedPositionMode() | 🔐 | POST | /linear-swap-api/v1/swap_switch_position_mode |
| updateLinearSwapCrossPositionMode() | 🔐 | POST | /linear-swap-api/v1/swap_cross_switch_position_mode |
| submitLinearSwapIsolatedOrder() | 🔐 | POST | /linear-swap-api/v1/swap_order |
| submitLinearSwapCrossOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_order |
| submitLinearSwapIsolatedBatchOrders() | 🔐 | POST | /linear-swap-api/v1/swap_batchorder |
| submitLinearSwapCrossBatchOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_batchorder |
| cancelLinearSwapIsolatedOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cancel |
| cancelLinearSwapCrossOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_cancel |
| cancelLinearSwapIsolatedAllOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cancelall |
| cancelLinearSwapCrossAllOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_cancelall |
| updateLinearSwapIsolatedLeverage() | 🔐 | POST | /linear-swap-api/v1/swap_switch_lever_rate |
| updateLinearSwapCrossLeverage() | 🔐 | POST | /linear-swap-api/v1/swap_cross_switch_lever_rate |
| getLinearSwapIsolatedOrderInfo() | 🔐 | POST | /linear-swap-api/v1/swap_order_info |
| getLinearSwapCrossOrderInfo() | 🔐 | POST | /linear-swap-api/v1/swap_cross_order_info |
| getLinearSwapIsolatedOrderDetail() | 🔐 | POST | /linear-swap-api/v1/swap_order_detail |
| getLinearSwapCrossOrderDetail() | 🔐 | POST | /linear-swap-api/v1/swap_cross_order_detail |
| getLinearSwapIsolatedOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_openorders |
| getLinearSwapCrossOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_openorders |
| getLinearSwapIsolatedHistoryOrders() | 🔐 | POST | /linear-swap-api/v3/swap_hisorders |
| getLinearSwapCrossHistoryOrders() | 🔐 | POST | /linear-swap-api/v3/swap_cross_hisorders |
| getLinearSwapIsolatedHistoryOrdersExact() | 🔐 | POST | /linear-swap-api/v3/swap_hisorders_exact |
| getLinearSwapCrossHistoryOrdersExact() | 🔐 | POST | /linear-swap-api/v3/swap_cross_hisorders_exact |
| getLinearSwapIsolatedFills() | 🔐 | POST | /linear-swap-api/v3/swap_matchresults |
| getLinearSwapCrossFills() | 🔐 | POST | /linear-swap-api/v3/swap_cross_matchresults |
| getLinearSwapIsolatedFillsExact() | 🔐 | POST | /linear-swap-api/v3/swap_matchresults_exact |
| getLinearSwapCrossFillsExact() | 🔐 | POST | /linear-swap-api/v3/swap_cross_matchresults_exact |
| submitLinearSwapIsolatedLightningCloseOrder() | 🔐 | POST | /linear-swap-api/v1/swap_lightning_close_position |
| submitLinearSwapCrossLightningCloseOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_lightning_close_position |
| getLinearSwapIsolatedPositionMode() | 🔐 | GET | /linear-swap-api/v1/swap_position_side |
| getLinearSwapCrossPositionMode() | 🔐 | GET | /linear-swap-api/v1/swap_cross_position_side |
| submitLinearSwapIsolatedTriggerOrder() | 🔐 | POST | /linear-swap-api/v1/swap_trigger_order |
| submitLinearSwapCrossTriggerOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_trigger_order |
| cancelLinearSwapIsolatedTriggerOrder() | 🔐 | POST | /linear-swap-api/v1/swap_trigger_cancel |
| cancelLinearSwapCrossTriggerOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_trigger_cancel |
| cancelLinearSwapIsolatedAllTriggerOrders() | 🔐 | POST | /linear-swap-api/v1/swap_trigger_cancelall |
| cancelLinearSwapCrossAllTriggerOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_trigger_cancelall |
| getLinearSwapIsolatedTriggerOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_trigger_openorders |
| getLinearSwapCrossTriggerOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_trigger_openorders |
| getLinearSwapIsolatedTriggerHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_trigger_hisorders |
| getLinearSwapCrossTriggerHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_trigger_hisorders |
| submitLinearSwapIsolatedTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_tpsl_order |
| submitLinearSwapCrossTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_tpsl_order |
| cancelLinearSwapIsolatedTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_tpsl_cancel |
| cancelLinearSwapCrossTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_tpsl_cancel |
| cancelLinearSwapIsolatedAllTpslOrders() | 🔐 | POST | /linear-swap-api/v1/swap_tpsl_cancelall |
| cancelLinearSwapCrossAllTpslOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_tpsl_cancelall |
| getLinearSwapIsolatedTpslOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_tpsl_openorders |
| getLinearSwapCrossTpslOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_tpsl_openorders |
| getLinearSwapIsolatedTpslHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_tpsl_hisorders |
| getLinearSwapCrossTpslHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_tpsl_hisorders |
| getLinearSwapIsolatedRelationTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_relation_tpsl_order |
| getLinearSwapCrossRelationTpslOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_relation_tpsl_order |
| submitLinearSwapIsolatedTrailingOrder() | 🔐 | POST | /linear-swap-api/v1/swap_track_order |
| submitLinearSwapCrossTrailingOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_track_order |
| cancelLinearSwapIsolatedTrailingOrder() | 🔐 | POST | /linear-swap-api/v1/swap_track_cancel |
| cancelLinearSwapCrossTrailingOrder() | 🔐 | POST | /linear-swap-api/v1/swap_cross_track_cancel |
| cancelLinearSwapIsolatedAllTrailingOrders() | 🔐 | POST | /linear-swap-api/v1/swap_track_cancelall |
| cancelLinearSwapCrossAllTrailingOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_track_cancelall |
| getLinearSwapIsolatedTrailingOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_track_openorders |
| getLinearSwapCrossTrailingOpenOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_track_openorders |
| getLinearSwapIsolatedTrailingHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_track_hisorders |
| getLinearSwapCrossTrailingHistoryOrders() | 🔐 | POST | /linear-swap-api/v1/swap_cross_track_hisorders |
| getLinearSwapUnifiedAccountInfo() | 🔐 | GET | /linear-swap-api/v3/unified_account_info |
| getLinearSwapUnifiedAssets() | 🔐 | GET | /linear-swap-api/v3/linear_swap_overview_account_info |
| updateLinearSwapUnifiedFeeMethod() | 🔐 | POST | /linear-swap-api/v3/linear_swap_fee_switch |
| getLinearSwapUnifiedMarginAdjustments() | 🔐 | GET | /linear-swap-api/v3/fix_position_margin_change_record |
| updateLinearSwapUnifiedMargin() | 🔐 | POST | /linear-swap-api/v3/fix_position_margin_change |
| getMultiAssetAccountBalance() | 🔐 | GET | /v5/account/balance |
| getMultiAssetMode() | 🔐 | GET | /v5/account/asset_mode |
| updateMultiAssetMode() | 🔐 | POST | /v5/account/asset_mode |
| updateMultiAssetFeeCurrency() | 🔐 | POST | /v5/account/fee_deduction_currency |
| getMultiAssetFeeCurrency() | 🔐 | GET | /v5/account/fee_deduction_currency |
| getMultiAssetBills() | 🔐 | GET | /v5/account/bills |
| submitMultiAssetOrder() | 🔐 | POST | /v5/trade/order |
| submitMultiAssetBatchOrders() | 🔐 | POST | /v5/trade/batch_orders |
| cancelMultiAssetOrder() | 🔐 | POST | /v5/trade/cancel_order |
| cancelMultiAssetBatchOrders() | 🔐 | POST | /v5/trade/cancel_batch_orders |
| cancelMultiAssetAllOrders() | 🔐 | POST | /v5/trade/cancel_all_orders |
| closeMultiAssetPosition() | 🔐 | POST | /v5/trade/position |
| closeMultiAssetAllPositions() | 🔐 | POST | /v5/trade/position_all |
| getMultiAssetOpenOrders() | 🔐 | GET | /v5/trade/order/opens |
| getMultiAssetFills() | 🔐 | GET | /v5/trade/order/details |
| getMultiAssetOrderHistory() | 🔐 | GET | /v5/trade/order/history |
| getMultiAssetOrderInfo() | 🔐 | GET | /v5/trade/order |
| setMultiAssetCancelAfter() | 🔐 | POST | /v5/trade/cancel-after |
| getMultiAssetPositions() | 🔐 | GET | /v5/trade/position/opens |
| getMultiAssetLeverage() | 🔐 | GET | /v5/position/lever |
| updateMultiAssetLeverage() | 🔐 | POST | /v5/position/lever |
| getMultiAssetPositionMode() | 🔐 | GET | /v5/position/mode |
| updateMultiAssetPositionMode() | 🔐 | POST | /v5/position/mode |
| getMultiAssetRiskLimit() | 🔐 | GET | /v5/position/risk/limit |
| getMultiAssetRiskLimitTiers() | 🔐 | GET | /v5/position/risk/limit_tier |
| adjustMultiAssetMargin() | 🔐 | POST | /v5/position/margin |
| getMultiAssetMarketRiskLimit() | 🔐 | GET | /v5/market/risk/limit |
| getMultiAssetFeeCurrencies() | 🔐 | GET | /v5/market/assets_deduction_currency |
| getMultiAssetCollateralAssets() | 🔐 | GET | /v5/market/multi_assets_margin |
| getCoinMDeliveryAdjustFactor() | GET | /api/v1/contract_adjustfactor | |
| getCoinMDeliveryHistoricalOpenInterest() | GET | /api/v1/contract_his_open_interest | |
| getCoinMDeliveryTieredMargin() | GET | /api/v1/contract_ladder_margin | |
| getCoinMDeliveryAccountRatio() | GET | /api/v1/contract_elite_account_ratio | |
| getCoinMDeliveryPositionRatio() | GET | /api/v1/contract_elite_position_ratio | |
| getCoinMDeliveryLiquidationOrders() | GET | /api/v3/contract_liquidation_orders | |
| getCoinMDeliverySettlementRecords() | GET | /api/v1/contract_settlement_records | |
| getCoinMDeliveryRiskReserveBalance() | GET | /v1/insurance_fund_info | |
| getCoinMDeliveryRiskReserveHistory() | GET | /v1/insurance_fund_history | |
| getCoinMDeliveryContractLimit() | GET | /api/v1/contract_price_limit | |
| getCoinMDeliveryOpenInterest() | GET | /api/v1/contract_open_interest | |
| getCoinMDeliveryDeliveryPrice() | GET | /api/v1/contract_delivery_price | |
| getCoinMDeliveryEstimatedSettlementPrice() | GET | /api/v1/contract_estimated_settlement_price | |
| getCoinMDeliverySystemStatus() | GET | /api/v1/contract_api_state | |
| getCoinMDeliveryContractInfo() | GET | /api/v1/contract_contract_info | |
| getCoinMDeliveryIndexPrice() | GET | /api/v1/contract_index | |
| getCoinMDeliveryIndexConstituents() | GET | /api/market/contract_constituents | |
| getCoinMDeliveryContractElements() | GET | /api/v1/contract_query_elements | |
| getCoinMDeliveryMarketDepth() | GET | /market/depth | |
| getCoinMDeliveryMarketBbo() | GET | /market/bbo | |
| getCoinMDeliveryKlines() | GET | /market/history/kline | |
| getCoinMDeliveryMarkKlines() | GET | /index/market/history/mark_price_kline | |
| getCoinMDeliveryTicker() | GET | /market/detail/merged | |
| getCoinMDeliveryTickers() | GET | /v2/market/detail/batch_merged | |
| getCoinMDeliveryLastTrade() | GET | /market/trade | |
| getCoinMDeliveryTradeHistory() | GET | /market/history/trade | |
| getCoinMDeliveryIndexKlines() | GET | /index/market/history/index | |
| getCoinMDeliveryBasisData() | GET | /index/market/history/basis | |
| getCoinMDeliveryAssetValuation() | 🔐 | POST | /api/v1/contract_balance_valuation |
| getCoinMDeliveryAccountInfo() | 🔐 | POST | /api/v1/contract_account_info |
| getCoinMDeliveryPositionInfo() | 🔐 | POST | /api/v1/contract_position_info |
| updateCoinMDeliverySubPermissions() | 🔐 | POST | /api/v1/contract_sub_auth |
| getCoinMDeliverySubPermissions() | 🔐 | GET | /api/v1/contract_sub_auth_list |
| getCoinMDeliverySubAccounts() | 🔐 | POST | /api/v1/contract_sub_account_list |
| getCoinMDeliverySubAccountsAssets() | 🔐 | POST | /api/v1/contract_sub_account_info_list |
| getCoinMDeliverySubAccountAssets() | 🔐 | POST | /api/v1/contract_sub_account_info |
| getCoinMDeliverySubPositionInfo() | 🔐 | POST | /api/v1/contract_sub_position_info |
| getCoinMDeliveryFinancialRecords() | 🔐 | POST | /api/v3/contract_financial_record |
| getCoinMDeliveryFinancialRecordsExact() | 🔐 | POST | /api/v3/contract_financial_record_exact |
| getCoinMDeliveryUserSettlementRecords() | 🔐 | POST | /api/v1/contract_user_settlement_records |
| getCoinMDeliveryOrderLimit() | 🔐 | POST | /api/v1/contract_order_limit |
| getCoinMDeliveryFee() | 🔐 | POST | /api/v1/contract_fee |
| getCoinMDeliveryTransferLimit() | 🔐 | POST | /api/v1/contract_transfer_limit |
| getCoinMDeliveryPositionLimit() | 🔐 | POST | /api/v1/contract_position_limit |
| getCoinMDeliveryAccountFull() | 🔐 | POST | /api/v1/contract_account_position_info |
| transferCoinMDeliveryMasterSub() | 🔐 | POST | /api/v1/contract_master_sub_transfer |
| getCoinMDeliveryMasterSubTransfers() | 🔐 | POST | /api/v1/contract_master_sub_transfer_record |
| getCoinMDeliveryApiStatus() | 🔐 | GET | /api/v1/contract_api_trading_status |
| getCoinMDeliveryAvailableLeverage() | 🔐 | POST | /api/v1/contract_available_level_rate |
| setCoinMDeliveryCancelAfter() | 🔐 | POST | /api/v1/contract-cancel-after |
| submitCoinMDeliveryOrder() | 🔐 | POST | /api/v1/contract_order |
| submitCoinMDeliveryBatchOrders() | 🔐 | POST | /api/v1/contract_batchorder |
| cancelCoinMDeliveryOrder() | 🔐 | POST | /api/v1/contract_cancel |
| cancelCoinMDeliveryAllOrders() | 🔐 | POST | /api/v1/contract_cancelall |
| updateCoinMDeliveryLeverage() | 🔐 | POST | /api/v1/contract_switch_lever_rate |
| getCoinMDeliveryOrderInfo() | 🔐 | POST | /api/v1/contract_order_info |
| getCoinMDeliveryOrderDetail() | 🔐 | POST | /api/v1/contract_order_detail |
| getCoinMDeliveryOpenOrders() | 🔐 | POST | /api/v1/contract_openorders |
| getCoinMDeliveryHistoryOrders() | 🔐 | POST | /api/v3/contract_hisorders |
| getCoinMDeliveryHistoryOrdersExact() | 🔐 | POST | /api/v3/contract_hisorders_exact |
| getCoinMDeliveryFills() | 🔐 | POST | /api/v3/contract_matchresults |
| getCoinMDeliveryFillsExact() | 🔐 | POST | /api/v3/contract_matchresults_exact |
| submitCoinMDeliveryLightningCloseOrder() | 🔐 | POST | /api/v1/lightning_close_position |
| submitCoinMDeliveryTriggerOrder() | 🔐 | POST | /api/v1/contract_trigger_order |
| cancelCoinMDeliveryTriggerOrder() | 🔐 | POST | /api/v1/contract_trigger_cancel |
| cancelCoinMDeliveryAllTriggerOrders() | 🔐 | POST | /api/v1/contract_trigger_cancelall |
| getCoinMDeliveryTriggerOpenOrders() | 🔐 | POST | /api/v1/contract_trigger_openorders |
| getCoinMDeliveryTriggerHistoryOrders() | 🔐 | POST | /api/v1/contract_trigger_hisorders |
| submitCoinMDeliveryTpslOrder() | 🔐 | POST | /api/v1/contract_tpsl_order |
| cancelCoinMDeliveryTpslOrder() | 🔐 | POST | /api/v1/contract_tpsl_cancel |
| cancelCoinMDeliveryAllTpslOrders() | 🔐 | POST | /api/v1/contract_tpsl_cancelall |
| getCoinMDeliveryTpslOpenOrders() | 🔐 | POST | /api/v1/contract_tpsl_openorders |
| getCoinMDeliveryTpslHistoryOrders() | 🔐 | POST | /api/v1/contract_tpsl_hisorders |
| getCoinMDeliveryRelationTpslOrder() | 🔐 | POST | /api/v1/contract_relation_tpsl_order |
| submitCoinMDeliveryTrailingOrder() | 🔐 | POST | /api/v1/contract_track_order |
| cancelCoinMDeliveryTrailingOrder() | 🔐 | POST | /api/v1/contract_track_cancel |
| cancelCoinMDeliveryAllTrailingOrders() | 🔐 | POST | /api/v1/contract_track_cancelall |
| getCoinMDeliveryTrailingOpenOrders() | 🔐 | POST | /api/v1/contract_track_openorders |
| getCoinMDeliveryTrailingHistoryOrders() | 🔐 | POST | /api/v1/contract_track_hisorders |
| getCoinMPerpAdjustFactor() | GET | /swap-api/v1/swap_adjustfactor | |
| getCoinMPerpHistoricalOpenInterest() | GET | /swap-api/v1/swap_his_open_interest | |
| getCoinMPerpTieredMargin() | GET | /swap-api/v1/swap_ladder_margin | |
| getCoinMPerpAccountRatio() | GET | /swap-api/v1/swap_elite_account_ratio | |
| getCoinMPerpPositionRatio() | GET | /swap-api/v1/swap_elite_position_ratio | |
| getCoinMPerpEstimatedSettlementPrice() | GET | /swap-api/v1/swap_estimated_settlement_price | |
| getCoinMPerpSystemStatus() | GET | /swap-api/v1/swap_api_state | |
| getCoinMPerpFundingRate() | GET | /swap-api/v1/swap_funding_rate | |
| getCoinMPerpFundingRates() | GET | /swap-api/v1/swap_batch_funding_rate | |
| getCoinMPerpHistoricalFundingRate() | GET | /swap-api/v1/swap_historical_funding_rate | |
| getCoinMPerpLiquidationOrders() | GET | /swap-api/v3/swap_liquidation_orders | |
| getCoinMPerpSettlementRecords() | GET | /swap-api/v1/swap_settlement_records | |
| getCoinMPerpContractInfo() | GET | /swap-api/v1/swap_contract_info | |
| getCoinMPerpIndexPrice() | GET | /swap-api/v1/swap_index | |
| getCoinMPerpContractElements() | GET | /swap-api/v1/swap_query_elements | |
| getCoinMPerpIndexConstituents() | GET | /swap-api/market/swap_constituents | |
| getCoinMPerpRiskReserveBalance() | GET | /v1/insurance_fund_info | |
| getCoinMPerpRiskReserveHistory() | GET | /v1/insurance_fund_history | |
| getCoinMPerpPriceLimit() | GET | /swap-api/v1/swap_price_limit | |
| getCoinMPerpOpenInterest() | GET | /swap-api/v1/swap_open_interest | |
| getCoinMPerpMarketDepth() | GET | /swap-ex/market/depth | |
| getCoinMPerpMarketBbo() | GET | /swap-ex/market/bbo | |
| getCoinMPerpKlines() | GET | /swap-ex/market/history/kline | |
| getCoinMPerpMarkKlines() | GET | /index/market/history/swap_mark_price_kline | |
| getCoinMPerpTicker() | GET | /swap-ex/market/detail/merged | |
| getCoinMPerpTickers() | GET | /v2/swap-ex/market/detail/batch_merged | |
| getCoinMPerpLastTrade() | GET | /swap-ex/market/trade | |
| getCoinMPerpTradeHistory() | GET | /swap-ex/market/history/trade | |
| getCoinMPerpPremiumIndexKlines() | GET | /index/market/history/swap_premium_index_kline | |
| getCoinMPerpFundingRateKlines() | GET | /index/market/history/swap_estimated_rate_kline | |
| getCoinMPerpBasisData() | GET | /index/market/history/swap_basis | |
| getCoinMPerpAssetValuation() | 🔐 | POST | /swap-api/v1/swap_balance_valuation |
| getCoinMPerpAccountInfo() | 🔐 | POST | /swap-api/v1/swap_account_info |
| getCoinMPerpPositionInfo() | 🔐 | POST | /swap-api/v1/swap_position_info |
| getCoinMPerpAccountFull() | 🔐 | POST | /swap-api/v1/swap_account_position_info |
| getCoinMPerpSubPermissions() | 🔐 | GET | /swap-api/v1/swap_sub_auth_list |
| updateCoinMPerpSubPermissions() | 🔐 | POST | /swap-api/v1/swap_sub_auth |
| getCoinMPerpSubAccounts() | 🔐 | POST | /swap-api/v1/swap_sub_account_list |
| getCoinMPerpSubAccountsAssets() | 🔐 | POST | /swap-api/v1/swap_sub_account_info_list |
| getCoinMPerpSubAccountAssets() | 🔐 | POST | /swap-api/v1/swap_sub_account_info |
| getCoinMPerpSubPositions() | 🔐 | POST | /swap-api/v1/swap_sub_position_info |
| getCoinMPerpFinancialRecords() | 🔐 | POST | /swap-api/v3/swap_financial_record |
| getCoinMPerpFinancialRecordsExact() | 🔐 | POST | /swap-api/v3/swap_financial_record_exact |
| getCoinMPerpAvailableLeverage() | 🔐 | POST | /swap-api/v1/swap_available_level_rate |
| getCoinMPerpOrderLimit() | 🔐 | POST | /swap-api/v1/swap_order_limit |
| getCoinMPerpFee() | 🔐 | POST | /swap-api/v1/swap_fee |
| getCoinMPerpTransferLimit() | 🔐 | POST | /swap-api/v1/swap_transfer_limit |
| getCoinMPerpPositionLimit() | 🔐 | POST | /swap-api/v1/swap_position_limit |
| transferCoinMPerpMasterSub() | 🔐 | POST | /swap-api/v1/swap_master_sub_transfer |
| getCoinMPerpMasterSubTransfers() | 🔐 | POST | /swap-api/v1/swap_master_sub_transfer_record |
| getCoinMPerpApiStatus() | 🔐 | GET | /swap-api/v1/swap_api_trading_status |
| setCoinMPerpCancelAfter() | 🔐 | POST | /swap-api/v1/swap-cancel-after |
| submitCoinMPerpOrder() | 🔐 | POST | /swap-api/v1/swap_order |
| submitCoinMPerpBatchOrders() | 🔐 | POST | /swap-api/v1/swap_batchorder |
| cancelCoinMPerpOrder() | 🔐 | POST | /swap-api/v1/swap_cancel |
| cancelCoinMPerpAllOrders() | 🔐 | POST | /swap-api/v1/swap_cancelall |
| updateCoinMPerpLeverage() | 🔐 | POST | /swap-api/v1/swap_switch_lever_rate |
| getCoinMPerpOrderInfo() | 🔐 | POST | /swap-api/v1/swap_order_info |
| getCoinMPerpOrderDetail() | 🔐 | POST | /swap-api/v1/swap_order_detail |
| getCoinMPerpOpenOrders() | 🔐 | POST | /swap-api/v1/swap_openorders |
| getCoinMPerpHistoryOrders() | 🔐 | POST | /swap-api/v3/swap_hisorders |
| getCoinMPerpHistoryOrdersExact() | 🔐 | POST | /swap-api/v3/swap_hisorders_exact |
| getCoinMPerpFills() | 🔐 | POST | /swap-api/v3/swap_matchresults |
| getCoinMPerpFillsExact() | 🔐 | POST | /swap-api/v3/swap_matchresults_exact |
| submitCoinMPerpLightningCloseOrder() | 🔐 | POST | /swap-api/v1/swap_lightning_close_position |
| submitCoinMPerpTriggerOrder() | 🔐 | POST | /swap-api/v1/swap_trigger_order |
| cancelCoinMPerpTriggerOrder() | 🔐 | POST | /swap-api/v1/swap_trigger_cancel |
| cancelCoinMPerpAllTriggerOrders() | 🔐 | POST | /swap-api/v1/swap_trigger_cancelall |
| getCoinMPerpTriggerOpenOrders() | 🔐 | POST | /swap-api/v1/swap_trigger_openorders |
| getCoinMPerpTriggerHistoryOrders() | 🔐 | POST | /swap-api/v1/swap_trigger_hisorders |
| submitCoinMPerpTpslOrder() | 🔐 | POST | /swap-api/v1/swap_tpsl_order |
| cancelCoinMPerpTpslOrder() | 🔐 | POST | /swap-api/v1/swap_tpsl_cancel |
| cancelCoinMPerpAllTpslOrders() | 🔐 | POST | /swap-api/v1/swap_tpsl_cancelall |
| getCoinMPerpTpslOpenOrders() | 🔐 | POST | /swap-api/v1/swap_tpsl_openorders |
| getCoinMPerpTpslHistoryOrders() | 🔐 | POST | /swap-api/v1/swap_tpsl_hisorders |
| getCoinMPerpRelationTpslOrder() | 🔐 | POST | /swap-api/v1/swap_relation_tpsl_order |
| submitCoinMPerpTrailingOrder() | 🔐 | POST | /swap-api/v1/swap_track_order |
| cancelCoinMPerpTrailingOrder() | 🔐 | POST | /swap-api/v1/swap_track_cancel |
| cancelCoinMPerpAllTrailingOrders() | 🔐 | POST | /swap-api/v1/swap_track_cancelall |
| getCoinMPerpTrailingOpenOrders() | 🔐 | POST | /swap-api/v1/swap_track_openorders |
| getCoinMPerpTrailingHistoryOrders() | 🔐 | POST | /swap-api/v1/swap_track_hisorders |
| getCopyTraderInstruments() | 🔐 | GET | /api/v6/copyTrading/trader/instruments |
| getCopyTraderStatistics() | 🔐 | GET | /api/v6/copyTrading/trader/statistics |
| getCopyTraderProfitSharingHistory() | 🔐 | GET | /api/v6/copyTrading/trader/profit-sharing-history |
| getCopyTraderProfitSharingHistorySummary() | 🔐 | GET | /api/v6/copyTrading/trader/profit-sharing-history-summary |
| getCopyTraderUPNLSharingSummary() | 🔐 | GET | /api/v6/copyTrading/trader/unrealized-profit-sharing-summary |
| getCopyTraderFollowers() | 🔐 | GET | /api/v6/copyTrading/trader/followers |
| removeCopyTraderFollower() | 🔐 | POST | /api/v6/copyTrading/trader/follower |
| submitCopyTraderTransfer() | 🔐 | POST | /api/v6/copyTrading/trader/transfer |
| updateCopyTraderFollowerSettings() | 🔐 | POST | /api/v6/copyTrading/trader/follower-settings |
| getCopyTraderConfig() | 🔐 | POST | /api/v6/copyTrading/trader/config |
| createCopyTraderApikey() | 🔐 | POST | /api/v6/copyTrading/trader/apikey |
WebsocketAPIClient.ts
This table includes all endpoints from the official Exchange API docs and corresponding SDK functions for each endpoint that are found in WebsocketAPIClient.ts.
This client provides WebSocket API endpoints which allow for faster interactions with the HTX API via a WebSocket connection.
HTX JavaScript FAQ
What does the HTX JavaScript SDK cover?
HTX supports Spot, Futures, Margin, WebSockets, and WebSocket API workflows. The JavaScript guide covers the main REST and WebSocket integration patterns.
How do I authenticate private HTX API calls in JavaScript?
Install @siebly/htx-api from npm & pass API credentials into the SDK client options, as shown in the HTX JavaScript examples above. The SDK handles the exchange-specific signing requirements for private requests.
Does the HTX JavaScript SDK help with WebSocket connection management?
Yes. Use the SDK WebSocket client for subscriptions, reconnect handling, and stream lifecycle management instead of building raw socket flows yourself.
When should I use the HTX WebSocket API instead of REST?
Use REST for standard request and response workflows such as account queries and order management. Use the WebSocket API flow when you want persistent low-latency interactions over a connected session.
Direct Example Files
Open the example files below for JavaScript and TypeScript-compatible request, authentication, WebSocket, and Node.js service patterns.