From fdbe0ee5144fb6ac04b7a43ddf1c7f8ce3954614 Mon Sep 17 00:00:00 2001 From: Jerko J <83344666+JJ-Cro@users.noreply.github.com> Date: Thu, 17 Sep 2026 19:04:22 +0200 Subject: [PATCH] feat(v1.0.4): sync HTX API changelog through 2026-08-25 Add v5 algo REST, cancel_volume, isolated_available, contract labels, and related WS topics/fields from the Aug changelog. --- docs/endpointFunctionList.md | 683 +- .../cancelMultiAssetAlgoOrders.js | 22 + .../getMultiAssetAlgoOpenOrders.js | 22 + .../FuturesClient/getMultiAssetAlgoOrder.js | 22 + .../getMultiAssetAlgoOrderHistory.js | 22 + .../submitMultiAssetAlgoOrder.js | 22 + llms.txt | 19473 ++++++++-------- package-lock.json | 4 +- package.json | 2 +- src/FuturesClient.ts | 59 + src/types/request/futures.types.ts | 90 + src/types/request/spot.types.ts | 2 +- src/types/response/futures.types.ts | 58 + src/types/response/spot.types.ts | 1 + src/types/response/ws.ts | 51 + src/types/websockets/ws-subscriptions.ts | 4 + 16 files changed, 10586 insertions(+), 9951 deletions(-) create mode 100644 examples/apidoc/FuturesClient/cancelMultiAssetAlgoOrders.js create mode 100644 examples/apidoc/FuturesClient/getMultiAssetAlgoOpenOrders.js create mode 100644 examples/apidoc/FuturesClient/getMultiAssetAlgoOrder.js create mode 100644 examples/apidoc/FuturesClient/getMultiAssetAlgoOrderHistory.js create mode 100644 examples/apidoc/FuturesClient/submitMultiAssetAlgoOrder.js diff --git a/docs/endpointFunctionList.md b/docs/endpointFunctionList.md index d9c9e49..ecf9918 100644 --- a/docs/endpointFunctionList.md +++ b/docs/endpointFunctionList.md @@ -169,345 +169,350 @@ This table includes all endpoints from the official Exchange API docs and corres | Function | AUTH | HTTP Method | Endpoint | | -------- | :------: | :------: | -------- | -| [getTimestamp()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L430) | | GET | `/api/v1/timestamp` | -| [getHeartbeat()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L440) | | GET | `/heartbeat/` | -| [getLinearSwapAccountType()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L456) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/swap_unified_account_type` | -| [updateLinearSwapAccountType()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L472) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_switch_account_type` | -| [getLinearSwapFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L488) | | GET | `/linear-swap-api/v1/swap_funding_rate` | -| [getLinearSwapFundingRates()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L500) | | GET | `/linear-swap-api/v1/swap_batch_funding_rate` | -| [getLinearSwapHistoricalFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L512) | | GET | `/linear-swap-api/v1/swap_historical_funding_rate` | -| [getLinearSwapLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L524) | | GET | `/linear-swap-api/v3/swap_liquidation_orders` | -| [getLinearSwapSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L536) | | GET | `/linear-swap-api/v1/swap_settlement_records` | -| [getLinearSwapNetAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L548) | | GET | `/linear-swap-api/v1/swap_elite_account_ratio` | -| [getLinearSwapNetPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L561) | | GET | `/linear-swap-api/v1/swap_elite_position_ratio` | -| [getLinearSwapIsolatedSystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L574) | | GET | `/linear-swap-api/v1/swap_api_state` | -| [getLinearSwapCrossTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L587) | | GET | `/linear-swap-api/v1/swap_cross_ladder_margin` | -| [getLinearSwapIsolatedTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L599) | | GET | `/linear-swap-api/v1/swap_ladder_margin` | -| [getLinearSwapEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L612) | | GET | `/linear-swap-api/v1/swap_estimated_settlement_price` | -| [getLinearSwapIsolatedAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L627) | | GET | `/linear-swap-api/v1/swap_adjustfactor` | -| [getLinearSwapCrossAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L640) | | GET | `/linear-swap-api/v1/swap_cross_adjustfactor` | -| [getLinearSwapRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L652) | | GET | `/v1/insurance_fund_info` | -| [getLinearSwapRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L664) | | GET | `/v1/insurance_fund_history` | -| [getLinearSwapContractPriceLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L676) | | GET | `/linear-swap-api/v1/swap_price_limit` | -| [getLinearSwapOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L688) | | GET | `/linear-swap-api/v1/swap_open_interest` | -| [getLinearSwapContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L700) | | GET | `/linear-swap-api/v1/swap_contract_info` | -| [getLinearSwapIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L712) | | GET | `/linear-swap-api/v1/swap_index` | -| [getLinearSwapIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L724) | | GET | `/linear-swap-api/market/swap_contract_constituents` | -| [getLinearSwapContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L739) | | GET | `/linear-swap-api/v1/swap_query_elements` | -| [getLinearSwapMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L757) | | GET | `/linear-swap-ex/market/depth` | -| [getLinearSwapMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L770) | | GET | `/linear-swap-ex/market/bbo` | -| [getLinearSwapKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L783) | | GET | `/linear-swap-ex/market/history/kline` | -| [getLinearSwapMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L794) | | GET | `/index/market/history/linear_swap_mark_price_kline` | -| [getLinearSwapTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L808) | | GET | `/linear-swap-ex/market/detail/merged` | -| [getLinearSwapTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L820) | | GET | `/v2/linear-swap-ex/market/detail/batch_merged` | -| [getLinearSwapLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L833) | | GET | `/linear-swap-ex/market/trade` | -| [getLinearSwapTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L845) | | GET | `/linear-swap-ex/market/history/trade` | -| [getLinearSwapHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L858) | | GET | `/linear-swap-api/v1/swap_his_open_interest` | -| [getLinearSwapPremiumIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L869) | | GET | `/index/market/history/linear_swap_premium_index_kline` | -| [getLinearSwapFundingRateKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L883) | | GET | `/index/market/history/linear_swap_estimated_rate_kline` | -| [getLinearSwapBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L897) | | GET | `/index/market/history/linear_swap_basis` | -| [getLinearSwapAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L915) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_balance_valuation` | -| [getLinearSwapIsolatedAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L928) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_account_info` | -| [getLinearSwapCrossAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L941) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_account_info` | -| [getLinearSwapIsolatedPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L954) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_position_info` | -| [getLinearSwapCrossPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L967) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_position_info` | -| [getLinearSwapIsolatedAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L980) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_account_position_info` | -| [getLinearSwapCrossAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L993) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_account_position_info` | -| [updateLinearSwapSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1007) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_auth` | -| [getLinearSwapSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1021) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_sub_auth_list` | -| [getLinearSwapIsolatedSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1032) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_list` | -| [getLinearSwapCrossSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1045) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_list` | -| [getLinearSwapIsolatedSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1058) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_info_list` | -| [getLinearSwapCrossSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1071) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_info_list` | -| [getLinearSwapIsolatedSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1085) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_info` | -| [getLinearSwapCrossSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1099) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_info` | -| [getLinearSwapIsolatedSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1113) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_position_info` | -| [getLinearSwapCrossSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1127) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_position_info` | -| [getLinearSwapFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1141) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_financial_record` | -| [getLinearSwapFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1154) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_financial_record_exact` | -| [getLinearSwapIsolatedAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1167) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_available_level_rate` | -| [getLinearSwapCrossAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1180) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_available_level_rate` | -| [getLinearSwapOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1194) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_limit` | -| [getLinearSwapFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1207) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_fee` | -| [getLinearSwapIsolatedTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1220) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_transfer_limit` | -| [getLinearSwapCrossTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1233) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_transfer_limit` | -| [getLinearSwapIsolatedPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1246) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_position_limit` | -| [getLinearSwapCrossPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1259) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_position_limit` | -| [getLinearSwapIsolatedLeverageLimits()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1272) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_lever_position_limit` | -| [getLinearSwapCrossLeverageLimits()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1286) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_lever_position_limit` | -| [transferLinearSwapMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1302) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_master_sub_transfer` | -| [getLinearSwapMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1315) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_master_sub_transfer_record` | -| [transferLinearSwapInner()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1331) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_transfer_inner` | -| [setLinearSwapCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1350) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/linear-cancel-after` | -| [getLinearSwapCrossTradeState()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1364) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_trade_state` | -| [getLinearSwapCrossTransferState()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1378) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_transfer_state` | -| [updateLinearSwapIsolatedPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1392) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_switch_position_mode` | -| [updateLinearSwapCrossPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1406) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_switch_position_mode` | -| [submitLinearSwapIsolatedOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1423) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order` | -| [submitLinearSwapCrossOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1436) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order` | -| [submitLinearSwapIsolatedBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1449) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_batchorder` | -| [submitLinearSwapCrossBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1462) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_batchorder` | -| [cancelLinearSwapIsolatedOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1475) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cancel` | -| [cancelLinearSwapCrossOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1488) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_cancel` | -| [cancelLinearSwapIsolatedAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1501) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cancelall` | -| [cancelLinearSwapCrossAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1514) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_cancelall` | -| [updateLinearSwapIsolatedLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1527) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_switch_lever_rate` | -| [updateLinearSwapCrossLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1541) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_switch_lever_rate` | -| [getLinearSwapIsolatedOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1557) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_info` | -| [getLinearSwapCrossOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1570) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order_info` | -| [getLinearSwapIsolatedOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1583) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_detail` | -| [getLinearSwapCrossOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1596) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order_detail` | -| [getLinearSwapIsolatedOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1609) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_openorders` | -| [getLinearSwapCrossOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1622) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_openorders` | -| [getLinearSwapIsolatedHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1635) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_hisorders` | -| [getLinearSwapCrossHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1648) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_hisorders` | -| [getLinearSwapIsolatedHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1661) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_hisorders_exact` | -| [getLinearSwapCrossHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1674) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_hisorders_exact` | -| [getLinearSwapIsolatedFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1687) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_matchresults` | -| [getLinearSwapCrossFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1700) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_matchresults` | -| [getLinearSwapIsolatedFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1713) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_matchresults_exact` | -| [getLinearSwapCrossFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1726) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_matchresults_exact` | -| [submitLinearSwapIsolatedLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1742) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_lightning_close_position` | -| [submitLinearSwapCrossLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1758) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_lightning_close_position` | -| [getLinearSwapIsolatedPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1772) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_position_side` | -| [getLinearSwapCrossPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1783) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_position_side` | -| [submitLinearSwapIsolatedTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1803) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_order` | -| [submitLinearSwapCrossTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1816) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_order` | -| [cancelLinearSwapIsolatedTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1829) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_cancel` | -| [cancelLinearSwapCrossTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1843) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_cancel` | -| [cancelLinearSwapIsolatedAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1856) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_cancelall` | -| [cancelLinearSwapCrossAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1869) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_cancelall` | -| [getLinearSwapIsolatedTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1885) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_openorders` | -| [getLinearSwapCrossTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1898) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_openorders` | -| [getLinearSwapIsolatedTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1912) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_hisorders` | -| [getLinearSwapCrossTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1925) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_hisorders` | -| [submitLinearSwapIsolatedTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1939) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_order` | -| [submitLinearSwapCrossTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1952) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_order` | -| [cancelLinearSwapIsolatedTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1965) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_cancel` | -| [cancelLinearSwapCrossTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1979) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_cancel` | -| [cancelLinearSwapIsolatedAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1992) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_cancelall` | -| [cancelLinearSwapCrossAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2006) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_cancelall` | -| [getLinearSwapIsolatedTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2019) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_openorders` | -| [getLinearSwapCrossTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2032) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_openorders` | -| [getLinearSwapIsolatedTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2045) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_hisorders` | -| [getLinearSwapCrossTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2058) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_hisorders` | -| [getLinearSwapIsolatedRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2071) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_relation_tpsl_order` | -| [getLinearSwapCrossRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2085) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_relation_tpsl_order` | -| [submitLinearSwapIsolatedTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2101) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_order` | -| [submitLinearSwapCrossTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2114) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_order` | -| [cancelLinearSwapIsolatedTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2127) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_cancel` | -| [cancelLinearSwapCrossTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2141) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_cancel` | -| [cancelLinearSwapIsolatedAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2154) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_cancelall` | -| [cancelLinearSwapCrossAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2167) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_cancelall` | -| [getLinearSwapIsolatedTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2180) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_openorders` | -| [getLinearSwapCrossTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2193) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_openorders` | -| [getLinearSwapIsolatedTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2206) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_hisorders` | -| [getLinearSwapCrossTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2219) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_hisorders` | -| [getLinearSwapUnifiedAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2236) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/unified_account_info` | -| [getLinearSwapUnifiedAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2247) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/linear_swap_overview_account_info` | -| [updateLinearSwapUnifiedFeeMethod()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2263) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/linear_swap_fee_switch` | -| [getLinearSwapUnifiedMarginAdjustments()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2277) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/fix_position_margin_change_record` | -| [updateLinearSwapUnifiedMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2293) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/fix_position_margin_change` | -| [getMultiAssetAccountBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2313) | :closed_lock_with_key: | GET | `/v5/account/balance` | -| [getMultiAssetMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2325) | :closed_lock_with_key: | GET | `/v5/account/asset_mode` | -| [updateMultiAssetMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2337) | :closed_lock_with_key: | POST | `/v5/account/asset_mode` | -| [updateMultiAssetFeeCurrency()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2349) | :closed_lock_with_key: | POST | `/v5/account/fee_deduction_currency` | -| [getMultiAssetFeeCurrency()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2364) | :closed_lock_with_key: | GET | `/v5/account/fee_deduction_currency` | -| [getMultiAssetBills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2376) | :closed_lock_with_key: | GET | `/v5/account/bills` | -| [submitMultiAssetOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2394) | :closed_lock_with_key: | POST | `/v5/trade/order` | -| [submitMultiAssetBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2406) | :closed_lock_with_key: | POST | `/v5/trade/batch_orders` | -| [cancelMultiAssetOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2418) | :closed_lock_with_key: | POST | `/v5/trade/cancel_order` | -| [cancelMultiAssetBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2430) | :closed_lock_with_key: | POST | `/v5/trade/cancel_batch_orders` | -| [cancelMultiAssetAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2442) | :closed_lock_with_key: | POST | `/v5/trade/cancel_all_orders` | -| [closeMultiAssetPosition()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2456) | :closed_lock_with_key: | POST | `/v5/trade/position` | -| [closeMultiAssetAllPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2468) | :closed_lock_with_key: | POST | `/v5/trade/position_all` | -| [getMultiAssetOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2480) | :closed_lock_with_key: | GET | `/v5/trade/order/opens` | -| [getMultiAssetFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2492) | :closed_lock_with_key: | GET | `/v5/trade/order/details` | -| [getMultiAssetOrderHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2504) | :closed_lock_with_key: | GET | `/v5/trade/order/history` | -| [getMultiAssetOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2516) | :closed_lock_with_key: | GET | `/v5/trade/order` | -| [setMultiAssetCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2528) | :closed_lock_with_key: | POST | `/v5/trade/cancel-after` | -| [getMultiAssetPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2546) | :closed_lock_with_key: | GET | `/v5/trade/position/opens` | -| [getMultiAssetLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2558) | :closed_lock_with_key: | GET | `/v5/position/lever` | -| [updateMultiAssetLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2570) | :closed_lock_with_key: | POST | `/v5/position/lever` | -| [getMultiAssetPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2582) | :closed_lock_with_key: | GET | `/v5/position/mode` | -| [updateMultiAssetPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2594) | :closed_lock_with_key: | POST | `/v5/position/mode` | -| [getMultiAssetRiskLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2606) | :closed_lock_with_key: | GET | `/v5/position/risk/limit` | -| [getMultiAssetRiskLimitTiers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2618) | :closed_lock_with_key: | GET | `/v5/position/risk/limit_tier` | -| [adjustMultiAssetMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2631) | :closed_lock_with_key: | POST | `/v5/position/margin` | -| [getMultiAssetMarketRiskLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2648) | :closed_lock_with_key: | GET | `/v5/market/risk/limit` | -| [getMultiAssetFeeCurrencies()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2660) | :closed_lock_with_key: | GET | `/v5/market/assets_deduction_currency` | -| [getMultiAssetCollateralAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2672) | :closed_lock_with_key: | GET | `/v5/market/multi_assets_margin` | -| [getCoinMDeliveryAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2689) | | GET | `/api/v1/contract_adjustfactor` | -| [getCoinMDeliveryHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2700) | | GET | `/api/v1/contract_his_open_interest` | -| [getCoinMDeliveryTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2711) | | GET | `/api/v1/contract_ladder_margin` | -| [getCoinMDeliveryAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2722) | | GET | `/api/v1/contract_elite_account_ratio` | -| [getCoinMDeliveryPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2734) | | GET | `/api/v1/contract_elite_position_ratio` | -| [getCoinMDeliveryLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2746) | | GET | `/api/v3/contract_liquidation_orders` | -| [getCoinMDeliverySettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2757) | | GET | `/api/v1/contract_settlement_records` | -| [getCoinMDeliveryRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2768) | | GET | `/v1/insurance_fund_info` | -| [getCoinMDeliveryRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2779) | | GET | `/v1/insurance_fund_history` | -| [getCoinMDeliveryContractLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2790) | | GET | `/api/v1/contract_price_limit` | -| [getCoinMDeliveryOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2801) | | GET | `/api/v1/contract_open_interest` | -| [getCoinMDeliveryDeliveryPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2814) | | GET | `/api/v1/contract_delivery_price` | -| [getCoinMDeliveryEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2825) | | GET | `/api/v1/contract_estimated_settlement_price` | -| [getCoinMDeliverySystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2838) | | GET | `/api/v1/contract_api_state` | -| [getCoinMDeliveryContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2849) | | GET | `/api/v1/contract_contract_info` | -| [getCoinMDeliveryIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2860) | | GET | `/api/v1/contract_index` | -| [getCoinMDeliveryIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2871) | | GET | `/api/market/contract_constituents` | -| [getCoinMDeliveryContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2882) | | GET | `/api/v1/contract_query_elements` | -| [getCoinMDeliveryMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2899) | | GET | `/market/depth` | -| [getCoinMDeliveryMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2911) | | GET | `/market/bbo` | -| [getCoinMDeliveryKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2922) | | GET | `/market/history/kline` | -| [getCoinMDeliveryMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2933) | | GET | `/index/market/history/mark_price_kline` | -| [getCoinMDeliveryTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2944) | | GET | `/market/detail/merged` | -| [getCoinMDeliveryTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2955) | | GET | `/v2/market/detail/batch_merged` | -| [getCoinMDeliveryLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2966) | | GET | `/market/trade` | -| [getCoinMDeliveryTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2977) | | GET | `/market/history/trade` | -| [getCoinMDeliveryIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2989) | | GET | `/index/market/history/index` | -| [getCoinMDeliveryBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3000) | | GET | `/index/market/history/basis` | -| [getCoinMDeliveryAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3017) | :closed_lock_with_key: | POST | `/api/v1/contract_balance_valuation` | -| [getCoinMDeliveryAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3030) | :closed_lock_with_key: | POST | `/api/v1/contract_account_info` | -| [getCoinMDeliveryPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3043) | :closed_lock_with_key: | POST | `/api/v1/contract_position_info` | -| [updateCoinMDeliverySubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3056) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_auth` | -| [getCoinMDeliverySubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3070) | :closed_lock_with_key: | GET | `/api/v1/contract_sub_auth_list` | -| [getCoinMDeliverySubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3081) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_list` | -| [getCoinMDeliverySubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3094) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_info_list` | -| [getCoinMDeliverySubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3107) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_info` | -| [getCoinMDeliverySubPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3121) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_position_info` | -| [getCoinMDeliveryFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3135) | :closed_lock_with_key: | POST | `/api/v3/contract_financial_record` | -| [getCoinMDeliveryFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3148) | :closed_lock_with_key: | POST | `/api/v3/contract_financial_record_exact` | -| [getCoinMDeliveryUserSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3161) | :closed_lock_with_key: | POST | `/api/v1/contract_user_settlement_records` | -| [getCoinMDeliveryOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3176) | :closed_lock_with_key: | POST | `/api/v1/contract_order_limit` | -| [getCoinMDeliveryFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3189) | :closed_lock_with_key: | POST | `/api/v1/contract_fee` | -| [getCoinMDeliveryTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3202) | :closed_lock_with_key: | POST | `/api/v1/contract_transfer_limit` | -| [getCoinMDeliveryPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3215) | :closed_lock_with_key: | POST | `/api/v1/contract_position_limit` | -| [getCoinMDeliveryAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3228) | :closed_lock_with_key: | POST | `/api/v1/contract_account_position_info` | -| [transferCoinMDeliveryMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3241) | :closed_lock_with_key: | POST | `/api/v1/contract_master_sub_transfer` | -| [getCoinMDeliveryMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3254) | :closed_lock_with_key: | POST | `/api/v1/contract_master_sub_transfer_record` | -| [getCoinMDeliveryApiStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3267) | :closed_lock_with_key: | GET | `/api/v1/contract_api_trading_status` | -| [getCoinMDeliveryAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3278) | :closed_lock_with_key: | POST | `/api/v1/contract_available_level_rate` | -| [setCoinMDeliveryCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3297) | :closed_lock_with_key: | POST | `/api/v1/contract-cancel-after` | -| [submitCoinMDeliveryOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3311) | :closed_lock_with_key: | POST | `/api/v1/contract_order` | -| [submitCoinMDeliveryBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3324) | :closed_lock_with_key: | POST | `/api/v1/contract_batchorder` | -| [cancelCoinMDeliveryOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3337) | :closed_lock_with_key: | POST | `/api/v1/contract_cancel` | -| [cancelCoinMDeliveryAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3350) | :closed_lock_with_key: | POST | `/api/v1/contract_cancelall` | -| [updateCoinMDeliveryLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3363) | :closed_lock_with_key: | POST | `/api/v1/contract_switch_lever_rate` | -| [getCoinMDeliveryOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3377) | :closed_lock_with_key: | POST | `/api/v1/contract_order_info` | -| [getCoinMDeliveryOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3390) | :closed_lock_with_key: | POST | `/api/v1/contract_order_detail` | -| [getCoinMDeliveryOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3403) | :closed_lock_with_key: | POST | `/api/v1/contract_openorders` | -| [getCoinMDeliveryHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3416) | :closed_lock_with_key: | POST | `/api/v3/contract_hisorders` | -| [getCoinMDeliveryHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3429) | :closed_lock_with_key: | POST | `/api/v3/contract_hisorders_exact` | -| [getCoinMDeliveryFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3442) | :closed_lock_with_key: | POST | `/api/v3/contract_matchresults` | -| [getCoinMDeliveryFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3455) | :closed_lock_with_key: | POST | `/api/v3/contract_matchresults_exact` | -| [submitCoinMDeliveryLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3468) | :closed_lock_with_key: | POST | `/api/v1/lightning_close_position` | -| [submitCoinMDeliveryTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3487) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_order` | -| [cancelCoinMDeliveryTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3500) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_cancel` | -| [cancelCoinMDeliveryAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3514) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_cancelall` | -| [getCoinMDeliveryTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3527) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_openorders` | -| [getCoinMDeliveryTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3540) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_hisorders` | -| [submitCoinMDeliveryTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3553) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_order` | -| [cancelCoinMDeliveryTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3566) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_cancel` | -| [cancelCoinMDeliveryAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3580) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_cancelall` | -| [getCoinMDeliveryTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3593) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_openorders` | -| [getCoinMDeliveryTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3606) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_hisorders` | -| [getCoinMDeliveryRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3619) | :closed_lock_with_key: | POST | `/api/v1/contract_relation_tpsl_order` | -| [submitCoinMDeliveryTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3633) | :closed_lock_with_key: | POST | `/api/v1/contract_track_order` | -| [cancelCoinMDeliveryTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3646) | :closed_lock_with_key: | POST | `/api/v1/contract_track_cancel` | -| [cancelCoinMDeliveryAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3660) | :closed_lock_with_key: | POST | `/api/v1/contract_track_cancelall` | -| [getCoinMDeliveryTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3673) | :closed_lock_with_key: | POST | `/api/v1/contract_track_openorders` | -| [getCoinMDeliveryTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3686) | :closed_lock_with_key: | POST | `/api/v1/contract_track_hisorders` | -| [getCoinMPerpAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3707) | | GET | `/swap-api/v1/swap_adjustfactor` | -| [getCoinMPerpHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3718) | | GET | `/swap-api/v1/swap_his_open_interest` | -| [getCoinMPerpTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3729) | | GET | `/swap-api/v1/swap_ladder_margin` | -| [getCoinMPerpAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3740) | | GET | `/swap-api/v1/swap_elite_account_ratio` | -| [getCoinMPerpPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3752) | | GET | `/swap-api/v1/swap_elite_position_ratio` | -| [getCoinMPerpEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3764) | | GET | `/swap-api/v1/swap_estimated_settlement_price` | -| [getCoinMPerpSystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3777) | | GET | `/swap-api/v1/swap_api_state` | -| [getCoinMPerpFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3788) | | GET | `/swap-api/v1/swap_funding_rate` | -| [getCoinMPerpFundingRates()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3799) | | GET | `/swap-api/v1/swap_batch_funding_rate` | -| [getCoinMPerpHistoricalFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3810) | | GET | `/swap-api/v1/swap_historical_funding_rate` | -| [getCoinMPerpLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3823) | | GET | `/swap-api/v3/swap_liquidation_orders` | -| [getCoinMPerpSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3834) | | GET | `/swap-api/v1/swap_settlement_records` | -| [getCoinMPerpContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3845) | | GET | `/swap-api/v1/swap_contract_info` | -| [getCoinMPerpIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3856) | | GET | `/swap-api/v1/swap_index` | -| [getCoinMPerpContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3867) | | GET | `/swap-api/v1/swap_query_elements` | -| [getCoinMPerpIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3878) | | GET | `/swap-api/market/swap_constituents` | -| [getCoinMPerpRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3889) | | GET | `/v1/insurance_fund_info` | -| [getCoinMPerpRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3900) | | GET | `/v1/insurance_fund_history` | -| [getCoinMPerpPriceLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3911) | | GET | `/swap-api/v1/swap_price_limit` | -| [getCoinMPerpOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3922) | | GET | `/swap-api/v1/swap_open_interest` | -| [getCoinMPerpMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3939) | | GET | `/swap-ex/market/depth` | -| [getCoinMPerpMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3951) | | GET | `/swap-ex/market/bbo` | -| [getCoinMPerpKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3962) | | GET | `/swap-ex/market/history/kline` | -| [getCoinMPerpMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3973) | | GET | `/index/market/history/swap_mark_price_kline` | -| [getCoinMPerpTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3984) | | GET | `/swap-ex/market/detail/merged` | -| [getCoinMPerpTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3995) | | GET | `/v2/swap-ex/market/detail/batch_merged` | -| [getCoinMPerpLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4006) | | GET | `/swap-ex/market/trade` | -| [getCoinMPerpTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4017) | | GET | `/swap-ex/market/history/trade` | -| [getCoinMPerpPremiumIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4029) | | GET | `/index/market/history/swap_premium_index_kline` | -| [getCoinMPerpFundingRateKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4040) | | GET | `/index/market/history/swap_estimated_rate_kline` | -| [getCoinMPerpBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4051) | | GET | `/index/market/history/swap_basis` | -| [getCoinMPerpAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4068) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_balance_valuation` | -| [getCoinMPerpAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4081) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_account_info` | -| [getCoinMPerpPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4094) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_position_info` | -| [getCoinMPerpAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4107) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_account_position_info` | -| [getCoinMPerpSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4120) | :closed_lock_with_key: | GET | `/swap-api/v1/swap_sub_auth_list` | -| [updateCoinMPerpSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4131) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_auth` | -| [getCoinMPerpSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4145) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_list` | -| [getCoinMPerpSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4158) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_info_list` | -| [getCoinMPerpSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4171) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_info` | -| [getCoinMPerpSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4185) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_position_info` | -| [getCoinMPerpFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4199) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_financial_record` | -| [getCoinMPerpFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4212) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_financial_record_exact` | -| [getCoinMPerpAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4225) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_available_level_rate` | -| [getCoinMPerpOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4238) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_limit` | -| [getCoinMPerpFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4251) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_fee` | -| [getCoinMPerpTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4264) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_transfer_limit` | -| [getCoinMPerpPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4277) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_position_limit` | -| [transferCoinMPerpMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4290) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_master_sub_transfer` | -| [getCoinMPerpMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4303) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_master_sub_transfer_record` | -| [getCoinMPerpApiStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4316) | :closed_lock_with_key: | GET | `/swap-api/v1/swap_api_trading_status` | -| [setCoinMPerpCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4333) | :closed_lock_with_key: | POST | `/swap-api/v1/swap-cancel-after` | -| [submitCoinMPerpOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4347) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order` | -| [submitCoinMPerpBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4360) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_batchorder` | -| [cancelCoinMPerpOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4373) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_cancel` | -| [cancelCoinMPerpAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4386) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_cancelall` | -| [updateCoinMPerpLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4399) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_switch_lever_rate` | -| [getCoinMPerpOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4413) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_info` | -| [getCoinMPerpOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4426) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_detail` | -| [getCoinMPerpOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4439) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_openorders` | -| [getCoinMPerpHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4452) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_hisorders` | -| [getCoinMPerpHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4465) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_hisorders_exact` | -| [getCoinMPerpFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4478) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_matchresults` | -| [getCoinMPerpFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4491) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_matchresults_exact` | -| [submitCoinMPerpLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4504) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_lightning_close_position` | -| [submitCoinMPerpTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4523) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_order` | -| [cancelCoinMPerpTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4536) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_cancel` | -| [cancelCoinMPerpAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4550) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_cancelall` | -| [getCoinMPerpTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4563) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_openorders` | -| [getCoinMPerpTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4576) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_hisorders` | -| [submitCoinMPerpTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4589) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_order` | -| [cancelCoinMPerpTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4602) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_cancel` | -| [cancelCoinMPerpAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4615) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_cancelall` | -| [getCoinMPerpTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4628) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_openorders` | -| [getCoinMPerpTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4641) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_hisorders` | -| [getCoinMPerpRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4654) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_relation_tpsl_order` | -| [submitCoinMPerpTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4667) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_order` | -| [cancelCoinMPerpTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4680) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_cancel` | -| [cancelCoinMPerpAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4693) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_cancelall` | -| [getCoinMPerpTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4706) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_openorders` | -| [getCoinMPerpTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4719) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_hisorders` | -| [getCopyTraderInstruments()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4738) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/instruments` | -| [getCopyTraderStatistics()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4749) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/statistics` | -| [getCopyTraderProfitSharingHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4760) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/profit-sharing-history` | -| [getCopyTraderProfitSharingHistorySummary()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4776) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/profit-sharing-history-summary` | -| [getCopyTraderUPNLSharingSummary()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4792) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/unrealized-profit-sharing-summary` | -| [getCopyTraderFollowers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4808) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/followers` | -| [removeCopyTraderFollower()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4819) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/follower` | -| [submitCopyTraderTransfer()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4834) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/transfer` | -| [updateCopyTraderFollowerSettings()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4847) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/follower-settings` | -| [getCopyTraderConfig()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4860) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/config` | -| [createCopyTraderApikey()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4873) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/apikey` | +| [getTimestamp()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L438) | | GET | `/api/v1/timestamp` | +| [getHeartbeat()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L448) | | GET | `/heartbeat/` | +| [getLinearSwapAccountType()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L464) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/swap_unified_account_type` | +| [updateLinearSwapAccountType()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L480) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_switch_account_type` | +| [getLinearSwapFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L496) | | GET | `/linear-swap-api/v1/swap_funding_rate` | +| [getLinearSwapFundingRates()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L508) | | GET | `/linear-swap-api/v1/swap_batch_funding_rate` | +| [getLinearSwapHistoricalFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L520) | | GET | `/linear-swap-api/v1/swap_historical_funding_rate` | +| [getLinearSwapLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L532) | | GET | `/linear-swap-api/v3/swap_liquidation_orders` | +| [getLinearSwapSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L544) | | GET | `/linear-swap-api/v1/swap_settlement_records` | +| [getLinearSwapNetAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L556) | | GET | `/linear-swap-api/v1/swap_elite_account_ratio` | +| [getLinearSwapNetPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L569) | | GET | `/linear-swap-api/v1/swap_elite_position_ratio` | +| [getLinearSwapIsolatedSystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L582) | | GET | `/linear-swap-api/v1/swap_api_state` | +| [getLinearSwapCrossTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L595) | | GET | `/linear-swap-api/v1/swap_cross_ladder_margin` | +| [getLinearSwapIsolatedTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L607) | | GET | `/linear-swap-api/v1/swap_ladder_margin` | +| [getLinearSwapEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L620) | | GET | `/linear-swap-api/v1/swap_estimated_settlement_price` | +| [getLinearSwapIsolatedAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L635) | | GET | `/linear-swap-api/v1/swap_adjustfactor` | +| [getLinearSwapCrossAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L648) | | GET | `/linear-swap-api/v1/swap_cross_adjustfactor` | +| [getLinearSwapRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L660) | | GET | `/v1/insurance_fund_info` | +| [getLinearSwapRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L672) | | GET | `/v1/insurance_fund_history` | +| [getLinearSwapContractPriceLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L684) | | GET | `/linear-swap-api/v1/swap_price_limit` | +| [getLinearSwapOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L696) | | GET | `/linear-swap-api/v1/swap_open_interest` | +| [getLinearSwapContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L708) | | GET | `/linear-swap-api/v1/swap_contract_info` | +| [getLinearSwapIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L720) | | GET | `/linear-swap-api/v1/swap_index` | +| [getLinearSwapIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L732) | | GET | `/linear-swap-api/market/swap_contract_constituents` | +| [getLinearSwapContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L747) | | GET | `/linear-swap-api/v1/swap_query_elements` | +| [getLinearSwapMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L765) | | GET | `/linear-swap-ex/market/depth` | +| [getLinearSwapMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L778) | | GET | `/linear-swap-ex/market/bbo` | +| [getLinearSwapKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L791) | | GET | `/linear-swap-ex/market/history/kline` | +| [getLinearSwapMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L802) | | GET | `/index/market/history/linear_swap_mark_price_kline` | +| [getLinearSwapTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L816) | | GET | `/linear-swap-ex/market/detail/merged` | +| [getLinearSwapTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L828) | | GET | `/v2/linear-swap-ex/market/detail/batch_merged` | +| [getLinearSwapLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L841) | | GET | `/linear-swap-ex/market/trade` | +| [getLinearSwapTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L853) | | GET | `/linear-swap-ex/market/history/trade` | +| [getLinearSwapHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L866) | | GET | `/linear-swap-api/v1/swap_his_open_interest` | +| [getLinearSwapPremiumIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L877) | | GET | `/index/market/history/linear_swap_premium_index_kline` | +| [getLinearSwapFundingRateKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L891) | | GET | `/index/market/history/linear_swap_estimated_rate_kline` | +| [getLinearSwapBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L905) | | GET | `/index/market/history/linear_swap_basis` | +| [getLinearSwapAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L923) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_balance_valuation` | +| [getLinearSwapIsolatedAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L936) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_account_info` | +| [getLinearSwapCrossAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L949) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_account_info` | +| [getLinearSwapIsolatedPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L962) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_position_info` | +| [getLinearSwapCrossPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L975) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_position_info` | +| [getLinearSwapIsolatedAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L988) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_account_position_info` | +| [getLinearSwapCrossAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1001) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_account_position_info` | +| [updateLinearSwapSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1015) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_auth` | +| [getLinearSwapSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1029) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_sub_auth_list` | +| [getLinearSwapIsolatedSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1040) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_list` | +| [getLinearSwapCrossSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1053) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_list` | +| [getLinearSwapIsolatedSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1066) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_info_list` | +| [getLinearSwapCrossSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1079) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_info_list` | +| [getLinearSwapIsolatedSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1093) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_account_info` | +| [getLinearSwapCrossSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1107) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_account_info` | +| [getLinearSwapIsolatedSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1121) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_sub_position_info` | +| [getLinearSwapCrossSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1135) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_sub_position_info` | +| [getLinearSwapFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1149) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_financial_record` | +| [getLinearSwapFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1162) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_financial_record_exact` | +| [getLinearSwapIsolatedAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1175) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_available_level_rate` | +| [getLinearSwapCrossAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1188) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_available_level_rate` | +| [getLinearSwapOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1202) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_limit` | +| [getLinearSwapFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1215) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_fee` | +| [getLinearSwapIsolatedTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1228) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_transfer_limit` | +| [getLinearSwapCrossTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1241) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_transfer_limit` | +| [getLinearSwapIsolatedPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1254) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_position_limit` | +| [getLinearSwapCrossPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1267) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_position_limit` | +| [getLinearSwapIsolatedLeverageLimits()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1280) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_lever_position_limit` | +| [getLinearSwapCrossLeverageLimits()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1294) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_lever_position_limit` | +| [transferLinearSwapMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1310) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_master_sub_transfer` | +| [getLinearSwapMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1323) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_master_sub_transfer_record` | +| [transferLinearSwapInner()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1339) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_transfer_inner` | +| [setLinearSwapCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1358) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/linear-cancel-after` | +| [getLinearSwapCrossTradeState()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1372) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_trade_state` | +| [getLinearSwapCrossTransferState()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1386) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_transfer_state` | +| [updateLinearSwapIsolatedPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1400) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_switch_position_mode` | +| [updateLinearSwapCrossPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1414) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_switch_position_mode` | +| [submitLinearSwapIsolatedOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1431) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order` | +| [submitLinearSwapCrossOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1444) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order` | +| [submitLinearSwapIsolatedBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1457) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_batchorder` | +| [submitLinearSwapCrossBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1470) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_batchorder` | +| [cancelLinearSwapIsolatedOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1483) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cancel` | +| [cancelLinearSwapCrossOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1496) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_cancel` | +| [cancelLinearSwapIsolatedAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1509) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cancelall` | +| [cancelLinearSwapCrossAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1522) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_cancelall` | +| [updateLinearSwapIsolatedLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1535) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_switch_lever_rate` | +| [updateLinearSwapCrossLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1549) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_switch_lever_rate` | +| [getLinearSwapIsolatedOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1565) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_info` | +| [getLinearSwapCrossOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1578) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order_info` | +| [getLinearSwapIsolatedOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1591) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_order_detail` | +| [getLinearSwapCrossOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1604) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_order_detail` | +| [getLinearSwapIsolatedOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1617) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_openorders` | +| [getLinearSwapCrossOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1630) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_openorders` | +| [getLinearSwapIsolatedHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1643) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_hisorders` | +| [getLinearSwapCrossHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1656) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_hisorders` | +| [getLinearSwapIsolatedHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1669) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_hisorders_exact` | +| [getLinearSwapCrossHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1682) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_hisorders_exact` | +| [getLinearSwapIsolatedFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1695) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_matchresults` | +| [getLinearSwapCrossFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1708) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_matchresults` | +| [getLinearSwapIsolatedFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1721) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_matchresults_exact` | +| [getLinearSwapCrossFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1734) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/swap_cross_matchresults_exact` | +| [submitLinearSwapIsolatedLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1750) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_lightning_close_position` | +| [submitLinearSwapCrossLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1766) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_lightning_close_position` | +| [getLinearSwapIsolatedPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1780) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_position_side` | +| [getLinearSwapCrossPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1791) | :closed_lock_with_key: | GET | `/linear-swap-api/v1/swap_cross_position_side` | +| [submitLinearSwapIsolatedTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1811) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_order` | +| [submitLinearSwapCrossTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1824) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_order` | +| [cancelLinearSwapIsolatedTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1837) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_cancel` | +| [cancelLinearSwapCrossTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1851) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_cancel` | +| [cancelLinearSwapIsolatedAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1864) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_cancelall` | +| [cancelLinearSwapCrossAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1877) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_cancelall` | +| [getLinearSwapIsolatedTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1893) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_openorders` | +| [getLinearSwapCrossTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1906) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_openorders` | +| [getLinearSwapIsolatedTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1920) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_trigger_hisorders` | +| [getLinearSwapCrossTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1933) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_trigger_hisorders` | +| [submitLinearSwapIsolatedTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1947) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_order` | +| [submitLinearSwapCrossTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1960) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_order` | +| [cancelLinearSwapIsolatedTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1973) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_cancel` | +| [cancelLinearSwapCrossTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L1987) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_cancel` | +| [cancelLinearSwapIsolatedAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2000) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_cancelall` | +| [cancelLinearSwapCrossAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2014) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_cancelall` | +| [getLinearSwapIsolatedTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2027) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_openorders` | +| [getLinearSwapCrossTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2040) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_openorders` | +| [getLinearSwapIsolatedTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2053) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_tpsl_hisorders` | +| [getLinearSwapCrossTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2066) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_tpsl_hisorders` | +| [getLinearSwapIsolatedRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2079) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_relation_tpsl_order` | +| [getLinearSwapCrossRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2093) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_relation_tpsl_order` | +| [submitLinearSwapIsolatedTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2109) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_order` | +| [submitLinearSwapCrossTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2122) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_order` | +| [cancelLinearSwapIsolatedTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2135) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_cancel` | +| [cancelLinearSwapCrossTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2149) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_cancel` | +| [cancelLinearSwapIsolatedAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2162) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_cancelall` | +| [cancelLinearSwapCrossAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2175) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_cancelall` | +| [getLinearSwapIsolatedTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2188) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_openorders` | +| [getLinearSwapCrossTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2201) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_openorders` | +| [getLinearSwapIsolatedTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2214) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_track_hisorders` | +| [getLinearSwapCrossTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2227) | :closed_lock_with_key: | POST | `/linear-swap-api/v1/swap_cross_track_hisorders` | +| [getLinearSwapUnifiedAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2244) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/unified_account_info` | +| [getLinearSwapUnifiedAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2255) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/linear_swap_overview_account_info` | +| [updateLinearSwapUnifiedFeeMethod()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2271) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/linear_swap_fee_switch` | +| [getLinearSwapUnifiedMarginAdjustments()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2285) | :closed_lock_with_key: | GET | `/linear-swap-api/v3/fix_position_margin_change_record` | +| [updateLinearSwapUnifiedMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2301) | :closed_lock_with_key: | POST | `/linear-swap-api/v3/fix_position_margin_change` | +| [getMultiAssetAccountBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2321) | :closed_lock_with_key: | GET | `/v5/account/balance` | +| [getMultiAssetMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2333) | :closed_lock_with_key: | GET | `/v5/account/asset_mode` | +| [updateMultiAssetMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2345) | :closed_lock_with_key: | POST | `/v5/account/asset_mode` | +| [updateMultiAssetFeeCurrency()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2357) | :closed_lock_with_key: | POST | `/v5/account/fee_deduction_currency` | +| [getMultiAssetFeeCurrency()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2372) | :closed_lock_with_key: | GET | `/v5/account/fee_deduction_currency` | +| [getMultiAssetBills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2384) | :closed_lock_with_key: | GET | `/v5/account/bills` | +| [submitMultiAssetOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2402) | :closed_lock_with_key: | POST | `/v5/trade/order` | +| [submitMultiAssetBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2414) | :closed_lock_with_key: | POST | `/v5/trade/batch_orders` | +| [cancelMultiAssetOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2426) | :closed_lock_with_key: | POST | `/v5/trade/cancel_order` | +| [cancelMultiAssetBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2438) | :closed_lock_with_key: | POST | `/v5/trade/cancel_batch_orders` | +| [cancelMultiAssetAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2450) | :closed_lock_with_key: | POST | `/v5/trade/cancel_all_orders` | +| [closeMultiAssetPosition()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2464) | :closed_lock_with_key: | POST | `/v5/trade/position` | +| [closeMultiAssetAllPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2476) | :closed_lock_with_key: | POST | `/v5/trade/position_all` | +| [getMultiAssetOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2488) | :closed_lock_with_key: | GET | `/v5/trade/order/opens` | +| [getMultiAssetFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2500) | :closed_lock_with_key: | GET | `/v5/trade/order/details` | +| [getMultiAssetOrderHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2512) | :closed_lock_with_key: | GET | `/v5/trade/order/history` | +| [getMultiAssetOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2524) | :closed_lock_with_key: | GET | `/v5/trade/order` | +| [setMultiAssetCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2536) | :closed_lock_with_key: | POST | `/v5/trade/cancel-after` | +| [submitMultiAssetAlgoOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2551) | :closed_lock_with_key: | POST | `/v5/algo/order` | +| [cancelMultiAssetAlgoOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2560) | :closed_lock_with_key: | POST | `/v5/algo/cancel_orders` | +| [getMultiAssetAlgoOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2569) | :closed_lock_with_key: | GET | `/v5/algo/order` | +| [getMultiAssetAlgoOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2578) | :closed_lock_with_key: | GET | `/v5/algo/order/opens` | +| [getMultiAssetAlgoOrderHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2587) | :closed_lock_with_key: | GET | `/v5/algo/order/history` | +| [getMultiAssetPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2605) | :closed_lock_with_key: | GET | `/v5/trade/position/opens` | +| [getMultiAssetLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2617) | :closed_lock_with_key: | GET | `/v5/position/lever` | +| [updateMultiAssetLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2629) | :closed_lock_with_key: | POST | `/v5/position/lever` | +| [getMultiAssetPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2641) | :closed_lock_with_key: | GET | `/v5/position/mode` | +| [updateMultiAssetPositionMode()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2653) | :closed_lock_with_key: | POST | `/v5/position/mode` | +| [getMultiAssetRiskLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2665) | :closed_lock_with_key: | GET | `/v5/position/risk/limit` | +| [getMultiAssetRiskLimitTiers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2677) | :closed_lock_with_key: | GET | `/v5/position/risk/limit_tier` | +| [adjustMultiAssetMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2690) | :closed_lock_with_key: | POST | `/v5/position/margin` | +| [getMultiAssetMarketRiskLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2707) | :closed_lock_with_key: | GET | `/v5/market/risk/limit` | +| [getMultiAssetFeeCurrencies()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2719) | :closed_lock_with_key: | GET | `/v5/market/assets_deduction_currency` | +| [getMultiAssetCollateralAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2731) | :closed_lock_with_key: | GET | `/v5/market/multi_assets_margin` | +| [getCoinMDeliveryAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2748) | | GET | `/api/v1/contract_adjustfactor` | +| [getCoinMDeliveryHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2759) | | GET | `/api/v1/contract_his_open_interest` | +| [getCoinMDeliveryTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2770) | | GET | `/api/v1/contract_ladder_margin` | +| [getCoinMDeliveryAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2781) | | GET | `/api/v1/contract_elite_account_ratio` | +| [getCoinMDeliveryPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2793) | | GET | `/api/v1/contract_elite_position_ratio` | +| [getCoinMDeliveryLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2805) | | GET | `/api/v3/contract_liquidation_orders` | +| [getCoinMDeliverySettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2816) | | GET | `/api/v1/contract_settlement_records` | +| [getCoinMDeliveryRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2827) | | GET | `/v1/insurance_fund_info` | +| [getCoinMDeliveryRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2838) | | GET | `/v1/insurance_fund_history` | +| [getCoinMDeliveryContractLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2849) | | GET | `/api/v1/contract_price_limit` | +| [getCoinMDeliveryOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2860) | | GET | `/api/v1/contract_open_interest` | +| [getCoinMDeliveryDeliveryPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2873) | | GET | `/api/v1/contract_delivery_price` | +| [getCoinMDeliveryEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2884) | | GET | `/api/v1/contract_estimated_settlement_price` | +| [getCoinMDeliverySystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2897) | | GET | `/api/v1/contract_api_state` | +| [getCoinMDeliveryContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2908) | | GET | `/api/v1/contract_contract_info` | +| [getCoinMDeliveryIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2919) | | GET | `/api/v1/contract_index` | +| [getCoinMDeliveryIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2930) | | GET | `/api/market/contract_constituents` | +| [getCoinMDeliveryContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2941) | | GET | `/api/v1/contract_query_elements` | +| [getCoinMDeliveryMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2958) | | GET | `/market/depth` | +| [getCoinMDeliveryMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2970) | | GET | `/market/bbo` | +| [getCoinMDeliveryKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2981) | | GET | `/market/history/kline` | +| [getCoinMDeliveryMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L2992) | | GET | `/index/market/history/mark_price_kline` | +| [getCoinMDeliveryTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3003) | | GET | `/market/detail/merged` | +| [getCoinMDeliveryTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3014) | | GET | `/v2/market/detail/batch_merged` | +| [getCoinMDeliveryLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3025) | | GET | `/market/trade` | +| [getCoinMDeliveryTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3036) | | GET | `/market/history/trade` | +| [getCoinMDeliveryIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3048) | | GET | `/index/market/history/index` | +| [getCoinMDeliveryBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3059) | | GET | `/index/market/history/basis` | +| [getCoinMDeliveryAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3076) | :closed_lock_with_key: | POST | `/api/v1/contract_balance_valuation` | +| [getCoinMDeliveryAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3089) | :closed_lock_with_key: | POST | `/api/v1/contract_account_info` | +| [getCoinMDeliveryPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3102) | :closed_lock_with_key: | POST | `/api/v1/contract_position_info` | +| [updateCoinMDeliverySubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3115) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_auth` | +| [getCoinMDeliverySubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3129) | :closed_lock_with_key: | GET | `/api/v1/contract_sub_auth_list` | +| [getCoinMDeliverySubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3140) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_list` | +| [getCoinMDeliverySubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3153) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_info_list` | +| [getCoinMDeliverySubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3166) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_account_info` | +| [getCoinMDeliverySubPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3180) | :closed_lock_with_key: | POST | `/api/v1/contract_sub_position_info` | +| [getCoinMDeliveryFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3194) | :closed_lock_with_key: | POST | `/api/v3/contract_financial_record` | +| [getCoinMDeliveryFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3207) | :closed_lock_with_key: | POST | `/api/v3/contract_financial_record_exact` | +| [getCoinMDeliveryUserSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3220) | :closed_lock_with_key: | POST | `/api/v1/contract_user_settlement_records` | +| [getCoinMDeliveryOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3235) | :closed_lock_with_key: | POST | `/api/v1/contract_order_limit` | +| [getCoinMDeliveryFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3248) | :closed_lock_with_key: | POST | `/api/v1/contract_fee` | +| [getCoinMDeliveryTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3261) | :closed_lock_with_key: | POST | `/api/v1/contract_transfer_limit` | +| [getCoinMDeliveryPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3274) | :closed_lock_with_key: | POST | `/api/v1/contract_position_limit` | +| [getCoinMDeliveryAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3287) | :closed_lock_with_key: | POST | `/api/v1/contract_account_position_info` | +| [transferCoinMDeliveryMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3300) | :closed_lock_with_key: | POST | `/api/v1/contract_master_sub_transfer` | +| [getCoinMDeliveryMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3313) | :closed_lock_with_key: | POST | `/api/v1/contract_master_sub_transfer_record` | +| [getCoinMDeliveryApiStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3326) | :closed_lock_with_key: | GET | `/api/v1/contract_api_trading_status` | +| [getCoinMDeliveryAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3337) | :closed_lock_with_key: | POST | `/api/v1/contract_available_level_rate` | +| [setCoinMDeliveryCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3356) | :closed_lock_with_key: | POST | `/api/v1/contract-cancel-after` | +| [submitCoinMDeliveryOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3370) | :closed_lock_with_key: | POST | `/api/v1/contract_order` | +| [submitCoinMDeliveryBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3383) | :closed_lock_with_key: | POST | `/api/v1/contract_batchorder` | +| [cancelCoinMDeliveryOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3396) | :closed_lock_with_key: | POST | `/api/v1/contract_cancel` | +| [cancelCoinMDeliveryAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3409) | :closed_lock_with_key: | POST | `/api/v1/contract_cancelall` | +| [updateCoinMDeliveryLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3422) | :closed_lock_with_key: | POST | `/api/v1/contract_switch_lever_rate` | +| [getCoinMDeliveryOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3436) | :closed_lock_with_key: | POST | `/api/v1/contract_order_info` | +| [getCoinMDeliveryOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3449) | :closed_lock_with_key: | POST | `/api/v1/contract_order_detail` | +| [getCoinMDeliveryOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3462) | :closed_lock_with_key: | POST | `/api/v1/contract_openorders` | +| [getCoinMDeliveryHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3475) | :closed_lock_with_key: | POST | `/api/v3/contract_hisorders` | +| [getCoinMDeliveryHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3488) | :closed_lock_with_key: | POST | `/api/v3/contract_hisorders_exact` | +| [getCoinMDeliveryFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3501) | :closed_lock_with_key: | POST | `/api/v3/contract_matchresults` | +| [getCoinMDeliveryFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3514) | :closed_lock_with_key: | POST | `/api/v3/contract_matchresults_exact` | +| [submitCoinMDeliveryLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3527) | :closed_lock_with_key: | POST | `/api/v1/lightning_close_position` | +| [submitCoinMDeliveryTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3546) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_order` | +| [cancelCoinMDeliveryTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3559) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_cancel` | +| [cancelCoinMDeliveryAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3573) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_cancelall` | +| [getCoinMDeliveryTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3586) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_openorders` | +| [getCoinMDeliveryTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3599) | :closed_lock_with_key: | POST | `/api/v1/contract_trigger_hisorders` | +| [submitCoinMDeliveryTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3612) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_order` | +| [cancelCoinMDeliveryTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3625) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_cancel` | +| [cancelCoinMDeliveryAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3639) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_cancelall` | +| [getCoinMDeliveryTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3652) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_openorders` | +| [getCoinMDeliveryTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3665) | :closed_lock_with_key: | POST | `/api/v1/contract_tpsl_hisorders` | +| [getCoinMDeliveryRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3678) | :closed_lock_with_key: | POST | `/api/v1/contract_relation_tpsl_order` | +| [submitCoinMDeliveryTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3692) | :closed_lock_with_key: | POST | `/api/v1/contract_track_order` | +| [cancelCoinMDeliveryTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3705) | :closed_lock_with_key: | POST | `/api/v1/contract_track_cancel` | +| [cancelCoinMDeliveryAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3719) | :closed_lock_with_key: | POST | `/api/v1/contract_track_cancelall` | +| [getCoinMDeliveryTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3732) | :closed_lock_with_key: | POST | `/api/v1/contract_track_openorders` | +| [getCoinMDeliveryTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3745) | :closed_lock_with_key: | POST | `/api/v1/contract_track_hisorders` | +| [getCoinMPerpAdjustFactor()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3766) | | GET | `/swap-api/v1/swap_adjustfactor` | +| [getCoinMPerpHistoricalOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3777) | | GET | `/swap-api/v1/swap_his_open_interest` | +| [getCoinMPerpTieredMargin()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3788) | | GET | `/swap-api/v1/swap_ladder_margin` | +| [getCoinMPerpAccountRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3799) | | GET | `/swap-api/v1/swap_elite_account_ratio` | +| [getCoinMPerpPositionRatio()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3811) | | GET | `/swap-api/v1/swap_elite_position_ratio` | +| [getCoinMPerpEstimatedSettlementPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3823) | | GET | `/swap-api/v1/swap_estimated_settlement_price` | +| [getCoinMPerpSystemStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3836) | | GET | `/swap-api/v1/swap_api_state` | +| [getCoinMPerpFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3847) | | GET | `/swap-api/v1/swap_funding_rate` | +| [getCoinMPerpFundingRates()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3858) | | GET | `/swap-api/v1/swap_batch_funding_rate` | +| [getCoinMPerpHistoricalFundingRate()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3869) | | GET | `/swap-api/v1/swap_historical_funding_rate` | +| [getCoinMPerpLiquidationOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3882) | | GET | `/swap-api/v3/swap_liquidation_orders` | +| [getCoinMPerpSettlementRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3893) | | GET | `/swap-api/v1/swap_settlement_records` | +| [getCoinMPerpContractInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3904) | | GET | `/swap-api/v1/swap_contract_info` | +| [getCoinMPerpIndexPrice()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3915) | | GET | `/swap-api/v1/swap_index` | +| [getCoinMPerpContractElements()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3926) | | GET | `/swap-api/v1/swap_query_elements` | +| [getCoinMPerpIndexConstituents()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3937) | | GET | `/swap-api/market/swap_constituents` | +| [getCoinMPerpRiskReserveBalance()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3948) | | GET | `/v1/insurance_fund_info` | +| [getCoinMPerpRiskReserveHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3959) | | GET | `/v1/insurance_fund_history` | +| [getCoinMPerpPriceLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3970) | | GET | `/swap-api/v1/swap_price_limit` | +| [getCoinMPerpOpenInterest()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3981) | | GET | `/swap-api/v1/swap_open_interest` | +| [getCoinMPerpMarketDepth()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L3998) | | GET | `/swap-ex/market/depth` | +| [getCoinMPerpMarketBbo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4010) | | GET | `/swap-ex/market/bbo` | +| [getCoinMPerpKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4021) | | GET | `/swap-ex/market/history/kline` | +| [getCoinMPerpMarkKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4032) | | GET | `/index/market/history/swap_mark_price_kline` | +| [getCoinMPerpTicker()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4043) | | GET | `/swap-ex/market/detail/merged` | +| [getCoinMPerpTickers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4054) | | GET | `/v2/swap-ex/market/detail/batch_merged` | +| [getCoinMPerpLastTrade()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4065) | | GET | `/swap-ex/market/trade` | +| [getCoinMPerpTradeHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4076) | | GET | `/swap-ex/market/history/trade` | +| [getCoinMPerpPremiumIndexKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4088) | | GET | `/index/market/history/swap_premium_index_kline` | +| [getCoinMPerpFundingRateKlines()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4099) | | GET | `/index/market/history/swap_estimated_rate_kline` | +| [getCoinMPerpBasisData()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4110) | | GET | `/index/market/history/swap_basis` | +| [getCoinMPerpAssetValuation()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4127) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_balance_valuation` | +| [getCoinMPerpAccountInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4140) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_account_info` | +| [getCoinMPerpPositionInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4153) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_position_info` | +| [getCoinMPerpAccountFull()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4166) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_account_position_info` | +| [getCoinMPerpSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4179) | :closed_lock_with_key: | GET | `/swap-api/v1/swap_sub_auth_list` | +| [updateCoinMPerpSubPermissions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4190) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_auth` | +| [getCoinMPerpSubAccounts()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4204) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_list` | +| [getCoinMPerpSubAccountsAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4217) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_info_list` | +| [getCoinMPerpSubAccountAssets()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4230) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_account_info` | +| [getCoinMPerpSubPositions()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4244) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_sub_position_info` | +| [getCoinMPerpFinancialRecords()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4258) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_financial_record` | +| [getCoinMPerpFinancialRecordsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4271) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_financial_record_exact` | +| [getCoinMPerpAvailableLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4284) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_available_level_rate` | +| [getCoinMPerpOrderLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4297) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_limit` | +| [getCoinMPerpFee()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4310) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_fee` | +| [getCoinMPerpTransferLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4323) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_transfer_limit` | +| [getCoinMPerpPositionLimit()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4336) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_position_limit` | +| [transferCoinMPerpMasterSub()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4349) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_master_sub_transfer` | +| [getCoinMPerpMasterSubTransfers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4362) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_master_sub_transfer_record` | +| [getCoinMPerpApiStatus()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4375) | :closed_lock_with_key: | GET | `/swap-api/v1/swap_api_trading_status` | +| [setCoinMPerpCancelAfter()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4392) | :closed_lock_with_key: | POST | `/swap-api/v1/swap-cancel-after` | +| [submitCoinMPerpOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4406) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order` | +| [submitCoinMPerpBatchOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4419) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_batchorder` | +| [cancelCoinMPerpOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4432) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_cancel` | +| [cancelCoinMPerpAllOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4445) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_cancelall` | +| [updateCoinMPerpLeverage()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4458) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_switch_lever_rate` | +| [getCoinMPerpOrderInfo()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4472) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_info` | +| [getCoinMPerpOrderDetail()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4485) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_order_detail` | +| [getCoinMPerpOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4498) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_openorders` | +| [getCoinMPerpHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4511) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_hisorders` | +| [getCoinMPerpHistoryOrdersExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4524) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_hisorders_exact` | +| [getCoinMPerpFills()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4537) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_matchresults` | +| [getCoinMPerpFillsExact()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4550) | :closed_lock_with_key: | POST | `/swap-api/v3/swap_matchresults_exact` | +| [submitCoinMPerpLightningCloseOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4563) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_lightning_close_position` | +| [submitCoinMPerpTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4582) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_order` | +| [cancelCoinMPerpTriggerOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4595) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_cancel` | +| [cancelCoinMPerpAllTriggerOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4609) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_cancelall` | +| [getCoinMPerpTriggerOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4622) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_openorders` | +| [getCoinMPerpTriggerHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4635) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_trigger_hisorders` | +| [submitCoinMPerpTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4648) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_order` | +| [cancelCoinMPerpTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4661) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_cancel` | +| [cancelCoinMPerpAllTpslOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4674) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_cancelall` | +| [getCoinMPerpTpslOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4687) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_openorders` | +| [getCoinMPerpTpslHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4700) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_tpsl_hisorders` | +| [getCoinMPerpRelationTpslOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4713) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_relation_tpsl_order` | +| [submitCoinMPerpTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4726) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_order` | +| [cancelCoinMPerpTrailingOrder()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4739) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_cancel` | +| [cancelCoinMPerpAllTrailingOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4752) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_cancelall` | +| [getCoinMPerpTrailingOpenOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4765) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_openorders` | +| [getCoinMPerpTrailingHistoryOrders()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4778) | :closed_lock_with_key: | POST | `/swap-api/v1/swap_track_hisorders` | +| [getCopyTraderInstruments()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4797) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/instruments` | +| [getCopyTraderStatistics()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4808) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/statistics` | +| [getCopyTraderProfitSharingHistory()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4819) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/profit-sharing-history` | +| [getCopyTraderProfitSharingHistorySummary()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4835) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/profit-sharing-history-summary` | +| [getCopyTraderUPNLSharingSummary()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4851) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/unrealized-profit-sharing-summary` | +| [getCopyTraderFollowers()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4867) | :closed_lock_with_key: | GET | `/api/v6/copyTrading/trader/followers` | +| [removeCopyTraderFollower()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4878) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/follower` | +| [submitCopyTraderTransfer()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4893) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/transfer` | +| [updateCopyTraderFollowerSettings()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4906) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/follower-settings` | +| [getCopyTraderConfig()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4919) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/config` | +| [createCopyTraderApikey()](https://github.com/sieblyio/htx-api/blob/main/src/FuturesClient.ts#L4932) | :closed_lock_with_key: | POST | `/api/v6/copyTrading/trader/apikey` | # WebsocketAPIClient.ts diff --git a/examples/apidoc/FuturesClient/cancelMultiAssetAlgoOrders.js b/examples/apidoc/FuturesClient/cancelMultiAssetAlgoOrders.js new file mode 100644 index 0000000..e4c5d5c --- /dev/null +++ b/examples/apidoc/FuturesClient/cancelMultiAssetAlgoOrders.js @@ -0,0 +1,22 @@ +import { FuturesClient } from '@siebly/htx-api'; +// or, if require is preferred: +// const { FuturesClient } = require('@siebly/htx-api'); + +// This example shows how to call this HTX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "@siebly/htx-api" for HTX exchange +// This HTX API SDK is available on npm via "npm install @siebly/htx-api" +// ENDPOINT: /v5/algo/cancel_orders +// METHOD: POST +// PUBLIC: NO + +const client = new FuturesClient({ + apiKey: 'insert_api_key_here', + apiSecret: 'insert_api_secret_here', +}); + +client.cancelMultiAssetAlgoOrders(params) + .then((response) => { + console.log(response); + }) + .catch((error) => { + console.error(error); + }); diff --git a/examples/apidoc/FuturesClient/getMultiAssetAlgoOpenOrders.js b/examples/apidoc/FuturesClient/getMultiAssetAlgoOpenOrders.js new file mode 100644 index 0000000..260992c --- /dev/null +++ b/examples/apidoc/FuturesClient/getMultiAssetAlgoOpenOrders.js @@ -0,0 +1,22 @@ +import { FuturesClient } from '@siebly/htx-api'; +// or, if require is preferred: +// const { FuturesClient } = require('@siebly/htx-api'); + +// This example shows how to call this HTX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "@siebly/htx-api" for HTX exchange +// This HTX API SDK is available on npm via "npm install @siebly/htx-api" +// ENDPOINT: /v5/algo/order/opens +// METHOD: GET +// PUBLIC: NO + +const client = new FuturesClient({ + apiKey: 'insert_api_key_here', + apiSecret: 'insert_api_secret_here', +}); + +client.getMultiAssetAlgoOpenOrders(params) + .then((response) => { + console.log(response); + }) + .catch((error) => { + console.error(error); + }); diff --git a/examples/apidoc/FuturesClient/getMultiAssetAlgoOrder.js b/examples/apidoc/FuturesClient/getMultiAssetAlgoOrder.js new file mode 100644 index 0000000..8d98b35 --- /dev/null +++ b/examples/apidoc/FuturesClient/getMultiAssetAlgoOrder.js @@ -0,0 +1,22 @@ +import { FuturesClient } from '@siebly/htx-api'; +// or, if require is preferred: +// const { FuturesClient } = require('@siebly/htx-api'); + +// This example shows how to call this HTX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "@siebly/htx-api" for HTX exchange +// This HTX API SDK is available on npm via "npm install @siebly/htx-api" +// ENDPOINT: /v5/algo/order +// METHOD: GET +// PUBLIC: NO + +const client = new FuturesClient({ + apiKey: 'insert_api_key_here', + apiSecret: 'insert_api_secret_here', +}); + +client.getMultiAssetAlgoOrder(params) + .then((response) => { + console.log(response); + }) + .catch((error) => { + console.error(error); + }); diff --git a/examples/apidoc/FuturesClient/getMultiAssetAlgoOrderHistory.js b/examples/apidoc/FuturesClient/getMultiAssetAlgoOrderHistory.js new file mode 100644 index 0000000..c6f4915 --- /dev/null +++ b/examples/apidoc/FuturesClient/getMultiAssetAlgoOrderHistory.js @@ -0,0 +1,22 @@ +import { FuturesClient } from '@siebly/htx-api'; +// or, if require is preferred: +// const { FuturesClient } = require('@siebly/htx-api'); + +// This example shows how to call this HTX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "@siebly/htx-api" for HTX exchange +// This HTX API SDK is available on npm via "npm install @siebly/htx-api" +// ENDPOINT: /v5/algo/order/history +// METHOD: GET +// PUBLIC: NO + +const client = new FuturesClient({ + apiKey: 'insert_api_key_here', + apiSecret: 'insert_api_secret_here', +}); + +client.getMultiAssetAlgoOrderHistory(params) + .then((response) => { + console.log(response); + }) + .catch((error) => { + console.error(error); + }); diff --git a/examples/apidoc/FuturesClient/submitMultiAssetAlgoOrder.js b/examples/apidoc/FuturesClient/submitMultiAssetAlgoOrder.js new file mode 100644 index 0000000..b4e4a19 --- /dev/null +++ b/examples/apidoc/FuturesClient/submitMultiAssetAlgoOrder.js @@ -0,0 +1,22 @@ +import { FuturesClient } from '@siebly/htx-api'; +// or, if require is preferred: +// const { FuturesClient } = require('@siebly/htx-api'); + +// This example shows how to call this HTX API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "@siebly/htx-api" for HTX exchange +// This HTX API SDK is available on npm via "npm install @siebly/htx-api" +// ENDPOINT: /v5/algo/order +// METHOD: POST +// PUBLIC: NO + +const client = new FuturesClient({ + apiKey: 'insert_api_key_here', + apiSecret: 'insert_api_secret_here', +}); + +client.submitMultiAssetAlgoOrder(params) + .then((response) => { + console.log(response); + }) + .catch((error) => { + console.error(error); + }); diff --git a/llms.txt b/llms.txt index c2efdc7..5ade6bd 100644 --- a/llms.txt +++ b/llms.txt @@ -153,6 +153,66 @@ export interface WsConnectionInfo { token: string; instanceServers: WsServerInfo[]; } +⋮---- +/** Currency detail from v5 `account` WS push */ +export interface WsV5AccountDetail { + currency: string; + equity?: string; + available?: string; + available_margin?: string; + profit_unreal?: string; + initial_margin?: string; + maintenance_margin?: string; + maintenance_margin_rate?: string; + initial_margin_rate?: string; + voucher?: string; + voucher_value?: string; + created_time?: string; + updated_time?: string; + isolated_equity?: string; + isolated_profit_unreal?: string; + withdraw_available?: string; +} +⋮---- +/** Data object from v5 `account` WS push */ +export interface WsV5AccountData { + state?: string; + equity?: string; + initial_margin?: string; + maintenance_margin?: string; + maintenance_margin_rate?: string; + profit_unreal?: string; + available_margin?: string; + voucher_value?: string; + created_time?: string; + updated_time?: string; + version?: number | string; + details?: WsV5AccountDetail[]; +} +⋮---- +/** Order item from v5 `match_orders.$contract_code` WS push */ +export interface WsV5MatchOrder { + volume?: string; + trade_volume?: string; + cancel_volume?: string; +} +⋮---- +/** Tick from spot `market.$symbol.fullDepth.$type` (includes RPI) */ +export interface WsSpotFullDepthTick { + bids?: [number, number][]; + asks?: [number, number][]; + version?: number; + ts?: number; +} + +================ +File: .prettierrc +================ +{ + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all" +} ================ File: LICENSE.md @@ -2934,50 +2994,9 @@ export interface EventEmitterConstructor { listenerCount(emitter: EventEmitterLike, eventName: EventName): number; ================ -File: src/types/websockets/ws-subscriptions.ts -================ -/** - * HTX websocket topics are string templates, e.g.: - * - * - `market.btcusdt.kline.1min` - * - `market.btcusdt.mbp.150` - * - `orders#btcusdt` - * - `orders.btc-usdt` - * - * The exchange publishes a large and evolving topic surface, so the SDK keeps - * the topic type open while exporting common topic groups for discovery and - * private/public routing. - */ -⋮---- -export type WSSpotPublicTopic = (typeof WS_SPOT_PUBLIC_TOPICS)[number]; -export type WSSpotPrivateTopic = (typeof WS_SPOT_PRIVATE_TOPICS)[number]; -export type WSDerivativesPublicTopic = - (typeof WS_DERIVATIVES_PUBLIC_TOPICS)[number]; -export type WSDerivativesPrivateTopic = - (typeof WS_DERIVATIVES_PRIVATE_TOPICS)[number]; -⋮---- -export type WSTopic = - | WSSpotPublicTopic - | WSSpotPrivateTopic - | WSDerivativesPublicTopic - | WSDerivativesPrivateTopic - | string; -⋮---- -export function isPrivateTopic(topic: string): boolean - -================ -File: .npmrc -================ -min-release-age=30 - -================ -File: .prettierrc +File: eslint.config.cjs ================ -{ - "tabWidth": 2, - "singleQuote": true, - "trailingComma": "all" -} +/* eslint-disable @typescript-eslint/no-require-imports */ ================ File: tsconfig.cjs.json @@ -3564,6 +3583,38 @@ export interface WsDataEvent { ⋮---- export function isMessageEvent(msg: unknown): msg is MessageEventLike +================ +File: src/types/websockets/ws-subscriptions.ts +================ +/** + * HTX websocket topics are string templates, e.g.: + * + * - `market.btcusdt.kline.1min` + * - `market.btcusdt.mbp.150` + * - `orders#btcusdt` + * - `orders.btc-usdt` + * + * The exchange publishes a large and evolving topic surface, so the SDK keeps + * the topic type open while exporting common topic groups for discovery and + * private/public routing. + */ +⋮---- +export type WSSpotPublicTopic = (typeof WS_SPOT_PUBLIC_TOPICS)[number]; +export type WSSpotPrivateTopic = (typeof WS_SPOT_PRIVATE_TOPICS)[number]; +export type WSDerivativesPublicTopic = + (typeof WS_DERIVATIVES_PUBLIC_TOPICS)[number]; +export type WSDerivativesPrivateTopic = + (typeof WS_DERIVATIVES_PRIVATE_TOPICS)[number]; +⋮---- +export type WSTopic = + | WSSpotPublicTopic + | WSSpotPrivateTopic + | WSDerivativesPublicTopic + | WSDerivativesPrivateTopic + | string; +⋮---- +export function isPrivateTopic(topic: string): boolean + ================ File: src/WebsocketAPIClient.ts ================ @@ -3795,6 +3846,17 @@ cancelAllCoinSwapOrders( ⋮---- private setupDefaultEventListeners() +================ +File: .npmrc +================ +min-release-age=30 +save-exact=true + +================ +File: .nvmrc +================ +v24.18.0 + ================ File: jest.config.cjs ================ @@ -4430,16 +4492,6 @@ export interface WsDerivativesAuthParams { /** Vague structure for JSON-parsed incoming msg */ export type ParsedWsMessage = Record; -================ -File: .nvmrc -================ -v24.18.0 - -================ -File: eslint.config.cjs -================ -/* eslint-disable @typescript-eslint/no-require-imports */ - ================ File: examples/Derivatives/WebSockets/privateWs.ts ================ @@ -6423,12 +6475,15 @@ export interface SpotAccountHistory { currency: string; 'record-id': number; 'transact-amt': string; + /** Includes loan-disburse, loan-repay, loan-interest-refund, loan-interest-pay. */ 'transact-type': string; 'avail-balance': string; 'acct-balance': string; 'transact-time': number; } ⋮---- +/** Includes loan-disburse, loan-repay, loan-interest-refund, loan-interest-pay. */ +⋮---- /** Ledger row from GET /v2/account/ledger */ export interface SpotV2AccountLedger { accountId: number; @@ -7230,8067 +7285,7805 @@ WSWIP.md .tmp-packed* ================ -File: src/types/request/spot.types.ts +File: src/types/request/futures.types.ts ================ /** - * Reference Data + * Union Types (Request) */ ⋮---- -export interface SpotGetChainsReq { - /** Show desc: 0=no, 1=all, 2=suspend deposit/withdrawal and chain exchange */ - 'show-desc'?: string; - /** Currency filter */ - currency?: string; - /** Timestamp for incremental data. Returns updates from ts to now. If no update, data is []. */ - ts?: number; -} -⋮---- -/** Show desc: 0=no, 1=all, 2=suspend deposit/withdrawal and chain exchange */ -⋮---- -/** Currency filter */ +/** Pagination direction */ +export type FuturesDirect = 'next' | 'prev'; ⋮---- -/** Timestamp for incremental data. Returns updates from ts to now. If no update, data is []. */ +/** Buy or sell */ +export type FuturesDirection = 'buy' | 'sell'; ⋮---- -/** - * Market Data - */ +/** Open or close position */ +export type FuturesOffset = 'open' | 'close'; ⋮---- -/** Req for /market/history/kline */ -export interface SpotGetKlineReq { - /** Trading symbol (e.g. btcusdt, btc3lusdtnav for ETP NAV) */ - symbol: string; - /** Candle period. Default 1day. */ - period?: string; - /** Number of data points [1-2000]. Default 150. */ - size?: number; -} +/** Open, close, or both (hedge mode) */ +export type FuturesOffsetBoth = 'open' | 'close' | 'both'; ⋮---- -/** Trading symbol (e.g. btcusdt, btc3lusdtnav for ETP NAV) */ +/** Position side (long, short, both) */ +export type FuturesPositionSide = 'long' | 'short' | 'both'; ⋮---- -/** Candle period. Default 1day. */ +/** Margin mode */ +export type FuturesMarginMode = 'cross' | 'isolated'; ⋮---- -/** Number of data points [1-2000]. Default 150. */ +/** Margin mode including all */ +export type FuturesMarginModeAll = 'cross' | 'isolated' | 'all'; ⋮---- -export interface SpotGetDepthReq { - /** Trading symbol (e.g. btcusdt) */ - symbol: string; - /** Depth levels per side. 5, 10, 20, 30. Default 20. step0 uses 150 if omitted. */ - depth?: number; - /** step0=no agg, step1-5=aggregation levels. Default step0. */ - type?: string; -} +/** Business type filter */ +export type FuturesBusinessType = 'futures' | 'swap' | 'all'; ⋮---- -/** Trading symbol (e.g. btcusdt) */ +/** Contract type (delivery) */ +export type FuturesContractType = + | 'this_week' + | 'next_week' + | 'quarter' + | 'next_quarter'; ⋮---- -/** Depth levels per side. 5, 10, 20, 30. Default 20. step0 uses 150 if omitted. */ +/** Kline period */ +export type FuturesKlinePeriod = + | '1min' + | '5min' + | '15min' + | '30min' + | '60min' + | '1hour' + | '4hour' + | '12hour' + | '1day' + | '1week' + | '1mon'; ⋮---- -/** step0=no agg, step1-5=aggregation levels. Default step0. */ +/** Open interest / funding period */ +export type FuturesOpenInterestPeriod = '60min' | '4hour' | '12hour' | '1day'; ⋮---- -/** - * Account - */ export interface SpotGetAssetValuationReq { +/** Sort field */ +export type FuturesSortBy = 'created_at' | 'update_time'; ⋮---- -*/ export interface SpotGetAssetValuationReq { - /** Account type: spot, margin, otc, super-margin. Default spot. */ - accountType?: string; - /** Valuation currency: BTC, CNY, USD, JPY, etc. Case sensitive. Default BTC. */ - valuationCurrency?: string; - /** Sub user UID. Omit for API key owner. */ - subUid?: number; -} +/** Sort field (extended) */ +export type FuturesSortByExtended = + | 'create_date' + | 'update_time' + | 'created_at'; ⋮---- -/** Account type: spot, margin, otc, super-margin. Default spot. */ +/** Sort field (CmPerp) */ +export type FuturesSortByCmPerp = 'create_date' | 'update_time'; ⋮---- -/** Valuation currency: BTC, CNY, USD, JPY, etc. Case sensitive. Default BTC. */ +/** Trigger condition */ +export type FuturesTriggerType = 'ge' | 'le'; ⋮---- -/** Sub user UID. Omit for API key owner. */ +/** Basis price type */ +export type FuturesBasisPriceType = + | 'open' + | 'close' + | 'high' + | 'low' + | 'average'; ⋮---- -/** Req for POST /v2/account/transfer - transfer between spot, linear-swap, otc, futures, swap */ -export interface SpotV2AccountTransferReq { - /** Source: spot, linear-swap, otc, futures, swap */ - from: string; - /** Destination: spot, linear-swap, otc, futures, swap */ - to: string; - /** Currency (e.g. usdt). Upper/lowercase supported. */ - currency: string; - /** Transfer amount */ - amount: string; - /** Margin account (e.g. btc-usdt, eth-usdt, USDT) */ - 'margin-account': string; -} +/** Transfer type */ +export type FuturesTransferType = 'master_to_sub' | 'sub_to_master'; ⋮---- -/** Source: spot, linear-swap, otc, futures, swap */ +/** Margin adjust type */ +export type FuturesMarginAdjustType = 'add' | 'reduce'; ⋮---- -/** Destination: spot, linear-swap, otc, futures, swap */ -⋮---- -/** Currency (e.g. usdt). Upper/lowercase supported. */ +/** Self-match prevention */ +export type FuturesSelfMatchPrevent = + | 'cancel_taker' + | 'cancel_maker' + | 'cancel_both'; ⋮---- -/** Transfer amount */ +/** Lightning order price type */ +export type FuturesLightningOrderPriceType = + | 'market' + | 'lightning_fok' + | 'lightning_ioc'; ⋮---- -/** Margin account (e.g. btc-usdt, eth-usdt, USDT) */ +/** Lightning order price type (CmDelivery) */ +export type FuturesLightningOrderPriceTypeCm = + | 'lightning' + | 'lightning_fok' + | 'lightning_ioc'; ⋮---- -/** Req for POST /v1/futures/transfer - transfer between spot and future contract account */ -export interface SpotV1FuturesTransferReq { - /** Currency name */ - currency: string; - /** Amount to transfer */ - amount: string; - /** futures-to-pro (contract -> spot) or pro-to-futures (spot -> contract) */ - type: 'futures-to-pro' | 'pro-to-futures'; -} +/** Trigger order price type */ +export type FuturesTriggerOrderPriceType = + | 'limit' + | 'optimal_5' + | 'optimal_10' + | 'optimal_20'; ⋮---- -/** Currency name */ +/** Trailing order price type */ +export type FuturesTrailingOrderPriceType = + | 'optimal_5' + | 'optimal_10' + | 'optimal_20' + | 'formula_price'; ⋮---- -/** Amount to transfer */ +/** V5 order type */ +export type FuturesV5OrderType = 'market' | 'limit' | 'post_only'; ⋮---- -/** futures-to-pro (contract -> spot) or pro-to-futures (spot -> contract) */ +/** Time in force */ +export type FuturesTimeInForce = 'fok' | 'ioc' | 'gtc'; ⋮---- -/** Req for POST /v1/account/transfer */ -export interface SpotAccountTransferReq { - /** Transfer out user uid */ - 'from-user': number; - /** Transfer out account type: spot, margin */ - 'from-account-type': string; - /** Transfer out account id */ - 'from-account': number; - /** Transfer in user uid */ - 'to-user': number; - /** Transfer in account type: spot, margin */ - 'to-account-type': string; - /** Transfer in account id */ - 'to-account': number; - /** Currency name */ - currency: string; - /** Amount to transfer */ - amount: string; -} +/** Trigger price type */ +export type FuturesTriggerPriceType = 'last' | 'market'; ⋮---- -/** Transfer out user uid */ +/** Price match type */ +export type FuturesPriceMatch = + | 'opponent' + | 'optimal_5' + | 'optimal_10' + | 'optimal_20'; ⋮---- -/** Transfer out account type: spot, margin */ +/** Base order price types: limit, opponent, optimal_*, ioc, fok, *_ioc, *_fok */ +export type FuturesOrderPriceTypeBase = + | 'limit' + | 'opponent' + | 'optimal_5' + | 'optimal_10' + | 'optimal_20' + | 'ioc' + | 'fok' + | 'opponent_ioc' + | 'optimal_5_ioc' + | 'optimal_10_ioc' + | 'optimal_20_ioc' + | 'opponent_fok' + | 'optimal_5_fok' + | 'optimal_10_fok' + | 'optimal_20_fok'; ⋮---- -/** Transfer out account id */ +/** Order price type for swap_order and swap_cross_order. Base + market + post_only */ +export type FuturesSubmitOrderPriceType = + | FuturesOrderPriceTypeBase + | 'market' + | 'post_only'; ⋮---- -/** Transfer in user uid */ +/** Order price type for swap_order_limit and contract_order_limit. Base + lightning variants */ +export type FuturesGetOrderLimitPriceType = + | FuturesOrderPriceTypeBase + | 'lightning' + | 'lightning_ioc' + | 'lightning_fok'; ⋮---- -/** Transfer in account type: spot, margin */ +/** Order price type for contract_order_limit (alias) */ +export type FuturesCmDeliveryOrderLimitPriceType = + FuturesGetOrderLimitPriceType; ⋮---- -/** Transfer in account id */ +/** Order price type for contract_order and swap_order (Delivery/CMPerp). Base + post_only */ +export type FuturesCmDeliverySubmitOrderPriceType = + | FuturesOrderPriceTypeBase + | 'post_only'; ⋮---- -/** Currency name */ +/** Order price type for swap_order and swap_batchorder (CMPerp) (alias) */ +export type FuturesCmPerpSubmitOrderPriceType = + FuturesCmDeliverySubmitOrderPriceType; ⋮---- -/** Amount to transfer */ +/** + * Reference Data + */ ⋮---- -/** Req for GET /v1/account/history */ -export interface SpotGetAccountHistoryReq { - /** Account ID from GET /v1/account/accounts */ - 'account-id': string | number; - /** Currency filter */ - currency?: string; - /** Amount change types, comma-separated. Default all. */ - 'transact-types'?: string; - /** Start time (unix ms). Query window max 1 hour. */ - 'start-time'?: number; - /** End time (unix ms). Query window within 30 days. */ - 'end-time'?: number; - /** Sort order: asc, desc. Default asc. */ - sort?: string; - /** Max items [1-500]. Default 100. */ - size?: number; - /** First record ID for pagination (next page) */ - 'from-id'?: number; +/** Req for GET /linear-swap-api/v1/swap_historical_funding_rate */ +export interface FuturesGetHistoricalFundingRateReq { + /** Contract code (e.g. BTC-USDT). Case-insensitive */ + contract_code: string; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; } ⋮---- -/** Account ID from GET /v1/account/accounts */ +/** Contract code (e.g. BTC-USDT). Case-insensitive */ ⋮---- -/** Currency filter */ +/** Page index. Default 1 */ ⋮---- -/** Amount change types, comma-separated. Default all. */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Start time (unix ms). Query window max 1 hour. */ +/** Req for GET /linear-swap-api/v3/swap_liquidation_orders. One of pair and contract must be filled; contract preferred. */ +export interface FuturesGetLiquidationOrdersReq { + /** Contract code (e.g. BTC-USDT). Case-insensitive */ + contract: string; + /** 0:All; 1:Open long; 2:Open short; 3:Close short; 4:Close long; 5:Liquidate long; 6:Liquidate short; 17:buy(one-way); 18:sell(one-way) */ + trade_type: number; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** Query start time (ms). Window max 2h, within 90 days */ + start_time?: number; + /** Query end time (ms). Default now. Within 90 days */ + end_time?: number; + /** next=chronological, prev=reverse. Default prev */ + direct?: FuturesDirect; + /** Search from query_id for pagination */ + from_id?: number; +} ⋮---- -/** End time (unix ms). Query window within 30 days. */ +/** Contract code (e.g. BTC-USDT). Case-insensitive */ ⋮---- -/** Sort order: asc, desc. Default asc. */ +/** 0:All; 1:Open long; 2:Open short; 3:Close short; 4:Close long; 5:Liquidate long; 6:Liquidate short; 17:buy(one-way); 18:sell(one-way) */ ⋮---- -/** Max items [1-500]. Default 100. */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** First record ID for pagination (next page) */ +/** Query start time (ms). Window max 2h, within 90 days */ ⋮---- -export interface SpotV2PointTransferReq { - /** Transferer UID */ - fromUid: string; - /** Transferee UID */ - toUid: string; - /** Group ID. 0 = termless points. For terminable points, query sub user balance first. */ - groupId: number; - /** Transfer amount (max 8 decimal places) */ - amount: string; +/** Query end time (ms). Default now. Within 90 days */ +⋮---- +/** next=chronological, prev=reverse. Default prev */ +⋮---- +/** Search from query_id for pagination */ +⋮---- +/** Req for GET /linear-swap-api/v1/swap_settlement_records */ +export interface FuturesGetSettlementRecordsReq { + /** Contract code. swap: BTC-USDT; future: BTC-USDT-210625 */ + contract_code: string; + /** Start time (ms). Default: now - 90 days. Within 90 days */ + start_time?: number; + /** End time (ms). Default: now. Must be after start_time */ + end_time?: number; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; } ⋮---- -/** Transferer UID */ +/** Contract code. swap: BTC-USDT; future: BTC-USDT-210625 */ ⋮---- -/** Transferee UID */ +/** Start time (ms). Default: now - 90 days. Within 90 days */ ⋮---- -/** Group ID. 0 = termless points. For terminable points, query sub user balance first. */ +/** End time (ms). Default: now. Must be after start_time */ ⋮---- -/** Transfer amount (max 8 decimal places) */ +/** Page index. Default 1 */ ⋮---- -/** - * Trading - */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Order type: direction-type. market=no price; limit=price+amount; limit-maker=maker only; ioc=immediately or cancel; limit-fok=fill or kill; stop-*=trigger price */ -export type SpotOrderType = - | 'buy-market' - | 'sell-market' - | 'buy-limit' - | 'sell-limit' - | 'buy-ioc' - | 'sell-ioc' - | 'buy-limit-maker' - | 'sell-limit-maker' - | 'buy-stop-limit' - | 'sell-stop-limit' - | 'buy-limit-fok' - | 'sell-limit-fok' - | 'buy-stop-limit-fok' - | 'sell-stop-limit-fok'; +/** Req for GET /linear-swap-api/v1/swap_cross_ladder_margin. When all filled, contract_code preferred. business_type required for futures. */ +export interface FuturesGetCrossTieredMarginReq { + /** Contract code. Omit for all. swap: BTC-USDT; future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** Default swap. futures, swap, all. Required for futures contract query */ + business_type?: FuturesBusinessType; +} ⋮---- -/** Order source: spot-api, margin-api, super-margin-api, c2c-margin-api */ -export type SpotOrderSource = - | 'spot-api' - | 'margin-api' - | 'super-margin-api' - | 'c2c-margin-api'; +/** Contract code. Omit for all. swap: BTC-USDT; future: BTC-USDT-210625 */ ⋮---- -/** Req for POST /v1/order/orders/place */ -export interface SpotV1OrderPlaceReq { - /** Account ID from GET /v1/account/accounts. Required for trading. */ - 'account-id': string | number; - /** Trading symbol (e.g. ethusdt) */ - symbol: string; - /** Order type (e.g. buy-limit, sell-market) */ - type: SpotOrderType; - /** Order size. For buy-market = order value in quote currency. */ - amount: string; - /** Order price. Not used for market orders. Required for limit types. */ - price?: string; - /** Order source. Default spot-api */ - source?: SpotOrderSource; - /** Client order ID. Max 64 chars. Valid 8h for open, 2h for completed. */ - 'client-order-id'?: string; - /** 0=allow self-trade, 1=prevent. Default 0 */ - 'self-match-prevent'?: 0 | 1; - /** Trigger price for stop-limit orders */ - 'stop-price'?: string; - /** Operator for stop price (lte, gte, etc) */ - operator?: string; - /** RPI order - type must be buy-limit or sell-limit */ - 'time-in-force'?: 'rpi'; -} -⋮---- -/** Account ID from GET /v1/account/accounts. Required for trading. */ -⋮---- -/** Trading symbol (e.g. ethusdt) */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Order type (e.g. buy-limit, sell-market) */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Order size. For buy-market = order value in quote currency. */ +/** Default swap. futures, swap, all. Required for futures contract query */ ⋮---- -/** Order price. Not used for market orders. Required for limit types. */ +export type FuturesGetEstimatedSettlementPriceReq = + FuturesGetCrossTieredMarginReq; +export type FuturesGetCrossAdjustFactorReq = FuturesGetCrossTieredMarginReq; +export type FuturesGetContractPriceLimitReq = FuturesGetCrossTieredMarginReq; +export type FuturesGetOpenInterestReq = FuturesGetCrossTieredMarginReq; ⋮---- -/** Order source. Default spot-api */ +/** Req for GET /v1/insurance_fund_history */ +export interface FuturesGetRiskReserveHistoryReq { + /** Query start time (ms) */ + start_time?: number; + /** Query end time (ms) */ + end_time?: number; + /** next=chronological, prev=reverse. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result depending on direct */ + from_id?: number; + /** Items per page [1-100]. Default 10 */ + limit?: number; +} ⋮---- -/** Client order ID. Max 64 chars. Valid 8h for open, 2h for completed. */ +/** Query start time (ms) */ ⋮---- -/** 0=allow self-trade, 1=prevent. Default 0 */ +/** Query end time (ms) */ ⋮---- -/** Trigger price for stop-limit orders */ +/** next=chronological, prev=reverse. Default prev */ ⋮---- -/** Operator for stop price (lte, gte, etc) */ +/** Pagination: min/max query_id from last result depending on direct */ ⋮---- -/** RPI order - type must be buy-limit or sell-limit */ +/** Items per page [1-100]. Default 10 */ ⋮---- -/** Margin order with auto borrow/repay for POST /v1/order/auto/place. Sub-accounts not supported. */ -export interface SpotV1OrderAutoPlaceReq { - symbol: string; - 'account-id': string | number; - type: SpotOrderType; - /** 1: automatic loan, 2: automatic repayment */ - 'trade-purpose': '1' | '2'; - source: SpotOrderSource; - /** Order volume. For market buy = order value. Use amount or market-amount, not both. */ - amount?: string; - /** Market buy = order volume, market sell = order amount. Use amount or market-amount, not both. */ - 'market-amount'?: string; - /** Amount/quantity to borrow when trade-purpose=1. Max 3 decimal precision. */ - 'borrow-amount'?: string; - price?: string; - /** Client order ID. Max 64 chars. Valid 8h for open, 2h for completed. */ - 'client-order-id'?: string; - 'stop-price'?: string; - operator?: string; +/** Req for GET /linear-swap-api/v1/swap_contract_info. When isolated, contract_type/business_type cannot be futures. */ +export interface FuturesGetContractInfoReq { + /** Contract code. Omit for all. swap: BTC-USDT; future: BTC-USDT-210625 */ + contract_code?: string; + /** cross, isolated, or all. Filter by supported margin mode */ + support_margin_mode?: FuturesMarginModeAll; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** Default swap. futures, swap, all. Required for futures query */ + business_type?: FuturesBusinessType; } ⋮---- -/** 1: automatic loan, 2: automatic repayment */ +/** Contract code. Omit for all. swap: BTC-USDT; future: BTC-USDT-210625 */ ⋮---- -/** Order volume. For market buy = order value. Use amount or market-amount, not both. */ +/** cross, isolated, or all. Filter by supported margin mode */ ⋮---- -/** Market buy = order volume, market sell = order amount. Use amount or market-amount, not both. */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Amount/quantity to borrow when trade-purpose=1. Max 3 decimal precision. */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Client order ID. Max 64 chars. Valid 8h for open, 2h for completed. */ +/** Default swap. futures, swap, all. Required for futures query */ ⋮---- -/** Req for POST /v1/order/orders/batchCancelOpenOrders */ -export interface SpotV1OrderBatchCancelOpenOrdersReq { - /** Account ID from GET /v1/account/accounts */ - 'account-id'?: string; - /** Comma-separated symbols (max 10). Default all */ - symbol?: string; - /** Order types comma-separated */ - types?: string; - /** Filter: buy, sell */ - side?: 'buy' | 'sell'; - /** Orders to cancel [1-100]. Default 100 */ +/** + * Market Data + */ +⋮---- +/** Req for GET /linear-swap-ex/market/history/kline. Either size or (from+to) required. */ +export interface FuturesGetKlinesReq { + /** Contract code or type. swap: BTC-USDT; future: BTC-USDT-220325 or BTC-USDT-CW/NW/CQ/NQ */ + contract_code: string; + /** 1min, 5min, 15min, 30min, 60min, 1hour, 4hour, 1day, 1mon */ + period: FuturesKlinePeriod; + /** Items [1-2000]. Default 150. Ignored if from+to provided */ size?: number; + /** Start timestamp (seconds) */ + from?: number; + /** End timestamp (seconds). Required if from provided */ + to?: number; } ⋮---- -/** Account ID from GET /v1/account/accounts */ +/** Contract code or type. swap: BTC-USDT; future: BTC-USDT-220325 or BTC-USDT-CW/NW/CQ/NQ */ ⋮---- -/** Comma-separated symbols (max 10). Default all */ +/** 1min, 5min, 15min, 30min, 60min, 1hour, 4hour, 1day, 1mon */ ⋮---- -/** Order types comma-separated */ +/** Items [1-2000]. Default 150. Ignored if from+to provided */ ⋮---- -/** Filter: buy, sell */ +/** Start timestamp (seconds) */ ⋮---- -/** Orders to cancel [1-100]. Default 100 */ +/** End timestamp (seconds). Required if from provided */ ⋮---- -/** Req for GET /v1/order/orders (search past orders) */ -export interface SpotGetOrderHistoryReq { - /** Trading symbol (required) */ - symbol: string; - /** Order types comma-separated */ - types?: string; - /** Start time (unix ms). Max 48h window. */ - 'start-time'?: number; - /** End time (unix ms). Max 48h window, within 180 days. */ - 'end-time'?: number; - /** States: filled, partial-canceled, canceled (comma-separated, required) */ - states: string; - /** Start order ID for pagination */ - from?: string; - /** next=desc, prev=asc. Default both */ - direct?: 'next' | 'prev'; - /** Orders to return [1-100]. Default 100 */ +/** Req for GET /linear-swap-api/v1/swap_his_open_interest. One of (pair+contract_type) or contract_code required. */ +export interface FuturesGetHistoricalOpenInterestReq { + /** Contract code. Omit if pair+contract_type provided */ + contract_code?: string; + /** Pair (e.g. BTC-USDT). Use with contract_type */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** 60min, 4hour, 12hour, 1day */ + period: FuturesOpenInterestPeriod; + /** Items [1-200]. Default 48 */ size?: number; + /** 1: cont, 2: cryptocurrency */ + amount_type: 1 | 2; } ⋮---- -/** Trading symbol (required) */ -⋮---- -/** Order types comma-separated */ -⋮---- -/** Start time (unix ms). Max 48h window. */ +/** Contract code. Omit if pair+contract_type provided */ ⋮---- -/** End time (unix ms). Max 48h window, within 180 days. */ +/** Pair (e.g. BTC-USDT). Use with contract_type */ ⋮---- -/** States: filled, partial-canceled, canceled (comma-separated, required) */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Start order ID for pagination */ +/** 60min, 4hour, 12hour, 1day */ ⋮---- -/** next=desc, prev=asc. Default both */ +/** Items [1-200]. Default 48 */ ⋮---- -/** Orders to return [1-100]. Default 100 */ +/** 1: cont, 2: cryptocurrency */ ⋮---- -/** Req for GET /v1/order/history (48h historical orders) */ -export interface SpotGetOrderHistory48hReq { - /** Trading symbol */ - symbol?: string; - /** Start time (unix ms). Default 48h ago */ - 'start-time'?: number; - /** End time (unix ms). Default now */ - 'end-time'?: number; - /** prev=asc, next=desc. Default next */ - direct?: 'prev' | 'next'; - /** Items per response [10-1000]. Default 100 */ - size?: number; +/** Req for GET /index/market/history/linear_swap_mark_price_kline. Also used for premium index and estimated rate kline. */ +export interface FuturesGetMarkKlinesReq { + /** Contract code or type. swap: BTC-USDT; future: BTC-USDT-210625 or BTC-USDT-CW/NW/CQ/NQ */ + contract_code: string; + /** 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1week, 1mon */ + period: string; + /** Items [1-2000] */ + size: number; } ⋮---- -/** Trading symbol */ -⋮---- -/** Start time (unix ms). Default 48h ago */ +/** Contract code or type. swap: BTC-USDT; future: BTC-USDT-210625 or BTC-USDT-CW/NW/CQ/NQ */ ⋮---- -/** End time (unix ms). Default now */ +/** 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1week, 1mon */ ⋮---- -/** prev=asc, next=desc. Default next */ +/** Items [1-2000] */ ⋮---- -/** Items per response [10-1000]. Default 100 */ +export type FuturesGetPremiumIndexKlinesReq = FuturesGetMarkKlinesReq; +export type FuturesGetFundingRateKlinesReq = FuturesGetMarkKlinesReq; ⋮---- -/** Req for GET /v1/order/matchresults (search match results) */ -export interface SpotGetMatchResultsReq { - /** Trading symbol */ - symbol?: string; - /** Order types comma-separated */ - types?: string; - /** Start time (unix ms). 48h window, 120 days range */ - 'start-time'?: number; - /** End time (unix ms). 48h window */ - 'end-time'?: number; - /** Internal id to begin pagination (use last id of prev page) */ - from?: string; - /** next or prev. Default next */ - direct?: 'next' | 'prev'; - /** Items to return [1-500]. Default 100 */ - size?: number; +/** Req for GET /index/market/history/linear_swap_basis */ +export interface FuturesGetBasisDataReq { + /** Contract code or type */ + contract_code: string; + /** 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon */ + period: FuturesKlinePeriod; + /** Items [1-2000]. Default 150 */ + size: number; + /** open, close, high, low, average. Default open */ + basis_price_type?: FuturesBasisPriceType; } ⋮---- -/** Trading symbol */ -⋮---- -/** Order types comma-separated */ -⋮---- -/** Start time (unix ms). 48h window, 120 days range */ +/** Contract code or type */ ⋮---- -/** End time (unix ms). 48h window */ +/** 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1mon */ ⋮---- -/** Internal id to begin pagination (use last id of prev page) */ +/** Items [1-2000]. Default 150 */ ⋮---- -/** next or prev. Default next */ +/** open, close, high, low, average. Default open */ ⋮---- -/** Items to return [1-500]. Default 100 */ +/** + * Account + */ ⋮---- -/** Req for GET /v1/order/openOrders */ -export interface SpotGetOpenOrdersReq { - /** Account ID from GET /v1/account/accounts */ - 'account-id'?: string; - /** Trading symbol (e.g. ethusdt) */ - symbol?: string; - /** Filter: buy, sell */ - side?: 'buy' | 'sell'; - /** Order types comma-separated */ - types?: string; - /** Start order ID for pagination */ - from?: string; - /** prev=asc from start, next=desc from start */ - direct?: 'prev' | 'next'; - /** Orders to return [1-500]. Default 100 */ - size?: number; +/** Req for POST /linear-swap-api/v1/swap_cross_position_info */ +export interface FuturesGetCrossPositionsReq { + /** Contract code. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; } ⋮---- -/** Account ID from GET /v1/account/accounts */ +/** Contract code. Omit for all */ ⋮---- -/** Trading symbol (e.g. ethusdt) */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Filter: buy, sell */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Order types comma-separated */ +/** Req for GET /linear-swap-api/v1/swap_sub_auth_list. getSubPermissions. */ +export interface FuturesGetSubPermissionsReq { + /** Sub-account UIDs, comma-separated. Max 10 */ + sub_uid?: string; + /** Start time of sub-account creation (ms) */ + start_time?: number; + /** End time of sub-account creation (ms) */ + end_time?: number; + /** next=chronological, prev=reverse */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; +} ⋮---- -/** Start order ID for pagination */ +/** Sub-account UIDs, comma-separated. Max 10 */ ⋮---- -/** prev=asc from start, next=desc from start */ +/** Start time of sub-account creation (ms) */ ⋮---- -/** Orders to return [1-500]. Default 100 */ +/** End time of sub-account creation (ms) */ ⋮---- -/** - * Conditional Order - */ +/** next=chronological, prev=reverse */ ⋮---- -/** Req for POST /v2/algo-orders (Place a conditional order). Conditional orders only via this endpoint, not Trading section. */ -export interface SpotV2AlgoOrdersPlaceReq { - /** Account ID. Spot, margin, super-margin. C2C margin not supported. */ - accountId?: number; - /** Trading symbol */ - symbol?: string; - /** Order price (invalid for market order) */ - orderPrice?: string; - /** Order side: buy, sell */ - orderSide?: 'buy' | 'sell'; - /** Order size (invalid for market buy order) */ - orderSize?: string; - /** Order value (only valid for market buy order) */ - orderValue?: string; - /** Time in force: gtc, boc, ioc, fok. gtc=good till cancel, boc=book or cancel, ioc=immediate or cancel, fok=fill or kill. gtc for limit; ioc for market. */ - timeInForce?: 'gtc' | 'boc' | 'ioc' | 'fok'; - /** Order type: limit, market */ - orderType?: 'limit' | 'market'; - /** Client order ID (max 64 chars). Must be unique within 24h for same user. */ - clientOrderId?: string; - /** Stop price */ - stopPrice?: string; - /** Trailing rate [0.001-0.050]. Only valid for trailing stop order */ - trailingRate?: string; +/** Pagination: min/max query_id from last result */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_sub_account_list. Isolated margin only. */ +export interface FuturesGetIsolatedSubAccountsReq { + /** Contract code (e.g. BTC-USDT). Omit for all */ + contract_code?: string; + /** next=chronological, prev=reverse. Default next */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result depending on direct */ + from_id?: number; } ⋮---- -/** Account ID. Spot, margin, super-margin. C2C margin not supported. */ +/** Contract code (e.g. BTC-USDT). Omit for all */ ⋮---- -/** Trading symbol */ +/** next=chronological, prev=reverse. Default next */ ⋮---- -/** Order price (invalid for market order) */ +/** Pagination: min/max query_id from last result depending on direct */ ⋮---- -/** Order side: buy, sell */ +/** Req for POST /linear-swap-api/v1/swap_cross_sub_account_list. Cross margin only. */ +export interface FuturesGetCrossSubAccountsReq { + /** Margin account (e.g. USDT). Omit for all */ + margin_account?: string; + /** next=chronological, prev=reverse. Default next */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result depending on direct */ + from_id?: number; +} ⋮---- -/** Order size (invalid for market buy order) */ +/** Margin account (e.g. USDT). Omit for all */ ⋮---- -/** Order value (only valid for market buy order) */ +/** next=chronological, prev=reverse. Default next */ ⋮---- -/** Time in force: gtc, boc, ioc, fok. gtc=good till cancel, boc=book or cancel, ioc=immediate or cancel, fok=fill or kill. gtc for limit; ioc for market. */ +/** Pagination: min/max query_id from last result depending on direct */ ⋮---- -/** Order type: limit, market */ +/** Req for POST /linear-swap-api/v1/swap_sub_account_info_list. Isolated margin only. */ +export interface FuturesGetSubAccountsAssetsReq { + /** Contract code (e.g. BTC-USDT). Omit for all */ + contract_code?: string; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; +} ⋮---- -/** Client order ID (max 64 chars). Must be unique within 24h for same user. */ +/** Contract code (e.g. BTC-USDT). Omit for all */ ⋮---- -/** Stop price */ +/** Page index. Default 1 */ ⋮---- -/** Trailing rate [0.001-0.050]. Only valid for trailing stop order */ +/** Page size. Default 20, max 50 */ ⋮---- -export interface SpotV2AlgoOrdersOpeningReq { - /** Account ID */ - accountId?: number; - /** Trading symbol */ - symbol?: string; - /** Order side: buy, sell */ - orderSide?: 'buy' | 'sell'; - /** Order type: limit, market */ - orderType?: 'limit' | 'market'; - /** Sort: asc, desc. Default desc */ - sort?: 'asc' | 'desc'; - /** Max items [1-500]. Default 100 */ - limit?: number; - /** First record ID for next-page pagination */ - fromId?: number; +/** Req for POST /linear-swap-api/v1/swap_cross_sub_account_info_list. Cross margin only. */ +export interface FuturesGetCrossSubAccountsAssetsReq { + /** Margin account (e.g. USDT). Omit for all */ + margin_account?: string; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; } ⋮---- -/** Account ID */ +/** Margin account (e.g. USDT). Omit for all */ ⋮---- -/** Trading symbol */ +/** Page index. Default 1 */ ⋮---- -/** Order side: buy, sell */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Order type: limit, market */ +/** Req for POST /linear-swap-api/v1/swap_cross_sub_position_info. Cross margin only. */ +export interface FuturesGetCrossSubPositionsReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all. contract_code preferred when all filled */ + contract_code?: string; + /** Sub-account UID */ + sub_uid: number; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; +} ⋮---- -/** Sort: asc, desc. Default desc */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all. contract_code preferred when all filled */ ⋮---- -/** Max items [1-500]. Default 100 */ +/** Sub-account UID */ ⋮---- -/** First record ID for next-page pagination */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Req for GET /v2/algo-orders/history (Query conditional order history). orderStatus: canceled, rejected, triggered. */ -export interface SpotV2AlgoOrdersHistoryReq { - /** Account ID */ - accountId?: number; - /** Trading symbol */ - symbol?: string; - /** Order side: buy, sell */ - orderSide?: 'buy' | 'sell'; - /** Order type: limit, market */ - orderType?: 'limit' | 'market'; - /** Order status: canceled, rejected, triggered */ - orderStatus?: 'canceled' | 'rejected' | 'triggered'; - /** Start time (unix ms) */ - startTime?: number; - /** End time (unix ms) */ - endTime?: number; - /** Sort: asc, desc */ - sort?: 'asc' | 'desc'; - /** Max items [1-500] */ - limit?: number; - /** First record ID for next-page pagination */ - fromId?: number; +/** swap, this_week, next_week, quarter, next_quarter */ +⋮---- +/** Req for POST /linear-swap-api/v3/swap_financial_record. Supports cross and isolated. */ +export interface FuturesGetFinancialRecordsReq { + /** Margin account. swap: BTC-USDT, future: BTC-USDT-210625. Required */ + mar_acct: string; + /** Contract code (e.g. BTC-USDT). Omit for all */ + contract?: string; + /** Comma-separated type codes. Omit for all. e.g. 3,4,5,6 */ + type?: string; + /** Query start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** Query end time (ms). Default now. Within 90 days */ + end_time?: number; + /** next=chronological, prev=reverse. Default next */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result depending on direct */ + from_id?: number; } ⋮---- -/** Account ID */ +/** Margin account. swap: BTC-USDT, future: BTC-USDT-210625. Required */ ⋮---- -/** Trading symbol */ +/** Contract code (e.g. BTC-USDT). Omit for all */ ⋮---- -/** Order side: buy, sell */ +/** Comma-separated type codes. Omit for all. e.g. 3,4,5,6 */ ⋮---- -/** Order type: limit, market */ +/** Query start time (ms). Window max 48h, within 90 days */ ⋮---- -/** Order status: canceled, rejected, triggered */ +/** Query end time (ms). Default now. Within 90 days */ ⋮---- -/** Start time (unix ms) */ +/** next=chronological, prev=reverse. Default next */ ⋮---- -/** End time (unix ms) */ +/** Pagination: min/max query_id from last result depending on direct */ ⋮---- -/** Sort: asc, desc */ +/** Req for POST /linear-swap-api/v3/swap_financial_record_exact. Same params as swap_financial_record; API default direct is prev. */ +export type FuturesGetFinancialRecordsExactReq = FuturesGetFinancialRecordsReq; ⋮---- -/** Max items [1-500] */ +/** Req for POST /linear-swap-api/v1/swap_cross_available_level_rate. Cross margin only. */ +export interface FuturesGetCrossAvailableLeverageReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** futures, swap, all. Required for futures. Default swap */ + business_type?: FuturesBusinessType; +} ⋮---- -/** First record ID for next-page pagination */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ ⋮---- -/** - * Margin Loan (Cross/Isolated) - */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Req for GET /v2/account/repayment (Repayment Record Reference). Sorted by repayTime. */ -export interface SpotRepaymentRecordReq { - /** Repayment transaction ID */ - repayId?: string; - /** Account ID. Default all accounts */ - accountId?: string; - /** Borrowing/lending currency. Default all currencies */ - currency?: string; - /** Start time (unix ms). Range: [(endTime – x D), endTime] */ - startTime?: number; - /** End time (unix ms). Range: [(now – y D), now]. Default now */ - endTime?: number; - /** Sort: asc, desc. Default desc */ - sort?: 'asc' | 'desc'; - /** Max items [1-100]. Default 50 */ - limit?: number; - /** Search ID for next-page pagination */ - fromId?: number; -} -⋮---- -/** Repayment transaction ID */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Account ID. Default all accounts */ +/** futures, swap, all. Required for futures. Default swap */ ⋮---- -/** Borrowing/lending currency. Default all currencies */ +/** Req for POST /linear-swap-api/v1/swap_order_limit. Supports cross and isolated. */ +export interface FuturesGetOrderLimitReq { + /** Order price type. Required */ + order_price_type: FuturesGetOrderLimitPriceType; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** futures, swap, all. Required for futures. Default swap */ + business_type?: FuturesBusinessType; +} ⋮---- -/** Start time (unix ms). Range: [(endTime – x D), endTime] */ +/** Order price type. Required */ ⋮---- -/** End time (unix ms). Range: [(now – y D), now]. Default now */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ ⋮---- -/** Sort: asc, desc. Default desc */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Max items [1-100]. Default 50 */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Search ID for next-page pagination */ +/** futures, swap, all. Required for futures. Default swap */ ⋮---- -/** Req for POST /v2/account/repayment (Repay Margin Loan). Loan interest paid first if no transactId. */ -export interface SpotMarginRepaymentReq { - /** Repayment account ID */ - accountId?: string; - /** Repayment currency */ - currency?: string; - /** Repayment amount */ - amount?: string; - /** Loan transaction ID. When specified, repay that loan; otherwise interest paid first. */ - transactId?: string; +/** Req for POST /linear-swap-api/v1/swap_fee. Supports cross and isolated. */ +export interface FuturesGetFeeReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** futures, swap, all. Required for futures. Default swap */ + business_type?: FuturesBusinessType; } ⋮---- -/** Repayment account ID */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ ⋮---- -/** Repayment currency */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Repayment amount */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Loan transaction ID. When specified, repay that loan; otherwise interest paid first. */ +/** futures, swap, all. Required for futures. Default swap */ ⋮---- -/** Req for POST /v1/dw/transfer-in/margin (Transfer Spot -> Isolated Margin). */ -export interface SpotMarginTransferInIsolatedReq { - /** Trading symbol (e.g. btcusdt, ethusdt) */ - symbol?: string; - /** Currency to transfer */ - currency?: string; - /** Amount to transfer */ - amount?: string; +/** Req for POST /linear-swap-api/v1/swap_cross_position_limit. Cross margin only. */ +export interface FuturesGetCrossPositionLimitReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** futures, swap, all. Required for futures. Default swap */ + business_type?: FuturesBusinessType; } ⋮---- -/** Trading symbol (e.g. btcusdt, ethusdt) */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ ⋮---- -/** Currency to transfer */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Amount to transfer */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Req for POST /v1/dw/transfer-out/margin (Transfer Isolated Margin -> Spot). */ -export interface SpotMarginTransferOutIsolatedReq { - /** Trading symbol (e.g. btcusdt, ethusdt) */ - symbol?: string; - /** Currency to transfer */ - currency?: string; - /** Amount to transfer */ - amount?: string; +/** futures, swap, all. Required for futures. Default swap */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_cross_lever_position_limit. Cross margin only. */ +export interface FuturesGetCrossLeverageLimitsReq { + /** futures, swap, all. Required for futures */ + business_type?: FuturesBusinessType; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-211231. Omit for all */ + contract_code?: string; + /** Leverage rate. Omit for all */ + lever_rate?: number; } ⋮---- -/** Trading symbol (e.g. btcusdt, ethusdt) */ +/** futures, swap, all. Required for futures */ ⋮---- -/** Currency to transfer */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Amount to transfer */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Req for POST /v1/margin/orders (Request a Margin Loan, Isolated) */ -export interface SpotMarginLoanOrderReq { - /** Trading symbol to borrow margin (e.g. btcusdt, ethusdt) */ - symbol?: string; - /** Currency to borrow */ - currency?: string; - /** Amount to borrow (max 3 decimal places) */ - amount?: string; -} +/** Contract code. swap: BTC-USDT, future: BTC-USDT-211231. Omit for all */ ⋮---- -/** Trading symbol to borrow margin (e.g. btcusdt, ethusdt) */ +/** Leverage rate. Omit for all */ ⋮---- -/** Currency to borrow */ +/** Req for POST /linear-swap-api/v1/swap_master_sub_transfer. Supports cross and isolated. */ +export interface FuturesTransferMasterSubReq { + /** Sub-account UID */ + sub_uid: number; + /** Asset (e.g. USDT) */ + asset: string; + /** From margin account (e.g. USDT, BTC-USDT) */ + from_margin_account: string; + /** To margin account */ + to_margin_account: string; + /** Transfer amount */ + amount: number | string; + /** master_to_sub or sub_to_master */ + type: FuturesTransferType; + /** Optional client order ID [1, 9223372036854775807]. Valid 8h per transfer path */ + client_order_id?: number; +} ⋮---- -/** Amount to borrow (max 3 decimal places) */ +/** Sub-account UID */ ⋮---- -/** Req for GET /v1/margin/loan-orders (Search Past Margin Orders, Isolated) */ -export interface SpotMarginLoanOrdersReq { - /** Trading symbol (e.g. btcusdt) */ - symbol?: string; - /** Order states comma-separated: created, accrual, cleared, invalid, failed */ - states?: string; - /** Start date yyyy-mm-dd. Default -61d */ - 'start-date'?: string; - /** End date yyyy-mm-dd. Default today */ - 'end-date'?: string; - /** Search order id to begin with */ - from?: string; - /** Search direction when from is used: next, prev */ - direct?: 'next' | 'prev'; - /** Orders to return [1-100]. Default 100 */ - size?: number; - /** Sub user ID (required when parent queries sub user's orders) */ - 'sub-uid'?: number; -} +/** Asset (e.g. USDT) */ ⋮---- -/** Trading symbol (e.g. btcusdt) */ +/** From margin account (e.g. USDT, BTC-USDT) */ ⋮---- -/** Order states comma-separated: created, accrual, cleared, invalid, failed */ +/** To margin account */ ⋮---- -/** Start date yyyy-mm-dd. Default -61d */ +/** Transfer amount */ ⋮---- -/** End date yyyy-mm-dd. Default today */ +/** master_to_sub or sub_to_master */ ⋮---- -/** Search order id to begin with */ +/** Optional client order ID [1, 9223372036854775807]. Valid 8h per transfer path */ ⋮---- -/** Search direction when from is used: next, prev */ +/** Req for POST /linear-swap-api/v1/swap_master_sub_transfer_record. Supports cross and isolated. */ +export interface FuturesGetMasterSubTransfersReq { + /** Margin account (e.g. BTC-USDT, USDT). Required */ + margin_account: string; + /** 34: to sub, 35: from sub. Comma-separated for multiple. Omit for all */ + transfer_type?: string; + /** Days to query. Max 90 */ + create_date: number; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; +} ⋮---- -/** Orders to return [1-100]. Default 100 */ +/** Margin account (e.g. BTC-USDT, USDT). Required */ ⋮---- -/** Sub user ID (required when parent queries sub user's orders) */ +/** 34: to sub, 35: from sub. Comma-separated for multiple. Omit for all */ ⋮---- -/** Req for GET /v1/cross-margin/loan-orders (Search Past Margin Orders, Cross) */ -export interface SpotCrossMarginLoanOrdersReq { - /** Start date yyyy-mm-dd. Default -61d */ - 'start-date'?: string; - /** End date yyyy-mm-dd. Default today */ - 'end-date'?: string; - /** Currency filter */ - currency?: string; - /** Order state: created, accrual, cleared, invalid. Default all */ - state?: string; - /** Search order id to begin with. Default 0 */ - from?: string; - /** Search direction when from is used: next, prev. Default next */ - direct?: 'next' | 'prev'; - /** Orders to return [10-100]. Default 10 */ - size?: number; - /** Sub user UID */ - 'sub-uid'?: number; -} +/** Days to query. Max 90 */ ⋮---- -/** Start date yyyy-mm-dd. Default -61d */ +/** Page index. Default 1 */ ⋮---- -/** End date yyyy-mm-dd. Default today */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Currency filter */ +/** Req for POST /linear-swap-api/v1/swap_transfer_inner. Transfer between margin accounts under same account. */ +export interface FuturesTransferInnerReq { + /** Asset (e.g. USDT) */ + asset: string; + /** From margin account (e.g. BTC-USDT, USDT) */ + from_margin_account: string; + /** To margin account */ + to_margin_account: string; + /** Transfer amount */ + amount: number | string; + /** Optional client order ID [1, 9223372036854775807]. Valid 8h */ + client_order_id?: number; +} ⋮---- -/** Order state: created, accrual, cleared, invalid. Default all */ +/** Asset (e.g. USDT) */ ⋮---- -/** Search order id to begin with. Default 0 */ +/** From margin account (e.g. BTC-USDT, USDT) */ ⋮---- -/** Search direction when from is used: next, prev. Default next */ +/** To margin account */ ⋮---- -/** Orders to return [10-100]. Default 10 */ +/** Transfer amount */ ⋮---- -/** Sub user UID */ +/** Optional client order ID [1, 9223372036854775807]. Valid 8h */ ⋮---- -/** Req for POST /v1/dw/withdraw/api/create. Create withdraw request. */ -export interface SpotWithdrawCreateReq { - /** - * Destination address. - * On-chain: chain address. - * Internal: UID:1234567, PHONE:xxx, MAIL:xxx. - * Poloniex zero-fee cross-exchange: POLOUSER:{UUID} (linked on HTX first). - */ - address: string; - /** Crypto currency */ - currency: string; - /** Amount to withdraw */ - amount: string; - /** Fee. Use 0 for UID withdraw and Poloniex cross-exchange transfers. */ - fee?: number; - /** - * Chain. Required for multi-chain coins. - * For internal withdraw or Poloniex cross-exchange transfer, use t397342. - */ - chain?: string; - /** Address tag. For UID withdraw, use recipient UID. */ - 'addr-tag'?: string; - /** Client order id for idempotency (max 32 char) */ - 'client-order-id'?: string; - /** Exchange VASP id from /v1/query/vasp-list */ - 'exchange-vasp'?: string; - /** Recipient name for Korean/English: "SURNAME##FIRSTNAME" */ - 'user-name-vasp'?: string; +/** Req for POST /linear-swap-api/v1/swap_order. Isolated margin only. */ +export interface FuturesSubmitOrderReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract_code: string; + /** buy or sell */ + direction: FuturesDirection; + /** Order quantity */ + volume: number; + /** Leverage rate */ + lever_rate: number; + /** Order price type */ + order_price_type: FuturesSubmitOrderPriceType; + /** open, close, both. Required in hedge mode */ + offset?: FuturesOffsetBoth; + /** Price. Required for limit, post_only, ioc, fok */ + price?: number | string; + /** 0: no, 1: yes */ + reduce_only?: 0 | 1; + /** Client order ID [1, 9223372036854775807] */ + client_order_id?: number; + /** Take-profit trigger price */ + tp_trigger_price?: number | string; + /** Take-profit order price */ + tp_order_price?: number | string; + /** Take-profit order type */ + tp_order_price_type?: string; + /** Stop-loss trigger price */ + sl_trigger_price?: number | string; + /** Stop-loss order price */ + sl_order_price?: number | string; + /** Stop-loss order type */ + sl_order_price_type?: string; + /** Price protection when setting tp/sl */ + price_protect?: boolean; + /** 0: allow self-trade, 1: prevent (default) */ + self_match_prevent?: 0 | 1; + /** cancel_taker, cancel_maker, cancel_both */ + self_match_prevent_new?: FuturesSelfMatchPrevent; } ⋮---- -/** - * Destination address. - * On-chain: chain address. - * Internal: UID:1234567, PHONE:xxx, MAIL:xxx. - * Poloniex zero-fee cross-exchange: POLOUSER:{UUID} (linked on HTX first). - */ -⋮---- -/** Crypto currency */ -⋮---- -/** Amount to withdraw */ -⋮---- -/** Fee. Use 0 for UID withdraw and Poloniex cross-exchange transfers. */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** - * Chain. Required for multi-chain coins. - * For internal withdraw or Poloniex cross-exchange transfer, use t397342. - */ +/** buy or sell */ ⋮---- -/** Address tag. For UID withdraw, use recipient UID. */ +/** Order quantity */ ⋮---- -/** Client order id for idempotency (max 32 char) */ +/** Leverage rate */ ⋮---- -/** Exchange VASP id from /v1/query/vasp-list */ +/** Order price type */ ⋮---- -/** Recipient name for Korean/English: "SURNAME##FIRSTNAME" */ +/** open, close, both. Required in hedge mode */ ⋮---- -/** Req for GET /v1/query/deposit-withdraw. Search deposit/withdraw records. */ -export interface SpotDepositWithdrawQueryReq { - /** Crypto currency. Omit for all. */ - currency?: string; - /** deposit or withdraw */ - type: 'deposit' | 'withdraw'; - /** Transfer id to begin search */ - from?: string; - /** Items to return [1-50]. Default 50. */ - size?: string; - /** prev (asc) or next (desc). Default next. */ - direct?: 'prev' | 'next'; -} +/** Price. Required for limit, post_only, ioc, fok */ ⋮---- -/** Crypto currency. Omit for all. */ +/** 0: no, 1: yes */ ⋮---- -/** deposit or withdraw */ +/** Client order ID [1, 9223372036854775807] */ ⋮---- -/** Transfer id to begin search */ +/** Take-profit trigger price */ ⋮---- -/** Items to return [1-50]. Default 50. */ +/** Take-profit order price */ ⋮---- -/** prev (asc) or next (desc). Default next. */ +/** Take-profit order type */ ⋮---- -/** Req for GET /v2/account/withdraw/address. Query withdraw address. */ -export interface SpotWithdrawAddressReq { - /** - * Crypto currency. - * Use "t247117" for universal address. - * Use "t397342" to query Poloniex UID withdraw addresses added on platform. - */ - currency?: string; - /** Block chain name. Omit for all chains. */ - chain?: string; - /** Note of withdraw address. Omit for all. */ - note?: string; - /** Items to return [1-500]. Default 100. */ - limit?: number; - /** First record ID for next page. */ - fromId?: number; -} +/** Stop-loss trigger price */ ⋮---- -/** - * Crypto currency. - * Use "t247117" for universal address. - * Use "t397342" to query Poloniex UID withdraw addresses added on platform. - */ +/** Stop-loss order price */ ⋮---- -/** Block chain name. Omit for all chains. */ +/** Stop-loss order type */ ⋮---- -/** Note of withdraw address. Omit for all. */ +/** Price protection when setting tp/sl */ ⋮---- -/** Items to return [1-500]. Default 100. */ +/** 0: allow self-trade, 1: prevent (default) */ ⋮---- -/** First record ID for next page. */ +/** cancel_taker, cancel_maker, cancel_both */ ⋮---- -/** Req for POST /broker/v1/sub-user/fee_rate/add. Set sub-user trading fee rate. */ -export interface SpotBrokerSubUserFeeRateAddReq { - /** Sub-account ids, max 10 */ - subUids: number[]; - /** 0 all, 1 Spot, 2 U-standard linear, 3 Coin-Margined swap */ - bizType: number; - /** Type: 1 fixed (0.001-0.5), 2 percent (1-1000) */ - type: number; - /** Additional taker fee. Either taker or maker required. */ - taker?: string; - /** Additional maker fee. Either taker or maker required. */ - maker?: string; - /** YYYYMMDD effect date. Omit for T+1. */ - effectAt?: string; +/** Req for POST /linear-swap-api/v1/swap_cross_order. Cross margin only. One of contract_code or (pair+contract_type) required. */ +export interface FuturesCrossSubmitOrderReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit if pair+contract_type */ + contract_code?: string; + /** Pair (e.g. BTC-USDT). Use with contract_type */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** buy or sell */ + direction: FuturesDirection; + /** Order quantity */ + volume: number; + /** Leverage rate */ + lever_rate: number; + /** Order price type */ + order_price_type: FuturesSubmitOrderPriceType; + /** open, close, both. Required in hedge mode */ + offset?: FuturesOffsetBoth; + /** Price. Required for limit, post_only, ioc, fok */ + price?: number | string; + /** 0: no, 1: yes */ + reduce_only?: 0 | 1; + /** Client order ID [1, 9223372036854775807] */ + client_order_id?: number; + /** Take-profit trigger price */ + tp_trigger_price?: number | string; + /** Take-profit order price */ + tp_order_price?: number | string; + /** Take-profit order type */ + tp_order_price_type?: string; + /** Stop-loss trigger price */ + sl_trigger_price?: number | string; + /** Stop-loss order price */ + sl_order_price?: number | string; + /** Stop-loss order type */ + sl_order_price_type?: string; + /** 0: allow self-trade, 1: prevent (default) */ + self_match_prevent?: 0 | 1; + /** cancel_taker, cancel_maker, cancel_both */ + self_match_prevent_new?: FuturesSelfMatchPrevent; } ⋮---- -/** Sub-account ids, max 10 */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit if pair+contract_type */ ⋮---- -/** 0 all, 1 Spot, 2 U-standard linear, 3 Coin-Margined swap */ +/** Pair (e.g. BTC-USDT). Use with contract_type */ ⋮---- -/** Type: 1 fixed (0.001-0.5), 2 percent (1-1000) */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Additional taker fee. Either taker or maker required. */ +/** buy or sell */ ⋮---- -/** Additional maker fee. Either taker or maker required. */ +/** Order quantity */ ⋮---- -/** YYYYMMDD effect date. Omit for T+1. */ +/** Leverage rate */ ⋮---- -/** Req for POST /broker/v1/account_capital_snapshot_everyday. Account asset snapshot. */ -export interface SpotBrokerAccountCapitalSnapshotReq { - /** Account type: spot, margin-api, super-margin-api, delivery, swap, linear */ - account_type: string; - /** Start time (ms). Omit with end_time for last 7 days. */ - start_time?: number; - /** End time (ms). Max 30 days from start. */ - end_time?: number; -} +/** Order price type */ ⋮---- -/** Account type: spot, margin-api, super-margin-api, delivery, swap, linear */ +/** open, close, both. Required in hedge mode */ ⋮---- -/** Start time (ms). Omit with end_time for last 7 days. */ +/** Price. Required for limit, post_only, ioc, fok */ ⋮---- -/** End time (ms). Max 30 days from start. */ +/** 0: no, 1: yes */ ⋮---- -/** Req for POST /v2/sub-user/tradable-market. Set tradable market for sub users. */ -export interface SpotSubUserTradableMarketReq { - /** Sub user UIDs, comma-separated, max 50 */ - subUids: string; - /** isolated-margin or cross-margin */ - accountType: 'isolated-margin' | 'cross-margin'; - /** activated or deactivated */ - activation: 'activated' | 'deactivated'; -} +/** Client order ID [1, 9223372036854775807] */ ⋮---- -/** Sub user UIDs, comma-separated, max 50 */ +/** Take-profit trigger price */ ⋮---- -/** isolated-margin or cross-margin */ +/** Take-profit order price */ ⋮---- -/** activated or deactivated */ +/** Take-profit order type */ ⋮---- -/** Req for setSubUserTransferPermissions. Set asset transfer permission. */ -export interface SpotSubUserTransferPermissionsReq { - /** Sub user UIDs, comma-separated, max 50 */ - subUids: string; - /** true or false */ - transferrable: boolean; - /** Account type. Default spot. */ - accountType?: 'spot'; -} +/** Stop-loss trigger price */ ⋮---- -/** Sub user UIDs, comma-separated, max 50 */ +/** Stop-loss order price */ ⋮---- -/** true or false */ +/** Stop-loss order type */ ⋮---- -/** Account type. Default spot. */ +/** 0: allow self-trade, 1: prevent (default) */ ⋮---- -/** Req for POST /v1/subuser/transfer. Transfer asset between parent and sub account. */ -export interface SpotSubUserTransferReq { - /** Sub account UID */ - 'sub-uid': number; - /** Currency e.g. btc, usdt */ - currency: string; - /** Amount to transfer */ - amount: string; - /** master-transfer-in, master-transfer-out, master-point-transfer-in, master-point-transfer-out */ - type: - | 'master-transfer-in' - | 'master-transfer-out' - | 'master-point-transfer-in' - | 'master-point-transfer-out'; - /** Client order id for idempotency */ - 'client-order-id'?: string; +/** cancel_taker, cancel_maker, cancel_both */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_batchorder. Isolated. Max 10 orders. */ +export interface FuturesSubmitBatchOrderReq { + orders_data: FuturesSubmitOrderReq[]; } ⋮---- -/** Sub account UID */ +/** Req for POST /linear-swap-api/v1/swap_cross_batchorder. Cross. Max 25 orders. */ +export interface FuturesSubmitCrossBatchOrderReq { + orders_data: FuturesCrossSubmitOrderReq[]; +} ⋮---- -/** Currency e.g. btc, usdt */ +/** Req for POST /linear-swap-api/v1/swap_cancel. Isolated. One of order_id or client_order_id required. Max 25 IDs. */ +export interface FuturesCancelOrderReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract_code: string; + /** Order IDs, comma-separated. Max 25 */ + order_id?: string; + /** Client order IDs, comma-separated. Max 25 */ + client_order_id?: string; +} ⋮---- -/** Amount to transfer */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** master-transfer-in, master-transfer-out, master-point-transfer-in, master-point-transfer-out */ +/** Order IDs, comma-separated. Max 25 */ ⋮---- -/** Client order id for idempotency */ +/** Client order IDs, comma-separated. Max 25 */ ⋮---- -/** Req for getSubUserDepositHistory. Query sub user deposit history. */ -export interface SpotSubUserDepositHistoryReq { - /** Sub user UID */ - subUid: number; - /** Crypto currency. Omit for all. */ - currency?: string; - /** Start time (ms). Default endTime - 30 days. */ - startTime?: number; - /** End time (ms). Default now. */ - endTime?: number; - /** asc or desc */ - sort?: 'asc' | 'desc'; - /** Items per page [1-500]. Default 100. */ - limit?: number; - /** First record ID for next page. */ - fromId?: number; +/** Req for POST /linear-swap-api/v1/swap_cross_cancel. Cross. One of order_id/client_order_id and one of contract_code/(pair+contract_type) required. */ +export interface FuturesCancelCrossOrderReq { + /** Order IDs, comma-separated. Max 25 */ + order_id?: string; + /** Client order IDs, comma-separated. Max 25 */ + client_order_id?: string; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; } ⋮---- -/** Sub user UID */ +/** Order IDs, comma-separated. Max 25 */ ⋮---- -/** Crypto currency. Omit for all. */ +/** Client order IDs, comma-separated. Max 25 */ ⋮---- -/** Start time (ms). Default endTime - 30 days. */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** End time (ms). Default now. */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** asc or desc */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Items per page [1-500]. Default 100. */ +/** Req for POST /linear-swap-api/v1/swap_cancelall. Isolated. One of direction or offset optional. */ +export interface FuturesCancelAllOrdersReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract_code: string; + /** buy or sell. Omit for all */ + direction?: FuturesDirection; + /** open or close. Omit for all */ + offset?: FuturesOffset; +} ⋮---- -/** First record ID for next page. */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** Req for GET /v2/sub-user/managed-transfer-history. Managed sub-account transfer history. */ -export interface SpotSubUserManagedTransferHistoryReq { - /** Sub user UID. Omit for all managed sub-accounts. */ - uid?: number; - /** Currency filter */ - currency?: string; - /** 0: master to sub, 1: sub to master */ - type?: string; - /** Start time (ms). Max 48h window, within 120 days. */ - startTime?: number; - /** End time (ms). */ - endTime?: number; - /** Search id to begin with. */ - from?: string; - /** next or prev. Default next. */ - direct?: 'next' | 'prev'; - /** Items to return [1-100]. Default 100. */ - size?: string; +/** buy or sell. Omit for all */ +⋮---- +/** open or close. Omit for all */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_cross_cancelall. Cross. One of contract_code or (pair+contract_type) required. */ +export interface FuturesCancelCrossAllOrdersReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** buy or sell. Omit for all */ + direction?: FuturesDirection; + /** open or close. Omit for all */ + offset?: FuturesOffset; } ⋮---- -/** Sub user UID. Omit for all managed sub-accounts. */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** Currency filter */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** 0: master to sub, 1: sub to master */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Start time (ms). Max 48h window, within 120 days. */ +/** buy or sell. Omit for all */ ⋮---- -/** End time (ms). */ +/** open or close. Omit for all */ ⋮---- -/** Search id to begin with. */ +/** Req for POST /linear-swap-api/v1/swap_cross_switch_lever_rate. Cross margin only. One of contract_code or (pair+contract_type) required. */ +export interface FuturesUpdateCrossLeverageReq { + /** Leverage multiple. Required */ + lever_rate: number; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; +} ⋮---- -/** next or prev. Default next. */ +/** Leverage multiple. Required */ ⋮---- -/** Items to return [1-100]. Default 100. */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** Req for createSubUserApiKey. Create sub user API key. */ -export interface SpotSubUserApiKeyCreationReq { - /** Sub user UID */ - subUid: number; - /** Google OTP (6 digits) if parent has 2FA */ - otpToken?: string; - /** API key note, max 255 chars */ - note?: string; - /** readOnly, trade. readOnly required. Comma-separated. */ - permission?: string; - /** IP addresses, comma-separated, max 20 */ - ipAddresses?: string; -} +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Sub user UID */ +/** swap, this_week, next_week, quarter, next_quarter */ ⋮---- -/** Google OTP (6 digits) if parent has 2FA */ +/** Req for POST /linear-swap-api/v1/swap_order_info. Isolated. One of order_id or client_order_id required. Max 50 IDs. */ +export interface FuturesGetOrderInfoReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract_code: string; + /** Order IDs, comma-separated. Max 50 */ + order_id?: string; + /** Client order IDs, comma-separated. Max 50 */ + client_order_id?: string; +} ⋮---- -/** API key note, max 255 chars */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** readOnly, trade. readOnly required. Comma-separated. */ +/** Order IDs, comma-separated. Max 50 */ ⋮---- -/** IP addresses, comma-separated, max 20 */ +/** Client order IDs, comma-separated. Max 50 */ ⋮---- -/** Req for updateSubUserApiKey. Modify sub user API key. */ -export interface SpotSubUserApiKeyUpdateReq { - /** Sub user UID */ - subUid: number; - /** Access key to modify */ - accessKey: string; - /** API key note, max 255 chars */ - note?: string; - /** readOnly, trade. Comma-separated. */ - permission?: string; - /** IP addresses, comma-separated, max 20 */ - ipAddresses?: string; +/** Req for POST /linear-swap-api/v1/swap_cross_order_info. Cross. One of order_id/client_order_id and one of contract_code/pair required. */ +export interface FuturesGetCrossOrderInfoReq { + /** Order IDs, comma-separated. Max 50 */ + order_id?: string; + /** Client order IDs, comma-separated. Max 50 */ + client_order_id?: string; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; } ⋮---- -/** Sub user UID */ -⋮---- -/** Access key to modify */ +/** Order IDs, comma-separated. Max 50 */ ⋮---- -/** API key note, max 255 chars */ +/** Client order IDs, comma-separated. Max 50 */ ⋮---- -/** readOnly, trade. Comma-separated. */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** IP addresses, comma-separated, max 20 */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Req for GET /v2/account/ledger */ -export interface SpotGetAccountLedgerReq { - /** Account ID */ - accountId: string; - /** Currency. Default all. */ - currency?: string; - /** Transaction types, comma-separated. Phase 1: transfer only. */ - transactTypes?: string; - /** Start time (unix ms). Max 10-day window, within 180 days. */ - startTime?: number; - /** End time (unix ms). */ - endTime?: number; - /** Sort order: asc, desc. Deprecated. */ - sort?: string; - /** Max items [1-500]. Default 100. */ - limit?: number; - /** First record ID for pagination (next page) */ - fromId?: number; +/** Req for POST /linear-swap-api/v1/swap_order_detail. Isolated. Order details with trades. */ +export interface FuturesGetOrderDetailReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract_code: string; + /** Order ID. Required */ + order_id: number | string; + /** Created timestamp (ms). Improves query performance. Cannot be 0 */ + created_at?: number; + /** 1: Quotation, 2: Cancelled, 3: Forced liquidation, 4: Delivery, 22: ADL */ + order_type?: number; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; } ⋮---- -/** Account ID */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** Currency. Default all. */ +/** Order ID. Required */ ⋮---- -/** Transaction types, comma-separated. Phase 1: transfer only. */ +/** Created timestamp (ms). Improves query performance. Cannot be 0 */ ⋮---- -/** Start time (unix ms). Max 10-day window, within 180 days. */ +/** 1: Quotation, 2: Cancelled, 3: Forced liquidation, 4: Delivery, 22: ADL */ ⋮---- -/** End time (unix ms). */ +/** Page index. Default 1 */ ⋮---- -/** Sort order: asc, desc. Deprecated. */ -⋮---- -/** Max items [1-500]. Default 100. */ -⋮---- -/** First record ID for pagination (next page) */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Req for GET /v2/invitee/rebate/history. Referral rebate history. */ -export interface SpotReferralRebateHistoryReq { - /** Invitee UID */ - inviteeUid: number; - /** Start date yyyy-MM-dd. Last 90 days. */ - startTime?: string; - /** End date yyyy-MM-dd. Last 90 days. */ - endTime?: string; - /** next or prev. Default prev. */ - direct?: 'next' | 'prev'; - /** Pagination cursor. Min query_id for prev, max for next. */ - fromId?: string; - /** Items per page, max 100. Default 100. */ - limit?: number; +/** Req for POST /linear-swap-api/v1/swap_cross_order_detail. Cross. One of contract_code or pair required. */ +export interface FuturesGetCrossOrderDetailReq { + /** Order ID. Required */ + order_id: number | string; + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** Created timestamp (ms). Cannot be 0 */ + created_at?: number; + /** 1: Quotation, 2: Cancelled, 3: Forced liquidation, 4: Delivery, 22: ADL */ + order_type?: number; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; } ⋮---- -/** Invitee UID */ -⋮---- -/** Start date yyyy-MM-dd. Last 90 days. */ -⋮---- -/** End date yyyy-MM-dd. Last 90 days. */ -⋮---- -/** next or prev. Default prev. */ +/** Order ID. Required */ ⋮---- -/** Pagination cursor. Min query_id for prev, max for next. */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** Items per page, max 100. Default 100. */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Req for GET /v2/invitee/rebate/all_rebate/detail. All rebate detail. */ -export interface SpotReferralAllRebateDetailReq { - /** next or prev. Default prev. */ - direct?: 'next' | 'prev'; - /** Pagination cursor. */ - fromId?: string; - /** Items per page, max 100. Default 100. */ - limit?: number; -} +/** Created timestamp (ms). Cannot be 0 */ ⋮---- -/** next or prev. Default prev. */ +/** 1: Quotation, 2: Cancelled, 3: Forced liquidation, 4: Delivery, 22: ADL */ ⋮---- -/** Pagination cursor. */ +/** Page index. Default 1 */ ⋮---- -/** Items per page, max 100. Default 100. */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Req for GET /v2/invitee/rebate/referrals. Invited user list. */ -export interface SpotReferralReferralsReq { - /** Invitee UIDs, comma-separated, max 50. */ - inviteeUidList?: string; - /** Referral code used at registration. */ - referralCode?: string; - /** Start date yyyy-MM-dd. Last 14 days. */ - startTime?: string; - /** End date yyyy-MM-dd. Last 14 days. */ - endTime?: string; - /** prev or next. Default next. */ - direct?: 'prev' | 'next'; - /** Pagination cursor. */ - fromId?: string; - /** Items per page, max 100. Default 30. */ - limit?: number; +/** Req for POST /linear-swap-api/v1/swap_openorders. Isolated. Current unfilled orders. */ +export interface FuturesGetOpenOrdersReq { + /** Contract code (e.g. BTC-USDT). Omit for all */ + contract_code?: string; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; + /** created_at or update_time. Default created_at */ + sort_by?: FuturesSortBy; + /** 0: all, 1: buy long, 2: sell short, 3: buy short, 4: sell long, 17: buy(one-way), 18: sell(one-way) */ + trade_type?: 0 | 1 | 2 | 3 | 4 | 17 | 18; } ⋮---- -/** Invitee UIDs, comma-separated, max 50. */ -⋮---- -/** Referral code used at registration. */ -⋮---- -/** Start date yyyy-MM-dd. Last 14 days. */ +/** Contract code (e.g. BTC-USDT). Omit for all */ ⋮---- -/** End date yyyy-MM-dd. Last 14 days. */ +/** Page index. Default 1 */ ⋮---- -/** prev or next. Default next. */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Pagination cursor. */ +/** created_at or update_time. Default created_at */ ⋮---- -/** Items per page, max 100. Default 30. */ +/** 0: all, 1: buy long, 2: sell short, 3: buy short, 4: sell long, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Req for GET /v1/api/c2c/order/history. P2P order history. */ -export interface SpotP2POrderHistoryReq { - /** 0: buy, 1: sell */ - side?: string; - /** Start time (ms). Last 90 days. */ - startTime?: number; - /** End time (ms). Last 90 days. */ - endTime?: number; - /** next or prev. Default prev. */ - direct?: 'next' | 'prev'; - /** Pagination cursor. Min query_id for prev, max for next. */ - fromId?: number; - /** Items per page, max 100. Default 100. */ - limit?: number; +/** Req for POST /linear-swap-api/v1/swap_cross_openorders. Cross. Omit all for all contracts. */ +export interface FuturesGetCrossOpenOrdersReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** Page index. Default 1 */ + page_index?: number; + /** Page size. Default 20, max 50 */ + page_size?: number; + /** created_at or update_time */ + sort_by?: FuturesSortBy; + /** 0: all, 1: buy long, 2: sell short, 3: buy short, 4: sell long, 17: buy(one-way), 18: sell(one-way) */ + trade_type?: 0 | 1 | 2 | 3 | 4 | 17 | 18; } ⋮---- -/** 0: buy, 1: sell */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** Start time (ms). Last 90 days. */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** End time (ms). Last 90 days. */ +/** Page index. Default 1 */ ⋮---- -/** next or prev. Default prev. */ +/** Page size. Default 20, max 50 */ ⋮---- -/** Pagination cursor. Min query_id for prev, max for next. */ +/** created_at or update_time */ ⋮---- -/** Items per page, max 100. Default 100. */ +/** 0: all, 1: buy long, 2: sell short, 3: buy short, 4: sell long, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Req for GET /v1/earn/project/queryEarnProjectList. Earn product query. */ -export interface SpotEarnProjectListReq { - /** Crypto currency filter */ - currency?: string; - /** Page number. Default 1. */ - pageNum: number; - /** Items per page, max 100. Default 10. */ - pageSize: number; +/** Req for POST /linear-swap-api/v3/swap_hisorders. Isolated. History orders. */ +export interface FuturesGetHistoryOrdersReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** 1: All Orders, 2: Order in Finished Status */ + type: 1 | 2; + /** 0: all, or comma-separated e.g. "3,4,5" */ + status: string; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; } ⋮---- -/** Crypto currency filter */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** Page number. Default 1. */ +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Items per page, max 100. Default 10. */ +/** 1: All Orders, 2: Order in Finished Status */ ⋮---- -/** Req for POST /v1/earn/order/demand/add. Earn subscription. */ -export interface SpotEarnSubscribeReq { - /** Project ID */ - id: number; - /** Subscription amount */ - amount: string; - /** Idempotent ID (e.g. Snowflake). */ - requestId: string; -} +/** 0: all, or comma-separated e.g. "3,4,5" */ ⋮---- -/** Project ID */ +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -/** Subscription amount */ +/** End time (ms). Default now */ ⋮---- -/** Idempotent ID (e.g. Snowflake). */ +/** next or prev. Default prev */ ⋮---- -/** Req for POST /v1/earn/order/demand/redeem-order. Earn redemption. */ -export interface SpotEarnRedeemReq { - /** Order ID */ - orderId: number; - /** Redemption amount */ - amount: string; - /** Idempotent ID (e.g. Snowflake). */ - requestId?: string; +/** Pagination: min/max query_id from last result */ +⋮---- +/** Req for POST /linear-swap-api/v3/swap_hisorders_exact. Isolated. History orders via multiple fields; adds price_type filter. */ +export interface FuturesGetHistoryOrdersExactReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** 1: All Orders, 2: Order in Finished Status */ + type: 1 | 2; + /** 0: all, or comma-separated e.g. "3,4,5" */ + status: string; + /** Order price type filter: limit, opponent, post_only, optimal_5, optimal_10, optimal_20, ioc, fok, opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok, optimal_5_fok, optimal_10_fok, optimal_20_fok */ + price_type?: string; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; } ⋮---- -/** Order ID */ +/** Contract code (e.g. BTC-USDT). Required */ ⋮---- -/** Redemption amount */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Idempotent ID (e.g. Snowflake). */ +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Req for GET /v1/earn/order/user/assets/list. Earn position query. */ -export interface SpotEarnUserAssetsReq { - /** Project type: 0 = Flexible */ - projectType?: number; - /** Crypto currency filter */ - currency?: string; - /** Page number. Default 1. */ - pageNum: number; - /** Items per page, max 100. Default 10. */ - pageSize: number; -} +/** 1: All Orders, 2: Order in Finished Status */ ⋮---- -/** Project type: 0 = Flexible */ +/** 0: all, or comma-separated e.g. "3,4,5" */ ⋮---- -/** Crypto currency filter */ +/** Order price type filter: limit, opponent, post_only, optimal_5, optimal_10, optimal_20, ioc, fok, opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok, optimal_5_fok, optimal_10_fok, optimal_20_fok */ ⋮---- -/** Page number. Default 1. */ +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -/** Items per page, max 100. Default 10. */ +/** End time (ms). Default now */ ⋮---- -/** Account type for POST /v5/account/universal_transfer */ -export type SpotUniversalTransferAccountType = - | 'otc' - | 'spot' - | 'linear-swap' - | 'futures' - | 'swap' - | 'margin' - | 'super-margin' - | 'otc-options'; +/** next or prev. Default prev */ ⋮---- -/** Req for POST /v5/account/universal_transfer. Create universal transfer. */ -export interface SpotUniversalTransferReq { - amount: number | string; - currency: string; - from_account_type: SpotUniversalTransferAccountType; - to_account_type: SpotUniversalTransferAccountType; - from_asset_type?: string; - to_asset_type?: string; -} +/** Pagination: min/max query_id from last result */ ⋮---- -/** Req for GET /v5/account/universal_transfer_records. Universal transfer history. */ -export interface SpotUniversalTransferRecordsReq { - transfer_id?: number | string; - currency?: string; - status?: 'success' | 'pending' | 'failed'; +/** Req for POST /linear-swap-api/v3/swap_cross_hisorders_exact. Cross. History orders via multiple fields; adds price_type filter. */ +export interface FuturesGetCrossHistoryOrdersExactReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. When both pair and contract filled, contract preferred */ + contract: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** 1: All Orders, 2: Order in Finished Status */ + type: 1 | 2; + /** 0: all, or comma-separated e.g. "3,4,5" */ + status: string; + /** Order price type filter: limit, opponent, post_only, optimal_5, optimal_10, optimal_20, ioc, fok, opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok, optimal_5_fok, optimal_10_fok, optimal_20_fok */ + price_type?: string; + /** Start time (ms). Window max 48h, within 90 days */ start_time?: number; + /** End time (ms). Default now */ end_time?: number; - from?: number; - limit?: number; - direct?: 'prev' | 'next'; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; } - -================ -File: src/lib/requestUtils.ts -================ -/* eslint-disable @typescript-eslint/no-explicit-any */ ⋮---- -import { - OrderIdProperty, - SpotOrderIdProperty, -} from '../types/response/shared.types.js'; -import { - HTXWSAPIRequest, - WSAPIDerivativesOperation, - WSAPISpotOperation, -} from '../types/websockets/ws-api.js'; -import { - isDerivativesWSAPIRequest, - isSpotWSAPIRequest, -} from './websocket/type-guards.js'; -import { WS_KEY_MAP, WsKey } from './websocket/websocket-util.js'; +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. When both pair and contract filled, contract preferred */ ⋮---- -/** - * Used to switch how authentication/requests work under the hood - */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** Spot */ +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Spot AWS */ +/** 1: All Orders, 2: Order in Finished Status */ ⋮---- -/** - * Futures Cloudflare CDN (default for futures clients) - */ +/** 0: all, or comma-separated e.g. "3,4,5" */ ⋮---- -/** - * Futures - * - * If you can't connect "https://api.hbdm.com", please use "https://api.btcgateway.pro" for debug purpose. If your server is deployed in AWS, we recommend using "https://api.hbdm.vn". - */ +/** Order price type filter: limit, opponent, post_only, optimal_5, optimal_10, optimal_20, ioc, fok, opponent_ioc, optimal_5_ioc, optimal_10_ioc, optimal_20_ioc, opponent_fok, optimal_5_fok, optimal_10_fok, optimal_20_fok */ ⋮---- -/** - * Futures AWS CDN - */ +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -export type RestClientType = - (typeof REST_CLIENT_TYPE_ENUM)[keyof typeof REST_CLIENT_TYPE_ENUM]; +/** End time (ms). Default now */ ⋮---- -[REST_CLIENT_TYPE_ENUM.futures]: 'https://api.hbdm.com', // Cloudflare's CDN -// If you can't connect "https://api.hbdm.com", please use "https://api.btcgateway.pro" for debug purpose. If your server is deployed in AWS, HTX recommend using "https://api.hbdm.vn". +/** next or prev. Default prev */ ⋮---- -[REST_CLIENT_TYPE_ENUM.futuresAWS]: 'https://api.hbdm.vn', // AWS's CDN +/** Pagination: min/max query_id from last result */ ⋮---- -export interface RestClientOptions { - /** Your API key */ - apiKey?: string; - - /** Your API secret */ - apiSecret?: string; - - /** - * Use access token instead of sign, if this is provided. - * For guidance refer to: https://github.com/tiagosiebler/kucoin-api/issues/2 - */ - apiAccessToken?: string; - - /** Default: false. If true, we'll throw errors if any params are undefined */ - strictParamValidation?: boolean; - - /** - * Optionally override API protocol + domain - * e.g baseUrl: 'https://api.huobi.pro' - **/ - baseUrl?: string; - - /** - * Advanced: force a specific base URL. - * - For AWS deployments, use REST_CLIENT_TYPE_ENUM.spotAWS for spot or REST_CLIENT_TYPE_ENUM.futuresAWS for futures. - * - If you can't connect to the default futures endpoint (Cloudflare's CDN), you can use REST_CLIENT_TYPE_ENUM.futuresAlt1 to connect to the alternative endpoint (btcgateway.pro). https://www.htx.com/en-us/opend/newApiPages/?id=707 - */ - baseUrlKey?: RestClientType; - - /** Default: true. whether to try and post-process request exceptions (and throw them). */ - parseExceptions?: boolean; - - customTimestampFn?: () => number; - - /** - * Enable keep alive for REST API requests (via axios). - */ - keepAlive?: boolean; - - /** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - * Default: 1000 (defaults comes from https agent) - */ - keepAliveMsecs?: number; - - /** - * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method - * - * Look in the examples folder for a demonstration on using node's createHmac instead. - */ - customSignMessageFn?: (message: string, secret: string) => Promise; +/** Req for POST /linear-swap-api/v3/swap_cross_hisorders. Cross. One of contract or pair required. */ +export interface FuturesGetCrossHistoryOrdersReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** 1: All Orders, 2: Order in Finished Status */ + type: 1 | 2; + /** 0: all, or comma-separated e.g. "3,4,5" */ + status: string; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; } ⋮---- -/** Your API key */ +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -/** Your API secret */ +/** Pair (e.g. BTC-USDT) */ ⋮---- -/** - * Use access token instead of sign, if this is provided. - * For guidance refer to: https://github.com/tiagosiebler/kucoin-api/issues/2 - */ +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -/** Default: false. If true, we'll throw errors if any params are undefined */ +/** 1: All Orders, 2: Order in Finished Status */ ⋮---- -/** - * Optionally override API protocol + domain - * e.g baseUrl: 'https://api.huobi.pro' - **/ +/** 0: all, or comma-separated e.g. "3,4,5" */ ⋮---- -/** - * Advanced: force a specific base URL. - * - For AWS deployments, use REST_CLIENT_TYPE_ENUM.spotAWS for spot or REST_CLIENT_TYPE_ENUM.futuresAWS for futures. - * - If you can't connect to the default futures endpoint (Cloudflare's CDN), you can use REST_CLIENT_TYPE_ENUM.futuresAlt1 to connect to the alternative endpoint (btcgateway.pro). https://www.htx.com/en-us/opend/newApiPages/?id=707 - */ +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -/** Default: true. whether to try and post-process request exceptions (and throw them). */ +/** End time (ms). Default now */ ⋮---- -/** - * Enable keep alive for REST API requests (via axios). - */ +/** next or prev. Default prev */ ⋮---- -/** - * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000. - * Only relevant if keepAlive is set to true. - * Default: 1000 (defaults comes from https agent) - */ +/** Pagination: min/max query_id from last result */ ⋮---- -/** - * Allows you to provide a custom "signMessage" function, e.g. to use node's much faster createHmac method - * - * Look in the examples folder for a demonstration on using node's createHmac instead. - */ +/** Req for POST /linear-swap-api/v3/swap_matchresults. getFills. Isolated. One of contract or pair required. */ +export interface FuturesGetFillsReq { + /** Contract code (e.g. BTC-USDT) */ + contract?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; +} ⋮---- -export type GenericAPIResponse = Promise; +/** Contract code (e.g. BTC-USDT) */ ⋮---- -export function serializeParams< - T extends Record | undefined = object, ->( - params: T, - strict_validation: boolean | undefined, - encodeValues: boolean, - prefixWith: string, - repeatArrayValuesAsKVPairs: boolean, -): string +/** Pair (e.g. BTC-USDT) */ ⋮---- -// Only prefix if there's a value +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -export function logInvalidOrderId( - orderIdProperty: SpotOrderIdProperty, - expectedOrderIdPrefix: string, - params: object, -) +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -function getWSAPICustomOrderIdProperties( - operation: WSAPISpotOperation | string, - wsKey: WsKey, -): OrderIdProperty[] +/** End time (ms). Default now */ ⋮---- -function isOrderParamRecord(value: unknown): value is Record +/** next or prev. Default prev */ ⋮---- -function getOrderParamRecords(params: unknown): Record[] +/** Pagination: min/max query_id from last result */ ⋮---- -export function requiresWSAPINewCustomOID( - request: HTXWSAPIRequest, - wsKey: WsKey, -): boolean +/** Req for POST /linear-swap-api/v3/swap_cross_matchresults. getCrossFills. Cross. One of contract or pair required. */ +export interface FuturesGetCrossFillsReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; +} ⋮---- -export function validateWSAPICustomOrderID( - request: HTXWSAPIRequest, - wsKey: WsKey, -): void +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ ⋮---- -function isDerivativesWSAPIOrderPlacementOperation( - operation: WSAPIDerivativesOperation | string, -): boolean +/** Pair (e.g. BTC-USDT) */ ⋮---- -export function validateWSAPIDerivativesChannelKey( - request: HTXWSAPIRequest, - wsKey: WsKey, -): void +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ ⋮---- -export function isEmptyObject(obj: any, acceptStringIfNotEmpty: boolean) +/** Start time (ms). Window max 48h, within 90 days */ ⋮---- -export function getRestBaseUrl( - restClientOptions: RestClientOptions, - restClientType: RestClientType, -): string +/** End time (ms). Default now */ +⋮---- +/** next or prev. Default prev */ +⋮---- +/** Pagination: min/max query_id from last result */ +⋮---- +/** Req for POST /linear-swap-api/v3/swap_matchresults_exact. getFillsExact. Isolated. No pair param. */ +export interface FuturesGetFillsExactReq { + /** Contract code (e.g. BTC-USDT). Required */ + contract: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; +} +⋮---- +/** Contract code (e.g. BTC-USDT). Required */ +⋮---- +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ +⋮---- +/** Start time (ms). Window max 48h, within 90 days */ +⋮---- +/** End time (ms). Default now */ +⋮---- +/** next or prev. Default prev */ +⋮---- +/** Pagination: min/max query_id from last result */ +⋮---- +/** Req for POST /linear-swap-api/v3/swap_cross_matchresults_exact. getCrossFillsExact. Cross. When both filled, contract preferred. */ +export interface FuturesGetCrossFillsExactReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ + contract: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ + trade_type: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 17 | 18; + /** Start time (ms). Window max 48h, within 90 days */ + start_time?: number; + /** End time (ms). Default now */ + end_time?: number; + /** next or prev. Default prev */ + direct?: FuturesDirect; + /** Pagination: min/max query_id from last result */ + from_id?: number; +} +⋮---- +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625 */ +⋮---- +/** Pair (e.g. BTC-USDT) */ +⋮---- +/** 0: All, 1: Open long, 2: Open short, 3: Close short, 4: Close long, 5: Liquidate long, 6: Liquidate short, 17: buy(one-way), 18: sell(one-way) */ +⋮---- +/** Start time (ms). Window max 48h, within 90 days */ +⋮---- +/** End time (ms). Default now */ +⋮---- +/** next or prev. Default prev */ +⋮---- +/** Pagination: min/max query_id from last result */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_lightning_close_position. Isolated. Lightning close order. */ +export interface FuturesSubmitLightningCloseOrderReq { + /** Contract code (e.g. BTC-USDT). Case-insensitive */ + contract_code: string; + /** buy: open, sell: close */ + direction: FuturesDirection; + /** Client order ID. Unique per API, user-maintained */ + client_order_id?: number; + /** market (default), lightning_fok, lightning_ioc */ + order_price_type?: FuturesLightningOrderPriceType; +} +⋮---- +/** Contract code (e.g. BTC-USDT). Case-insensitive */ +⋮---- +/** buy: open, sell: close */ +⋮---- +/** Client order ID. Unique per API, user-maintained */ +⋮---- +/** market (default), lightning_fok, lightning_ioc */ +⋮---- +/** Req for POST /linear-swap-api/v1/swap_cross_lightning_close_position. Cross. One of (pair+contract_type) or contract_code required. */ +export interface FuturesSubmitCrossLightningCloseOrderReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Preferred when all filled */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** buy or sell */ + direction: FuturesDirection; + /** Client order ID [1, 9223372036854775807] */ + client_order_id?: number; + /** market (default), lightning_fok, lightning_ioc */ + order_price_type?: FuturesLightningOrderPriceType; +} +⋮---- +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Preferred when all filled */ +⋮---- +/** Pair (e.g. BTC-USDT) */ +⋮---- +/** swap, this_week, next_week, quarter, next_quarter */ +⋮---- +/** buy or sell */ +⋮---- +/** Client order ID [1, 9223372036854775807] */ +⋮---- +/** market (default), lightning_fok, lightning_ioc */ +⋮---- +/** Req for GET /linear-swap-api/v1/swap_cross_trade_state. Cross margin only. */ +export interface FuturesGetCrossTradeStateReq { + /** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ + contract_code?: string; + /** Pair (e.g. BTC-USDT) */ + pair?: string; + /** swap, this_week, next_week, quarter, next_quarter */ + contract_type?: string; + /** futures, swap, all. Required for futures. Default swap */ + business_type?: FuturesBusinessType; +} +⋮---- +/** Contract code. swap: BTC-USDT, future: BTC-USDT-210625. Omit for all */ +⋮---- +/** Pair (e.g. BTC-USDT) */ +⋮---- +/** swap, this_week, next_week, quarter, next_quarter */ +⋮---- +/** futures, swap, all. Required for futures. Default swap */ ⋮---- /** - * Iterates to extract pure domain from URL. - * https://example.com/v1/endpoint -> example.com + * Swap Strategy Order Interface */ -export function getBaseDomain(url: string): string ⋮---- -export function generateNewOrderID(): string +/** Req for POST /linear-swap-api/v1/swap_trigger_order. [Isolated] Submit Trigger Order. Isolated margin only. Trade. 5/s. */ +export interface FuturesSubmitTriggerOrderReq { + /** Contract type (e.g. BTC-USDT) */ + contract_code: string; + /** ge: Equal to or Greater than; le: Less than or Equal to */ + trigger_type: FuturesTriggerType; + /** Trigger price */ + trigger_price: number | string; + /** Order price (required when order_price_type is limit) */ + order_price?: number | string; + /** limit (default), optimal_5, optimal_10, optimal_20 */ + order_price_type?: FuturesTriggerOrderPriceType; + /** Volume (number of contracts) */ + volume: number; + /** buy or sell */ + direction: FuturesDirection; + /** open, close, both. In hedge mode required; in one-way mode optional, must be both when filled */ + offset?: FuturesOffsetBoth; + /** Leverage. Must match current position leverage when holding. High leverage = high risk */ + lever_rate?: number; + /** 0: no, 1: yes. In hedge mode invalid; one-way: 0 when not filled. reduce_only=1 for open in one-way triggers error 1492 */ + reduce_only?: 0 | 1; +} ⋮---- -export function getOrderIdPrefix(): string - -================ -File: README.md -================ -# Node.js & JavaScript SDK for HTX REST APIs & WebSockets - -[![Build & Test](https://github.com/sieblyio/htx-api/actions/workflows/e2etest.yml/badge.svg?branch=main)](https://github.com/sieblyio/htx-api/actions/workflows/e2etest.yml) -[![npm version](https://img.shields.io/npm/v/%40siebly%2Fhtx-api)][1] -[![npm size](https://img.shields.io/bundlephobia/min/%40siebly%2Fhtx-api/latest)][1] -[![npm downloads](https://img.shields.io/npm/dt/%40siebly%2Fhtx-api)][1] -[![last commit](https://img.shields.io/github/last-commit/sieblyio/htx-api)][1] -[![Telegram](https://img.shields.io/badge/chat-on%20telegram-blue.svg)](https://t.me/nodetraders) -[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/sieblyio/htx-api) - -

- - - - SDK Logo - - -

- -[1]: https://www.npmjs.com/package/@siebly/htx-api - -Complete & robust JavaScript & Node.js SDK for the HTX REST APIs and WebSockets: - -- Professional, robust & complete HTX SDK for all JavaScript runtimes. -- Complete integration with HTX REST APIs and WebSockets. - - Dedicated REST clients for Spot and Derivatives (linear swap, coin swap, delivery futures) - - Unified WebSocket client for all markets -- Complete TypeScript support (with type declarations for most API requests & responses). - - Strongly typed requests and responses. - - Automated end-to-end tests ensuring reliability. -- Actively maintained with a modern, promise-driven interface. -- Robust WebSocket integration with configurable connection heartbeats & automatic reconnect then resubscribe workflows. - - Event driven messaging. - - Smart WebSocket persistence with automatic reconnection handling. - - Emit `reconnected` event when dropped connection is restored. - - Support for both public and private WebSocket streams. -- Portable HMAC signing support for trusted server-side runtimes. -- Automatically supports both ESM and CJS projects. -- Heavy automated end-to-end testing with real API calls. -- Proxy support via axios integration. -- Active community support & collaboration in telegram: [Node.js Algo Traders](https://t.me/nodetraders). -- Looking to get started as soon as possible? Review our [HTX JavaScript QuickStart Guide](https://siebly.io/sdk/htx/javascript) on our website. -- Looking to learn about all product groups & features? Review our [HTX JavaScript Tutorial](https://siebly.io/sdk/htx/javascript/tutorial) on our website. - -## Table of Contents - -- [Installation](#installation) -- [Examples](#examples) -- [Issues & Discussion](#issues--discussion) -- [Related Projects](#related-projects) -- [Documentation](#documentation) -- [Structure](#structure) -- [Usage](#usage) - - [REST API Clients](#rest-api) - - [Spot Trading](#spot-trading) - - [Derivatives (Futures) Trading](#derivatives-futures-trading) - - [WebSockets](#websockets) - - [Public WebSocket Streams](#public-websocket-streams) - - [Private WebSocket Streams](#private-websocket-streams) - - [WebSocket API (WebsocketAPIClient)](#websocket-api-websocketapiclient) -- [Customise Logging](#customise-logging) -- [Browser/Frontend Usage](#browserfrontend-usage) - - [React and Vite](#react-and-vite) - - [Webpack](#webpack) - - [Browser Requirements](#browser-requirements) - - [Security and CORS](#security-and-cors) -- [LLMs & AI](#use-with-llms--ai) -- [Used By](#used-by) -- [Contributions & Thanks](#contributions--thanks) - -## Installation - -`npm install --save @siebly/htx-api` - -Node.js usage requires Node 22.13.0 or newer. Browser applications should follow the public-data and credential-safety guidance below. - -## Examples - -Refer to the [examples](./examples) folder for implementation demos, including: - -- **Spot WebSocket Examples**: public and private market/account streams -- **Derivatives WebSocket Examples**: linear swap, coin swap, delivery futures, and index streams - -## Issues & Discussion - -- Issues? Check the [issues tab](https://github.com/sieblyio/htx-api/issues). -- Discuss & collaborate with other node devs? Join our [Node.js Algo Traders](https://t.me/nodetraders) engineering community on telegram. -- Follow our announcement channel for real-time updates on [X/Twitter](https://x.com/sieblyio) - - - -## Related Projects - -Check out our JavaScript/TypeScript/Node.js SDKs & Projects: - -- Visit our website: [https://Siebly.io](https://siebly.io/) -- Try our REST API & WebSocket SDKs published on npmjs: - - [Bybit JavaScript SDK: bybit-api](https://www.npmjs.com/package/bybit-api) - - [Kraken JavaScript SDK: @siebly/kraken-api](https://www.npmjs.com/package/@siebly/kraken-api) - - [OKX JavaScript SDK: okx-api](https://www.npmjs.com/package/okx-api) - - [Binance JavaScript SDK: binance](https://www.npmjs.com/package/binance) - - [Gate (gate.com) JavaScript SDK: gateio-api](https://www.npmjs.com/package/gateio-api) - - [Bitget JavaScript SDK: bitget-api](https://www.npmjs.com/package/bitget-api) - - [Kucoin JavaScript SDK: kucoin-api](https://www.npmjs.com/package/kucoin-api) - - [Coinbase JavaScript SDK: coinbase-api](https://www.npmjs.com/package/coinbase-api) - - [HTX JavaScript SDK: @siebly/htx-api](https://www.npmjs.com/package/@siebly/htx-api) -- Try my misc utilities: - - [OrderBooks Node.js: orderbooks](https://www.npmjs.com/package/orderbooks) - - [Crypto Exchange Account State Cache: accountstate](https://www.npmjs.com/package/accountstate) -- Check out my examples: - - [awesome-crypto-examples Node.js](https://github.com/sieblyio/awesome-crypto-examples) - - -## Documentation - -Most methods accept JS objects. These can be populated using parameters specified by HTX's API documentation, or check the type definition in each class within this repository. - -### API Documentation Links - -- [HTX API Documentation](https://www.htx.com/en-us/opend/newApiPages/) - - [Spot Trading API](https://www.htx.com/en-us/opend/newApiPages/) - - [Derivatives Trading API](https://www.htx.com/en-us/opend/newApiPages/) -- [REST Endpoint Function List](./docs/endpointFunctionList.md) - -## Structure - -This project uses typescript. Resources are stored in 2 key structures: - -- [src](./src) - the whole connector written in typescript -- [examples](./examples) - some implementation examples & demonstrations. Contributions are welcome! - ---- - -# Usage - -Create API credentials on HTX's website: - -- [HTX API Key Management](https://www.htx.com/apikey/) - -## REST API - -The SDK provides dedicated REST clients for different trading products: - -- **SpotClient** - for spot trading, margin, earn, sub-accounts, and account operations -- **FuturesClient** - for linear swap, coin swap, delivery futures, and copy trading operations - -Both clients default to HTX's AWS CDN domains for better connectivity. You can override this via `baseUrlKey` in the client options if needed. - -### Spot Trading - -To use HTX's Spot APIs, import (or require) the `SpotClient`: - -```javascript -import { SpotClient } from '@siebly/htx-api'; -// or if you prefer require: -// const { SpotClient } = require('@siebly/htx-api'); - -// For public endpoints, API credentials are optional -const publicClient = new SpotClient(); - -// For private endpoints, provide API credentials -const client = new SpotClient({ - apiKey: 'your-api-key', - apiSecret: 'your-api-secret', -}); - -// Public API Examples - -// Get ticker information -const ticker = await publicClient.getTicker({ - symbol: 'btcusdt', -}); -console.log('Ticker: ', ticker); - -// Get order book -const orderBook = await publicClient.getMarketDepth({ - symbol: 'btcusdt', - depth: 10, -}); -console.log('Order Book: ', orderBook); - -// Private API Examples (requires authentication) - -// Get accounts and balances -client - .getAccounts() - .then(async (accounts) => { - console.log('Accounts: ', accounts); - - const accountId = accounts.data?.[0]?.id; - if (accountId) { - const balance = await client.getAccountBalance({ accountId }); - console.log('Account Balance: ', balance); - } - }) - .catch((err) => { - console.error('Error: ', err); - }); - -// Submit a limit order -client - .submitOrder({ - 'account-id': 'your-account-id', // Retrievable via getAccounts() as shown above - symbol: 'btcusdt', - type: 'buy-limit', - amount: '0.0001', - price: '10000', - 'client-order-id': client.generateNewOrderID(), - }) - .then((result) => { - console.log('Limit Order Result: ', result); - }) - .catch((err) => { - console.error('Error: ', err); - }); - -// Submit batch of orders (max 10 per batch) -client - .submitBatchOrders([ - { - 'account-id': 'your-account-id', // Retrievable via getAccounts() as shown above - symbol: 'btcusdt', - type: 'buy-limit', - amount: '0.0001', - price: '10000.00', - 'client-order-id': client.generateNewOrderID(), - }, - { - 'account-id': 'your-account-id', - symbol: 'btcusdt', - type: 'sell-limit', - amount: '0.0001', - price: '13000.00', - 'client-order-id': client.generateNewOrderID(), - }, - ]) - .then((result) => { - console.log('Batch Order Result: ', JSON.stringify(result, null, 2)); - }) - .catch((err) => { - console.error('Error: ', err); - }); -``` - -See [SpotClient](./src/SpotClient.ts) for further information. - -### Derivatives (Futures) Trading - -Use the `FuturesClient` for futures and swap trading operations: - -```javascript -import { FuturesClient } from '@siebly/htx-api'; -// or if you prefer require: -// const { FuturesClient } = require('@siebly/htx-api'); - -// For public endpoints, API credentials are optional -const publicClient = new FuturesClient(); - -// For private endpoints, provide API credentials -const client = new FuturesClient({ - apiKey: 'your-api-key', - apiSecret: 'your-api-secret', -}); - -// Public API Examples - -// Get order book for a specific contract -const orderBook = await publicClient.getLinearSwapMarketDepth({ - contract_code: 'BTC-USDT', - type: 'step0', -}); -console.log('Futures Order Book: ', orderBook); - -// Get ticker information -const ticker = await publicClient.getLinearSwapTicker({ - contract_code: 'BTC-USDT', -}); -console.log('Futures Ticker: ', ticker); - -// Private API Examples (requires authentication) - -// Get cross margin account info -client - .getLinearSwapCrossAccountInfo() - .then((accounts) => { - console.log('Cross Account Info: ', accounts); - }) - .catch((err) => { - console.error('Error: ', err); - }); - -// Submit a cross margin limit order -client - .submitLinearSwapCrossOrder({ - contract_code: 'BTC-USDT', - direction: 'buy', - volume: 1, - lever_rate: 5, - order_price_type: 'limit', - price: 10000, - }) - .then((result) => { - console.log('Limit Order Result: ', JSON.stringify(result, null, 2)); - }) - .catch((err) => { - console.error('Error: ', err); - }); -``` - -See [FuturesClient](./src/FuturesClient.ts) for further information. - -## WebSockets - -HTX supports two types of WebSocket connections: - -1. **WebSocket Subscriptions** - Real-time market data and account updates via the `WebsocketClient` -2. **WebSocket API** - REST-like request/response trading via `WebsocketAPIClient` or `sendWSAPIRequest()` - -### WebSocket Subscriptions (WebsocketClient) - -The unified `WebsocketClient` handles all HTX WebSocket streams with automatic connection management and reconnection. - -Key WebSocket features: - -- Event driven messaging -- Smart WebSocket persistence with automatic reconnection -- Heartbeat mechanisms to detect disconnections -- Automatic resubscription after reconnection -- Support for Spot and Derivatives markets (linear swap, coin swap, delivery) -- Support for both public and private WebSocket streams - -Each connection is tracked using a `WsKey` (see [WS_KEY_MAP](./src/lib/websocket/websocket-util.ts)). Pass the appropriate `WsKey` when subscribing so the client routes your request to the correct endpoint. - -### Public WebSocket Streams - -For public market data, API credentials are not required: - -```javascript -import { WebsocketClient, WS_KEY_MAP } from '@siebly/htx-api'; -// or if you prefer require: -// const { WebsocketClient, WS_KEY_MAP } = require('@siebly/htx-api'); - -// Create WebSocket client for public streams -const wsClient = new WebsocketClient(); - -// Set up event handlers -wsClient.on('open', (data) => { - console.log('WebSocket connected: ', data?.wsKey); -}); - -wsClient.on('message', (data) => { - console.log('Data received: ', JSON.stringify(data, null, 2)); -}); - -wsClient.on('reconnected', (data) => { - console.log('WebSocket reconnected: ', data); -}); - -wsClient.on('exception', (data) => { - console.error('WebSocket error: ', data); -}); - -// Spot - Subscribe to public data streams -wsClient.subscribe( - [ - 'market.btcusdt.kline.1min', - 'market.btcusdt.ticker', - 'market.btcusdt.depth.step0', - 'market.btcusdt.trade.detail', - ], - WS_KEY_MAP.spotPublic, -); - -// Spot feed - high-frequency topics such as BBO and MBP -wsClient.subscribe( - ['market.btcusdt.mbp.5', 'market.btcusdt.trade.detail'], - WS_KEY_MAP.spotFeed, -); - -// Linear swap (USDT-margined) public streams -wsClient.subscribe( - [ - 'market.BTC-USDT.kline.1min', - 'market.BTC-USDT.detail', - 'market.BTC-USDT.trade.detail', - 'market.BTC-USDT.bbo', - ], - WS_KEY_MAP.linearSwapPublic, -); - -// Derivatives index/mark price streams -wsClient.subscribe( - ['market.BTC-USDT.index.1min', 'market.BTC-USDT.mark_price.1min'], - WS_KEY_MAP.derivativesIndex, -); -``` - -### Private WebSocket Streams - -For private account data streams, API credentials are required: - -```javascript -import { WebsocketClient, WS_KEY_MAP } from '@siebly/htx-api'; - -// Create WebSocket client with API credentials for private streams -const wsClient = new WebsocketClient({ - apiKey: 'your-api-key', - apiSecret: 'your-api-secret', -}); - -// Set up event handlers -wsClient.on('open', (data) => { - console.log('Private WebSocket connected: ', data?.wsKey); -}); - -wsClient.on('message', (data) => { - console.log('Private data received: ', JSON.stringify(data, null, 2)); -}); - -wsClient.on('authenticated', (data) => { - console.log('WebSocket authenticated: ', data); -}); - -wsClient.on('response', (data) => { - console.log('WebSocket response: ', data); -}); - -wsClient.on('exception', (data) => { - console.error('WebSocket error: ', data); -}); - -// Spot - Subscribe to private data streams -// Note: SDK automatically handles authentication before subscribing -wsClient.subscribe( - ['accounts.update#1', 'orders#btcusdt', 'trade.clearing#btcusdt#0'], - WS_KEY_MAP.spotPrivateV2, -); - -// Linear swap private streams -wsClient.subscribe( - ['orders.BTC-USDT', 'accounts.BTC-USDT', 'positions.BTC-USDT'], - WS_KEY_MAP.linearSwapPrivate, -); -``` - -For more comprehensive examples, including custom logging and error handling, check the [examples](./examples/Spot/WebSockets) and [examples](./examples/Derivatives/WebSockets) folders. - -### WebSocket API (WebsocketAPIClient) - -Use `WebsocketAPIClient` for typed REST-like trading methods over a persisted WebSocket connection, or call `WebsocketClient.sendWSAPIRequest()` directly for lower-level control. - -Trade connections connect and authenticate lazily on the first request. Optional pre-connect: `client.getWSClient().connectWSAPI(WS_KEY_MAP.spotTrade)`. - -Trade keys: `spotTrade`, `linearSwapTrade`, `coinDeliveryTrade`, `coinSwapTrade`. - -```javascript -import { WebsocketAPIClient, WS_KEY_MAP } from '@siebly/htx-api'; - -const client = new WebsocketAPIClient({ - apiKey: 'your-api-key', - apiSecret: 'your-api-secret', -}); - -// Spot -const order = await client.submitSpotOrder({ - 'account-id': 123456, - symbol: 'btcusdt', - type: 'buy-limit', - amount: '0.001', - price: '20000', - source: 'spot-api', -}); - -// Derivatives -const linearOrder = await client.placeLinearSwapOrder({ - contract_code: 'BTC-USDT', - margin_mode: 'cross', - position_side: 'long', - side: 'buy', - type: 'limit', - time_in_force: 'gtc', - price: '20000', - volume: '1', - reduce_only: 0, -}); -``` - -See [WebsocketAPIClient](./src/WebsocketAPIClient.ts) for all typed methods. Examples: [Spot](./examples/Spot/WebSockets/wsAPI.ts), [Derivatives](./examples/Derivatives/WebSockets/wsAPI.ts), [raw spot](./examples/Spot/WebSockets/wsAPI.RAW.ts), [raw derivatives](./examples/Derivatives/WebSockets/wsAPI.RAW.ts). - ---- - -## Customise Logging - -Pass a custom logger which supports the log methods `trace`, `info` and `error`, or override methods from the default logger as desired. - -```javascript -import { WebsocketClient, DefaultLogger } from '@siebly/htx-api'; - -// E.g. customise logging for only the trace level: -const customLogger = { - ...DefaultLogger, - trace: (...params) => { - // console.log('trace', ...params); - }, - info: (...params) => { - console.log('info', ...params); - }, - error: (...params) => { - console.error('error', ...params); - }, -}; - -const ws = new WebsocketClient( - { - apiKey: 'apiKeyHere', - apiSecret: 'apiSecretHere', - }, - customLogger, -); -``` - -In rare situations, you may want to see the raw HTTP requests being built as well as the API response. These can be enabled by setting the `HTXTRACE` env var to `true`. - -## Browser/Frontend Usage - -The package's ESM entry can be imported directly by modern frontend bundlers. Do not build or copy a separate SDK bundle into your application. - -Browser applications should use the SDK only for public market data. Keep API keys, API secrets, authenticated REST calls, private WebSocket subscriptions, and WebSocket API trading on a trusted backend. - -### React and Vite - -Install and import the package normally; no SDK-specific Vite plugin or Node.js polyfill is required: - -```bash -npm install @siebly/htx-api -``` - -```tsx -import { useEffect, useState } from 'react'; -import { SpotClient, WebsocketClient, WS_KEY_MAP } from '@siebly/htx-api'; - -export function BtcTicker() { - const [ticker, setTicker] = useState(); - - useEffect(() => { - const restClient = new SpotClient(); - const wsClient = new WebsocketClient(); - - restClient.getTicker({ symbol: 'btcusdt' }).then(setTicker); - - const onMessage = (message: unknown) => setTicker(message); - wsClient.on('message', onMessage); - wsClient.subscribe('market.btcusdt.ticker', WS_KEY_MAP.spotPublic); - - return () => { - wsClient.off('message', onMessage); - wsClient.closeAll(); - }; - }, []); - - return
{JSON.stringify(ticker, null, 2)}
; -} -``` - -The cleanup is important during navigation, hot reloads, and React Strict Mode development checks so that an old socket is not left reconnecting in the background. - -### Webpack - -Webpack 5 can consume the same package entry directly: - -```javascript -import { SpotClient, WebsocketClient } from '@siebly/htx-api'; -``` - -Use a normal `target: 'web'` application build. The SDK does not require a checked-in UMD bundle or `resolve.fallback` shims for Node.js core modules. - -Direct `