diff --git a/docs/endpointFunctionList.md b/docs/endpointFunctionList.md index 9c25affb..6fa181ee 100644 --- a/docs/endpointFunctionList.md +++ b/docs/endpointFunctionList.md @@ -49,432 +49,438 @@ This table includes all endpoints from the official Exchange API docs and corres | Function | AUTH | HTTP Method | Endpoint | | -------- | :------: | :------: | -------- | -| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L730) | :closed_lock_with_key: | GET | `/v5/system/status` | -| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L747) | | GET | `/v5/market/time` | -| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L759) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | -| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L772) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | -| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L785) | | GET | `/v5/spread/instrument` | -| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L797) | | GET | `/v5/spread/orderbook` | -| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L807) | | GET | `/v5/spread/tickers` | -| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L818) | | GET | `/v5/spread/recent-trade` | -| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L830) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | -| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L839) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | -| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L852) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | -| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L864) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | -| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L882) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | -| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L901) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | -| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L918) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | -| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L934) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | -| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L954) | | GET | `/v5/market/kline` | -| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L971) | | GET | `/v5/market/mark-price-kline` | -| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L986) | | GET | `/v5/market/index-price-kline` | -| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1001) | | GET | `/v5/market/premium-index-price-kline` | -| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1017) | | GET | `/v5/market/instruments-info` | -| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1031) | | GET | `/v5/market/instrument-summary` | -| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1042) | | GET | `/v5/market/orderbook` | -| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1048) | | GET | `/v5/market/full_orderbook` | -| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1062) | | GET | `/v5/market/rpi_orderbook` | -| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1068) | | GET | `/v5/market/tickers` | -| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1106) | | GET | `/v5/market/funding/history` | -| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1121) | | GET | `/v5/market/recent-trade` | -| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1134) | | GET | `/v5/market/open-interest` | -| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1144) | | GET | `/v5/market/historical-volatility` | -| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1155) | | GET | `/v5/market/insurance` | -| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1166) | | GET | `/v5/market/risk-limit` | -| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1181) | | GET | `/v5/market/delivery-price` | -| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1194) | | GET | `/v5/market/delivery-price` | -| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1210) | | GET | `/v5/market/new-delivery-price` | -| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1226) | | GET | `/v5/market/account-ratio` | -| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1236) | | GET | `/v5/market/index-price-components` | -| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1242) | | GET | `/v5/market/price-limit` | -| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1256) | | GET | `/v5/market/adlAlert` | -| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1269) | | GET | `/v5/market/fee-group-info` | -| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1278) | | GET | `/v5/market/option-base-coins` | -| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1290) | :closed_lock_with_key: | POST | `/v5/order/create` | -| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1296) | :closed_lock_with_key: | POST | `/v5/order/amend` | -| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1302) | :closed_lock_with_key: | POST | `/v5/order/cancel` | -| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1311) | :closed_lock_with_key: | GET | `/v5/order/realtime` | -| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1317) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | -| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1330) | :closed_lock_with_key: | GET | `/v5/order/history` | -| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1342) | :closed_lock_with_key: | GET | `/v5/execution/list` | -| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1360) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | -| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1385) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | -| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1410) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | -| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1432) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | -| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1453) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1471) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | -| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1486) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | -| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1503) | :closed_lock_with_key: | POST | `/v5/strategy/create` | -| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1514) | :closed_lock_with_key: | GET | `/v5/strategy/list` | -| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1525) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | -| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1536) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | -| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1561) | :closed_lock_with_key: | GET | `/v5/position/list` | -| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1573) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | -| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1588) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | -| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1601) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | -| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1615) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | -| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1630) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | -| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1644) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | -| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1659) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | -| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1670) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | -| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1682) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | -| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1694) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | -| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1708) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | -| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1733) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | -| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1744) | :closed_lock_with_key: | GET | `/v5/position/move-history` | -| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1763) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | -| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1783) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | -| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1798) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | -| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1809) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | -| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1823) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | -| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1840) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | -| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1854) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | -| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1875) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | -| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1886) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | -| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1903) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | -| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1914) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | -| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1925) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | -| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1946) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | -| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1971) | :closed_lock_with_key: | POST | `/v5/account/repay` | -| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1980) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | -| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1986) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | -| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1996) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | -| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2005) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | -| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2018) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | -| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2027) | :closed_lock_with_key: | GET | `/v5/account/info` | -| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2040) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | -| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2047) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | -| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2058) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | -| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2069) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | -| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2082) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | -| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2099) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | -| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2112) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | -| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2123) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | -| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2131) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | -| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2140) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | -| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2147) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | -| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2154) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | -| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2164) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | -| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2174) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | -| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2184) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | -| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2204) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | -| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2214) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | -| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2224) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | -| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2236) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | -| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2252) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | -| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2263) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | -| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2276) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | -| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2291) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | -| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2305) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | -| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2320) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | -| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2331) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2345) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | -| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | -| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2368) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | -| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2384) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | -| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2403) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | -| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2423) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | -| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2434) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | -| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2446) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | -| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2459) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | -| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2474) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | -| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2490) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | -| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2505) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | -| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2521) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | -| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2533) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | -| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2551) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2576) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | -| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2596) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | -| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2608) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | -| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2622) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | -| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2632) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | -| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2647) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | -| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2658) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | -| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2667) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | -| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2678) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | -| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2687) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | -| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2699) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | -| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2718) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | -| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2735) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | -| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2749) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | -| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2767) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | -| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2779) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | -| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2788) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | -| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2797) | :closed_lock_with_key: | GET | `/v5/user/submembers` | -| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2815) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | -| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2830) | :closed_lock_with_key: | GET | `/v5/user/query-api` | -| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2837) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | -| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2846) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | -| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2865) | :closed_lock_with_key: | POST | `/v5/user/update-api` | -| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2879) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | -| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2892) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | -| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2907) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | -| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2921) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | -| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2936) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | -| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2948) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | -| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2971) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | -| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2989) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | -| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3005) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | -| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3017) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | -| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3026) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | -| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3038) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | -| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3051) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | -| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3066) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | -| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3079) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | -| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3097) | :closed_lock_with_key: | POST | `/v5/user/agreement` | -| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3114) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | -| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3125) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | -| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3136) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | -| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3146) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | -| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3156) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | -| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3166) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | -| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3176) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | -| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3186) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | -| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3196) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | -| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3204) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | -| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3220) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | -| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3230) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | -| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3240) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | -| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3250) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | -| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3260) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | -| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3270) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | -| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3280) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | -| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3290) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | -| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3300) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | -| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3310) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | -| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3320) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | -| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3330) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | -| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3340) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | -| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3350) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | -| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3360) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | -| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3370) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | -| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3383) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | -| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3402) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | -| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3412) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | -| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3422) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | -| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3432) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | -| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3442) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | -| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3452) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | -| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3462) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | -| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3472) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | -| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3492) | | GET | `/v5/spot-margin-trade/data` | -| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3503) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | -| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3528) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | -| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3540) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | -| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3551) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3559) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | -| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3570) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | -| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3577) | :closed_lock_with_key: | POST | `/v5/account/borrow` | -| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3592) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | -| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3601) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | -| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3612) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | -| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3623) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | -| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3642) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | -| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3655) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | -| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3671) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | -| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3683) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | -| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3692) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | -| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3701) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | -| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3718) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | -| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3735) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | -| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3747) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | -| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3753) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | -| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3762) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | -| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3780) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | -| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3797) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | -| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3814) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | -| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3832) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | -| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3856) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | -| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3867) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | -| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3882) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | -| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3911) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | -| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3940) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | -| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3960) | | GET | `/v5/crypto-loan/collateral-data` | -| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3977) | | GET | `/v5/crypto-loan/loanable-data` | -| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3995) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | -| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4015) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | -| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4036) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | -| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4052) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | -| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4073) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | -| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4093) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | -| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4112) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | -| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4131) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | -| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4155) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | -| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4176) | | GET | `/v5/crypto-loan-common/loanable-data` | -| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4188) | | GET | `/v5/crypto-loan-common/collateral-data` | -| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4198) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | -| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4217) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | -| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4227) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | -| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4238) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | -| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4253) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | -| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4270) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | -| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4281) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | -| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4291) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4305) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | -| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4317) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | -| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4330) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | -| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4344) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | -| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4364) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | -| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4377) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | -| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4390) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | -| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4403) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | -| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4413) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | -| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4427) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | -| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4440) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | -| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4458) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | -| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4476) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | -| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4489) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | -| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4503) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | -| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4514) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | -| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4527) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | -| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4544) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | -| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4557) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | -| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4566) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | -| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4581) | | GET | `/v5/ins-loan/product-infos` | -| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4593) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | -| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4602) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | -| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4612) | | GET | `/v5/ins-loan/ensure-tokens` | -| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4621) | | GET | `/v5/ins-loan/ensure-tokens-convert` | -| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4630) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | -| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4642) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | -| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4654) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | -| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4663) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | -| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4678) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | -| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4698) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | -| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4719) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | -| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4732) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | -| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4748) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | -| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4763) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | -| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4775) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | -| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4787) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | -| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4804) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | -| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4823) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | -| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4841) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | -| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4861) | | GET | `/v5/earn/product` | -| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4872) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | -| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4883) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | -| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4893) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | -| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4903) | | GET | `/v5/earn/rwa/product` | -| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4913) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | -| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4922) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | -| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4931) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | -| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4941) | | GET | `/v5/earn/rwa/nav-chart` | -| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4952) | | GET | `/v5/earn/hold-to-earn/product` | -| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4963) | | GET | `/v5/earn/advance/product` | -| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4974) | | GET | `/v5/earn/liquidity-mining/product` | -| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4987) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | -| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4998) | | GET | `/v5/earn/fixed-term/product` | -| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5010) | | GET | `/v5/earn/advance/product-extra-info` | -| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5021) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | -| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5032) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | -| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5043) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | -| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5054) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | -| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5065) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | -| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5076) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | -| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5087) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | -| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5098) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | -| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5114) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | -| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5133) | :closed_lock_with_key: | GET | `/v5/earn/order` | -| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5151) | :closed_lock_with_key: | GET | `/v5/earn/position` | -| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5164) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | -| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5177) | :closed_lock_with_key: | GET | `/v5/earn/yield` | -| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5191) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | -| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5202) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | -| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5216) | | GET | `/v5/earn/apr-history` | -| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5226) | | GET | `/v5/earn/token/product` | -| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5235) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | -| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5244) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | -| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5256) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | -| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5265) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | -| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5277) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | -| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5289) | | GET | `/v5/earn/token/history-apr` | -| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5304) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | -| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5313) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | -| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5322) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | -| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5331) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | -| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5340) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | -| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5349) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | -| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5358) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | -| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5367) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | -| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5376) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | -| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5385) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | -| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5394) | | GET | `/v5/earn/pwm/customize-plan/product` | -| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5403) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | -| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5418) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | -| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5427) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | -| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5436) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | -| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5445) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | -| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5459) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | -| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5471) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | -| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5485) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | -| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5494) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | -| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5503) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | -| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5515) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | -| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5524) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | -| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5539) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | -| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5548) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | -| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5555) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | -| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5564) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | -| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5571) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | -| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5580) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | -| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5596) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | -| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5607) | :closed_lock_with_key: | GET | `/v5/rfq/config` | -| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5616) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | -| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5626) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | -| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5635) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | -| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5646) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | -| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5657) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | -| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5667) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | -| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5681) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | -| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5693) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | -| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5707) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | -| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5722) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | -| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5735) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | -| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5748) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | -| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5764) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | -| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5770) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | -| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5795) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | -| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5812) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | -| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5821) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | -| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5830) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | -| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5844) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | -| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5854) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | -| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5863) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | -| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5878) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | -| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5888) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | -| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5897) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | -| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5906) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | -| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5915) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | -| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5927) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | -| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5939) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | -| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5954) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | -| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5964) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | -| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6000) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | -| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6012) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | -| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6021) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | -| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6035) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | -| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6042) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | -| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6051) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | -| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6071) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | -| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6100) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | -| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6119) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | -| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6138) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | -| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6161) | | GET | `/v5/spot-x/launchpool/project/list` | -| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6167) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | -| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6173) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | -| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6179) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | -| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6185) | | GET | `/v5/spot-x/puzzle/project/list` | -| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6191) | | GET | `/v5/spot-x/token-splash/project/list` | -| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6197) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | -| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6220) | | GET | `/v5/event/instruments-info` | -| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6231) | | GET | `/v5/event/orderbook` | -| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6242) | :closed_lock_with_key: | GET | `/v5/event/order-list` | -| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6253) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | -| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6264) | :closed_lock_with_key: | GET | `/v5/event/positions` | -| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6275) | :closed_lock_with_key: | GET | `/v5/event/trades` | -| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6286) | :closed_lock_with_key: | GET | `/v5/event/settlements` | -| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6297) | :closed_lock_with_key: | POST | `/v5/event/quotes` | -| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6308) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [getSystemStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L739) | :closed_lock_with_key: | GET | `/v5/system/status` | +| [getServerTime()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L756) | | GET | `/v5/market/time` | +| [requestDemoTradingFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L768) | :closed_lock_with_key: | POST | `/v5/account/demo-apply-money` | +| [createDemoAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L781) | :closed_lock_with_key: | POST | `/v5/user/create-demo-member` | +| [getSpreadInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L794) | | GET | `/v5/spread/instrument` | +| [getSpreadOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L806) | | GET | `/v5/spread/orderbook` | +| [getSpreadTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L816) | | GET | `/v5/spread/tickers` | +| [getSpreadRecentTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L827) | | GET | `/v5/spread/recent-trade` | +| [getSpreadMaxQty()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L839) | :closed_lock_with_key: | GET | `/v5/spread/max-qty` | +| [submitSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L848) | :closed_lock_with_key: | POST | `/v5/spread/order/create` | +| [amendSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L861) | :closed_lock_with_key: | POST | `/v5/spread/order/amend` | +| [cancelSpreadOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L873) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel` | +| [cancelAllSpreadOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L891) | :closed_lock_with_key: | POST | `/v5/spread/order/cancel-all` | +| [getSpreadOpenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L910) | :closed_lock_with_key: | GET | `/v5/spread/order/realtime` | +| [getSpreadOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L932) | :closed_lock_with_key: | GET | `/v5/spread/order/history` | +| [getSpreadTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L948) | :closed_lock_with_key: | GET | `/v5/spread/execution/list` | +| [getKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L968) | | GET | `/v5/market/kline` | +| [getMarkPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L985) | | GET | `/v5/market/mark-price-kline` | +| [getIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1000) | | GET | `/v5/market/index-price-kline` | +| [getPremiumIndexPriceKline()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1015) | | GET | `/v5/market/premium-index-price-kline` | +| [getInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1031) | | GET | `/v5/market/instruments-info` | +| [getInstrumentSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1045) | | GET | `/v5/market/instrument-summary` | +| [getOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1056) | | GET | `/v5/market/orderbook` | +| [getFullDepthOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1062) | | GET | `/v5/market/full_orderbook` | +| [getRPIOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1076) | | GET | `/v5/market/rpi_orderbook` | +| [getTickers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1082) | | GET | `/v5/market/tickers` | +| [getFundingRateHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1120) | | GET | `/v5/market/funding/history` | +| [getPublicTradingHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1135) | | GET | `/v5/market/recent-trade` | +| [getOpenInterest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1148) | | GET | `/v5/market/open-interest` | +| [getHistoricalVolatility()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1158) | | GET | `/v5/market/historical-volatility` | +| [getInsurance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1169) | | GET | `/v5/market/insurance` | +| [getRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1180) | | GET | `/v5/market/risk-limit` | +| [getOptionDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1195) | | GET | `/v5/market/delivery-price` | +| [getDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1208) | | GET | `/v5/market/delivery-price` | +| [getNewDeliveryPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1224) | | GET | `/v5/market/new-delivery-price` | +| [getLongShortRatio()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1240) | | GET | `/v5/market/account-ratio` | +| [getIndexPriceComponents()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1250) | | GET | `/v5/market/index-price-components` | +| [getOrderPriceLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1256) | | GET | `/v5/market/price-limit` | +| [getADLAlert()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1270) | | GET | `/v5/market/adlAlert` | +| [getFeeGroupStructure()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1283) | | GET | `/v5/market/fee-group-info` | +| [getOptionBaseCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1292) | | GET | `/v5/market/option-base-coins` | +| [getCorporateActions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1298) | | GET | `/v5/market/corporate-action` | +| [submitOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1313) | :closed_lock_with_key: | POST | `/v5/order/create` | +| [amendOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1319) | :closed_lock_with_key: | POST | `/v5/order/amend` | +| [cancelOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1325) | :closed_lock_with_key: | POST | `/v5/order/cancel` | +| [getActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1334) | :closed_lock_with_key: | GET | `/v5/order/realtime` | +| [cancelAllOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1340) | :closed_lock_with_key: | POST | `/v5/order/cancel-all` | +| [getHistoricOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1358) | :closed_lock_with_key: | GET | `/v5/order/history` | +| [getExecutionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1370) | :closed_lock_with_key: | GET | `/v5/execution/list` | +| [batchSubmitOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1388) | :closed_lock_with_key: | POST | `/v5/order/create-batch` | +| [batchAmendOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1413) | :closed_lock_with_key: | POST | `/v5/order/amend-batch` | +| [batchCancelOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1438) | :closed_lock_with_key: | POST | `/v5/order/cancel-batch` | +| [getSpotBorrowCheck()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1460) | :closed_lock_with_key: | GET | `/v5/order/spot-borrow-check` | +| [setDisconnectCancelAllWindow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1481) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [setDisconnectCancelAllWindowV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1499) | :closed_lock_with_key: | POST | `/v5/order/disconnected-cancel-all` | +| [preCheckOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1514) | :closed_lock_with_key: | POST | `/v5/order/pre-check` | +| [createStrategyOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1531) | :closed_lock_with_key: | POST | `/v5/strategy/create` | +| [getStrategyList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1542) | :closed_lock_with_key: | GET | `/v5/strategy/list` | +| [getStrategyOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1553) | :closed_lock_with_key: | GET | `/v5/strategy/order-list` | +| [stopStrategy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1564) | :closed_lock_with_key: | POST | `/v5/strategy/stop` | +| [getPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1589) | :closed_lock_with_key: | GET | `/v5/position/list` | +| [getFuturesLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1601) | :closed_lock_with_key: | GET | `/v5/position/symbol-info` | +| [setLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1616) | :closed_lock_with_key: | POST | `/v5/position/set-leverage` | +| [switchIsolatedMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1629) | :closed_lock_with_key: | POST | `/v5/position/switch-isolated` | +| [setTPSLMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1643) | :closed_lock_with_key: | POST | `/v5/position/set-tpsl-mode` | +| [switchPositionMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1658) | :closed_lock_with_key: | POST | `/v5/position/switch-mode` | +| [setRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1672) | :closed_lock_with_key: | POST | `/v5/position/set-risk-limit` | +| [setTradingStop()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1687) | :closed_lock_with_key: | POST | `/v5/position/trading-stop` | +| [setAutoAddMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1698) | :closed_lock_with_key: | POST | `/v5/position/set-auto-add-margin` | +| [addOrReduceMargin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1710) | :closed_lock_with_key: | POST | `/v5/position/add-margin` | +| [getClosedPnL()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1722) | :closed_lock_with_key: | GET | `/v5/position/closed-pnl` | +| [getClosedOptionsPositions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1736) | :closed_lock_with_key: | GET | `/v5/position/get-closed-positions` | +| [movePosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1761) | :closed_lock_with_key: | POST | `/v5/position/move-positions` | +| [getMovePositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1772) | :closed_lock_with_key: | GET | `/v5/position/move-history` | +| [confirmNewRiskLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1791) | :closed_lock_with_key: | POST | `/v5/position/confirm-pending-mmr` | +| [getPreUpgradeOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1811) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/order/history` | +| [getPreUpgradeTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1826) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/execution/list` | +| [getPreUpgradeClosedPnl()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1837) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/position/closed-pnl` | +| [getPreUpgradeTransactions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1851) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/account/transaction-log` | +| [getPreUpgradeOptionDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1868) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/delivery-record` | +| [getPreUpgradeUSDCSessionSettlements()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1882) | :closed_lock_with_key: | GET | `/v5/pre-upgrade/asset/settlement-record` | +| [getWalletBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1903) | :closed_lock_with_key: | GET | `/v5/account/wallet-balance` | +| [getTransferableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1914) | :closed_lock_with_key: | GET | `/v5/account/withdrawal` | +| [getAccountInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1931) | :closed_lock_with_key: | GET | `/v5/account/instruments-info` | +| [upgradeToUnifiedAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1942) | :closed_lock_with_key: | POST | `/v5/account/upgrade-to-uta` | +| [getBorrowHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1953) | :closed_lock_with_key: | GET | `/v5/account/borrow-history` | +| [repayLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1974) | :closed_lock_with_key: | POST | `/v5/account/quick-repayment` | +| [manualRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L1999) | :closed_lock_with_key: | POST | `/v5/account/repay` | +| [setCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2008) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch` | +| [batchSetCollateralCoin()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2014) | :closed_lock_with_key: | POST | `/v5/account/set-collateral-switch-batch` | +| [getCollateralInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2024) | :closed_lock_with_key: | GET | `/v5/account/collateral-info` | +| [getCoinGreeks()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2033) | :closed_lock_with_key: | GET | `/v5/asset/coin-greeks` | +| [getFeeRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2046) | :closed_lock_with_key: | GET | `/v5/account/fee-rate` | +| [getAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2055) | :closed_lock_with_key: | GET | `/v5/account/info` | +| [getDCPInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2068) | :closed_lock_with_key: | GET | `/v5/account/query-dcp-info` | +| [getTransactionLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2075) | :closed_lock_with_key: | GET | `/v5/account/transaction-log` | +| [getClassicTransactionLogs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2086) | :closed_lock_with_key: | GET | `/v5/account/contract-transaction-log` | +| [getSMPGroup()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2097) | :closed_lock_with_key: | GET | `/v5/account/smp-group` | +| [setMarginMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2110) | :closed_lock_with_key: | POST | `/v5/account/set-margin-mode` | +| [setSpotHedging()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2127) | :closed_lock_with_key: | POST | `/v5/account/set-hedging-mode` | +| [setLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2140) | :closed_lock_with_key: | POST | `/v5/account/set-limit-px-action` | +| [getLimitPriceAction()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2151) | :closed_lock_with_key: | GET | `/v5/account/user-setting-config` | +| [setDeltaNeutralMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2159) | :closed_lock_with_key: | POST | `/v5/account/set-delta-mode` | +| [setMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2168) | :closed_lock_with_key: | POST | `/v5/account/mmp-modify` | +| [resetMMP()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2175) | :closed_lock_with_key: | POST | `/v5/account/mmp-reset` | +| [getMMPState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2182) | :closed_lock_with_key: | GET | `/v5/account/mmp-state` | +| [getOptionAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2192) | :closed_lock_with_key: | GET | `/v5/account/option-asset-info` | +| [getPayInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2202) | :closed_lock_with_key: | GET | `/v5/account/pay-info` | +| [getTradeInfoForAnalysis()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2212) | :closed_lock_with_key: | GET | `/v5/account/trade-info-for-analysis` | +| [getAssetOverview()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2232) | :closed_lock_with_key: | GET | `/v5/asset/asset-overview` | +| [getPortfolioMarginInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2242) | :closed_lock_with_key: | GET | `/v5/asset/portfolio-margin` | +| [getTotalMembersAssets()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2252) | :closed_lock_with_key: | GET | `/v5/asset/total-members-assets` | +| [getFundingAccountTransactionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2264) | :closed_lock_with_key: | GET | `/v5/asset/fundinghistory` | +| [getDeliveryRecord()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2280) | :closed_lock_with_key: | GET | `/v5/asset/delivery-record` | +| [getSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2291) | :closed_lock_with_key: | GET | `/v5/asset/settlement-record` | +| [getCoinExchangeRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2304) | :closed_lock_with_key: | GET | `/v5/asset/exchange/order-record` | +| [getCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2319) | :closed_lock_with_key: | GET | `/v5/asset/coin/query-info` | +| [getSubUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2333) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-sub-member-list` | +| [getAssetInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2348) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-asset-info` | +| [getAllCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2359) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getCoinBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2373) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coin-balance` | +| [getWithdrawableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2387) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/withdrawable-amount` | +| [getTransferableCoinList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2396) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-transfer-coin-list` | +| [createInternalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2412) | :closed_lock_with_key: | POST | `/v5/asset/transfer/inter-transfer` | +| [getInternalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2431) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-inter-transfer-list` | +| [enableUniversalTransferForSubUIDs()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2451) | :closed_lock_with_key: | POST | `/v5/asset/transfer/save-transfer-sub-member` | +| [createUniversalTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2462) | :closed_lock_with_key: | POST | `/v5/asset/transfer/universal-transfer` | +| [getUniversalTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2474) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-universal-transfer-list` | +| [getAllowedDepositCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2487) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-allowed-list` | +| [setDepositAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2502) | :closed_lock_with_key: | POST | `/v5/asset/deposit/deposit-to-account` | +| [getDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2518) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-record` | +| [getSubAccountDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2533) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-record` | +| [getInternalDepositRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2549) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-internal-record` | +| [getMasterDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2561) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-address` | +| [getSubDepositAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2579) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [querySubMemberAddress()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2604) | :closed_lock_with_key: | GET | `/v5/asset/deposit/query-sub-member-address` | +| [getWithdrawalRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2624) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-record` | +| [getWithdrawalAddressList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2636) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/query-address` | +| [getExchangeEntities()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2650) | :closed_lock_with_key: | GET | `/v5/asset/withdraw/vasp/list` | +| [submitDepositOriginatorInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2660) | :closed_lock_with_key: | POST | `/v5/asset/travel-rule/deposit/submit` | +| [submitWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2675) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/create` | +| [cancelWithdrawal()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2686) | :closed_lock_with_key: | POST | `/v5/asset/withdraw/cancel` | +| [getConvertCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2695) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-coin-list` | +| [requestConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2706) | :closed_lock_with_key: | POST | `/v5/asset/exchange/quote-apply` | +| [confirmConvertQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2715) | :closed_lock_with_key: | POST | `/v5/asset/exchange/convert-execute` | +| [getConvertStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2727) | :closed_lock_with_key: | GET | `/v5/asset/exchange/convert-result-query` | +| [getConvertHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2746) | :closed_lock_with_key: | GET | `/v5/asset/exchange/query-convert-history` | +| [getSmallBalanceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2763) | :closed_lock_with_key: | GET | `/v5/asset/covert/small-balance-list` | +| [getFiatTradingPairList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2777) | :closed_lock_with_key: | GET | `/v5/fiat/query-coin-list` | +| [createSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2795) | :closed_lock_with_key: | POST | `/v5/user/create-sub-member` | +| [createSubUIDAPIKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2807) | :closed_lock_with_key: | POST | `/v5/user/create-sub-api` | +| [getSubUIDList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2816) | :closed_lock_with_key: | GET | `/v5/user/query-sub-members` | +| [getSubUIDListUnlimited()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2825) | :closed_lock_with_key: | GET | `/v5/user/submembers` | +| [setSubUIDFrozenState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2843) | :closed_lock_with_key: | POST | `/v5/user/frozen-sub-member` | +| [getQueryApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2858) | :closed_lock_with_key: | GET | `/v5/user/query-api` | +| [getSubAccountAllApiKeys()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2865) | :closed_lock_with_key: | GET | `/v5/user/sub-apikeys` | +| [getUIDWalletType()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2874) | :closed_lock_with_key: | GET | `/v5/user/get-member-type` | +| [updateMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2893) | :closed_lock_with_key: | POST | `/v5/user/update-api` | +| [updateSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2907) | :closed_lock_with_key: | POST | `/v5/user/update-sub-api` | +| [deleteSubMember()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2920) | :closed_lock_with_key: | POST | `/v5/user/del-submember` | +| [deleteMasterApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2935) | :closed_lock_with_key: | POST | `/v5/user/delete-api` | +| [deleteSubApiKey()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2949) | :closed_lock_with_key: | POST | `/v5/user/delete-sub-api` | +| [createTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2964) | :closed_lock_with_key: | POST | `/v5/fht/compliance/tax/private/batch_create` | +| [getTaxBatchExport()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2976) | :closed_lock_with_key: | GET | `/v5/fht/compliance/tax/private/batch_query` | +| [getAffiliateUserList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L2999) | :closed_lock_with_key: | GET | `/v5/affiliate/aff-user-list` | +| [getAffiliateSubAffiliateList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3017) | :closed_lock_with_key: | GET | `/v5/affiliate/affiliate-sub-list` | +| [getAffiliateUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3033) | :closed_lock_with_key: | GET | `/v5/user/aff-customer-info` | +| [getFriendReferrals()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3045) | :closed_lock_with_key: | GET | `/v5/user/invitation/referrals` | +| [getReferralCode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3054) | :closed_lock_with_key: | GET | `/v5/user/invitation/code` | +| [getReferralCommissionRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3066) | :closed_lock_with_key: | POST | `/v5/referral/commission/records` | +| [getReferralCampaignRewards()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3079) | :closed_lock_with_key: | POST | `/v5/referral/campaign/rewards` | +| [getReferralUserIdentityProfile()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3094) | :closed_lock_with_key: | POST | `/v5/referral/user/identity-profile` | +| [getReferralUserInvitations()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3107) | :closed_lock_with_key: | POST | `/v5/referral/user/invitations` | +| [signAgreement()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3125) | :closed_lock_with_key: | POST | `/v5/user/agreement` | +| [getAlphaTradeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3142) | :closed_lock_with_key: | POST | `/v5/alpha/trade/quote` | +| [executeAlphaTradePurchase()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3153) | :closed_lock_with_key: | POST | `/v5/alpha/trade/purchase` | +| [executeAlphaTradeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3164) | :closed_lock_with_key: | POST | `/v5/alpha/trade/redeem` | +| [getAlphaPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3174) | :closed_lock_with_key: | POST | `/v5/alpha/trade/pay-token-list` | +| [getAlphaTradeOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3184) | :closed_lock_with_key: | POST | `/v5/alpha/trade/order-list` | +| [getAlphaBizTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3194) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-list` | +| [getAlphaBizTokenPriceList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3204) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-price-list` | +| [getAlphaBizTokenDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3214) | :closed_lock_with_key: | POST | `/v5/alpha/trade/biz-token-details` | +| [getAlphaAssetList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3224) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-list` | +| [getAlphaAssetDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3232) | :closed_lock_with_key: | POST | `/v5/alpha/trade/asset-detail` | +| [getAlphaPredictionEngineStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3248) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/engine-status` | +| [getAlphaPredictionPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3258) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/pay-token-list` | +| [getAlphaPredictionEventDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3268) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/event-detail` | +| [getAlphaPredictionOrderEstimate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3278) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-estimate` | +| [executeAlphaPredictionBuy()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3288) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/buy` | +| [executeAlphaPredictionSell()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3298) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sell` | +| [getAlphaPredictionOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3308) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-list` | +| [getAlphaPredictionOrderBook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3318) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/order-book` | +| [getAlphaPredictionTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3328) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/token-price` | +| [getAlphaPredictionPriceHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3338) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/price-history` | +| [getAlphaPredictionPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3348) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-list` | +| [getAlphaPredictionPositionHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3358) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/position-history` | +| [getAlphaPredictionPortfolioSummary()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3368) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/portfolio-summary` | +| [getAlphaPredictionSideMarketList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3378) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/side-market-list` | +| [getAlphaPredictionSportsMatchList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3388) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/match-list` | +| [getAlphaPredictionSportsTimelineStages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3398) | :closed_lock_with_key: | GET | `/v5/alpha/prediction/sports/timeline-stages` | +| [getAlphaPredictionSportsGroupStageDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3411) | :closed_lock_with_key: | POST | `/v5/alpha/prediction/sports/group-stage-detail` | +| [getAlphaLPPoolList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3430) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-list` | +| [getAlphaLPPoolInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3440) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pool-info` | +| [executeAlphaLPStake()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3450) | :closed_lock_with_key: | POST | `/v5/alpha/lp/stake` | +| [executeAlphaLPRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3460) | :closed_lock_with_key: | POST | `/v5/alpha/lp/redeem` | +| [getAlphaLPOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3470) | :closed_lock_with_key: | POST | `/v5/alpha/lp/order-list` | +| [getAlphaLPPayTokenList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3480) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-list` | +| [getAlphaLPPayTokenPrice()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3490) | :closed_lock_with_key: | POST | `/v5/alpha/lp/pay-token-price` | +| [getAlphaLPPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3500) | :closed_lock_with_key: | POST | `/v5/alpha/lp/position-list` | +| [getVIPMarginData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3520) | | GET | `/v5/spot-margin-trade/data` | +| [getHistoricalInterestRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3531) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/interest-rate-history` | +| [getSpotMarginCurrencyData()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3556) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/currency-data` | +| [toggleSpotMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3568) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/switch-mode` | +| [setSpotMarginLeverage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3579) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [setSpotMarginLeverageV2()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3587) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-leverage` | +| [getSpotMarginState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3598) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/state` | +| [manualBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3605) | :closed_lock_with_key: | POST | `/v5/account/borrow` | +| [getMaxBorrowableAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3620) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/max-borrowable` | +| [getPositionTiers()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3629) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/position-tiers` | +| [getCoinState()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3640) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/coinstate` | +| [getAvailableAmountToRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3651) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/repayment-available-amount` | +| [manualRepayWithoutConversion()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3670) | :closed_lock_with_key: | POST | `/v5/account/no-convert-repay` | +| [getAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3683) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-auto-repay-mode` | +| [setAutoRepayMode()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3701) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-auto-repay-mode` | +| [getTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3716) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/get-trade-auto-repay` | +| [setTradeAutoRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3727) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/set-trade-auto-repay` | +| [getSpotMarginLiability()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3739) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/liability` | +| [submitFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3748) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow` | +| [getFixedRateBorrowOrderInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3757) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-info` | +| [getFixedRateBorrowContractInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3774) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-contract-info` | +| [getFixedRateBorrowOrderQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3791) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-order-quote` | +| [renewFixedRateBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3803) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-renew` | +| [getFixedRateBorrowInterestAccrued()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3809) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixedborrow-interest-accrued` | +| [cancelFixedRateBorrowOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3823) | :closed_lock_with_key: | POST | `/v5/spot-margin-trade/fixedborrow-order-cancel` | +| [getFlexibleAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3832) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/flexible-available-inventory` | +| [getFixedRateAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3841) | :closed_lock_with_key: | GET | `/v5/spot-margin-trade/fixed-available-inventory` | +| [getSpotMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3859) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/pledge-token` | +| [getSpotMarginBorrowableCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3876) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/borrow-token` | +| [getSpotMarginInterestAndQuota()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3893) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/loan-info` | +| [getSpotMarginLoanAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3911) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/account` | +| [spotMarginBorrow()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3935) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/loan` | +| [spotMarginRepay()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3946) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/repay` | +| [getSpotMarginBorrowOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3961) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/orders` | +| [getSpotMarginRepaymentOrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L3990) | :closed_lock_with_key: | GET | `/v5/spot-cross-margin-trade/repay-history` | +| [toggleSpotCrossMarginTrade()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4019) | :closed_lock_with_key: | POST | `/v5/spot-cross-margin-trade/switch` | +| [getCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4039) | | GET | `/v5/crypto-loan/collateral-data` | +| [getBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4056) | | GET | `/v5/crypto-loan/loanable-data` | +| [getAccountBorrowCollateralLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4074) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrowable-collateralisable-number` | +| [borrowCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4094) | :closed_lock_with_key: | POST | `/v5/crypto-loan/borrow` | +| [repayCryptoLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4115) | :closed_lock_with_key: | POST | `/v5/crypto-loan/repay` | +| [getUnpaidLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4131) | :closed_lock_with_key: | GET | `/v5/crypto-loan/ongoing-orders` | +| [getRepaymentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4152) | :closed_lock_with_key: | GET | `/v5/crypto-loan/repayment-history` | +| [getCompletedLoanOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4172) | :closed_lock_with_key: | GET | `/v5/crypto-loan/borrow-history` | +| [getMaxAllowedReductionCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4191) | :closed_lock_with_key: | GET | `/v5/crypto-loan/max-collateral-amount` | +| [adjustCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4210) | :closed_lock_with_key: | POST | `/v5/crypto-loan/adjust-ltv` | +| [getLoanLTVAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4234) | :closed_lock_with_key: | GET | `/v5/crypto-loan/adjustment-history` | +| [getLoanBorrowableCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4255) | | GET | `/v5/crypto-loan-common/loanable-data` | +| [getLoanCollateralCoins()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4267) | | GET | `/v5/crypto-loan-common/collateral-data` | +| [getMaxCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4277) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/max-collateral-amount` | +| [getMaxLoanAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4296) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/max-loan` | +| [updateCollateralAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4306) | :closed_lock_with_key: | POST | `/v5/crypto-loan-common/adjust-ltv` | +| [getCollateralAdjustmentHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4317) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/adjustment-history` | +| [getCryptoLoanPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4332) | :closed_lock_with_key: | GET | `/v5/crypto-loan-common/position` | +| [borrowFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4349) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/borrow` | +| [repayFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4360) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay` | +| [repayCollateralFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4370) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getOngoingFlexibleLoans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4384) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/ongoing-coin` | +| [getBorrowHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4396) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/borrow-history` | +| [getRepaymentHistoryFlexible()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4409) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/repayment-history` | +| [getFlexibleLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4423) | :closed_lock_with_key: | GET | `/v5/crypto-loan-flexible/available-inventory` | +| [getSupplyOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4443) | | GET | `/v5/crypto-loan-fixed/supply-order-quote` | +| [getBorrowOrderQuoteFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4456) | | GET | `/v5/crypto-loan-fixed/borrow-order-quote` | +| [createBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4469) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow` | +| [createSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4482) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply` | +| [cancelBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4492) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/borrow-order-cancel` | +| [cancelSupplyOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4506) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/supply-order-cancel` | +| [getBorrowContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4519) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-contract-info` | +| [getSupplyContractInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4537) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-contract-info` | +| [getBorrowOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4555) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/borrow-order-info` | +| [getSupplyOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4568) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/supply-order-info` | +| [repayFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4582) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/fully-repay` | +| [repayCollateralFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4593) | :closed_lock_with_key: | POST | `/v5/crypto-loan-flexible/repay-collateral` | +| [getRepaymentHistoryFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4606) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/repayment-history` | +| [renewBorrowOrderFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4623) | :closed_lock_with_key: | POST | `/v5/crypto-loan-fixed/renew` | +| [getRenewOrderInfoFixed()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4636) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/renew-info` | +| [getFixedLoanAvailableInventory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4645) | :closed_lock_with_key: | GET | `/v5/crypto-loan-fixed/available-inventory` | +| [getInstitutionalLendingProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4660) | | GET | `/v5/ins-loan/product-infos` | +| [getInstitutionalLendingCoinDeltaAmount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4672) | :closed_lock_with_key: | GET | `/v5/ins-loan/coin-delta-amount` | +| [getInstitutionalLendingDelayLiquidationStatus()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4681) | :closed_lock_with_key: | GET | `/v5/ins-loan/delay-liq-status` | +| [getInstitutionalLendingMarginCoinInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4691) | | GET | `/v5/ins-loan/ensure-tokens` | +| [getInstitutionalLendingMarginCoinInfoWithConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4700) | | GET | `/v5/ins-loan/ensure-tokens-convert` | +| [getInstitutionalLendingLoanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4709) | :closed_lock_with_key: | GET | `/v5/ins-loan/loan-order` | +| [getInstitutionalLendingRepayOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4721) | :closed_lock_with_key: | GET | `/v5/ins-loan/repaid-history` | +| [getInstitutionalLendingLTV()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4733) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv` | +| [getInstitutionalLendingLTVWithLadderConversionRate()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4742) | :closed_lock_with_key: | GET | `/v5/ins-loan/ltv-convert` | +| [bindOrUnbindUID()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4757) | :closed_lock_with_key: | POST | `/v5/ins-loan/association-uid` | +| [repayInstitutionalLoan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4777) | :closed_lock_with_key: | POST | `/v5/ins-loan/repay-loan` | +| [getExchangeBrokerEarnings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4798) | :closed_lock_with_key: | GET | `/v5/broker/earnings-info` | +| [getExchangeBrokerAccountInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4811) | :closed_lock_with_key: | GET | `/v5/broker/account-info` | +| [getBrokerSubAccountDeposits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4827) | :closed_lock_with_key: | GET | `/v5/broker/asset/query-sub-member-deposit-record` | +| [getBrokerVoucherSpec()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4842) | :closed_lock_with_key: | POST | `/v5/broker/award/info` | +| [issueBrokerVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4854) | :closed_lock_with_key: | POST | `/v5/broker/award/distribute-award` | +| [getBrokerIssuedVoucher()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4866) | :closed_lock_with_key: | POST | `/v5/broker/award/distribution-record` | +| [setBrokerRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4883) | :closed_lock_with_key: | POST | `/v5/broker/apilimit/set` | +| [getBrokerRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4902) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-cap` | +| [getAllBrokerRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4920) | :closed_lock_with_key: | GET | `/v5/broker/apilimit/query-all` | +| [getEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4940) | | GET | `/v5/earn/product` | +| [getFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4951) | :closed_lock_with_key: | GET | `/v5/earn/flexible-saving/auto-savings` | +| [setFlexibleSavingAutoSavings()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4962) | :closed_lock_with_key: | POST | `/v5/earn/flexible-saving/auto-savings` | +| [getEarnCouponList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4972) | :closed_lock_with_key: | GET | `/v5/earn/coupons` | +| [getRWAProductList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4982) | | GET | `/v5/earn/rwa/product` | +| [placeRWAOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L4992) | :closed_lock_with_key: | POST | `/v5/earn/rwa/place-order` | +| [getRWAPositionList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5001) | :closed_lock_with_key: | GET | `/v5/earn/rwa/position` | +| [getRWAOrderList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5010) | :closed_lock_with_key: | GET | `/v5/earn/rwa/order` | +| [getRWANavChart()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5020) | | GET | `/v5/earn/rwa/nav-chart` | +| [getHoldToEarnAirdropProducts()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5031) | | GET | `/v5/earn/hold-to-earn/product` | +| [getAdvanceEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5042) | | GET | `/v5/earn/advance/product` | +| [getLiquidityMiningProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5053) | | GET | `/v5/earn/liquidity-mining/product` | +| [reinvestLiquidityMining()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5066) | :closed_lock_with_key: | POST | `/v5/earn/liquidity-mining/reinvest` | +| [getFixedTermEarnProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5077) | | GET | `/v5/earn/fixed-term/product` | +| [getAdvanceEarnProductExtraInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5089) | | GET | `/v5/earn/advance/product-extra-info` | +| [submitAdvanceEarnPlaceOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5100) | :closed_lock_with_key: | POST | `/v5/earn/advance/place-order` | +| [getAdvanceEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5111) | :closed_lock_with_key: | GET | `/v5/earn/advance/position` | +| [getAdvanceEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5122) | :closed_lock_with_key: | GET | `/v5/earn/advance/order` | +| [submitFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5133) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/place-order` | +| [redeemFixedTermEarn()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5144) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/redeem` | +| [getFixedTermEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5155) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/position` | +| [getFixedTermEarnOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5166) | :closed_lock_with_key: | GET | `/v5/earn/fixed-term/order` | +| [setFixedTermEarnAutoInvest()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5177) | :closed_lock_with_key: | POST | `/v5/earn/fixed-term/position/auto-invest` | +| [submitStakeRedeem()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5193) | :closed_lock_with_key: | POST | `/v5/earn/place-order` | +| [getEarnOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5212) | :closed_lock_with_key: | GET | `/v5/earn/order` | +| [getEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5230) | :closed_lock_with_key: | GET | `/v5/earn/position` | +| [modifyEarnPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5243) | :closed_lock_with_key: | POST | `/v5/earn/position/modify` | +| [getEarnYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5256) | :closed_lock_with_key: | GET | `/v5/earn/yield` | +| [getHoldToEarnAirdropYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5270) | :closed_lock_with_key: | GET | `/v5/earn/hold-to-earn/yield-history` | +| [getEarnHourlyYieldHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5281) | :closed_lock_with_key: | GET | `/v5/earn/hourly-yield` | +| [getEarnAprHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5295) | | GET | `/v5/earn/apr-history` | +| [getEarnTokenProduct()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5305) | | GET | `/v5/earn/token/product` | +| [submitEarnTokenOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5314) | :closed_lock_with_key: | POST | `/v5/earn/token/place-order` | +| [getEarnTokenOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5323) | :closed_lock_with_key: | GET | `/v5/earn/token/order` | +| [getEarnTokenPosition()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5335) | :closed_lock_with_key: | GET | `/v5/earn/token/position` | +| [getEarnTokenDailyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5344) | :closed_lock_with_key: | GET | `/v5/earn/token/yield` | +| [getEarnTokenHourlyYield()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5356) | :closed_lock_with_key: | GET | `/v5/earn/token/hourly-yield` | +| [getEarnTokenHistoryApr()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5368) | | GET | `/v5/earn/token/history-apr` | +| [getPwmInvestmentPlanList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5383) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/list` | +| [getPwmInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5392) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/detail` | +| [getPwmPendingInvestmentPlanDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5401) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/new-plan` | +| [claimPwmWithdrawableFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5410) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/claim` | +| [getPwmInvestmentPlanAssetTrend()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5419) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/asset-trend` | +| [getPwmFundHistoricalNav()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5428) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/fund-nav` | +| [subscribePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5437) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/subscribe` | +| [investMorePwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5446) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/invest-more` | +| [redeemPwmInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5455) | :closed_lock_with_key: | POST | `/v5/earn/pwm/investment-plan/redeem` | +| [getPwmInvestmentPlanOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5464) | :closed_lock_with_key: | GET | `/v5/earn/pwm/investment-plan/order` | +| [getPwmSubscribableProductInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5473) | | GET | `/v5/earn/pwm/customize-plan/product` | +| [createPwmCustomizeInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5482) | :closed_lock_with_key: | POST | `/v5/earn/pwm/customize-plan/create` | +| [getPwmAllFunds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5497) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-funds` | +| [settlePwmFundProfit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5506) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/settle-profit` | +| [createPwmFund()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5515) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-fund` | +| [createPwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5524) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-investment-plan` | +| [getPwmAssetManagerInvestmentPlans()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5538) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/get-investment-plan` | +| [managePwmAssetManagerInvestmentPlan()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5550) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-investment-plan` | +| [getPwmAllFundOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5564) | :closed_lock_with_key: | GET | `/v5/earn/pwm/asset-manager/all-order` | +| [managePwmFundOrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5573) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/manage-order` | +| [createPwmFundSubAccount()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5582) | :closed_lock_with_key: | POST | `/v5/earn/pwm/asset-manager/create-sub-account` | +| [pwmFundTransfer()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5594) | :closed_lock_with_key: | POST | `/v5/earn/pwm/fund-transfer` | +| [getPwmFundTransferRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5603) | :closed_lock_with_key: | GET | `/v5/earn/pwm/query-fund-transfer-result` | +| [queryCardAssetRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5618) | :closed_lock_with_key: | POST | `/v5/card/transaction/query-asset-records` | +| [queryCardPointsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5627) | :closed_lock_with_key: | POST | `/v5/card/reward/points/balance` | +| [queryCardPointsRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5634) | :closed_lock_with_key: | POST | `/v5/card/reward/points/records` | +| [queryCardPointsTier()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5643) | :closed_lock_with_key: | POST | `/v5/card/reward/points/tier` | +| [queryCardMallItemList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5650) | :closed_lock_with_key: | POST | `/v5/card/reward/mall/item/list` | +| [queryCardPointCashbackDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5659) | :closed_lock_with_key: | POST | `/v5/card/reward/point/cashback/detail` | +| [createRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5675) | :closed_lock_with_key: | POST | `/v5/rfq/create-rfq` | +| [getRFQConfig()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5686) | :closed_lock_with_key: | GET | `/v5/rfq/config` | +| [cancelRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5695) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-rfq` | +| [cancelAllRFQ()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5705) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-rfq` | +| [createRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5714) | :closed_lock_with_key: | POST | `/v5/rfq/create-quote` | +| [executeRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5725) | :closed_lock_with_key: | POST | `/v5/rfq/execute-quote` | +| [cancelRFQQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5736) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-quote` | +| [cancelAllRFQQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5746) | :closed_lock_with_key: | POST | `/v5/rfq/cancel-all-quotes` | +| [getRFQRealtimeInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5760) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-realtime` | +| [getRFQHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5772) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-list` | +| [getRFQRealtimeQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5786) | :closed_lock_with_key: | GET | `/v5/rfq/quote-realtime` | +| [getRFQHistoryQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5801) | :closed_lock_with_key: | GET | `/v5/rfq/quote-list` | +| [getRFQTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5814) | :closed_lock_with_key: | GET | `/v5/rfq/trade-list` | +| [getRFQPublicTrades()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5827) | :closed_lock_with_key: | GET | `/v5/rfq/public-trades` | +| [acceptNonLPQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5843) | :closed_lock_with_key: | POST | `/v5/rfq/accept-other-quote` | +| [getRFQDetails()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5849) | :closed_lock_with_key: | GET | `/v5/rfq/rfq-detail-list` | +| [getP2PAccountCoinsBalance()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5874) | :closed_lock_with_key: | GET | `/v5/asset/transfer/query-account-coins-balance` | +| [getP2POnlineAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5891) | :closed_lock_with_key: | POST | `/v5/p2p/item/online` | +| [createP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5900) | :closed_lock_with_key: | POST | `/v5/p2p/item/create` | +| [cancelP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5909) | :closed_lock_with_key: | POST | `/v5/p2p/item/cancel` | +| [updateP2PAd()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5923) | :closed_lock_with_key: | POST | `/v5/p2p/item/update` | +| [getP2PPersonalAds()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5933) | :closed_lock_with_key: | POST | `/v5/p2p/item/personal/list` | +| [getP2PAdDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5942) | :closed_lock_with_key: | POST | `/v5/p2p/item/info` | +| [getP2POrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5957) | :closed_lock_with_key: | POST | `/v5/p2p/order/simplifyList` | +| [getP2POrderDetail()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5967) | :closed_lock_with_key: | POST | `/v5/p2p/order/info` | +| [getP2PPendingOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5976) | :closed_lock_with_key: | POST | `/v5/p2p/order/pending/simplifyList` | +| [markP2POrderAsPaid()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5985) | :closed_lock_with_key: | POST | `/v5/p2p/order/pay` | +| [releaseP2POrder()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L5994) | :closed_lock_with_key: | POST | `/v5/p2p/order/finish` | +| [reviewP2PSellerCancelOrderApply()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6006) | :closed_lock_with_key: | POST | `/v5/p2p/order/buyer/examine/sellerCancelOrderApply` | +| [sendP2POrderMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6018) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/send` | +| [getP2PChatSessions()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6033) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/list_v1` | +| [getP2PChatSessionId()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6043) | :closed_lock_with_key: | POST | `/v5/p2p/chat/session/getSessionId` | +| [sendP2PChatMessage()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6079) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/send_v1` | +| [getP2PChatMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6091) | :closed_lock_with_key: | POST | `/v5/p2p/chat/message/listpage_v1` | +| [getP2POrderMessages()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6100) | :closed_lock_with_key: | POST | `/v5/p2p/order/message/listpage` | +| [getP2PUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6114) | :closed_lock_with_key: | POST | `/v5/p2p/user/personal/info` | +| [getP2PCounterpartyUserInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6121) | :closed_lock_with_key: | POST | `/v5/p2p/user/order/personal/info` | +| [getP2PUserPayments()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6130) | :closed_lock_with_key: | POST | `/v5/p2p/user/payment/list` | +| [setApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6150) | :closed_lock_with_key: | POST | `/v5/apilimit/set` | +| [queryApiRateLimit()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6179) | :closed_lock_with_key: | GET | `/v5/apilimit/query` | +| [getRateLimitCap()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6198) | :closed_lock_with_key: | GET | `/v5/apilimit/query-cap` | +| [getAllRateLimits()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6217) | :closed_lock_with_key: | GET | `/v5/apilimit/query-all` | +| [getLaunchpoolProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6240) | | GET | `/v5/spot-x/launchpool/project/list` | +| [getLaunchpoolUserActivityLog()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6246) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/activity-log` | +| [getLaunchpoolCurrentStaking()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6252) | :closed_lock_with_key: | GET | `/v5/spot-x/launchpool/user/current-staking` | +| [getLaunchpoolUserHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6258) | :closed_lock_with_key: | POST | `/v5/spot-x/launchpool/user/history` | +| [getPuzzleProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6264) | | GET | `/v5/spot-x/puzzle/project/list` | +| [getTokenSplashProjectList()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6270) | | GET | `/v5/spot-x/token-splash/project/list` | +| [getTokenSplashUserActivityParams()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6276) | :closed_lock_with_key: | GET | `/v5/spot-x/token-splash/user/activity-params` | +| [getEventInstrumentsInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6299) | | GET | `/v5/event/instruments-info` | +| [getEventOrderbook()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6310) | | GET | `/v5/event/orderbook` | +| [getEventOrderHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6321) | :closed_lock_with_key: | GET | `/v5/event/order-list` | +| [getEventActiveOrders()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6332) | :closed_lock_with_key: | GET | `/v5/event/order-realtime` | +| [getEventPositionInfo()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6343) | :closed_lock_with_key: | GET | `/v5/event/positions` | +| [getEventTradeHistory()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6354) | :closed_lock_with_key: | GET | `/v5/event/trades` | +| [getEventSettlementRecords()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6365) | :closed_lock_with_key: | GET | `/v5/event/settlements` | +| [submitEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6376) | :closed_lock_with_key: | POST | `/v5/event/quotes` | +| [cancelEventQuote()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6387) | :closed_lock_with_key: | POST | `/v5/event/cancel` | +| [cancelAllEventQuotes()](https://github.com/sieblyio/bybit-api/blob/master/src/rest-client-v5.ts#L6398) | :closed_lock_with_key: | POST | `/v5/event/cancel-all` | # websocket-api-client.ts diff --git a/llms.txt b/llms.txt index 4cc32437..b27e7188 100644 --- a/llms.txt +++ b/llms.txt @@ -530,6 +530,67 @@ import { RestClientV5 } from '../../src/index'; // }); // console.log('openInterest: ', openInterest.result.list); +================ +File: examples/Websocket/Private/ws-private-v5.ts +================ +/* eslint-disable @typescript-eslint/no-empty-function */ +import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../../../src'; +⋮---- +// or +// import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; +⋮---- +// Create & inject a custom logger to enable the trace logging level (empty function) +⋮---- +// trace: (...params) => console.log('trace', ...params), +⋮---- +/** + * Prepare an instance of the WebSocket client. This client handles all aspects of connectivity for you: + * - Connections are opened when you subscribe to topics + * - If key & secret are provided, authentication is handled automatically + * - If you subscribe to topics from different v5 products (e.g. spot and linear perps), + * subscription events are automatically routed to the different ws endpoints on bybit's side + * - Heartbeats/ping/pong/reconnects are all handled automatically. + * If a connection drops, the client will clean it up, respawn a fresh connection and resubscribe for you. + */ +⋮---- +// testnet: false, +// demoTrading: false, // set testnet to false, if you plan on using demo trading +⋮---- +// console.log('raw message received ', JSON.stringify(data, null, 2)); +⋮---- +// wsClient.on('exception', (data) => { +// console.error('ws exception: ', data); +// }); +⋮---- +/** + * For private V5 topics, us the subscribeV5() method on the ws client or use the original subscribe() method. + * + * Note: for private endpoints the "category" field is ignored since there is only one private endpoint + * (compared to one public one per category). + * The "category" is only needed for public topics since bybit has one endpoint for public events per category. + */ +⋮---- +// wsClient.subscribeV5('execution.fast', 'linear'); +// wsClient.subscribeV5('execution.fast.linear', 'linear'); +// wsClient.subscribeV5('execution.fast.spot', 'spot'); +// wsClient.subscribeV5('execution.fast.option', 'option'); +⋮---- +/** + * The following has the same effect as above, since there's only one private endpoint for V5 account topics: + */ +// wsClient.subscribe('position'); +// wsClient.subscribe('execution'); +// wsClient.subscribe(['order', 'wallet', 'greek']); +⋮---- +// To unsubscribe from topics (after a 5 second delay, in this example): +// setTimeout(() => { +// console.log('unsubscribing'); +// wsClient.unsubscribeV5('execution', 'linear'); +// }, 5 * 1000); +⋮---- +// Topics are tracked per websocket type +// Get a list of subscribed topics (e.g. for public v3 spot topics) (after a 5 second delay) + ================ File: examples/Websocket/Public/ws-public-allLiquidations.ts ================ @@ -859,6 +920,39 @@ These samples can be executed using `ts-node`: ts-node ./examples/rest-spot-public.ts ``` +================ +File: src/constants/enum.ts +================ +/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ +⋮---- +/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ +⋮---- +/** This could mean bad request, incorrect value types or even incorrect/missing values */ +⋮---- +/** API key requires specific whitelisted IPs, and this IP was not in the list */ +⋮---- +/** Account not unified margin, update required */ +⋮---- +/** Seen when placing an order */ +⋮---- +/** Seen if a conditional order is too large */ +⋮---- +/** E.g. trying to change position margin while on cross */ +⋮---- +/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ +⋮---- +/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ +⋮---- +/** + * Position idx, used to identify positions in different position modes. + * Required if you are under One-Way Mode: + */ +export enum LinearPositionIdx { + OneWayMode = 0, + BuySide = 1, + SellSide = 2, +} + ================ File: src/types/request/account-asset.ts ================ @@ -2208,2630 +2302,2922 @@ export interface USDCPositionsRequest { } ================ -File: src/types/request/v5-pre-upgrade.ts +File: src/types/request/v5-alpha-trade.ts ================ -import { ExecTypeV5 } from '../shared-v5'; -⋮---- -export interface GetPreUpgradeOrderHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - baseCoin?: string; - orderId?: string; - orderLinkId?: string; - orderFilter?: 'Order' | 'StopOrder'; - orderStatus?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +/** + * V5 private Alpha / on-chain (Web3) trade requests. + */ ⋮---- -export interface GetPreUpgradeTradeHistoryParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - orderId?: string; - orderLinkId?: string; - baseCoin?: string; - startTime?: number; - endTime?: number; - execType?: ExecTypeV5; - limit?: number; - cursor?: string; +export interface GetAlphaTradeQuoteParamsV5 { + tradeType: 1 | 2; + fromTokenCode: string; + fromTokenAmount: string; + toTokenCode: string; + quoteMode?: 0 | 1 | 2; } ⋮---- -export interface GetPreUpgradeClosedPnlParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface ExecuteAlphaTradeParamsV5 { + fromTokenCode: string; + fromTokenAmount: string; + toTokenCode: string; + slippage: string; + quoteData: string; + gas: string; + quoteMode: 0 | 1 | 2; + correctingCode: string; + tenant?: string; } ⋮---- -export interface GetPreUpgradeTransactionLogParamsV5 { - category: 'linear' | 'option'; - baseCoin?: string; - type?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface GetAlphaPayTokenListParamsV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface GetPreUpgradeOptionDeliveryRecordParamsV5 { - category: 'option'; - symbol?: string; - expDate?: string; - limit?: number; - cursor?: string; +export interface GetAlphaTradeOrderListParamsV5 { + limit: number; + pageIndex: number; + tradeType?: number; + tokenCode?: string; + orderStatus?: number[]; + days?: number; + direction?: 'prev' | 'next'; } ⋮---- -export interface GetPreUpgradeUSDCSessionParamsV5 { - category: 'linear'; - symbol?: string; - limit?: number; - cursor?: string; -} - -================ -File: src/types/response/account-asset.ts -================ -export interface UniversalTransferCreateResponse { - transferId: string; +export interface GetAlphaBizTokenListParamsV5 { + tokenTag?: number; } ⋮---- -export interface UniversalTransferListResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - timestamp: string; - status: string; - fromAccountType: string; - toAccountType: string; - fromMemberId: string; - toMemberId: string; - }[]; - nextPageCursor: string; +export interface AlphaTokenAddressInfoV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface QueryInternalTransferSResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - fromAccountType: string; - toAccountType: string; - timestamp: string; - status: string; - }[]; - nextPageCursor: string; +export interface GetAlphaBizTokenPriceListParamsV5 { + tokenAddressInfo: AlphaTokenAddressInfoV5[]; } ⋮---- -export interface SubAccountTransferResponseV3 { - list: { - transferId: string; - coin: string; - amount: string; - memberId: number; - subMemberId: number; - timestamp: string; - status: string; - type: 'IN' | 'OUT'; - }[]; - nextPageCursor: string; +export interface GetAlphaBizTokenDetailsParamsV5 { + chainCode: string; + tokenAddress: string; } ⋮---- -export interface AccountCoinBalanceResponseV3 { - accountType: string; - bizType: number; - accountId: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - }; +export interface GetAlphaAssetDetailParamsV5 { + chainCode: string; + tokenAddress: string; } + +================ +File: src/types/request/v5-card.ts +================ +/** + * Bybit Card — /v5/card/* + * Authenticated; API key permission per Bybit (often card-related). + */ ⋮---- -export interface AccountCoinBalancesResponseV3 { - accountType: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - }[]; +export interface QueryCardAssetRecordsParamsV5 { + /** 0: Pending, 1: Cleared, 2: Declined */ + statusCode?: string; + /** Default 100, range [1, 500] */ + limit?: number; + /** Default 1, min 1 */ + page?: number; + /** Last 2/4 digits of card number */ + pan4?: string; + createBeginTime?: number; + createEndTime?: number; + /** Fuzzy search */ + merchName?: string; + /** Authorization / Clearing / Refund (see Bybit) */ + type?: string; + txnId?: string; + cardToken?: string; + orderNo?: string; } ⋮---- -export interface AssetInfoResponseV3 { - spot: { - status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; - assets: { - coin: string; - frozen: string; - free: string; - withdraw: string; - }[]; - }; -} +/** 0: Pending, 1: Cleared, 2: Declined */ ⋮---- -interface SupportedDepositV3 { - coin: string; - chain: string; - coinShowName: string; - chainType: string; - blockConfirmNumber: number; - minDepositAmount: string; -} +/** Default 100, range [1, 500] */ ⋮---- -export interface SupportedDepositListResponseV3 { - configList: SupportedDepositV3[]; - nextPageCursor: string; -} +/** Default 1, min 1 */ ⋮---- -interface DepositRecordV3 { - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - depositFee: string; - successAt: string; - confirmations: string; - txIndex: string; - blockHash: string; +/** Last 2/4 digits of card number */ +⋮---- +/** Fuzzy search */ +⋮---- +/** Authorization / Clearing / Refund (see Bybit) */ +⋮---- +export interface QueryCardPointRecordsParamsV5 { + type?: string; + pageSize?: number; + pageNo?: number; + startTime?: number; + endTime?: number; + outOrderId?: string; + bizId?: string; + bizTxnId?: string; + /** 1: Earn, 2: Deduct */ + side?: string; } ⋮---- -export interface DepositRecordQueryResponseV3 { - rows: DepositRecordV3[]; - nextPageCursor: string; +/** 1: Earn, 2: Deduct */ +⋮---- +export interface QueryCardMallItemListParamsV5 { + pageNo?: number; + pageSize?: number; + /** 1: Virtual, 2: Physical */ + itemType?: number; + /** 1: POINTS, 2: CURRENCY */ + itemBizType?: number; + /** 1: Priority, 2: Listing time, 3: Price */ + orderBy?: number; + asc?: boolean; + /** 0: Default, 1: VIP */ + source?: number; } ⋮---- -export interface WithdrawRecordsQueryResponseV3 { - rows: { - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - withdrawFee: string; - createTime: string; - updateTime: string; - withdrawId: string; - withdrawType: number; - }[]; - nextPageCursor: string; +/** 1: Virtual, 2: Physical */ +⋮---- +/** 1: POINTS, 2: CURRENCY */ +⋮---- +/** 1: Priority, 2: Listing time, 3: Price */ +⋮---- +/** 0: Default, 1: VIP */ +⋮---- +export interface QueryCardPointCashbackDetailParamsV5 { + bizTxnId: string; } + +================ +File: src/types/request/v5-earn-advance-discount.ts +================ +/** + * /v5/earn/advance/ — product-extra, place order, position, order (Discount Buy, Dual Assets, etc.) + */ +export type GetAdvanceEarnProductExtraInfoParamsV5 = + | { + category: 'DiscountBuy'; + productId?: string; + } + | { + category: 'DualAssets'; + /** Required for Dual Assets quote. */ + productId: string; + }; ⋮---- -export interface CoinInfoV3 { - name: string; - coin: string; - remainAmount: string; - chains: { - chainType: string; - confirmation: string; - withdrawFee: string; - depositMin: string; - withdrawMin: string; - chain: string; - chainDeposit: string; - chainWithdraw: string; - minAccuracy: string; - }[]; +/** Required for Dual Assets quote. */ +⋮---- +export interface AdvanceEarnDiscountBuyExtraV5 { + initialPrice: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + settleType: 'Base' | 'Quote'; + instUid: string; } ⋮---- -export interface CoinInfoQueryResponseV3 { - rows: CoinInfoV3[]; +export interface AdvanceEarnDualAssetsExtraV5 { + orderDirection: 'BuyLow' | 'SellHigh'; + selectPrice: string; + /** Expected APY in e8 precision; API may return int. */ + apyE8: string | number; } ⋮---- -export interface DepositAddressChainV3 { - chainType: string; - addressDeposit: string; - tagDeposit: string; - chain: string; +/** Expected APY in e8 precision; API may return int. */ +⋮---- +export interface AdvanceEarnInterestCardExtraV5 { + awardId: string | number; + specCode: string; } ⋮---- -export interface DepositAddressResponseV3 { +/** + * POST /v5/earn/advance/place-order — Discount Buy + */ +export interface SubmitAdvanceEarnPlaceOrderDiscountBuyV5 { + category: 'DiscountBuy'; + productId: string; + orderType: 'Stake'; + amount: string; coin: string; - chains: DepositAddressChainV3[]; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + discountBuyExtra: AdvanceEarnDiscountBuyExtraV5; } ⋮---- -export interface CreateSubMemberResponseV3 { - uid: number; - username: string; - memberType: 1 | 6; - switch: 0 | 1; - note: string; +/** + * POST /v5/earn/advance/place-order — Dual Assets + */ +export interface SubmitAdvanceEarnPlaceOrderDualAssetsV5 { + category: 'DualAssets'; + productId: string; + orderType: 'Stake'; + amount: string; + coin: string; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + dualAssetsExtra: AdvanceEarnDualAssetsExtraV5; + interestCard?: AdvanceEarnInterestCardExtraV5; } ⋮---- -export interface CreateSubAPIKeyResponseV3 { - id: string; - note: string; - apiKey: string; - readOnly: string; - secret: string; - permissions: { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - }; +export type SubmitAdvanceEarnPlaceOrderParamsV5 = + | SubmitAdvanceEarnPlaceOrderDiscountBuyV5 + | SubmitAdvanceEarnPlaceOrderDualAssetsV5; +⋮---- +export interface GetAdvanceEarnPositionListParamsV5 { + category: 'DiscountBuy' | 'DualAssets' | string; + productId?: string; + coin?: string; + limit?: number; + cursor?: string; } ⋮---- -export interface SubMemberV3 { - uid: string; - username: string; - memberType: 1 | 6; - status: 1 | 2 | 4; - remark: string; +export interface GetAdvanceEarnOrderListParamsV5 { + category: 'DiscountBuy' | 'DualAssets' | string; + orderId?: string; + orderLinkId?: string; + productId?: string; + /** Dual Assets docs use string ms; other categories may use number. */ + startTime?: string | number; + endTime?: string | number; + limit?: number; + cursor?: string; } ⋮---- -export interface SubMemberResponseV3 { - subMembers: SubMemberV3[]; -} -⋮---- -export interface APIKeyInfoV3 { - id: string; - note: string; - apiKey: string; - readOnly: string; - secret: string; - permissions: { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - }; - ips: string[]; - type: number; - deadlineDay: number; - expiredAt: string; - createdAt: string; - unified: number; - uta: number; - userID: number; - inviterID: number; - vipLevel: string; - mktMakerLevel: string; - affiliateID: number; -} +/** Dual Assets docs use string ms; other categories may use number. */ ================ -File: src/types/response/shared.ts +File: src/types/request/v5-earn-fixed-term.ts ================ -export interface SymbolWalletBalance { - equity: number; - available_balance: number; - used_margin: number; - order_margin: number; - position_margin: number; - occ_closing_fee: number; - occ_funding_fee: number; - wallet_balance: number; - realised_pnl: number; - unrealised_pnl: number; - cum_realised_pnl: number; - given_cash: number; - service_cash: number; +/** + * /v5/earn/fixed-term/* + */ +export interface GetFixedTermEarnProductParamsV5 { + coin?: string; } ⋮---- -export interface WalletBalances { - [symbol: string]: SymbolWalletBalance | undefined; -} - -================ -File: src/types/response/spot.ts -================ -export interface SpotBalance { +export interface SubmitFixedTermEarnOrderParamsV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; coin: string; - coinId: string; - coinName: string; - total: string; - free: string; - locked: string; + amount: string; + accountType: 'FUND' | 'UNIFIED'; + orderLinkId: string; + autoInvest?: boolean; } ⋮---- -export interface SpotBalances { - balances: SpotBalance[]; +export interface RedeemFixedTermEarnParamsV5 { + productId: string; + /** Early redemption: FundPool only */ + category: 'FundPool'; + positionId: string; } ⋮---- -export interface SpotLastPrice { - symbol: string; - price: string; +/** Early redemption: FundPool only */ +⋮---- +export interface GetFixedTermEarnPositionParamsV5 { + productId?: string; + category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + coin?: string; +} +⋮---- +export interface GetFixedTermEarnOrderListParamsV5 { + orderType?: 'Stake' | 'Redeem' | 'Reinvest'; + productId?: string; + category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface SetFixedTermEarnAutoInvestParamsV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; + positionId: string; + status: 'Enable' | 'Disable'; } ================ -File: src/types/response/unified-margin.ts +File: src/types/request/v5-earn-token.ts ================ -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export interface UMPaginatedResult { - nextPageCursor: string; - category: string; - list: List[]; +/** + * Earn token product (e.g. BYUSDT) — /v5/earn/token/* + */ +⋮---- +export interface GetEarnTokenProductParamsV5 { + /** Currently only BYUSDT */ + coin: string; } ⋮---- -export interface UMLeverageFilter { - minLeverage: string; - maxLeverage: string; - leverageStep: string; +/** Currently only BYUSDT */ +⋮---- +export interface PlaceEarnTokenOrderParamsV5 { + coin: string; + orderLinkId: string; + orderType: 'Mint' | 'Redeem'; + amount: string; + /** Mint: FlexibleSaving; Redeem: UNIFIED */ + accountType: 'FlexibleSaving' | 'UNIFIED'; } ⋮---- -export interface UMPriceFilter { - minPrice: string; - maxPrice: string; - tickSize: string; +/** Mint: FlexibleSaving; Redeem: UNIFIED */ +⋮---- +export interface GetEarnTokenOrderListParamsV5 { + coin: string; + orderLinkId?: string; + orderId?: string; + orderType?: 'Mint' | 'Redeem'; + /** seconds */ + startTime?: number; + /** seconds */ + endTime?: number; + cursor?: string; + limit?: number; } ⋮---- -export interface UMLotSizeFilter { - maxTradingQty: string; - minTradingQty: string; - qtyStep: string; +/** seconds */ +⋮---- +/** seconds */ +⋮---- +export interface GetEarnTokenPositionParamsV5 { + coin: string; } ⋮---- -export interface UMInstrumentInfo { - symbol: string; - contractType: string; - status: string; - baseCoin: string; - quoteCoin: string; - launchTime: string; - deliveryTime: string; - deliveryFeeRate: string; - priceScale: string; - leverageFilter: UMLeverageFilter; - priceFilter: UMPriceFilter; - lotSizeFilter: UMLotSizeFilter; +export interface GetEarnTokenDailyYieldParamsV5 { + coin: string; + startTime?: number; + endTime?: number; + cursor?: string; + limit?: number; } ⋮---- -export interface UMHistoricOrder { - symbol: string; - orderType: string; - orderLinkId: string; - orderId: string; - stopOrderType: string; - orderStatus: string; - takeProfit: string; - cumExecValue: string; - blockTradeId: string; - rejectReason: string; - price: string; - createdTime: number; - tpTriggerBy: string; - timeInForce: string; - basePrice: string; - leavesValue: string; - updatedTime: number; - side: string; - triggerPrice: string; - cumExecFee: string; - slTriggerBy: string; - leavesQty: string; - closeOnTrigger: boolean; - cumExecQty: string; - reduceOnly: boolean; - qty: string; - stopLoss: string; - triggerBy: string; - orderIM: string; +export interface GetEarnTokenHourlyYieldParamsV5 { + coin: string; + startTime?: number; + endTime?: number; + cursor?: string; + limit?: number; +} +⋮---- +export interface GetEarnTokenHistoryAprParamsV5 { + coin: string; + /** 1 = 7d, 2 = 30d, 3 = 180d */ + range: 1 | 2 | 3; } +⋮---- +/** 1 = 7d, 2 = 30d, 3 = 180d */ ================ -File: src/types/response/usdt-perp.ts +File: src/types/request/v5-pre-upgrade.ts ================ -export interface PerpPosition { - user_id: number; - symbol: string; - side: string; - size: number; - position_value: number; - entry_price: number; - liq_price: number; - bust_price: number; - leverage: number; - auto_add_margin: number; - is_isolated: boolean; - position_margin: number; - occ_closing_fee: number; - realised_pnl: number; - cum_realised_pnl: number; - free_qty: number; - tp_sl_mode: string; - unrealised_pnl: number; - deleverage_indicator: number; - risk_id: number; - stop_loss: number; - take_profit: number; - trailing_stop: number; - position_idx: number; - mode: string; -} +import { ExecTypeV5 } from '../shared-v5'; ⋮---- -export interface PerpPositionRoot { - data: PerpPosition; - is_valid: boolean; +export interface GetPreUpgradeOrderHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + orderFilter?: 'Order' | 'StopOrder'; + orderStatus?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface LinearOrder { - order_id: string; - user_id: number; - symbol: string; - side: string; - order_type: string; - price: number; - qty: number; - time_in_force: string; - order_status: string; - last_exec_price: number; - cum_exec_qty: number; - cum_exec_value: number; - cum_exec_fee: number; - reduce_only: boolean; - close_on_trigger: boolean; - order_link_id: string; - created_time: string; - updated_time: string; - take_profit: number; - stop_loss: number; - tp_trigger_by: string; - sl_trigger_by: string; - position_idx: number; +export interface GetPreUpgradeTradeHistoryParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; + orderId?: string; + orderLinkId?: string; + baseCoin?: string; + startTime?: number; + endTime?: number; + execType?: ExecTypeV5; + limit?: number; + cursor?: string; } - -================ -File: src/types/response/v5-preupgrade.ts -================ -export interface PreUpgradeTransaction { +⋮---- +export interface GetPreUpgradeClosedPnlParamsV5 { + category: 'linear' | 'inverse'; symbol: string; - category: string; - side: 'Buy' | 'Sell' | 'None'; - transactionTime: string; - type: string; - qty: string; - size: string; - currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - extraFees: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface PreUpgradeOptionsDelivery { - deliveryTime: number; - symbol: string; - side: 'Buy' | 'Sell'; - position: string; - deliveryPrice: string; - strike: string; - fee: string; - deliveryRpl: string; +export interface GetPreUpgradeTransactionLogParamsV5 { + category: 'linear' | 'option'; + baseCoin?: string; + type?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface PreUpgradeUSDCSessionSettlement { - symbol: string; - side: 'Buy' | 'Sell'; - size: string; - sessionAvgPrice: string; - markPrice: string; - realisedPnl: string; - createdTime: string; +export interface GetPreUpgradeOptionDeliveryRecordParamsV5 { + category: 'option'; + symbol?: string; + expDate?: string; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetPreUpgradeUSDCSessionParamsV5 { + category: 'linear'; + symbol?: string; + limit?: number; + cursor?: string; } ================ -File: src/types/websockets/index.ts -================ - - -================ -File: src/types/websockets/ws-api.ts +File: src/types/response/account-asset.ts ================ -import { APIID, WS_KEY_MAP } from '../../util'; -import { - AmendOrderParamsV5, - BatchAmendOrderParamsV5, - BatchCancelOrderParamsV5, - BatchOrderParamsV5, - CancelOrderParamsV5, - OrderParamsV5, -} from '../request'; -import { - BatchAmendOrderResultV5, - BatchCancelOrderResultV5, - BatchCreateOrderResultV5, - BatchOrdersRetExtInfoV5, - OrderResultV5, -} from '../response'; -import { WsKey } from './ws-general'; -⋮---- -// When new WS API operations are added, make sure to also update WS_API_Operations[] below -export type WSAPIOperation = - | 'order.create' - | 'order.amend' - | 'order.cancel' - | 'order.create-batch' - | 'order.amend-batch' - | 'order.cancel-batch'; -⋮---- -export type WsOperation = - | 'subscribe' - | 'unsubscribe' - | 'auth' - | 'ping' - | 'pong'; +export interface UniversalTransferCreateResponse { + transferId: string; +} ⋮---- -export interface WsRequestOperationBybit { - req_id: string; - op: WsOperation; - args?: (TWSTopic | string | number)[]; +export interface UniversalTransferListResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + timestamp: string; + status: string; + fromAccountType: string; + toAccountType: string; + fromMemberId: string; + toMemberId: string; + }[]; + nextPageCursor: string; } ⋮---- -export interface WSAPIRequest< - TRequestParams = undefined, - // eslint-disable-next-line @typescript-eslint/no-explicit-any - TWSOperation extends WSAPIOperation = any, -> { - reqId: string; - op: TWSOperation; - header: { - 'X-BAPI-TIMESTAMP': string; - 'X-BAPI-RECV-WINDOW': string; - Referer: typeof APIID; - }; - args: [TRequestParams]; +export interface QueryInternalTransferSResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + fromAccountType: string; + toAccountType: string; + timestamp: string; + status: string; + }[]; + nextPageCursor: string; } ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any +export interface SubAccountTransferResponseV3 { + list: { + transferId: string; + coin: string; + amount: string; + memberId: number; + subMemberId: number; + timestamp: string; + status: string; + type: 'IN' | 'OUT'; + }[]; + nextPageCursor: string; +} ⋮---- -export interface WSAPIResponse< - TResponseData extends object = object, - TOperation extends WSAPIOperation = WSAPIOperation, - TResponseExtInfo = {}, // added as optional for batch calls -> { - wsKey: WsKey; - /** Auto-generated */ - reqId: string; - retCode: 0 | number; - retMsg: 'OK' | string; - op: TOperation; - data: TResponseData; - retExtInfo: TResponseExtInfo; - header?: { - 'X-Bapi-Limit': string; - 'X-Bapi-Limit-Status': string; - 'X-Bapi-Limit-Reset-Timestamp': string; - Traceid: string; - Timenow: string; +export interface AccountCoinBalanceResponseV3 { + accountType: string; + bizType: number; + accountId: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; }; - connId: string; } ⋮---- -TResponseExtInfo = {}, // added as optional for batch calls -⋮---- -/** Auto-generated */ -⋮---- -export type Exact = { - // This part says: if there's any key that's not in T, it's an error - [K: string]: never; -} & { - [K in keyof T]: T[K]; -}; +export interface AccountCoinBalancesResponseV3 { + accountType: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; + }[]; +} ⋮---- -// This part says: if there's any key that's not in T, it's an error +export interface AssetInfoResponseV3 { + spot: { + status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; + assets: { + coin: string; + frozen: string; + free: string; + withdraw: string; + }[]; + }; +} ⋮---- -/** - * List of operations supported for this WsKey (connection) - */ -export interface WsAPIWsKeyTopicMap { - [WS_KEY_MAP.v5PrivateTrade]: WSAPIOperation; +interface SupportedDepositV3 { + coin: string; + chain: string; + coinShowName: string; + chainType: string; + blockConfirmNumber: number; + minDepositAmount: string; } ⋮---- -/** - * Request parameters expected per operation - */ -export interface WsAPITopicRequestParamMap { - 'order.create': OrderParamsV5; - 'order.amend': AmendOrderParamsV5; - 'order.cancel': CancelOrderParamsV5; - - 'order.create-batch': { - category: 'option' | 'linear'; - request: BatchOrderParamsV5[]; - }; - 'order.amend-batch': { - category: 'option' | 'linear'; - request: BatchAmendOrderParamsV5[]; - }; - 'order.cancel-batch': { - category: 'option' | 'linear'; - request: BatchCancelOrderParamsV5[]; - }; +export interface SupportedDepositListResponseV3 { + configList: SupportedDepositV3[]; + nextPageCursor: string; } ⋮---- -/** - * Response structure expected for each operation - */ -export interface WsAPIOperationResponseMap { - 'order.create': WSAPIResponse; - 'order.amend': WSAPIResponse; - 'order.cancel': WSAPIResponse; - - 'order.create-batch': WSAPIResponse< - { list: BatchCreateOrderResultV5[] }, - 'order.create-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - 'order.amend-batch': WSAPIResponse< - { list: BatchAmendOrderResultV5[] }, - 'order.amend-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - 'order.cancel-batch': WSAPIResponse< - { list: BatchCancelOrderResultV5[] }, - 'order.cancel-batch' - > & { - retExtInfo: BatchOrdersRetExtInfoV5; - }; - - ping: { - retCode: 0 | number; - retMsg: 'OK' | string; - op: 'pong'; - data: [string]; - connId: string; - }; +interface DepositRecordV3 { + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + depositFee: string; + successAt: string; + confirmations: string; + txIndex: string; + blockHash: string; } - -================ -File: src/types/websockets/ws-confirmations.ts -================ -export interface WebsocketTopicSubscriptionConfirmationEvent { - op: 'subscribe'; - req_id: string; - conn_id: string; - ret_msg: string; - success: boolean; +⋮---- +export interface DepositRecordQueryResponseV3 { + rows: DepositRecordV3[]; + nextPageCursor: string; } ⋮---- -export interface WebsocketSucceededTopicSubscriptionConfirmationEvent - extends WebsocketTopicSubscriptionConfirmationEvent { - success: true; +export interface WithdrawRecordsQueryResponseV3 { + rows: { + coin: string; + chain: string; + amount: string; + txID: string; + status: number; + toAddress: string; + tag: string; + withdrawFee: string; + createTime: string; + updateTime: string; + withdrawId: string; + withdrawType: number; + }[]; + nextPageCursor: string; } ⋮---- -export interface WebsocketFailedTopicSubscriptionConfirmationEvent - extends WebsocketTopicSubscriptionConfirmationEvent { - success: false; +export interface CoinInfoV3 { + name: string; + coin: string; + remainAmount: string; + chains: { + chainType: string; + confirmation: string; + withdrawFee: string; + depositMin: string; + withdrawMin: string; + chain: string; + chainDeposit: string; + chainWithdraw: string; + minAccuracy: string; + }[]; } - -================ -File: src/types/index.ts -================ - - -================ -File: src/index.ts -================ - - -================ -File: src/spot-client-v3.ts -================ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { APIResponseV3, numberInString } from './types'; -import { REST_CLIENT_TYPE_ENUM } from './util'; -import BaseRestClient from './util/BaseRestClient'; ⋮---- -/** - * REST API client for newer Spot V3 APIs. - * @deprecated WARNING - * These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024. - * They may stop working at any point before then. - * Please update your code as soon as possible to use the V5 APIs instead. - */ -export class SpotClientV3 extends BaseRestClient +export interface CoinInfoQueryResponseV3 { + rows: CoinInfoV3[]; +} ⋮---- -getClientType() +export interface DepositAddressChainV3 { + chainType: string; + addressDeposit: string; + tagDeposit: string; + chain: string; +} ⋮---- -// Doesn't really matter here, since the only remaining endpoint does not require auth. +export interface DepositAddressResponseV3 { + coin: string; + chains: DepositAddressChainV3[]; +} ⋮---- -async fetchServerTime(): Promise +export interface CreateSubMemberResponseV3 { + uid: number; + username: string; + memberType: 1 | 6; + switch: 0 | 1; + note: string; +} ⋮---- -/** - * - * Market Data Endpoints - * - */ +export interface CreateSubAPIKeyResponseV3 { + id: string; + note: string; + apiKey: string; + readOnly: string; + secret: string; + permissions: { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; + }; +} ⋮---- -/** - * Get merged orderbook for symbol - * - * This is the only known pre-V5 endpoint to still be online. - */ -getMergedOrderBook( - symbol: string, - scale?: number, - limit?: number, -): Promise> +export interface SubMemberV3 { + uid: string; + username: string; + memberType: 1 | 6; + status: 1 | 2 | 4; + remark: string; +} ⋮---- -/** - * - * API Data Endpoints - * - */ +export interface SubMemberResponseV3 { + subMembers: SubMemberV3[]; +} ⋮---- -getServerTime(): Promise< - -================ -File: src/websocket-api-client.ts +export interface APIKeyInfoV3 { + id: string; + note: string; + apiKey: string; + readOnly: string; + secret: string; + permissions: { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; + }; + ips: string[]; + type: number; + deadlineDay: number; + expiredAt: string; + createdAt: string; + unified: number; + uta: number; + userID: number; + inviterID: number; + vipLevel: string; + mktMakerLevel: string; + affiliateID: number; +} + ================ -import { - AmendOrderParamsV5, - BatchAmendOrderParamsV5, - BatchAmendOrderResultV5, - BatchCancelOrderParamsV5, - BatchCancelOrderResultV5, - BatchCreateOrderResultV5, - BatchOrderParamsV5, - BatchOrdersRetExtInfoV5, - CancelOrderParamsV5, - OrderParamsV5, - OrderResultV5, -} from './types'; -import { WSAPIResponse } from './types/websockets/ws-api'; -import { WSClientConfigurableOptions } from './types/websockets/ws-general'; -import { DefaultLogger } from './util'; -import { WS_KEY_MAP } from './util/websockets/websocket-util'; -import { WebsocketClient } from './websocket-client'; -⋮---- -/** - * Configurable options specific to only the REST-like WebsocketAPIClient - */ -export interface WSAPIClientConfigurableOptions { - /** - * Default: true - * - * Attach default event listeners, which will console log any high level - * events (opened/reconnecting/reconnected/etc). - * - * If you disable this, you should set your own event listeners - * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. - */ - attachEventListeners: boolean; +File: src/types/response/shared.ts +================ +export interface SymbolWalletBalance { + equity: number; + available_balance: number; + used_margin: number; + order_margin: number; + position_margin: number; + occ_closing_fee: number; + occ_funding_fee: number; + wallet_balance: number; + realised_pnl: number; + unrealised_pnl: number; + cum_realised_pnl: number; + given_cash: number; + service_cash: number; } ⋮---- -/** - * Default: true - * - * Attach default event listeners, which will console log any high level - * events (opened/reconnecting/reconnected/etc). - * - * If you disable this, you should set your own event listeners - * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. - */ +export interface WalletBalances { + [symbol: string]: SymbolWalletBalance | undefined; +} + +================ +File: src/types/response/spot.ts +================ +export interface SpotBalance { + coin: string; + coinId: string; + coinName: string; + total: string; + free: string; + locked: string; +} ⋮---- -/** - * This is a minimal Websocket API wrapper around the WebsocketClient. - * - * Some methods support passing in a custom "wsKey". This is a reference to which WS connection should - * be used to transmit that message. This is only useful if you wish to use an alternative wss - * domain that is supported by the SDK. - * - * Note: To use testnet, don't set the wsKey - use `testnet: true` in - * the constructor instead. - * - * Note: You can also directly use the sendWSAPIRequest() method to make WS API calls, but some - * may find the below methods slightly more intuitive. - * - * Refer to the WS API promises example for a more detailed example on using sendWSAPIRequest() directly: - * https://github.com/tiagosiebler/bybit-api/blob/master/examples/ws-api-raw-promises.ts - */ -export class WebsocketAPIClient +export interface SpotBalances { + balances: SpotBalance[]; +} ⋮---- -constructor( - options?: WSClientConfigurableOptions & - Partial, - logger?: DefaultLogger, -) +export interface SpotLastPrice { + symbol: string; + price: string; +} + +================ +File: src/types/response/unified-margin.ts +================ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +export interface UMPaginatedResult { + nextPageCursor: string; + category: string; + list: List[]; +} ⋮---- -public getWSClient(): WebsocketClient +export interface UMLeverageFilter { + minLeverage: string; + maxLeverage: string; + leverageStep: string; +} ⋮---- -public setTimeOffsetMs(newOffset: number): void +export interface UMPriceFilter { + minPrice: string; + maxPrice: string; + tickSize: string; +} ⋮---- -/* - * Bybit WebSocket API Methods - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - */ +export interface UMLotSizeFilter { + maxTradingQty: string; + minTradingQty: string; + qtyStep: string; +} ⋮---- -/** - * Submit a new order - * - * @param params - * @returns - */ -submitNewOrder( - params: OrderParamsV5, -): Promise> +export interface UMInstrumentInfo { + symbol: string; + contractType: string; + status: string; + baseCoin: string; + quoteCoin: string; + launchTime: string; + deliveryTime: string; + deliveryFeeRate: string; + priceScale: string; + leverageFilter: UMLeverageFilter; + priceFilter: UMPriceFilter; + lotSizeFilter: UMLotSizeFilter; +} ⋮---- -/** - * Amend an order - * - * @param params - * @returns - */ -amendOrder( - params: AmendOrderParamsV5, -): Promise> +export interface UMHistoricOrder { + symbol: string; + orderType: string; + orderLinkId: string; + orderId: string; + stopOrderType: string; + orderStatus: string; + takeProfit: string; + cumExecValue: string; + blockTradeId: string; + rejectReason: string; + price: string; + createdTime: number; + tpTriggerBy: string; + timeInForce: string; + basePrice: string; + leavesValue: string; + updatedTime: number; + side: string; + triggerPrice: string; + cumExecFee: string; + slTriggerBy: string; + leavesQty: string; + closeOnTrigger: boolean; + cumExecQty: string; + reduceOnly: boolean; + qty: string; + stopLoss: string; + triggerBy: string; + orderIM: string; +} + +================ +File: src/types/response/usdt-perp.ts +================ +export interface PerpPosition { + user_id: number; + symbol: string; + side: string; + size: number; + position_value: number; + entry_price: number; + liq_price: number; + bust_price: number; + leverage: number; + auto_add_margin: number; + is_isolated: boolean; + position_margin: number; + occ_closing_fee: number; + realised_pnl: number; + cum_realised_pnl: number; + free_qty: number; + tp_sl_mode: string; + unrealised_pnl: number; + deleverage_indicator: number; + risk_id: number; + stop_loss: number; + take_profit: number; + trailing_stop: number; + position_idx: number; + mode: string; +} ⋮---- -/** - * Cancel an order - * - * @param params - * @returns - */ -cancelOrder( - params: CancelOrderParamsV5, -): Promise> +export interface PerpPositionRoot { + data: PerpPosition; + is_valid: boolean; +} ⋮---- +export interface LinearOrder { + order_id: string; + user_id: number; + symbol: string; + side: string; + order_type: string; + price: number; + qty: number; + time_in_force: string; + order_status: string; + last_exec_price: number; + cum_exec_qty: number; + cum_exec_value: number; + cum_exec_fee: number; + reduce_only: boolean; + close_on_trigger: boolean; + order_link_id: string; + created_time: string; + updated_time: string; + take_profit: number; + stop_loss: number; + tp_trigger_by: string; + sl_trigger_by: string; + position_idx: number; +} + +================ +File: src/types/response/v5-alpha-trade.ts +================ /** - * Batch submit orders - * - * @param params - * @returns - */ -batchSubmitOrders( - category: 'option' | 'linear', - orders: BatchOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchCreateOrderResultV5[]; - }, - 'order.create-batch', - BatchOrdersRetExtInfoV5 - > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.create-batch', - { - category, - request: orders, - }, - ); + * V5 private Alpha / on-chain (Web3) trade responses. + */ ⋮---- -/** - * Batch amend orders - * - * @param params - * @returns - */ -batchAmendOrder( - category: 'option' | 'linear', - orders: BatchAmendOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchAmendOrderResultV5[]; - }, - 'order.amend-batch', - BatchOrdersRetExtInfoV5 - > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.amend-batch', - { - category, - request: orders, - }, - ); +export interface AlphaTradeQuoteModeEstimationV5 { + quoteMode: number; + estimatedGas: string; + estimatedGasUsd: string; + estimatedSlippage: string; +} ⋮---- -/** - * Batch cancel orders - * - * @param params - * @returns - */ -batchCancelOrder( - category: 'option' | 'linear', - orders: BatchCancelOrderParamsV5[], - ): Promise< - WSAPIResponse< - { - list: BatchCancelOrderResultV5[]; - }, - 'order.cancel-batch', - BatchOrdersRetExtInfoV5 - > - > { - return this.wsClient.sendWSAPIRequest( - WS_KEY_MAP.v5PrivateTrade, - 'order.cancel-batch', - { - category, - request: orders, - }, - ); +export interface AlphaTradeQuoteResultV5 { + tradeType: number; + fromTokenCode: string; + fromTokenAmount: string; + fromTokenAmountUsd: string; + toTokenCode: string; + toTokenAmount: string; + toTokenAmountUsd: string; + minToTokenAmount: string; + slippage: string; + gas: string; + gasUsd: string; + platformFee: string; + platformFeeUsd: string; + swapRate: string; + lossRate: string; + quoteData: string; + correctingCode: string; + quoteMode: number; + quoteDataId: string; + expireTime: number; + modeEstimations: AlphaTradeQuoteModeEstimationV5[]; + chargeAmount?: string; + timestamp?: number; +} ⋮---- -/** - * - * - * - * - * - * - * - * Private methods for handling some of the convenience/automation provided by the WS API Client - * - * - * - * - * - * - * - */ +export interface ExecuteAlphaTradeResultV5 { + orderNo: string; +} ⋮---- -private setupDefaultEventListeners() +export interface AlphaPayTokenV5 { + tokenCode: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + limit: string; + supportChains: string[]; +} ⋮---- -/** - * General event handlers for monitoring the WebsocketClient - */ +export interface AlphaTradeOrderV5 { + orderType: number; + tradeType: number; + orderNo: string; + orderStatus: number; + fromTokenCode: string; + fromTokenAmount: string; + fromTokenSymbol: string; + fromTokenDecimals: number; + fromTokenIconUrlDay?: string; + fromTokenIconUrlNight?: string; + fromChainCode: string; + fromChainIconUrl?: string; + toTokenCode: string; + toTokenAmount: string; + toTokenSymbol: string; + toTokenDecimals: number; + toTokenIconUrlDay?: string; + toTokenIconUrlNight?: string; + toChainCode: string; + toChainIconUrl?: string; + gasTokenSymbol: string; + gasOnchain: string; + gasUsd: string | null; + platformFee: string; + platformFeeUsd: string | null; + quoteMode: number; + createTime: number; + executionTime?: number; + failureReasonCode?: string; + source?: string; + swapRate: string; + actualFromTokenAmount: string; +} ⋮---- -// Blind JSON.stringify can fail on circular references +export interface AlphaTradeOrderListResultV5 { + total: number; + pageIndex: number; + orders: AlphaTradeOrderV5[]; +} ⋮---- -// JSON.stringify({ ...data, target: 'WebSocket' }), - -================ -File: .eslintrc.cjs -================ -// 'require-extensions', // only once moved to ESM +export interface AlphaBizTokenV5 { + tokenCode: string; + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + createTime: number; + createTimeOnchain: number; + riskFlag: number; + minOrderQuantity: number; + maxOrderQuantity: number; + tokenTags: number[]; + payTokenCodes: string[]; +} ⋮---- -// 'plugin:require-extensions/recommended', // only once moved to ESM +export interface AlphaBizTokenPriceV5 { + chainCode: string; + tokenAddress: string; + price: string; + change24h: string; + vol24h: string; + marketCap: string; + liquidity: string; + holders: string; +} ⋮---- -// 'no-unused-vars': ['warn'], - -================ -File: .jshintrc -================ -{ - "esversion": 8, - "asi": true, - "laxbreak": true, - "predef": [ "-Promise" ] +export interface AlphaBizTokenPriceListResultV5 { + tokenPriceInfoList: AlphaBizTokenPriceV5[]; } - -================ -File: .prettierrc -================ -{ - "tabWidth": 2, - "singleQuote": true, - "trailingComma": "all" -} - -================ -File: index.js -================ - - -================ -File: jsconfig.json -================ -{ - "compilerOptions": { - "target": "ES6", - "module": "commonjs" - }, - "exclude": [ - "node_modules", - "**/node_modules/*", - "coverage", - "doc", - "examples/ignored/*" - ] +⋮---- +export interface AlphaBizTokenDetailsV5 { + tokenCode: string; + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + symbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + minOrderQuantity: string; + maxOrderQuantity: string; + maxPositionQuantity: string; + tokenDesc: string; + xUrl: string; + officialUrl: string; + whitePaperUrl: string; + tokenTag: number; + riskFlag: number; + createTimeOnchain: number; + status: number; + tokenTags: number[]; + showMessage: number; + content?: string; + linkName?: string; + linkAddress?: string; } - -================ -File: LICENSE.md -================ -Copyright 2024 Tiago Siebler - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -================ -File: tsconfig.build.json -================ -{ - "extends": "./tsconfig.json", - "exclude": [ - "node_modules", - "test", - "dist", - "**/*spec.ts", - "**/*test.ts", - "jest.config.ts" - ] +⋮---- +export interface AlphaAssetV5 { + chainCode: string; + chainIconUrl: string; + tokenAddress: string; + tokenCode: string; + tokenSymbol: string; + tokenDecimals: number; + tokenIconUrlDay: string; + tokenIconUrlNight: string; + tokenAmount: string; + tokenAmountUsd: string; + tradeFlag: number; + pnl: string | null; + pnlRatio: string | null; + costPrice: string | null; + lastPrice: string; + costTotalValue: string | null; + assetStatus: number; + announcementUrl?: string; + estimatedOfflineTime?: number; + delistingTime?: number; } - -================ -File: tsconfig.examples.json -================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "distExamples", - "allowJs": true - }, - "include": ["examples/**/*.ts", "examples/**/*.js"] +⋮---- +export interface AlphaAssetListResultV5 { + totalAssetUsd: string; + assetList: AlphaAssetV5[]; } - -================ -File: tsconfig.json -================ -{ - "compileOnSave": true, - "compilerOptions": { - "allowJs": true, - "target": "es6", - "module": "commonjs", - "moduleResolution": "node", - "declaration": true, - "removeComments": false, - "noEmitOnError": true, - "noImplicitAny": false, - "strictNullChecks": true, - "skipLibCheck": true, - "sourceMap": true, - "esModuleInterop": true, - "lib": ["es2017", "dom"], - "baseUrl": ".", - "outDir": "./lib" - }, - "include": ["src/**/*"], - "exclude": ["node_modules", "**/node_modules/*", "coverage", "doc"] +⋮---- +export interface AlphaAssetDetailResultV5 { + assetList: AlphaAssetV5[]; } ================ -File: tsconfig.linting.json +File: src/types/response/v5-card.ts ================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "commonjs", - "target": "esnext", - "rootDir": "../", - "allowJs": true - }, - "include": [ - "src/**/*.*", - "test/**/*.*", - "examples/**/*.*", - ".eslintrc.cjs", - "jest.config.ts" - ] +export interface CardAssetRecordV5 { + pan4: string; + pan6: string; + tradeStatus: string; + side: string; + basicAmount: string; + basicCurrency: string; + transactionAmount: string; + transactionCurrency: string; + txnCreate: number; + merchCountry: string; + merchCity: string; + merchName: string; + txnId: string; + declinedReason: string; + totalFees: string; + uid: number; + transactionCurrencyAmount: string; + fxPad: string; + interchangeFee: string; + billAmount: string; + paidAmount: string; + paidCurrency: string; + bonusAmount: string; + foreignTransactionFee: string; + totalTax: string; + paidFiat: string; + withdrawalFee: string; + status: string; + orderNo: string; + mccCode: string; + merchCategoryDesc: string; } - -================ -File: tsconfig.test.json -================ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "outDir": "./distTest", - "allowJs": true - }, - "include": ["test/**/*.ts", "test/**/*.js"] +⋮---- +export interface CardAssetRecordsResultV5 { + pageSize: number; + pageNo: number; + totalCount: number; + data: CardAssetRecordV5[]; } - -================ -File: examples/Websocket/Private/ws-private-v5.ts -================ -/* eslint-disable @typescript-eslint/no-empty-function */ -import { DefaultLogger, WebsocketClient, WS_KEY_MAP } from '../../../src'; ⋮---- -// or -// import { DefaultLogger, WS_KEY_MAP, WebsocketClient } from 'bybit-api'; +export interface CardPointBalanceV5 { + accountId: string; + availablePoint: string | number; + pendingPoint: string | number; + status: string; + updateTime: string | number; + settlementPeriod: number; +} ⋮---- -// Create & inject a custom logger to enable the trace logging level (empty function) +export interface CardPointRecordV5 { + outOrderId: string; + point: number; + side: string; + type: string; + subType: string; + createTime: number; + updateTime: number; + bizId: string; + bizTxnId: string; + transactionDate: string; + transactionId: string; + transactionAmount: string; + basicCurrency: string; + merchCategoryDesc: string; + merchName: string; + merchCountry: string; + merchCity: string; + pan4: string; + payFiatAmount: string; + transactionCurrencyAmount: string; +} ⋮---- -// trace: (...params) => console.log('trace', ...params), +export interface CardPointRecordsResultV5 { + pageSize: number; + pageNo: number; + totalCount: number; + data: CardPointRecordV5[]; +} ⋮---- -/** - * Prepare an instance of the WebSocket client. This client handles all aspects of connectivity for you: - * - Connections are opened when you subscribe to topics - * - If key & secret are provided, authentication is handled automatically - * - If you subscribe to topics from different v5 products (e.g. spot and linear perps), - * subscription events are automatically routed to the different ws endpoints on bybit's side - * - Heartbeats/ping/pong/reconnects are all handled automatically. - * If a connection drops, the client will clean it up, respawn a fresh connection and resubscribe for you. - */ -⋮---- -// testnet: false, -// demoTrading: false, // set testnet to false, if you plan on using demo trading -⋮---- -// console.log('raw message received ', JSON.stringify(data, null, 2)); -⋮---- -// wsClient.on('exception', (data) => { -// console.error('ws exception: ', data); -// }); -⋮---- -/** - * For private V5 topics, us the subscribeV5() method on the ws client or use the original subscribe() method. - * - * Note: for private endpoints the "category" field is ignored since there is only one private endpoint - * (compared to one public one per category). - * The "category" is only needed for public topics since bybit has one endpoint for public events per category. - */ -⋮---- -// wsClient.subscribeV5('execution.fast', 'linear'); -// wsClient.subscribeV5('execution.fast.linear', 'linear'); -// wsClient.subscribeV5('execution.fast.spot', 'spot'); -// wsClient.subscribeV5('execution.fast.option', 'option'); -⋮---- -/** - * The following has the same effect as above, since there's only one private endpoint for V5 account topics: - */ -// wsClient.subscribe('position'); -// wsClient.subscribe('execution'); -// wsClient.subscribe(['order', 'wallet', 'greek']); -⋮---- -// To unsubscribe from topics (after a 5 second delay, in this example): -// setTimeout(() => { -// console.log('unsubscribing'); -// wsClient.unsubscribeV5('execution', 'linear'); -// }, 5 * 1000); -⋮---- -// Topics are tracked per websocket type -// Get a list of subscribed topics (e.g. for public v3 spot topics) (after a 5 second delay) - -================ -File: src/constants/enum.ts -================ -/** Full take profit/stop loss mode (a single TP order and a single SL order can be placed, covering the entire position) */ -⋮---- -/** Partial take profit/stop loss mode (multiple TP and SL orders can be placed, covering portions of the position) */ -⋮---- -/** This could mean bad request, incorrect value types or even incorrect/missing values */ -⋮---- -/** API key requires specific whitelisted IPs, and this IP was not in the list */ -⋮---- -/** Account not unified margin, update required */ -⋮---- -/** Seen when placing an order */ -⋮---- -/** Seen if a conditional order is too large */ -⋮---- -/** E.g. trying to change position margin while on cross */ +export interface CardPointTierInfoV5 { + usedLimit: string; + limit: string; + unit: string; + tier: string; + autoCashback: boolean; +} ⋮---- -/** E.g. USDC Options trading, trying to access a symbol that is no longer active */ +export interface CardMallItemV5 { + itemId: string; + itemName: string; + priority: number; + onTime: string; + offTime: string; + price: string; + discountPrice: string; + totalNum: number; + redeemNum: number; + picPath: string; + currency: string; + currencyType: number; + itemType: number; + itemBizType: number; +} ⋮---- -/** E.g. USDC Options trading when the account hasn't been opened for USDC Options yet */ +export interface CardMallItemListResultV5 { + pageNo: number; + pageSize: number; + totalCount: number; + data: CardMallItemV5[]; +} ⋮---- -/** - * Position idx, used to identify positions in different position modes. - * Required if you are under One-Way Mode: - */ -export enum LinearPositionIdx { - OneWayMode = 0, - BuySide = 1, - SellSide = 2, +export interface CardPointCashbackDetailV5 { + points: string; + amt: string; + ccy: string; + ccyType: string; + createTime: string; + bizTxnId: string; + sourceId: number; + sourceCode: string; + orderStatus: number; + orderSubStatus: number; + orderShowStatus: string; + failedBizCode: string; } ================ -File: src/types/request/v5-alpha-lp.ts +File: src/types/response/v5-earn-advance-discount.ts ================ -/** - * V5 private Alpha LP requests. - */ -⋮---- -export interface GetAlphaLPPoolListParamsV5 { - tokenSymbol?: string; +export interface AdvanceEarnDiscountBuyOfferV5 { + productId: string; + currentPrice: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + maxInvestmentAmount: string; + instUid: string; + expiredAt: string; + category: string; } ⋮---- -export interface GetAlphaLPPoolInfoParamsV5 { - poolAddress: string; +/** GET /v5/earn/advance/product-extra-info?category=DiscountBuy */ +export interface AdvanceEarnProductExtraInfoDiscountBuyV5 { + offers: AdvanceEarnDiscountBuyOfferV5[]; } ⋮---- -export interface ExecuteAlphaLPStakeParamsV5 { - positionId: number; - poolAddress: string; - payTokenAmount: string; - payTokenCode: string; - rangeUpper?: string; - rangeLower?: string; - priceUpper?: string; - priceLower?: string; +export interface AdvanceEarnDualAssetQuoteLevelV5 { + selectPrice: string; + apyE8: string; + maxInvestmentAmount: string; + expiredAt: string; } ⋮---- -export interface ExecuteAlphaLPRedeemParamsV5 { - positionId: number; - poolAddress: string; - dercRatio: string; - receiveTokenCode?: string; +export interface AdvanceEarnDualAssetQuoteProductV5 { + productId: string; + currentPrice: string; + buyLowPrice: AdvanceEarnDualAssetQuoteLevelV5[]; + sellHighPrice: AdvanceEarnDualAssetQuoteLevelV5[]; } ⋮---- -export interface GetAlphaLPOrderListParamsV5 { - orderType?: 0 | 1 | 2; - tokenCode?: string; - orderStatus?: number[]; - days?: number; - limit?: number; - pageIndex?: number; - poolAddress?: string; +/** GET /v5/earn/advance/product-extra-info?category=DualAssets&productId= */ +export interface AdvanceEarnProductExtraInfoDualAssetsV5 { + category: 'DualAssets'; + list: AdvanceEarnDualAssetQuoteProductV5[]; } ⋮---- -export interface GetAlphaLPPayTokenListParamsV5 { - chainCode?: string; - tokenAddress?: string; -} +export type AdvanceEarnProductExtraInfoV5 = + | AdvanceEarnProductExtraInfoDiscountBuyV5 + | AdvanceEarnProductExtraInfoDualAssetsV5; ⋮---- -export interface GetAlphaLPPayTokenPriceParamsV5 { - tokenCode: string[]; - chainCode?: string; +export interface AdvanceEarnPlaceOrderResultV5 { + orderId: string; + orderLinkId: string; } - -================ -File: src/types/request/v5-alpha-prediction.ts -================ -/** - * V5 private Alpha prediction market requests. - */ ⋮---- -export interface GetAlphaPredictionEventDetailParamsV5 { - eventId?: string; - slug?: string; - hasMoreMarkets?: boolean; +export interface AdvanceEarnDiscountBuyPositionV5 { + positionId: string; + productId: string; + category: string; + coin: string; + underlyingAsset: string; + amount: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + status: string; + orderId: string; + duration: string; + settlementTime: string; + accountType: string; + toAccountType: string; + settleType: string; + expectReceiveAt: string; } ⋮---- -export interface GetAlphaPredictionOrderEstimateParamsV5 { - tokenId: string; - side: 1 | 2; - eventId: string; +export interface AdvanceEarnDualAssetsPositionV5 { + positionId: string; + productId: string; + category: string; + baseCoin: string; + quoteCoin: string; + investCoin: string; amount: string; - orderType: 1; - payTokenCode?: string; + apyE8: string; + direction: 'BuyLow' | 'SellHigh' | string; + targetPrice: string; + settlementTime: string; + status: string; + orderId: string; + duration: string; + expectReturnCoin: string; + expectReturnAmount: string; + accountType: string; + toAccountType: string; + yieldStartAt: string | number; + yieldEndAt: string | number; } ⋮---- -export interface ExecuteAlphaPredictionBuyParamsV5 { - tokenId: string; - amount: string; - payTokenCode: string; - orderType: 1; - slippage: string; - eventId: string; +export interface AdvanceEarnPositionListV5 { + category: string; + list: (AdvanceEarnDiscountBuyPositionV5 | AdvanceEarnDualAssetsPositionV5)[]; + nextPageCursor: string; } ⋮---- -export interface ExecuteAlphaPredictionSellParamsV5 { - tokenId: string; - size: string; - orderType: 1; - slippage: string; - eventId: string; - toTokenCode?: string; +export interface AdvanceEarnDiscountBuyOrderV5 { + orderId: string; + orderLinkId: string; + productId: string; + category: string; + orderType: string; + amount: string; + coin: string; + underlyingAsset: string; + status: string; + createdTime: string; + purchasePrice: string; + knockoutPrice: string; + knockoutCouponE8: string; + duration: string; + settlementTime: string; + accountType: string; + toAccountType: string; + settleType: string; + settlementPrice: string; + settlementCoin: string; + settlementAmount: string; + isVip: boolean; + refundStatus: string; } ⋮---- -export interface GetAlphaPredictionOrderListParamsV5 { - status?: number; - tokenId?: string; - eventId?: string; - side?: 1 | 2; - days?: number; - limit?: number; - pageIndex?: number; +export interface AdvanceEarnDualAssetsOrderV5 { + orderId: string; + orderLinkId: string; + productId: string; + category: string; + orderType: string; + amount: string; + coin: string; + baseCoin: string; + quoteCoin: string; + status: string; + createdTime: string; + updatedTime: string; + direction: 'BuyLow' | 'SellHigh' | string; + targetPrice: string; + settlementTime: string | number; + estimateApyE8: string | number; + duration: string; + accountType: string; + toAccountType: string; + selectApyE8: string | number; + isVip: boolean; + settlementCoin: string; + settlementAmount: string; + orderMode: string; + settlementPrice: string; + refundStatus: string; + trialBonusAmount: string; + trialBonusPnl: string; } ⋮---- -export interface GetAlphaPredictionOrderBookParamsV5 { - tokenIds: string[]; +export interface AdvanceEarnOrderListV5 { + category: string; + list: (AdvanceEarnDiscountBuyOrderV5 | AdvanceEarnDualAssetsOrderV5)[]; + nextPageCursor: string; +} + +================ +File: src/types/response/v5-earn-fixed-term.ts +================ +export interface FixedTermEarnTieredApyV5 { + min: string; + max: string; + apy: string; } ⋮---- -export interface GetAlphaPredictionTokenPriceParamsV5 { - tokenIds: string[]; +export interface FixedTermEarnInterestCoinApyV5 { + coin: string; + apy: string; + expectUnitEarning: string; + currentPrice: string; } ⋮---- -export interface GetAlphaPredictionPriceHistoryParamsV5 { - tokenId: string; - interval: string; +export interface FixedTermEarnProductV5 { + productId: string; + category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium' | string; + coin: string; + duration: string; + status: 'Available' | 'SoldOut' | 'NotStarted' | string; + tieredApyList: FixedTermEarnTieredApyV5[]; + minStakeAmount: string; + maxStakeAmount: string; + precision: number; + subscribeStartAt: string; + subscribeEndAt: string; + allowEarlyRedemption: boolean; + earlyRedemptionApy: string; + redemptionLimitDuration: string; + allowAutoReinvest: boolean; + interestCoinApyList: FixedTermEarnInterestCoinApyV5[]; + isVip: boolean; + creditTime: string; + specialUserGroupRequired: boolean; + specialUserGroupInfo: string; } ⋮---- -export interface GetAlphaPredictionPositionListParamsV5 { - tokenId?: string; - eventId?: string; - limit?: number; - pageIndex?: number; +export interface FixedTermEarnProductListV5 { + list: FixedTermEarnProductV5[]; } ⋮---- -export interface GetAlphaPredictionPositionHistoryParamsV5 { - tokenId?: string; - eventId?: string; - result?: number; - days?: number; - limit?: number; - pageIndex?: number; +export interface FixedTermEarnPlaceOrderResultV5 { + orderId: string; + orderLinkId: string; } ⋮---- -export interface GetAlphaPredictionPortfolioSummaryParamsV5 { - eventType?: number; +export interface RedeemFixedTermEarnResultV5 { + redeemAmount: string; + estEarnings: string; } ⋮---- -export interface GetAlphaPredictionSideMarketListParamsV5 { - eventId: string; - sortBy?: string; - marketType?: number; - limit?: number; - pageIndex?: number; +export interface FixedTermEarnEarlyRedeemInfoV5 { + allowEarlyRedeem: boolean; + earlyRedeemEarning: string; + returnCoin: string; + redemptionLimitDuration: string; } ⋮---- -export interface GetAlphaPredictionSportsMatchListParamsV5 { - eventType: number; - status?: number; - startTime?: number; - endTime?: number; - stageCode?: string; - limit?: number; - pageIndex?: number; +export interface FixedTermEarnPositionInterestV5 { + coin: string; + apy: string; + expectReturnEarning: string; + price: string; } ⋮---- -export interface GetAlphaPredictionSportsTimelineStagesParamsV5 { - eventType: number; +export interface FixedTermEarnPositionV5 { + positionId: string; + productId: string; + category: string; + coin: string; + amount: string; + effectiveAmount: string; + duration: string; + status: string; + settlementTime: string; + createdAt: string; + orderId: string; + earlyRedeemInfo: FixedTermEarnEarlyRedeemInfoV5 | null; + allowAutoReinvest: boolean; + autoReinvest: string; + interestCoinApyList: FixedTermEarnPositionInterestV5[]; } ⋮---- -export interface GetAlphaPredictionSportsGroupStageDetailParamsV5 { - eventType: number; - groupName?: string; +export interface FixedTermEarnPositionListV5 { + list: FixedTermEarnPositionV5[]; +} +⋮---- +export interface FixedTermEarnOrderYieldInfoV5 { + coin: string; + amount: string; + status: string; + createdAt: string; + apy: string; +} +⋮---- +export interface FixedTermEarnOrderV5 { + orderId: string; + orderLinkId: string; + orderType: string; + status: string; + productId: string; + category: string; + coin: string; + amount: string; + duration: string; + accountType: string; + settlementTime: string; + createdAt: string; + yieldInfoList: FixedTermEarnOrderYieldInfoV5[]; +} +⋮---- +export interface FixedTermEarnOrderListV5 { + list: FixedTermEarnOrderV5[]; + nextPageCursor: string; } ================ -File: src/types/request/v5-alpha-trade.ts +File: src/types/response/v5-earn-token.ts ================ /** - * V5 private Alpha / on-chain (Web3) trade requests. + * Earn token product (e.g. BYUSDT) — /v5/earn/token/* */ ⋮---- -export interface GetAlphaTradeQuoteParamsV5 { - tradeType: 1 | 2; - fromTokenCode: string; - fromTokenAmount: string; - toTokenCode: string; - quoteMode?: 0 | 1 | 2; -} -⋮---- -export interface ExecuteAlphaTradeParamsV5 { - fromTokenCode: string; - fromTokenAmount: string; - toTokenCode: string; - slippage: string; - quoteData: string; - gas: string; - quoteMode: 0 | 1 | 2; - correctingCode: string; - tenant?: string; +export interface EarnTokenProductV5 { + productId: string; + coin: string; + mintFeeRateE8: string; + redeemFeeRateE8: string; + minInvestment: string; + userHolding: string; + leftQuota: string; + canMint: boolean; + savingsBalance: string; + aprE8: string; + bonusAprE8: string; + bonusMaxAmount: string; + baseCoinPrecision: number; + tokenPrecision: number; } ⋮---- -export interface GetAlphaPayTokenListParamsV5 { - chainCode: string; - tokenAddress: string; +export interface PlaceEarnTokenOrderResultV5 { + orderId: string; + orderLinkId: string; } ⋮---- -export interface GetAlphaTradeOrderListParamsV5 { - limit: number; - pageIndex: number; - tradeType?: number; - tokenCode?: string; - orderStatus?: number[]; - days?: number; - direction?: 'prev' | 'next'; -} -⋮---- -export interface GetAlphaBizTokenListParamsV5 { - tokenTag?: number; +export interface EarnTokenOrderV5 { + orderId: string; + orderLinkId: string; + orderType: 'Mint' | 'Redeem'; + fromCoin: string; + toCoin: string; + fromAmount: string; + toAmount: string; + serviceFee: string; + status: 'Success' | 'Processing' | 'Fail'; + createdTime: string; } ⋮---- -export interface AlphaTokenAddressInfoV5 { - chainCode: string; - tokenAddress: string; +export interface EarnTokenPositionV5 { + totalAmount: string; + totalYield: string; + yesterdayYield: string; + aprE8: number; + bonusAprE8: number; + bonusMaxAmount: string; + hasQuota: boolean; } ⋮---- -export interface GetAlphaBizTokenPriceListParamsV5 { - tokenAddressInfo: AlphaTokenAddressInfoV5[]; +export interface EarnTokenDailyYieldRecordV5 { + yield: string; + bonusYield: string; + status: 'Success' | 'Processing'; + createdTime: string; } ⋮---- -export interface GetAlphaBizTokenDetailsParamsV5 { - chainCode: string; - tokenAddress: string; +export interface EarnTokenHourlyYieldRecordV5 { + effectiveAmount: string; + yield: string; + rewardType: 0 | 1; + aprE8: string; + hourlyDate: string; + createdTime: string; } ⋮---- -export interface GetAlphaAssetDetailParamsV5 { - chainCode: string; - tokenAddress: string; +export interface EarnTokenHistoryAprPointV5 { + timestamp: string; + aprE8: string; } ================ -File: src/types/request/v5-broker.ts +File: src/types/response/v5-preupgrade.ts ================ -export interface GetExchangeBrokerEarningsParamsV5 { - bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; - begin?: string; - end?: string; - uid?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetBrokerSubAccountDepositsV5 { - id?: string; - txID?: string; - subMemberId?: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface IssueVoucherParamsV5 { - accountId: string; - awardId: string; - specCode: string; - amount: string; - brokerId: string; -} -⋮---- -export interface GetBrokerIssuedVoucherParamsV5 { - accountId: string; - awardId: string; - specCode: string; - withUsedAmount?: boolean; +export interface PreUpgradeTransaction { + symbol: string; + category: string; + side: 'Buy' | 'Sell' | 'None'; + transactionTime: string; + type: string; + qty: string; + size: string; + currency: 'USDC' | 'USDT' | 'BTC' | 'ETH'; + tradePrice: string; + funding: string; + fee: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; + extraFees: string; } ⋮---- -/** Set Rate Limit - exchange broker only. API rate limit: 1 req per second. */ -export interface SetBrokerRateLimitParamsV5 { - list: { - uids: string; - bizType: string; - rate: number; - }[]; +export interface PreUpgradeOptionsDelivery { + deliveryTime: number; + symbol: string; + side: 'Buy' | 'Sell'; + position: string; + deliveryPrice: string; + strike: string; + fee: string; + deliveryRpl: string; } ⋮---- -/** Get All Rate Limits - exchange broker only. API rate limit: 1 req per second. */ -export interface GetAllBrokerRateLimitsParamsV5 { - limit?: string; - cursor?: string; - uids?: string; +export interface PreUpgradeUSDCSessionSettlement { + symbol: string; + side: 'Buy' | 'Sell'; + size: string; + sessionAvgPrice: string; + markPrice: string; + realisedPnl: string; + createdTime: string; } ================ -File: src/types/request/v5-card.ts +File: src/types/response/v5-spreadtrading.ts ================ -/** - * Bybit Card — /v5/card/* - * Authenticated; API key permission per Bybit (often card-related). - */ -⋮---- -export interface QueryCardAssetRecordsParamsV5 { - /** 0: Pending, 1: Cleared, 2: Declined */ - statusCode?: string; - /** Default 100, range [1, 500] */ - limit?: number; - /** Default 1, min 1 */ - page?: number; - /** Last 2/4 digits of card number */ - pan4?: string; - createBeginTime?: number; - createEndTime?: number; - /** Fuzzy search */ - merchName?: string; - /** Authorization / Clearing / Refund (see Bybit) */ - type?: string; - txnId?: string; - cardToken?: string; - orderNo?: string; +export interface SpreadInstrumentInfoV5 { + symbol: string; + contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; + status: 'Trading' | 'Settling'; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + tickSize: string; + minPrice: string; + maxPrice: string; + lotSize: string; + minSize: string; + maxSize: string; + launchTime: string; + deliveryTime: string; + legs: { + symbol: string; + contractType: 'LinearPerpetual' | 'LinearFutures' | 'Spot'; + }[]; } ⋮---- -/** 0: Pending, 1: Cleared, 2: Declined */ -⋮---- -/** Default 100, range [1, 500] */ -⋮---- -/** Default 1, min 1 */ +export interface SpreadOrderbookResponseV5 { + s: string; // Symbol + b: [string, string][]; // Bids array [price, size] + a: [string, string][]; // Asks array [price, size] + u: number; // Update ID + ts: number; // Timestamp + seq: number; // Sequence + cts: number; // Cross timestamp +} ⋮---- -/** Last 2/4 digits of card number */ +s: string; // Symbol +b: [string, string][]; // Bids array [price, size] +a: [string, string][]; // Asks array [price, size] +u: number; // Update ID +ts: number; // Timestamp +seq: number; // Sequence +cts: number; // Cross timestamp ⋮---- -/** Fuzzy search */ +export interface SpreadTickerV5 { + symbol: string; // Spread combination symbol name + bidPrice: string; // Bid 1 price + bidSize: string; // Bid 1 size + askPrice: string; // Ask 1 price + askSize: string; // Ask 1 size + lastPrice: string; // Last trade price + highPrice24h: string; // The highest price in the last 24 hours + lowPrice24h: string; // The lowest price in the last 24 hours + prevPrice24h: string; // Price 24 hours ago + volume24h: string; // Volume for 24h +} ⋮---- -/** Authorization / Clearing / Refund (see Bybit) */ +symbol: string; // Spread combination symbol name +bidPrice: string; // Bid 1 price +bidSize: string; // Bid 1 size +askPrice: string; // Ask 1 price +askSize: string; // Ask 1 size +lastPrice: string; // Last trade price +highPrice24h: string; // The highest price in the last 24 hours +lowPrice24h: string; // The lowest price in the last 24 hours +prevPrice24h: string; // Price 24 hours ago +volume24h: string; // Volume for 24h ⋮---- -export interface QueryCardPointRecordsParamsV5 { - type?: string; - pageSize?: number; - pageNo?: number; - startTime?: number; - endTime?: number; - outOrderId?: string; - bizId?: string; - bizTxnId?: string; - /** 1: Earn, 2: Deduct */ - side?: string; +export interface SpreadRecentTradeV5 { + execId: string; // Execution ID + symbol: string; // Spread combination symbol name + price: string; // Trade price + size: string; // Trade size + side: 'Buy' | 'Sell'; // Side of taker + time: string; // Trade time (ms) + seq?: string; } ⋮---- -/** 1: Earn, 2: Deduct */ +execId: string; // Execution ID +symbol: string; // Spread combination symbol name +price: string; // Trade price +size: string; // Trade size +side: 'Buy' | 'Sell'; // Side of taker +time: string; // Trade time (ms) ⋮---- -export interface QueryCardMallItemListParamsV5 { - pageNo?: number; - pageSize?: number; - /** 1: Virtual, 2: Physical */ - itemType?: number; - /** 1: POINTS, 2: CURRENCY */ - itemBizType?: number; - /** 1: Priority, 2: Listing time, 3: Price */ - orderBy?: number; - asc?: boolean; - /** 0: Default, 1: VIP */ - source?: number; +export interface SpreadOpenOrderV5 { + symbol: string; + baseCoin: string; + orderType: 'Market' | 'Limit'; + orderLinkId: string; + side: 'Buy' | 'Sell'; + timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; + orderId: string; + leavesQty: string; + orderStatus: 'New' | 'PartiallyFilled'; + cumExecQty: string; + price: string; + qty: string; + createdTime: string; + updatedTime: string; } ⋮---- -/** 1: Virtual, 2: Physical */ +export interface SpreadOrderHistoryV5 { + symbol: string; + orderType: 'Market' | 'Limit'; + orderLinkId: string; + orderId: string; + contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; + orderStatus: 'Rejected' | 'Cancelled' | 'Filled'; + price: string; + orderQty: string; + timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; + baseCoin: string; + createdAt: string; + updatedAt: string; + side: 'Buy' | 'Sell'; + leavesQty: string; + settleCoin: string; + cumExecQty: string; + qty: string; + leg1Symbol: string; + leg1ProdType: 'Futures' | 'Spot'; + leg1OrderId: string; + leg1Side: string; + leg2ProdType: 'Futures' | 'Spot'; + leg2OrderId: string; + leg2Symbol: string; + leg2Side: string; + cxlRejReason: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee +} ⋮---- -/** 1: POINTS, 2: CURRENCY */ +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee ⋮---- -/** 1: Priority, 2: Listing time, 3: Price */ +export interface SpreadTradeLegV5 { + symbol: string; + side: 'Buy' | 'Sell'; + execPrice: string; + execTime: string; + execValue: string; + execType: string; + category: 'linear' | 'spot'; + execQty: string; + execFee: string; + feeCurrency: string; // Trading fee currency + execId: string; +} ⋮---- -/** 0: Default, 1: VIP */ +feeCurrency: string; // Trading fee currency ⋮---- -export interface QueryCardPointCashbackDetailParamsV5 { - bizTxnId: string; +export interface SpreadTradeV5 { + symbol: string; + orderLinkId: string; + side: 'Buy' | 'Sell'; + orderId: string; + execPrice: string; + execTime: string; + execType: 'Trade'; + execQty: string; + execId: string; + legs: SpreadTradeLegV5[]; + extraFees: string; } +⋮---- +/** GET /v5/spread/max-qty */ +export interface SpreadMaxQtyResultV5 { + /** Maximum order quantity (available balance for the spread order). */ + ab: string; +} +⋮---- +/** Maximum order quantity (available balance for the spread order). */ ================ -File: src/types/request/v5-earn-advance-discount.ts +File: src/types/websockets/index.ts ================ -/** - * /v5/earn/advance/ — product-extra, place order, position, order (Discount Buy, Dual Assets, etc.) - */ -export type GetAdvanceEarnProductExtraInfoParamsV5 = - | { - category: 'DiscountBuy'; - productId?: string; - } - | { - category: 'DualAssets'; - /** Required for Dual Assets quote. */ - productId: string; - }; + + +================ +File: src/types/websockets/ws-api.ts +================ +import { APIID, WS_KEY_MAP } from '../../util'; +import { + AmendOrderParamsV5, + BatchAmendOrderParamsV5, + BatchCancelOrderParamsV5, + BatchOrderParamsV5, + CancelOrderParamsV5, + OrderParamsV5, +} from '../request'; +import { + BatchAmendOrderResultV5, + BatchCancelOrderResultV5, + BatchCreateOrderResultV5, + BatchOrdersRetExtInfoV5, + OrderResultV5, +} from '../response'; +import { WsKey } from './ws-general'; ⋮---- -/** Required for Dual Assets quote. */ +// When new WS API operations are added, make sure to also update WS_API_Operations[] below +export type WSAPIOperation = + | 'order.create' + | 'order.amend' + | 'order.cancel' + | 'order.create-batch' + | 'order.amend-batch' + | 'order.cancel-batch'; ⋮---- -export interface AdvanceEarnDiscountBuyExtraV5 { - initialPrice: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - settleType: 'Base' | 'Quote'; - instUid: string; +export type WsOperation = + | 'subscribe' + | 'unsubscribe' + | 'auth' + | 'ping' + | 'pong'; +⋮---- +export interface WsRequestOperationBybit { + req_id: string; + op: WsOperation; + args?: (TWSTopic | string | number)[]; } ⋮---- -export interface AdvanceEarnDualAssetsExtraV5 { - orderDirection: 'BuyLow' | 'SellHigh'; - selectPrice: string; - /** Expected APY in e8 precision; API may return int. */ - apyE8: string | number; +export interface WSAPIRequest< + TRequestParams = undefined, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + TWSOperation extends WSAPIOperation = any, +> { + reqId: string; + op: TWSOperation; + header: { + 'X-BAPI-TIMESTAMP': string; + 'X-BAPI-RECV-WINDOW': string; + Referer: typeof APIID; + }; + args: [TRequestParams]; } ⋮---- -/** Expected APY in e8 precision; API may return int. */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any ⋮---- -export interface AdvanceEarnInterestCardExtraV5 { - awardId: string | number; - specCode: string; +export interface WSAPIResponse< + TResponseData extends object = object, + TOperation extends WSAPIOperation = WSAPIOperation, + TResponseExtInfo = {}, // added as optional for batch calls +> { + wsKey: WsKey; + /** Auto-generated */ + reqId: string; + retCode: 0 | number; + retMsg: 'OK' | string; + op: TOperation; + data: TResponseData; + retExtInfo: TResponseExtInfo; + header?: { + 'X-Bapi-Limit': string; + 'X-Bapi-Limit-Status': string; + 'X-Bapi-Limit-Reset-Timestamp': string; + Traceid: string; + Timenow: string; + }; + connId: string; } ⋮---- +TResponseExtInfo = {}, // added as optional for batch calls +⋮---- +/** Auto-generated */ +⋮---- +export type Exact = { + // This part says: if there's any key that's not in T, it's an error + [K: string]: never; +} & { + [K in keyof T]: T[K]; +}; +⋮---- +// This part says: if there's any key that's not in T, it's an error +⋮---- /** - * POST /v5/earn/advance/place-order — Discount Buy + * List of operations supported for this WsKey (connection) */ -export interface SubmitAdvanceEarnPlaceOrderDiscountBuyV5 { - category: 'DiscountBuy'; - productId: string; - orderType: 'Stake'; - amount: string; - coin: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - discountBuyExtra: AdvanceEarnDiscountBuyExtraV5; +export interface WsAPIWsKeyTopicMap { + [WS_KEY_MAP.v5PrivateTrade]: WSAPIOperation; } ⋮---- /** - * POST /v5/earn/advance/place-order — Dual Assets + * Request parameters expected per operation */ -export interface SubmitAdvanceEarnPlaceOrderDualAssetsV5 { - category: 'DualAssets'; - productId: string; - orderType: 'Stake'; - amount: string; - coin: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - dualAssetsExtra: AdvanceEarnDualAssetsExtraV5; - interestCard?: AdvanceEarnInterestCardExtraV5; -} -⋮---- -export type SubmitAdvanceEarnPlaceOrderParamsV5 = - | SubmitAdvanceEarnPlaceOrderDiscountBuyV5 - | SubmitAdvanceEarnPlaceOrderDualAssetsV5; -⋮---- -export interface GetAdvanceEarnPositionListParamsV5 { - category: 'DiscountBuy' | 'DualAssets' | string; - productId?: string; - coin?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetAdvanceEarnOrderListParamsV5 { - category: 'DiscountBuy' | 'DualAssets' | string; - orderId?: string; - orderLinkId?: string; - productId?: string; - /** Dual Assets docs use string ms; other categories may use number. */ - startTime?: string | number; - endTime?: string | number; - limit?: number; - cursor?: string; +export interface WsAPITopicRequestParamMap { + 'order.create': OrderParamsV5; + 'order.amend': AmendOrderParamsV5; + 'order.cancel': CancelOrderParamsV5; + + 'order.create-batch': { + category: 'option' | 'linear'; + request: BatchOrderParamsV5[]; + }; + 'order.amend-batch': { + category: 'option' | 'linear'; + request: BatchAmendOrderParamsV5[]; + }; + 'order.cancel-batch': { + category: 'option' | 'linear'; + request: BatchCancelOrderParamsV5[]; + }; } ⋮---- -/** Dual Assets docs use string ms; other categories may use number. */ - -================ -File: src/types/request/v5-earn-fixed-term.ts -================ /** - * /v5/earn/fixed-term/* + * Response structure expected for each operation */ -export interface GetFixedTermEarnProductParamsV5 { - coin?: string; -} -⋮---- -export interface SubmitFixedTermEarnOrderParamsV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - coin: string; - amount: string; - accountType: 'FUND' | 'UNIFIED'; - orderLinkId: string; - autoInvest?: boolean; -} -⋮---- -export interface RedeemFixedTermEarnParamsV5 { - productId: string; - /** Early redemption: FundPool only */ - category: 'FundPool'; - positionId: string; +export interface WsAPIOperationResponseMap { + 'order.create': WSAPIResponse; + 'order.amend': WSAPIResponse; + 'order.cancel': WSAPIResponse; + + 'order.create-batch': WSAPIResponse< + { list: BatchCreateOrderResultV5[] }, + 'order.create-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + 'order.amend-batch': WSAPIResponse< + { list: BatchAmendOrderResultV5[] }, + 'order.amend-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + 'order.cancel-batch': WSAPIResponse< + { list: BatchCancelOrderResultV5[] }, + 'order.cancel-batch' + > & { + retExtInfo: BatchOrdersRetExtInfoV5; + }; + + ping: { + retCode: 0 | number; + retMsg: 'OK' | string; + op: 'pong'; + data: [string]; + connId: string; + }; } -⋮---- -/** Early redemption: FundPool only */ -⋮---- -export interface GetFixedTermEarnPositionParamsV5 { - productId?: string; - category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - coin?: string; + +================ +File: src/types/websockets/ws-confirmations.ts +================ +export interface WebsocketTopicSubscriptionConfirmationEvent { + op: 'subscribe'; + req_id: string; + conn_id: string; + ret_msg: string; + success: boolean; } ⋮---- -export interface GetFixedTermEarnOrderListParamsV5 { - orderType?: 'Stake' | 'Redeem' | 'Reinvest'; - productId?: string; - category?: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface WebsocketSucceededTopicSubscriptionConfirmationEvent + extends WebsocketTopicSubscriptionConfirmationEvent { + success: true; } ⋮---- -export interface SetFixedTermEarnAutoInvestParamsV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium'; - positionId: string; - status: 'Enable' | 'Disable'; +export interface WebsocketFailedTopicSubscriptionConfirmationEvent + extends WebsocketTopicSubscriptionConfirmationEvent { + success: false; } ================ -File: src/types/request/v5-earn-pwm.ts +File: src/types/index.ts ================ -/** GET /v5/earn/pwm/investment-plan/detail */ -export interface GetPwmInvestmentPlanDetailParamsV5 { - planId: string; -} + + +================ +File: src/index.ts +================ + + +================ +File: src/spot-client-v3.ts +================ +/* eslint-disable @typescript-eslint/no-explicit-any */ +import { APIResponseV3, numberInString } from './types'; +import { REST_CLIENT_TYPE_ENUM } from './util'; +import BaseRestClient from './util/BaseRestClient'; ⋮---- -/** GET /v5/earn/pwm/investment-plan/new-plan */ -export interface GetPwmPendingInvestmentPlanDetailParamsV5 { - planId: string; -} +/** + * REST API client for newer Spot V3 APIs. + * @deprecated WARNING + * These endpoints are being switched off gradually and are expected to be completely turned off by the end of 2024. + * They may stop working at any point before then. + * Please update your code as soon as possible to use the V5 APIs instead. + */ +export class SpotClientV3 extends BaseRestClient ⋮---- -/** POST /v5/earn/pwm/investment-plan/claim */ -export interface ClaimPwmWithdrawableFundsParamsV5 { - planId: string; - /** Default: FUND */ - toAccountType?: string; - orderLinkId: string; -} +getClientType() ⋮---- -/** Default: FUND */ +// Doesn't really matter here, since the only remaining endpoint does not require auth. ⋮---- -/** GET /v5/earn/pwm/investment-plan/asset-trend */ -export interface GetPwmInvestmentPlanAssetTrendParamsV5 { - planId: string; - startTime?: number; - endTime?: number; -} +async fetchServerTime(): Promise ⋮---- -/** GET /v5/earn/pwm/investment-plan/fund-nav */ -export interface GetPwmFundHistoricalNavParamsV5 { - fundId: string; - startTime?: number; - endTime?: number; -} +/** + * + * Market Data Endpoints + * + */ ⋮---- -/** POST /v5/earn/pwm/investment-plan/subscribe */ -export interface SubscribePwmInvestmentPlanParamsV5 { - planId: string; - /** Default: FUND */ - accountType?: string; - orderLinkId: string; -} +/** + * Get merged orderbook for symbol + * + * This is the only known pre-V5 endpoint to still be online. + */ +getMergedOrderBook( + symbol: string, + scale?: number, + limit?: number, + ): Promise> ⋮---- -/** Default: FUND */ +/** + * + * API Data Endpoints + * + */ ⋮---- -/** POST /v5/earn/pwm/investment-plan/invest-more */ -export interface InvestMorePwmInvestmentPlanParamsV5 { - planId: string; - /** Default: FUND */ - accountType?: string; - category: string; - productId: string; - amount: string; - orderLinkId: string; -} +getServerTime(): Promise<{ time_now: numberInString }> + +================ +File: src/websocket-api-client.ts +================ +import { + AmendOrderParamsV5, + BatchAmendOrderParamsV5, + BatchAmendOrderResultV5, + BatchCancelOrderParamsV5, + BatchCancelOrderResultV5, + BatchCreateOrderResultV5, + BatchOrderParamsV5, + BatchOrdersRetExtInfoV5, + CancelOrderParamsV5, + OrderParamsV5, + OrderResultV5, +} from './types'; +import { WSAPIResponse } from './types/websockets/ws-api'; +import { WSClientConfigurableOptions } from './types/websockets/ws-general'; +import { DefaultLogger } from './util'; +import { WS_KEY_MAP } from './util/websockets/websocket-util'; +import { WebsocketClient } from './websocket-client'; ⋮---- -/** Default: FUND */ +/** + * Configurable options specific to only the REST-like WebsocketAPIClient + */ +export interface WSAPIClientConfigurableOptions { + /** + * Default: true + * + * Attach default event listeners, which will console log any high level + * events (opened/reconnecting/reconnected/etc). + * + * If you disable this, you should set your own event listeners + * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. + */ + attachEventListeners: boolean; +} ⋮---- -/** POST /v5/earn/pwm/investment-plan/redeem */ -export interface RedeemPwmInvestmentPlanParamsV5 { - planId: string; - category: string; - productId: string; - orderLinkId: string; - /** Required for fund products */ - shares?: string; - /** Required for non-fund products */ - amount?: string; - /** Required for FundPool and On-chain Earn */ - positionId?: string; -} +/** + * Default: true + * + * Attach default event listeners, which will console log any high level + * events (opened/reconnecting/reconnected/etc). + * + * If you disable this, you should set your own event listeners + * on the embedded WS Client `wsApiClient.getWSClient().on(....)`. + */ ⋮---- -/** Required for fund products */ +/** + * This is a minimal Websocket API wrapper around the WebsocketClient. + * + * Some methods support passing in a custom "wsKey". This is a reference to which WS connection should + * be used to transmit that message. This is only useful if you wish to use an alternative wss + * domain that is supported by the SDK. + * + * Note: To use testnet, don't set the wsKey - use `testnet: true` in + * the constructor instead. + * + * Note: You can also directly use the sendWSAPIRequest() method to make WS API calls, but some + * may find the below methods slightly more intuitive. + * + * Refer to the WS API promises example for a more detailed example on using sendWSAPIRequest() directly: + * https://github.com/tiagosiebler/bybit-api/blob/master/examples/ws-api-raw-promises.ts + */ +export class WebsocketAPIClient ⋮---- -/** Required for non-fund products */ +constructor( + options?: WSClientConfigurableOptions & + Partial, + logger?: DefaultLogger, + ) ⋮---- -/** Required for FundPool and On-chain Earn */ +public getWSClient(): WebsocketClient ⋮---- -/** GET /v5/earn/pwm/investment-plan/order */ -export interface GetPwmInvestmentPlanOrdersParamsV5 { - planId?: string; - category?: string; - type?: 'Subscribe' | 'Redeem' | 'AutoReinvest' | string; - status?: 'Completed' | 'Pending' | 'Failed' | string; - startTime?: string; - endTime?: string; - limit?: number; - cursor?: string; - orderLinkId?: string; -} +public setTimeOffsetMs(newOffset: number): void ⋮---- -/** POST /v5/earn/pwm/customize-plan/create */ -export interface CreatePwmCustomizeInvestmentPlanProductV5 { - category: string; - productId: string; - fundName: string; - amount: string; -} +/* + * Bybit WebSocket API Methods + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + */ ⋮---- -export interface CreatePwmCustomizeInvestmentPlanParamsV5 { - accountType?: string; - products: CreatePwmCustomizeInvestmentPlanProductV5[]; -} +/** + * Submit a new order + * + * @param params + * @returns + */ +submitNewOrder( + params: OrderParamsV5, + ): Promise> ⋮---- -/** GET /v5/earn/pwm/asset-manager/all-funds */ -export interface GetPwmAllFundsParamsV5 { - coin?: string; - fundId?: string; - status?: string; - limit?: number; - cursor?: string; -} +/** + * Amend an order + * + * @param params + * @returns + */ +amendOrder( + params: AmendOrderParamsV5, + ): Promise> ⋮---- -/** POST /v5/earn/pwm/asset-manager/settle-profit */ -export interface SettlePwmFundProfitParamsV5 { - fundId: string; - reqLinkId: string; -} +/** + * Cancel an order + * + * @param params + * @returns + */ +cancelOrder( + params: CancelOrderParamsV5, + ): Promise> ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-fund */ -export interface CreatePwmFundParamsV5 { - fundName: string; - coin: string; - profitShareRate: string; - managementFeeRate: string; - fundIntroduction?: string; - reqLinkId: string; -} +/** + * Batch submit orders + * + * @param params + * @returns + */ +batchSubmitOrders( + category: 'option' | 'linear', + orders: BatchOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchCreateOrderResultV5[]; + }, + 'order.create-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ -export interface CreatePwmAssetManagerInvestmentPlanDistributionV5 { - productId: string; - amount: string; -} +/** + * Batch amend orders + * + * @param params + * @returns + */ +batchAmendOrder( + category: 'option' | 'linear', + orders: BatchAmendOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchAmendOrderResultV5[]; + }, + 'order.amend-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -export interface CreatePwmAssetManagerInvestmentPlanParamsV5 { - accountUid: string; - planName: string; - planType: 'stable' | 'advanced' | string; - investmentDistribution: CreatePwmAssetManagerInvestmentPlanDistributionV5[]; - reqLinkId: string; -} +/** + * Batch cancel orders + * + * @param params + * @returns + */ +batchCancelOrder( + category: 'option' | 'linear', + orders: BatchCancelOrderParamsV5[], + ): Promise< + WSAPIResponse< + { + list: BatchCancelOrderResultV5[]; + }, + 'order.cancel-batch', + BatchOrdersRetExtInfoV5 + > + > ⋮---- -/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ -export interface GetPwmAssetManagerInvestmentPlansParamsV5 { - planId?: string; - status?: string; - subscriptionUid?: string; - limit?: number; - cursor?: string; -} +/** + * + * + * + * + * + * + * + * Private methods for handling some of the convenience/automation provided by the WS API Client + * + * + * + * + * + * + * + */ ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ -export interface ManagePwmAssetManagerInvestmentPlanFundV5 { - fundId: string; - amount: string; -} +private setupDefaultEventListeners() ⋮---- -export interface ManagePwmAssetManagerInvestmentPlanParamsV5 { - planId: string; - updateStatus?: 'Closed' | 'Deleted' | string; - updateFunds?: ManagePwmAssetManagerInvestmentPlanFundV5[]; - reqLinkId: string; -} +/** + * General event handlers for monitoring the WebsocketClient + */ ⋮---- -/** GET /v5/earn/pwm/asset-manager/all-order */ -export interface GetPwmAllFundOrdersParamsV5 { - fundId?: string; - orderType?: 'Subscribe' | 'Redeem' | string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} +// Blind JSON.stringify can fail on circular references ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-order */ -export interface ManagePwmFundOrderParamsV5 { - orderId: string; - action: 'approve' | 'reject' | string; - reqLinkId: string; -} +// JSON.stringify({ ...data, target: 'WebSocket' }), + +================ +File: .eslintrc.cjs +================ +// 'require-extensions', // only once moved to ESM ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-sub-account */ -export interface CreatePwmFundSubAccountParamsV5 { - fundId: string; - reqLinkId: string; -} +// 'plugin:require-extensions/recommended', // only once moved to ESM ⋮---- -/** POST /v5/earn/pwm/fund-transfer */ -export interface PwmFundTransferParamsV5 { - transferId: string; - fromUserId: number; - toUserId: number; - amount: string; - coin: string; -} -⋮---- -/** GET /v5/earn/pwm/query-fund-transfer-result */ -export interface GetPwmFundTransferRecordsParamsV5 { - transferId?: string; - fromUserId?: number; +// 'no-unused-vars': ['warn'], + +================ +File: .jshintrc +================ +{ + "esversion": 8, + "asi": true, + "laxbreak": true, + "predef": [ "-Promise" ] } ================ -File: src/types/request/v5-earn-token.ts +File: .prettierrc +================ +{ + "tabWidth": 2, + "singleQuote": true, + "trailingComma": "all" +} + +================ +File: index.js +================ + + +================ +File: jsconfig.json +================ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs" + }, + "exclude": [ + "node_modules", + "**/node_modules/*", + "coverage", + "doc", + "examples/ignored/*" + ] +} + +================ +File: LICENSE.md +================ +Copyright 2024 Tiago Siebler + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +================ +File: tsconfig.build.json +================ +{ + "extends": "./tsconfig.json", + "exclude": [ + "node_modules", + "test", + "dist", + "**/*spec.ts", + "**/*test.ts", + "jest.config.ts" + ] +} + +================ +File: tsconfig.examples.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "distExamples", + "allowJs": true + }, + "include": ["examples/**/*.ts", "examples/**/*.js"] +} + +================ +File: tsconfig.json +================ +{ + "compileOnSave": true, + "compilerOptions": { + "allowJs": true, + "target": "es6", + "module": "commonjs", + "moduleResolution": "node", + "declaration": true, + "removeComments": false, + "noEmitOnError": true, + "noImplicitAny": false, + "strictNullChecks": true, + "skipLibCheck": true, + "sourceMap": true, + "esModuleInterop": true, + "lib": ["es2017", "dom"], + "baseUrl": ".", + "outDir": "./lib" + }, + "include": ["src/**/*"], + "exclude": ["node_modules", "**/node_modules/*", "coverage", "doc"] +} + +================ +File: tsconfig.linting.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "target": "esnext", + "rootDir": "../", + "allowJs": true + }, + "include": [ + "src/**/*.*", + "test/**/*.*", + "examples/**/*.*", + ".eslintrc.cjs", + "jest.config.ts" + ] +} + +================ +File: tsconfig.test.json +================ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./distTest", + "allowJs": true + }, + "include": ["test/**/*.ts", "test/**/*.js"] +} + +================ +File: src/types/request/v5-alpha-lp.ts ================ /** - * Earn token product (e.g. BYUSDT) — /v5/earn/token/* + * V5 private Alpha LP requests. */ ⋮---- -export interface GetEarnTokenProductParamsV5 { - /** Currently only BYUSDT */ - coin: string; +export interface GetAlphaLPPoolListParamsV5 { + tokenSymbol?: string; } ⋮---- -/** Currently only BYUSDT */ -⋮---- -export interface PlaceEarnTokenOrderParamsV5 { - coin: string; - orderLinkId: string; - orderType: 'Mint' | 'Redeem'; - amount: string; - /** Mint: FlexibleSaving; Redeem: UNIFIED */ - accountType: 'FlexibleSaving' | 'UNIFIED'; +export interface GetAlphaLPPoolInfoParamsV5 { + poolAddress: string; } ⋮---- -/** Mint: FlexibleSaving; Redeem: UNIFIED */ -⋮---- -export interface GetEarnTokenOrderListParamsV5 { - coin: string; - orderLinkId?: string; - orderId?: string; - orderType?: 'Mint' | 'Redeem'; - /** seconds */ - startTime?: number; - /** seconds */ - endTime?: number; - cursor?: string; - limit?: number; +export interface ExecuteAlphaLPStakeParamsV5 { + positionId: number; + poolAddress: string; + payTokenAmount: string; + payTokenCode: string; + rangeUpper?: string; + rangeLower?: string; + priceUpper?: string; + priceLower?: string; } ⋮---- -/** seconds */ -⋮---- -/** seconds */ -⋮---- -export interface GetEarnTokenPositionParamsV5 { - coin: string; +export interface ExecuteAlphaLPRedeemParamsV5 { + positionId: number; + poolAddress: string; + dercRatio: string; + receiveTokenCode?: string; } ⋮---- -export interface GetEarnTokenDailyYieldParamsV5 { - coin: string; - startTime?: number; - endTime?: number; - cursor?: string; +export interface GetAlphaLPOrderListParamsV5 { + orderType?: 0 | 1 | 2; + tokenCode?: string; + orderStatus?: number[]; + days?: number; limit?: number; + pageIndex?: number; + poolAddress?: string; } ⋮---- -export interface GetEarnTokenHourlyYieldParamsV5 { - coin: string; - startTime?: number; - endTime?: number; - cursor?: string; - limit?: number; +export interface GetAlphaLPPayTokenListParamsV5 { + chainCode?: string; + tokenAddress?: string; } ⋮---- -export interface GetEarnTokenHistoryAprParamsV5 { - coin: string; - /** 1 = 7d, 2 = 30d, 3 = 180d */ - range: 1 | 2 | 3; +export interface GetAlphaLPPayTokenPriceParamsV5 { + tokenCode: string[]; + chainCode?: string; } -⋮---- -/** 1 = 7d, 2 = 30d, 3 = 180d */ ================ -File: src/types/request/v5-event.ts +File: src/types/request/v5-alpha-prediction.ts ================ -export interface GetEventInstrumentsInfoParamsV5 { - symbol?: string; - status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; - limit?: number; - cursor?: string; +/** + * V5 private Alpha prediction market requests. + */ +⋮---- +export interface GetAlphaPredictionEventDetailParamsV5 { + eventId?: string; + slug?: string; + hasMoreMarkets?: boolean; } ⋮---- -export interface GetEventOrderbookParamsV5 { - symbol: string; +export interface GetAlphaPredictionOrderEstimateParamsV5 { + tokenId: string; + side: 1 | 2; + eventId: string; + amount: string; + orderType: 1; + payTokenCode?: string; } ⋮---- -export interface GetEventOrderHistoryParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventActiveOrdersParamsV5 { - symbol?: string; - orderId?: string; - orderLinkId?: string; - limit?: number; - cursor?: string; -} -⋮---- -export interface GetEventPositionInfoParamsV5 { - symbol?: string; - baseCoin?: string; - settleCoin?: string; - limit?: number; - cursor?: string; +export interface ExecuteAlphaPredictionBuyParamsV5 { + tokenId: string; + amount: string; + payTokenCode: string; + orderType: 1; + slippage: string; + eventId: string; } ⋮---- -export interface GetEventTradeHistoryParamsV5 { - symbol: string; - orderId?: string; - orderLinkId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface ExecuteAlphaPredictionSellParamsV5 { + tokenId: string; + size: string; + orderType: 1; + slippage: string; + eventId: string; + toTokenCode?: string; } ⋮---- -export interface GetEventSettlementRecordsParamsV5 { - symbol: string; - orderId?: string; - startTime?: number; - endTime?: number; +export interface GetAlphaPredictionOrderListParamsV5 { + status?: number; + tokenId?: string; + eventId?: string; + side?: 1 | 2; + days?: number; limit?: number; - cursor?: string; + pageIndex?: number; } ⋮---- -export interface SubmitEventQuoteParamsV5 { - symbol: string; - orderLinkId: string; - grossPayoutRatio: string; - amount: string; +export interface GetAlphaPredictionOrderBookParamsV5 { + tokenIds: string[]; } ⋮---- -export interface CancelEventQuoteParamsV5 { - orderLinkId?: string; - orderId?: string; +export interface GetAlphaPredictionTokenPriceParamsV5 { + tokenIds: string[]; } - -================ -File: src/types/request/v5-position.ts -================ -import { - CategoryV5, - ExecTypeV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - TPSLModeV5, -} from '../shared-v5'; ⋮---- -export interface GetFuturesLeverageParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; +export interface GetAlphaPredictionPriceHistoryParamsV5 { + tokenId: string; + interval: string; } ⋮---- -export interface PositionInfoParamsV5 { - category: CategoryV5; - symbol?: string; - baseCoin?: string; - settleCoin?: string; +export interface GetAlphaPredictionPositionListParamsV5 { + tokenId?: string; + eventId?: string; limit?: number; - cursor?: string; -} -⋮---- -export interface SetLeverageParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - buyLeverage: string; - sellLeverage: string; -} -⋮---- -export interface SwitchIsolatedMarginParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - tradeMode: 0 | 1; - buyLeverage: string; - sellLeverage: string; + pageIndex?: number; } ⋮---- -export interface SetTPSLModeParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - tpSlMode: TPSLModeV5; +export interface GetAlphaPredictionPositionHistoryParamsV5 { + tokenId?: string; + eventId?: string; + result?: number; + days?: number; + limit?: number; + pageIndex?: number; } ⋮---- -export interface SwitchPositionModeParamsV5 { - category: 'linear' | 'inverse'; - symbol?: string; - coin?: string; - mode: 0 | 3; +export interface GetAlphaPredictionPortfolioSummaryParamsV5 { + eventType?: number; } ⋮---- -export interface SetRiskLimitParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - riskId: number; - positionIdx?: PositionIdx; +export interface GetAlphaPredictionSideMarketListParamsV5 { + eventId: string; + sortBy?: string; + marketType?: number; + limit?: number; + pageIndex?: number; } ⋮---- -export interface SetTradingStopParamsV5 { - category: CategoryV5; - symbol: string; - takeProfit?: string; - stopLoss?: string; - trailingStop?: string; - tpTriggerBy?: OrderTriggerByV5; - slTriggerBy?: OrderTriggerByV5; - activePrice?: string; - tpslMode?: TPSLModeV5; - tpSize?: string; - slSize?: string; - tpLimitPrice?: string; - slLimitPrice?: string; - tpOrderType?: OrderTypeV5; - slOrderType?: OrderTypeV5; - positionIdx: PositionIdx; +export interface GetAlphaPredictionSportsMatchListParamsV5 { + eventType: number; + status?: number; + startTime?: number; + endTime?: number; + stageCode?: string; + limit?: number; + pageIndex?: number; } ⋮---- -export interface SetAutoAddMarginParamsV5 { - category: 'linear'; - symbol: string; - autoAddMargin: 0 | 1; - positionIdx?: PositionIdx; +export interface GetAlphaPredictionSportsTimelineStagesParamsV5 { + eventType: number; } ⋮---- -export interface AddOrReduceMarginParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; - margin: string; - positionIDex?: PositionIdx; +export interface GetAlphaPredictionSportsGroupStageDetailParamsV5 { + eventType: number; + groupName?: string; } -⋮---- -export interface GetExecutionListParamsV5 { - category: CategoryV5; - symbol?: string; - orderId?: string; - orderLinkId?: string; - baseCoin?: string; - settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option - startTime?: number; - endTime?: number; - execType?: ExecTypeV5; + +================ +File: src/types/request/v5-broker.ts +================ +export interface GetExchangeBrokerEarningsParamsV5 { + bizType?: 'SPOT' | 'DERIVATIVES' | 'OPTIONS' | 'CONVERT' | 'FIAT_CONVERT'; + begin?: string; + end?: string; + uid?: string; limit?: number; cursor?: string; } ⋮---- -settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option -⋮---- -export interface GetClosedPnLParamsV5 { - category: CategoryV5; - symbol?: string; +export interface GetBrokerSubAccountDepositsV5 { + id?: string; + txID?: string; + subMemberId?: string; + coin?: string; startTime?: number; endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface MovePositionParamsV5 { - fromUid: string; - toUid: string; - list: { - category: 'linear' | 'spot' | 'option' | 'inverse'; - symbol: string; - price: string; - side: 'Buy' | 'Sell'; - qty: string; - }[]; +export interface IssueVoucherParamsV5 { + accountId: string; + awardId: string; + specCode: string; + amount: string; + brokerId: string; } ⋮---- -export interface GetMovePositionHistoryParamsV5 { - category?: 'linear' | 'spot' | 'option'; - symbol?: string; - startTime?: number; - endTime?: number; - status?: 'Processing' | 'Filled' | 'Rejected'; - blockTradeId?: string; - limit?: string; - cursor?: string; +export interface GetBrokerIssuedVoucherParamsV5 { + accountId: string; + awardId: string; + specCode: string; + withUsedAmount?: boolean; } ⋮---- -export interface ConfirmNewRiskLimitParamsV5 { - category: 'linear' | 'inverse'; - symbol: string; +/** Set Rate Limit - exchange broker only. API rate limit: 1 req per second. */ +export interface SetBrokerRateLimitParamsV5 { + list: { + uids: string; + bizType: string; + rate: number; + }[]; } ⋮---- -export interface GetClosedOptionsPositionsParamsV5 { - category: 'option'; - symbol?: string; - startTime?: number; - endTime?: number; - limit?: number; +/** Get All Rate Limits - exchange broker only. API rate limit: 1 req per second. */ +export interface GetAllBrokerRateLimitsParamsV5 { + limit?: string; cursor?: string; + uids?: string; } ================ -File: src/types/request/v5-rfq.ts +File: src/types/request/v5-earn-liquidity-mining.ts ================ -export interface RFQTransactionV5 { - category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type - symbol: string; // Name of the trading contract - side: 'buy' | 'sell'; // Inquiry transaction direction - qty: string; // Transaction quantity - isLeverage?: boolean; // For spot lending, default false +/** + * GET /v5/earn/liquidity-mining/product (public, 50 req/s per IP) + */ +export interface GetLiquidityMiningProductParamsV5 { + baseCoin?: string; + quoteCoin?: string; } ⋮---- -category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type -symbol: string; // Name of the trading contract -side: 'buy' | 'sell'; // Inquiry transaction direction -qty: string; // Transaction quantity -isLeverage?: boolean; // For spot lending, default false +export interface ReinvestLiquidityMiningParamsV5 { + productId: string; + orderLinkId: string; + positionId: string; + leverage?: string; +} + +================ +File: src/types/request/v5-earn-pwm.ts +================ +/** GET /v5/earn/pwm/investment-plan/detail */ +export interface GetPwmInvestmentPlanDetailParamsV5 { + planId: string; +} ⋮---- -export interface RFQHedgeLegV5 { - category: string; - symbol: string; - side: string; - qty: string; - price?: string; +/** GET /v5/earn/pwm/investment-plan/new-plan */ +export interface GetPwmPendingInvestmentPlanDetailParamsV5 { + planId: string; } ⋮---- -export interface CreateRFQParamsV5 { - counterparties: string[]; // Array of deskCode - rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters - anonymous?: boolean; // Whether it is anonymous inquiry, default false - strategyType?: string; // Inquiry label, max 36 characters - list: RFQTransactionV5[]; // Transaction list, up to 10 sets - hedge?: RFQHedgeLegV5[]; +/** POST /v5/earn/pwm/investment-plan/claim */ +export interface ClaimPwmWithdrawableFundsParamsV5 { + planId: string; + /** Default: FUND */ + toAccountType?: string; + orderLinkId: string; } ⋮---- -counterparties: string[]; // Array of deskCode -rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters -anonymous?: boolean; // Whether it is anonymous inquiry, default false -strategyType?: string; // Inquiry label, max 36 characters -list: RFQTransactionV5[]; // Transaction list, up to 10 sets +/** Default: FUND */ ⋮---- -export interface CancelRFQParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Inquiry Custom ID +/** GET /v5/earn/pwm/investment-plan/asset-trend */ +export interface GetPwmInvestmentPlanAssetTrendParamsV5 { + planId: string; + startTime?: number; + endTime?: number; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Inquiry Custom ID +/** GET /v5/earn/pwm/investment-plan/fund-nav */ +export interface GetPwmFundHistoricalNavParamsV5 { + fundId: string; + startTime?: number; + endTime?: number; +} ⋮---- -export interface RFQQuoteV5 { - category: 'spot' | 'linear' | 'option'; // Product type - symbol: string; // Name of the trading contract - price: string; // Quote price - isLeverage?: boolean; // For spot lending, default false +/** POST /v5/earn/pwm/investment-plan/subscribe */ +export interface SubscribePwmInvestmentPlanParamsV5 { + planId: string; + /** Default: FUND */ + accountType?: string; + orderLinkId: string; } ⋮---- -category: 'spot' | 'linear' | 'option'; // Product type -symbol: string; // Name of the trading contract -price: string; // Quote price -isLeverage?: boolean; // For spot lending, default false +/** Default: FUND */ ⋮---- -export interface CreateRFQQuoteParamsV5 { - rfqId: string; // Inquiry ID - quoteLinkId?: string; // Quotation custom ID, 1-32 characters - anonymous?: boolean; // Whether it is anonymous quotation, default false - expiresIn?: number; // Validity period in seconds, default 60 - quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction - quoteSellList?: RFQQuoteV5[]; // Quotation sell direction +/** POST /v5/earn/pwm/investment-plan/invest-more */ +export interface InvestMorePwmInvestmentPlanParamsV5 { + planId: string; + /** Default: FUND */ + accountType?: string; + category: string; + productId: string; + amount: string; + orderLinkId: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteLinkId?: string; // Quotation custom ID, 1-32 characters -anonymous?: boolean; // Whether it is anonymous quotation, default false -expiresIn?: number; // Validity period in seconds, default 60 -quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction -quoteSellList?: RFQQuoteV5[]; // Quotation sell direction +/** Default: FUND */ ⋮---- -export interface ExecuteRFQQuoteParamsV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Quotation ID - quoteSide: 'buy' | 'sell'; // The direction of the quote - isHedge?: boolean; +/** POST /v5/earn/pwm/investment-plan/redeem */ +export interface RedeemPwmInvestmentPlanParamsV5 { + planId: string; + category: string; + productId: string; + orderLinkId: string; + /** Required for fund products */ + shares?: string; + /** Required for non-fund products */ + amount?: string; + /** Required for FundPool and On-chain Earn */ + positionId?: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Quotation ID -quoteSide: 'buy' | 'sell'; // The direction of the quote +/** Required for fund products */ ⋮---- -export interface GetRFQDetailsParamsV5 { - rfqId?: string; - rfqLinkId?: string; - status?: - | 'Active' - | 'PendingFill' - | 'Canceled' - | 'Filled' - | 'Expired' - | 'Failed'; - traderType?: 'quote' | 'request'; - startTime?: number; - endTime?: number; +/** Required for non-fund products */ +⋮---- +/** Required for FundPool and On-chain Earn */ +⋮---- +/** GET /v5/earn/pwm/investment-plan/order */ +export interface GetPwmInvestmentPlanOrdersParamsV5 { + planId?: string; + category?: string; + type?: 'Subscribe' | 'Redeem' | 'AutoReinvest' | string; + status?: 'Completed' | 'Pending' | 'Failed' | string; + startTime?: string; + endTime?: string; limit?: number; cursor?: string; + orderLinkId?: string; } ⋮---- -export interface CancelRFQQuoteParamsV5 { - quoteId?: string; // Quotation ID - rfqId?: string; // Inquiry ID - quoteLinkId?: string; // Quotation Custom ID +/** POST /v5/earn/pwm/customize-plan/create */ +export interface CreatePwmCustomizeInvestmentPlanProductV5 { + category: string; + productId: string; + fundName: string; + amount: string; } ⋮---- -quoteId?: string; // Quotation ID -rfqId?: string; // Inquiry ID -quoteLinkId?: string; // Quotation Custom ID -⋮---- -export interface GetRFQRealtimeParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Inquiry Custom ID - traderType?: 'quote' | 'request'; // Trader type, default 'request' +export interface CreatePwmCustomizeInvestmentPlanParamsV5 { + accountType?: string; + products: CreatePwmCustomizeInvestmentPlanProductV5[]; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Inquiry Custom ID -traderType?: 'quote' | 'request'; // Trader type, default 'request' +/** GET /v5/earn/pwm/asset-manager/all-funds */ +export interface GetPwmAllFundsParamsV5 { + coin?: string; + fundId?: string; + status?: string; + limit?: number; + cursor?: string; +} ⋮---- -export interface GetRFQListParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Custom ID for inquiry form - traderType?: 'quoter' | 'request'; // Trader type, default 'request' - status?: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status of the inquiry form - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** POST /v5/earn/pwm/asset-manager/settle-profit */ +export interface SettlePwmFundProfitParamsV5 { + fundId: string; + reqLinkId: string; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Custom ID for inquiry form -traderType?: 'quoter' | 'request'; // Trader type, default 'request' +/** POST /v5/earn/pwm/asset-manager/create-fund */ +export interface CreatePwmFundParamsV5 { + fundName: string; + coin: string; + profitShareRate: string; + managementFeeRate: string; + fundIntroduction?: string; + reqLinkId: string; +} ⋮---- -| 'Failed'; // Status of the inquiry form -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark +/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ +export interface CreatePwmAssetManagerInvestmentPlanDistributionV5 { + productId: string; + amount: string; +} ⋮---- -export interface GetRFQQuoteRealtimeParamsV5 { - rfqId?: string; // Inquiry ID - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation Custom ID - traderType?: 'quote' | 'request'; // Trader type, default 'quote' +export interface CreatePwmAssetManagerInvestmentPlanParamsV5 { + accountUid: string; + planName: string; + planType: 'stable' | 'advanced' | string; + investmentDistribution: CreatePwmAssetManagerInvestmentPlanDistributionV5[]; + reqLinkId: string; } ⋮---- -rfqId?: string; // Inquiry ID -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation Custom ID -traderType?: 'quote' | 'request'; // Trader type, default 'quote' +/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ +export interface GetPwmAssetManagerInvestmentPlansParamsV5 { + planId?: string; + status?: string; + subscriptionUid?: string; + limit?: number; + cursor?: string; +} ⋮---- -export interface GetRFQHistoryParamsV5 { - rfqId?: string; // Inquiry ID - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation custom ID, can only check last 3 months - traderType?: 'quote' | 'request'; // Trader type, default 'quote' - status?: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status of quotation - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ +export interface ManagePwmAssetManagerInvestmentPlanFundV5 { + fundId: string; + amount: string; } ⋮---- -rfqId?: string; // Inquiry ID -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation custom ID, can only check last 3 months -traderType?: 'quote' | 'request'; // Trader type, default 'quote' -⋮---- -| 'Failed'; // Status of quotation -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark -⋮---- -export interface GetRFQTradeListParamsV5 { - rfqId?: string; // Inquiry ID - rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months - quoteId?: string; // Quotation ID - quoteLinkId?: string; // Quotation custom ID, can only check last 3 months - status?: 'Filled' | 'Rejected'; // Status - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +export interface ManagePwmAssetManagerInvestmentPlanParamsV5 { + planId: string; + updateStatus?: 'Closed' | 'Deleted' | string; + updateFunds?: ManagePwmAssetManagerInvestmentPlanFundV5[]; + reqLinkId: string; } ⋮---- -rfqId?: string; // Inquiry ID -rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months -quoteId?: string; // Quotation ID -quoteLinkId?: string; // Quotation custom ID, can only check last 3 months -status?: 'Filled' | 'Rejected'; // Status -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark -⋮---- -export interface GetRFQPublicTradesParamsV5 { - startTime?: number; // Timestamp in milliseconds, time range is 7 days - endTime?: number; // Timestamp in milliseconds, time range is 7 days - limit?: number; // Return number of items, max 100, default 50 - cursor?: string; // Page turning mark +/** GET /v5/earn/pwm/asset-manager/all-order */ +export interface GetPwmAllFundOrdersParamsV5 { + fundId?: string; + orderType?: 'Subscribe' | 'Redeem' | string; + status?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -startTime?: number; // Timestamp in milliseconds, time range is 7 days -endTime?: number; // Timestamp in milliseconds, time range is 7 days -limit?: number; // Return number of items, max 100, default 50 -cursor?: string; // Page turning mark -⋮---- -export interface AcceptNonLPQuoteParamsV5 { - rfqId: string; // Inquiry ID +/** POST /v5/earn/pwm/asset-manager/manage-order */ +export interface ManagePwmFundOrderParamsV5 { + orderId: string; + action: 'approve' | 'reject' | string; + reqLinkId: string; } ⋮---- -rfqId: string; // Inquiry ID - -================ -File: src/types/request/v5-rwa.ts -================ -/** - * V5 RWA (Real World Assets) earn requests. - */ -⋮---- -export interface GetRWAProductListParamsV5 { - coin?: string; +/** POST /v5/earn/pwm/asset-manager/create-sub-account */ +export interface CreatePwmFundSubAccountParamsV5 { + fundId: string; + reqLinkId: string; } ⋮---- -export interface PlaceRWAOrderParamsV5 { - productId: number; - orderType: 'Stake' | 'Redeem'; +/** POST /v5/earn/pwm/fund-transfer */ +export interface PwmFundTransferParamsV5 { + transferId: string; + fromUserId: number; + toUserId: number; + amount: string; coin: string; - orderLinkId: string; - stakeAmount?: string; - redeemShares?: string; - accountType?: 'FUND' | 'UNIFIED'; -} -⋮---- -export interface GetRWAOrderListParamsV5 { - orderId?: string; - orderLinkId?: string; - orderType?: 'Stake' | 'Redeem'; - productId?: number; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; } ⋮---- -export interface GetRWANavChartParamsV5 { - productId: number; - startTime?: number; - endTime?: number; +/** GET /v5/earn/pwm/query-fund-transfer-result */ +export interface GetPwmFundTransferRecordsParamsV5 { + transferId?: string; + fromUserId?: number; } ================ -File: src/types/request/v5-spot-x.ts +File: src/types/request/v5-position.ts ================ -export interface GetLaunchpoolProjectListParamsV5 { - status: number; - activityCoin?: string; - projectId?: string; - cursor?: string; - limit?: number; -} +import { + CategoryV5, + ExecTypeV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + TPSLModeV5, +} from '../shared-v5'; ⋮---- -export interface GetLaunchpoolUserActivityLogParamsV5 { - stakeCoin?: string; - type?: number; - status?: number; - startTime?: string; - endTime?: string; - pageSize?: number; - current?: number; +export interface GetFuturesLeverageParamsV5 { + category: 'linear' | 'inverse'; + symbol?: string; } ⋮---- -export interface GetLaunchpoolUserHistoryParamsV5 { - stakeCoin?: string; - rewardCoin?: string; - startTime?: string; - endTime?: string; - pageSize?: number; - current?: number; +export interface PositionInfoParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; } ⋮---- -export interface GetPuzzleProjectListParamsV5 { - status: number; - projectId?: string; - activityCoin?: string; - cursor?: string; - limit?: number; +export interface SetLeverageParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + buyLeverage: string; + sellLeverage: string; } ⋮---- -export interface GetTokenSplashProjectListParamsV5 { - status: number; - projectId?: string; - activityCoin?: string; - cursor?: string; - limit?: number; +export interface SwitchIsolatedMarginParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + tradeMode: 0 | 1; + buyLeverage: string; + sellLeverage: string; } ⋮---- -export interface GetTokenSplashUserActivityParamsV5 { - projectId?: string; - activityCoin?: string; +export interface SetTPSLModeParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; + tpSlMode: TPSLModeV5; } - -================ -File: src/types/request/v5-spreadtrading.ts -================ -export interface GetSpreadInstrumentsInfoParamsV5 { +⋮---- +export interface SwitchPositionModeParamsV5 { + category: 'linear' | 'inverse'; symbol?: string; - baseCoin?: string; - limit?: number; - cursor?: string; + coin?: string; + mode: 0 | 3; } ⋮---- -/** GET /v5/spread/max-qty */ -export interface GetSpreadMaxQtyParamsV5 { +export interface SetRiskLimitParamsV5 { + category: 'linear' | 'inverse'; symbol: string; - /** 1: Buy, 2: Sell */ - side: '1' | '2'; - orderPrice: string; + riskId: number; + positionIdx?: PositionIdx; } ⋮---- -/** 1: Buy, 2: Sell */ +export interface SetTradingStopParamsV5 { + category: CategoryV5; + symbol: string; + takeProfit?: string; + stopLoss?: string; + trailingStop?: string; + tpTriggerBy?: OrderTriggerByV5; + slTriggerBy?: OrderTriggerByV5; + activePrice?: string; + tpslMode?: TPSLModeV5; + tpSize?: string; + slSize?: string; + tpLimitPrice?: string; + slLimitPrice?: string; + tpOrderType?: OrderTypeV5; + slOrderType?: OrderTypeV5; + positionIdx: PositionIdx; +} ⋮---- -export interface SubmitSpreadOrderParamsV5 { +export interface SetAutoAddMarginParamsV5 { + category: 'linear'; symbol: string; - side: 'Buy' | 'Sell'; - orderType: 'Limit' | 'Market'; - qty: string; - price: string; - orderLinkId: string; - timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; + autoAddMargin: 0 | 1; + positionIdx?: PositionIdx; } ⋮---- -export interface AmendSpreadOrderParamsV5 { +export interface AddOrReduceMarginParamsV5 { + category: 'linear' | 'inverse'; symbol: string; - orderId?: string; - orderLinkId?: string; - qty?: string; - price?: string; + margin: string; + positionIDex?: PositionIdx; } ⋮---- -export interface GetSpreadOpenOrdersParamsV5 { +export interface GetExecutionListParamsV5 { + category: CategoryV5; symbol?: string; - baseCoin?: string; orderId?: string; orderLinkId?: string; + baseCoin?: string; + settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option + startTime?: number; + endTime?: number; + execType?: ExecTypeV5; limit?: number; cursor?: string; } -export interface GetSpreadOrderHistoryParamsV5 { +⋮---- +settleCoin?: string; // Settle coin, uppercase only. For linear, inverse, option +⋮---- +export interface GetClosedPnLParamsV5 { + category: CategoryV5; symbol?: string; - baseCoin?: string; - orderId?: string; - orderLinkId?: string; startTime?: number; endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface GetSpreadTradeHistoryParamsV5 { +export interface MovePositionParamsV5 { + fromUid: string; + toUid: string; + list: { + category: 'linear' | 'spot' | 'option' | 'inverse'; + symbol: string; + price: string; + side: 'Buy' | 'Sell'; + qty: string; + }[]; +} +⋮---- +export interface GetMovePositionHistoryParamsV5 { + category?: 'linear' | 'spot' | 'option'; + symbol?: string; + startTime?: number; + endTime?: number; + status?: 'Processing' | 'Filled' | 'Rejected'; + blockTradeId?: string; + limit?: string; + cursor?: string; +} +⋮---- +export interface ConfirmNewRiskLimitParamsV5 { + category: 'linear' | 'inverse'; + symbol: string; +} +⋮---- +export interface GetClosedOptionsPositionsParamsV5 { + category: 'option'; symbol?: string; - orderId?: string; - orderLinkId?: string; startTime?: number; endTime?: number; limit?: number; @@ -4839,136 +5225,389 @@ export interface GetSpreadTradeHistoryParamsV5 { } ================ -File: src/types/request/v5-strategy.ts +File: src/types/request/v5-rfq.ts ================ -import { - OrderSideV5, - PositionIdx, - PovModeV5, - StrategyCategoryV5, - StrategyPreferV5, - StrategyTypeV5, -} from '../shared-v5'; -⋮---- -/** POST /v5/strategy/create */ -export interface CreateStrategyOrderParamsV5 { - category: StrategyCategoryV5; - symbol: string; - side: OrderSideV5; - strategyType: StrategyTypeV5; - /** Total order quantity (coin). Either size or positionValue is required */ - size?: string; - /** Total order quantity (value). Either size or positionValue is required */ - positionValue?: string; - reduceOnly?: boolean; - positionIdx?: PositionIdx; - /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ - leverageType?: 0 | 1; - /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ - duration?: number; - /** TWAP / POV: sub-order placement interval (seconds) */ - interval?: 5 | 10 | 15 | 30 | 60 | 120; - /** TWAP: randomize each sub-order quantity by ±20% */ - isRandom?: boolean; - /** Advanced: activate when market price reaches this value */ - triggerPrice?: string; - /** Advanced: terminate when last traded price reaches this value */ - maxChasePrice?: string; - /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ - chaseDistance?: string; - /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ - chasePercentE4?: number; - /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ - chasePrice?: string; - strategyPrefer?: StrategyPreferV5; - limitPrice?: string; - strategySl?: string; - strategyTp?: string; - /** Iceberg: 0 = taker allowed, 1 = post-only */ - postOnly?: 0 | 1; - isRebalance?: boolean; - /** 1: market, 2: limit */ - orderType?: 1 | 2; - orderPriceOffset?: string; - strategyName?: string; - /** POV execution mode */ - mode?: PovModeV5; - /** POV participation rate */ - participationRate?: string; - /** POV: historical traded volume window (seconds), range [60, 14400] */ - referenceWindow?: string; - /** POV: book depth reference levels [1, 10] */ - depthReference?: string; +export interface RFQTransactionV5 { + category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type + symbol: string; // Name of the trading contract + side: 'buy' | 'sell'; // Inquiry transaction direction + qty: string; // Transaction quantity + isLeverage?: boolean; // For spot lending, default false } ⋮---- -/** Total order quantity (coin). Either size or positionValue is required */ +category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type +symbol: string; // Name of the trading contract +side: 'buy' | 'sell'; // Inquiry transaction direction +qty: string; // Transaction quantity +isLeverage?: boolean; // For spot lending, default false ⋮---- -/** Total order quantity (value). Either size or positionValue is required */ +export interface RFQHedgeLegV5 { + category: string; + symbol: string; + side: string; + qty: string; + price?: string; +} ⋮---- -/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ +export interface CreateRFQParamsV5 { + counterparties: string[]; // Array of deskCode + rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters + anonymous?: boolean; // Whether it is anonymous inquiry, default false + strategyType?: string; // Inquiry label, max 36 characters + list: RFQTransactionV5[]; // Transaction list, up to 10 sets + hedge?: RFQHedgeLegV5[]; +} ⋮---- -/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ +counterparties: string[]; // Array of deskCode +rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters +anonymous?: boolean; // Whether it is anonymous inquiry, default false +strategyType?: string; // Inquiry label, max 36 characters +list: RFQTransactionV5[]; // Transaction list, up to 10 sets ⋮---- -/** TWAP / POV: sub-order placement interval (seconds) */ +export interface CancelRFQParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Inquiry Custom ID +} ⋮---- -/** TWAP: randomize each sub-order quantity by ±20% */ +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Inquiry Custom ID ⋮---- -/** Advanced: activate when market price reaches this value */ +export interface RFQQuoteV5 { + category: 'spot' | 'linear' | 'option'; // Product type + symbol: string; // Name of the trading contract + price: string; // Quote price + isLeverage?: boolean; // For spot lending, default false +} ⋮---- -/** Advanced: terminate when last traded price reaches this value */ +category: 'spot' | 'linear' | 'option'; // Product type +symbol: string; // Name of the trading contract +price: string; // Quote price +isLeverage?: boolean; // For spot lending, default false ⋮---- -/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ +export interface CreateRFQQuoteParamsV5 { + rfqId: string; // Inquiry ID + quoteLinkId?: string; // Quotation custom ID, 1-32 characters + anonymous?: boolean; // Whether it is anonymous quotation, default false + expiresIn?: number; // Validity period in seconds, default 60 + quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction + quoteSellList?: RFQQuoteV5[]; // Quotation sell direction +} ⋮---- -/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ +rfqId: string; // Inquiry ID +quoteLinkId?: string; // Quotation custom ID, 1-32 characters +anonymous?: boolean; // Whether it is anonymous quotation, default false +expiresIn?: number; // Validity period in seconds, default 60 +quoteBuyList?: RFQQuoteV5[]; // Quotation buy direction +quoteSellList?: RFQQuoteV5[]; // Quotation sell direction ⋮---- -/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ +export interface ExecuteRFQQuoteParamsV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Quotation ID + quoteSide: 'buy' | 'sell'; // The direction of the quote + isHedge?: boolean; +} ⋮---- -/** Iceberg: 0 = taker allowed, 1 = post-only */ +rfqId: string; // Inquiry ID +quoteId: string; // Quotation ID +quoteSide: 'buy' | 'sell'; // The direction of the quote ⋮---- -/** 1: market, 2: limit */ +export interface GetRFQDetailsParamsV5 { + rfqId?: string; + rfqLinkId?: string; + status?: + | 'Active' + | 'PendingFill' + | 'Canceled' + | 'Filled' + | 'Expired' + | 'Failed'; + traderType?: 'quote' | 'request'; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -/** POV execution mode */ +export interface CancelRFQQuoteParamsV5 { + quoteId?: string; // Quotation ID + rfqId?: string; // Inquiry ID + quoteLinkId?: string; // Quotation Custom ID +} ⋮---- -/** POV participation rate */ +quoteId?: string; // Quotation ID +rfqId?: string; // Inquiry ID +quoteLinkId?: string; // Quotation Custom ID ⋮---- -/** POV: historical traded volume window (seconds), range [60, 14400] */ +export interface GetRFQRealtimeParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Inquiry Custom ID + traderType?: 'quote' | 'request'; // Trader type, default 'request' +} ⋮---- -/** POV: book depth reference levels [1, 10] */ +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Inquiry Custom ID +traderType?: 'quote' | 'request'; // Trader type, default 'request' ⋮---- -/** GET /v5/strategy/list */ -export interface GetStrategyListParamsV5 { - strategyId?: string; - symbol?: string; - /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ - status?: '2' | '3' | '4' | '5' | '6'; - category?: StrategyCategoryV5; - strategyType?: StrategyTypeV5; - beginTimeE0?: number; - endTimeE0?: number; - pageSize?: number; - cursor?: string; +export interface GetRFQListParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Custom ID for inquiry form + traderType?: 'quoter' | 'request'; // Trader type, default 'request' + status?: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status of the inquiry form + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark } ⋮---- -/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Custom ID for inquiry form +traderType?: 'quoter' | 'request'; // Trader type, default 'request' ⋮---- -/** GET /v5/strategy/order-list */ -export interface GetStrategyOrderListParamsV5 { - strategyId: string; - /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ - status?: '2' | '3' | '4' | '5' | '6' | '7'; - symbol?: string; - strategyType?: StrategyTypeV5; - beginTimeE0?: number; - endTimeE0?: number; +| 'Failed'; // Status of the inquiry form +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark +⋮---- +export interface GetRFQQuoteRealtimeParamsV5 { + rfqId?: string; // Inquiry ID + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation Custom ID + traderType?: 'quote' | 'request'; // Trader type, default 'quote' +} +⋮---- +rfqId?: string; // Inquiry ID +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation Custom ID +traderType?: 'quote' | 'request'; // Trader type, default 'quote' +⋮---- +export interface GetRFQHistoryParamsV5 { + rfqId?: string; // Inquiry ID + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation custom ID, can only check last 3 months + traderType?: 'quote' | 'request'; // Trader type, default 'quote' + status?: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status of quotation + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark +} +⋮---- +rfqId?: string; // Inquiry ID +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation custom ID, can only check last 3 months +traderType?: 'quote' | 'request'; // Trader type, default 'quote' +⋮---- +| 'Failed'; // Status of quotation +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark +⋮---- +export interface GetRFQTradeListParamsV5 { + rfqId?: string; // Inquiry ID + rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months + quoteId?: string; // Quotation ID + quoteLinkId?: string; // Quotation custom ID, can only check last 3 months + status?: 'Filled' | 'Rejected'; // Status + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark +} +⋮---- +rfqId?: string; // Inquiry ID +rfqLinkId?: string; // Custom ID for inquiry form, can only check last 3 months +quoteId?: string; // Quotation ID +quoteLinkId?: string; // Quotation custom ID, can only check last 3 months +status?: 'Filled' | 'Rejected'; // Status +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark +⋮---- +export interface GetRFQPublicTradesParamsV5 { + startTime?: number; // Timestamp in milliseconds, time range is 7 days + endTime?: number; // Timestamp in milliseconds, time range is 7 days + limit?: number; // Return number of items, max 100, default 50 + cursor?: string; // Page turning mark +} +⋮---- +startTime?: number; // Timestamp in milliseconds, time range is 7 days +endTime?: number; // Timestamp in milliseconds, time range is 7 days +limit?: number; // Return number of items, max 100, default 50 +cursor?: string; // Page turning mark +⋮---- +export interface AcceptNonLPQuoteParamsV5 { + rfqId: string; // Inquiry ID +} +⋮---- +rfqId: string; // Inquiry ID + +================ +File: src/types/request/v5-rwa.ts +================ +/** + * V5 RWA (Real World Assets) earn requests. + */ +⋮---- +export interface GetRWAProductListParamsV5 { + coin?: string; +} +⋮---- +export interface PlaceRWAOrderParamsV5 { + productId: number; + orderType: 'Stake' | 'Redeem'; + coin: string; + orderLinkId: string; + stakeAmount?: string; + redeemShares?: string; + accountType?: 'FUND' | 'UNIFIED'; +} +⋮---- +export interface GetRWAOrderListParamsV5 { + orderId?: string; + orderLinkId?: string; + orderType?: 'Stake' | 'Redeem'; + productId?: number; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +export interface GetRWANavChartParamsV5 { + productId: number; + startTime?: number; + endTime?: number; +} + +================ +File: src/types/request/v5-spot-x.ts +================ +export interface GetLaunchpoolProjectListParamsV5 { + status: number; + activityCoin?: string; + projectId?: string; + cursor?: string; + limit?: number; +} +⋮---- +export interface GetLaunchpoolUserActivityLogParamsV5 { + stakeCoin?: string; + type?: number; + status?: number; + startTime?: string; + endTime?: string; + pageSize?: number; + current?: number; +} +⋮---- +export interface GetLaunchpoolUserHistoryParamsV5 { + stakeCoin?: string; + rewardCoin?: string; + startTime?: string; + endTime?: string; pageSize?: number; + current?: number; +} +⋮---- +export interface GetPuzzleProjectListParamsV5 { + status: number; + projectId?: string; + activityCoin?: string; cursor?: string; + limit?: number; } ⋮---- -/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ +export interface GetTokenSplashProjectListParamsV5 { + status: number; + projectId?: string; + activityCoin?: string; + cursor?: string; + limit?: number; +} ⋮---- -/** POST /v5/strategy/stop */ -export interface StopStrategyParamsV5 { - strategyId: string; +export interface GetTokenSplashUserActivityParamsV5 { + projectId?: string; + activityCoin?: string; +} + +================ +File: src/types/request/v5-spreadtrading.ts +================ +export interface GetSpreadInstrumentsInfoParamsV5 { + symbol?: string; + baseCoin?: string; + limit?: number; + cursor?: string; +} +⋮---- +/** GET /v5/spread/max-qty */ +export interface GetSpreadMaxQtyParamsV5 { + symbol: string; + /** 1: Buy, 2: Sell */ + side: '1' | '2'; + orderPrice: string; +} +⋮---- +/** 1: Buy, 2: Sell */ +⋮---- +export interface SubmitSpreadOrderParamsV5 { + symbol: string; + side: 'Buy' | 'Sell'; + orderType: 'Limit' | 'Market'; + qty: string; + price: string; + orderLinkId: string; + timeInForce: 'IOC' | 'FOK' | 'GTC' | 'PostOnly'; +} +⋮---- +export interface AmendSpreadOrderParamsV5 { + symbol: string; + orderId?: string; + orderLinkId?: string; + qty?: string; + price?: string; +} +⋮---- +export interface GetSpreadOpenOrdersParamsV5 { + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + limit?: number; + cursor?: string; +} +export interface GetSpreadOrderHistoryParamsV5 { + symbol?: string; + baseCoin?: string; + orderId?: string; + orderLinkId?: string; + /** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ + orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} +⋮---- +/** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ +⋮---- +export interface GetSpreadTradeHistoryParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ================ @@ -5491,194 +6130,7 @@ export interface AlphaPredictionSportsGroupStageDetailV5 { } ================ -File: src/types/response/v5-alpha-trade.ts -================ -/** - * V5 private Alpha / on-chain (Web3) trade responses. - */ -⋮---- -export interface AlphaTradeQuoteModeEstimationV5 { - quoteMode: number; - estimatedGas: string; - estimatedGasUsd: string; - estimatedSlippage: string; -} -⋮---- -export interface AlphaTradeQuoteResultV5 { - tradeType: number; - fromTokenCode: string; - fromTokenAmount: string; - fromTokenAmountUsd: string; - toTokenCode: string; - toTokenAmount: string; - toTokenAmountUsd: string; - minToTokenAmount: string; - slippage: string; - gas: string; - gasUsd: string; - platformFee: string; - platformFeeUsd: string; - swapRate: string; - lossRate: string; - quoteData: string; - correctingCode: string; - quoteMode: number; - quoteDataId: string; - expireTime: number; - modeEstimations: AlphaTradeQuoteModeEstimationV5[]; - chargeAmount?: string; - timestamp?: number; -} -⋮---- -export interface ExecuteAlphaTradeResultV5 { - orderNo: string; -} -⋮---- -export interface AlphaPayTokenV5 { - tokenCode: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - limit: string; - supportChains: string[]; -} -⋮---- -export interface AlphaTradeOrderV5 { - orderType: number; - tradeType: number; - orderNo: string; - orderStatus: number; - fromTokenCode: string; - fromTokenAmount: string; - fromTokenSymbol: string; - fromTokenDecimals: number; - fromTokenIconUrlDay?: string; - fromTokenIconUrlNight?: string; - fromChainCode: string; - fromChainIconUrl?: string; - toTokenCode: string; - toTokenAmount: string; - toTokenSymbol: string; - toTokenDecimals: number; - toTokenIconUrlDay?: string; - toTokenIconUrlNight?: string; - toChainCode: string; - toChainIconUrl?: string; - gasTokenSymbol: string; - gasOnchain: string; - gasUsd: string | null; - platformFee: string; - platformFeeUsd: string | null; - quoteMode: number; - createTime: number; - executionTime?: number; - failureReasonCode?: string; - source?: string; - swapRate: string; - actualFromTokenAmount: string; -} -⋮---- -export interface AlphaTradeOrderListResultV5 { - total: number; - pageIndex: number; - orders: AlphaTradeOrderV5[]; -} -⋮---- -export interface AlphaBizTokenV5 { - tokenCode: string; - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - createTime: number; - createTimeOnchain: number; - riskFlag: number; - minOrderQuantity: number; - maxOrderQuantity: number; - tokenTags: number[]; - payTokenCodes: string[]; -} -⋮---- -export interface AlphaBizTokenPriceV5 { - chainCode: string; - tokenAddress: string; - price: string; - change24h: string; - vol24h: string; - marketCap: string; - liquidity: string; - holders: string; -} -⋮---- -export interface AlphaBizTokenPriceListResultV5 { - tokenPriceInfoList: AlphaBizTokenPriceV5[]; -} -⋮---- -export interface AlphaBizTokenDetailsV5 { - tokenCode: string; - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - symbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - minOrderQuantity: string; - maxOrderQuantity: string; - maxPositionQuantity: string; - tokenDesc: string; - xUrl: string; - officialUrl: string; - whitePaperUrl: string; - tokenTag: number; - riskFlag: number; - createTimeOnchain: number; - status: number; - tokenTags: number[]; - showMessage: number; - content?: string; - linkName?: string; - linkAddress?: string; -} -⋮---- -export interface AlphaAssetV5 { - chainCode: string; - chainIconUrl: string; - tokenAddress: string; - tokenCode: string; - tokenSymbol: string; - tokenDecimals: number; - tokenIconUrlDay: string; - tokenIconUrlNight: string; - tokenAmount: string; - tokenAmountUsd: string; - tradeFlag: number; - pnl: string | null; - pnlRatio: string | null; - costPrice: string | null; - lastPrice: string; - costTotalValue: string | null; - assetStatus: number; - announcementUrl?: string; - estimatedOfflineTime?: number; - delistingTime?: number; -} -⋮---- -export interface AlphaAssetListResultV5 { - totalAssetUsd: string; - assetList: AlphaAssetV5[]; -} -⋮---- -export interface AlphaAssetDetailResultV5 { - assetList: AlphaAssetV5[]; -} - -================ -File: src/types/response/v5-broker.ts +File: src/types/response/v5-broker.ts ================ interface EarningDetailV5 { userId: string; @@ -5791,2451 +6243,2082 @@ export interface BrokerRateLimitAllItemV5 { } ================ -File: src/types/response/v5-card.ts +File: src/types/response/v5-earn-liquidity-mining.ts ================ -export interface CardAssetRecordV5 { - pan4: string; - pan6: string; - tradeStatus: string; - side: string; - basicAmount: string; - basicCurrency: string; - transactionAmount: string; - transactionCurrency: string; - txnCreate: number; - merchCountry: string; - merchCity: string; - merchName: string; - txnId: string; - declinedReason: string; - totalFees: string; - uid: number; - transactionCurrencyAmount: string; - fxPad: string; - interchangeFee: string; - billAmount: string; - paidAmount: string; - paidCurrency: string; - bonusAmount: string; - foreignTransactionFee: string; - totalTax: string; - paidFiat: string; - withdrawalFee: string; - status: string; - orderNo: string; - mccCode: string; - merchCategoryDesc: string; +export interface LiquidityMiningApyBreakdownV5 { + coin: string; + apy: string; } ⋮---- -export interface CardAssetRecordsResultV5 { - pageSize: number; - pageNo: number; - totalCount: number; - data: CardAssetRecordV5[]; +export interface LiquidityMiningProductV5 { + productId: string; + baseCoin: string; + quoteCoin: string; + status: 'Available' | 'NotAvailable' | string; + maxLeverage: number; + minInvestmentQuote: string; + minInvestmentBase: string; + maxInvestmentQuote: string; + maxInvestmentBase: string; + minWithdrawalAmount: string; + minReinvestAmount: string; + baseCoinPrecision: number; + quoteCoinPrecision: number; + yieldCoins: string[]; + apyE8: string; + apy7dE8: string; + poolLiquidityValue: string; + dailyYield: string; + slippageRateE8List: string[]; + apyBreakdown: LiquidityMiningApyBreakdownV5[]; + apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; + slippage_levels?: string[]; } ⋮---- -export interface CardPointBalanceV5 { - accountId: string; - availablePoint: string | number; - pendingPoint: string | number; - status: string; - updateTime: string | number; - settlementPeriod: number; +export interface LiquidityMiningProductResultV5 { + products: LiquidityMiningProductV5[]; } ⋮---- -export interface CardPointRecordV5 { - outOrderId: string; - point: number; - side: string; - type: string; - subType: string; - createTime: number; - updateTime: number; - bizId: string; - bizTxnId: string; - transactionDate: string; - transactionId: string; - transactionAmount: string; - basicCurrency: string; - merchCategoryDesc: string; - merchName: string; - merchCountry: string; - merchCity: string; - pan4: string; - payFiatAmount: string; - transactionCurrencyAmount: string; +export interface ReinvestLiquidityMiningResultV5 { + orderId: string; + orderLinkId: string; } -⋮---- -export interface CardPointRecordsResultV5 { - pageSize: number; - pageNo: number; - totalCount: number; - data: CardPointRecordV5[]; + +================ +File: src/types/response/v5-earn-pwm.ts +================ +export interface PwmCoinAmountV5 { + coin: string; + amount: string; } ⋮---- -export interface CardPointTierInfoV5 { - usedLimit: string; - limit: string; - unit: string; - tier: string; - autoCashback: boolean; +export interface PwmMultiCoinsEarningPositionItemV5 { + category: string; + productId: string; + coin: string; + currentAmount: string; + accumulateYield: string; + apr: string; + positionId: string; + status?: string; } ⋮---- -export interface CardMallItemV5 { - itemId: string; - itemName: string; - priority: number; - onTime: string; - offTime: string; - price: string; - discountPrice: string; - totalNum: number; - redeemNum: number; - picPath: string; - currency: string; - currencyType: number; - itemType: number; - itemBizType: number; +export interface PwmMultiCoinsEarningPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + items: PwmMultiCoinsEarningPositionItemV5[]; } ⋮---- -export interface CardMallItemListResultV5 { - pageNo: number; - pageSize: number; - totalCount: number; - data: CardMallItemV5[]; +export interface PwmFixedYieldPositionItemV5 { + category: string; + productId: string; + coin: string; + currentAmount: string; + accumulateYield: string; + apr: string; + duration: number; + maturityTime: string; + autoReinvest: boolean; + positionId: string; + status?: string; } ⋮---- -export interface CardPointCashbackDetailV5 { - points: string; - amt: string; - ccy: string; - ccyType: string; - createTime: string; - bizTxnId: string; - sourceId: number; - sourceCode: string; - orderStatus: number; - orderSubStatus: number; - orderShowStatus: string; - failedBizCode: string; +export interface PwmFixedYieldPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + items: PwmFixedYieldPositionItemV5[]; } - -================ -File: src/types/response/v5-earn-advance-discount.ts -================ -export interface AdvanceEarnDiscountBuyOfferV5 { - productId: string; - currentPrice: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - maxInvestmentAmount: string; - instUid: string; - expiredAt: string; +⋮---- +export interface PwmEquityFundPositionItemV5 { category: string; + productId: string; + fundName: string; + coin: string; + tags: string[]; + nav: string; + userShares: string; + shareValue: string; + holdingValue: string; + accumulateYield: string; + apr30d: string; + aprTotal: string; + sharpRatio: string; + maxDrawdown: string; + createdTime: string; + runningDays: number; + positionId?: string; + status?: string; } ⋮---- -/** GET /v5/earn/advance/product-extra-info?category=DiscountBuy */ -export interface AdvanceEarnProductExtraInfoDiscountBuyV5 { - offers: AdvanceEarnDiscountBuyOfferV5[]; +export interface PwmEquityFundsPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + items: PwmEquityFundPositionItemV5[]; } ⋮---- -export interface AdvanceEarnDualAssetQuoteLevelV5 { - selectPrice: string; - apyE8: string; - maxInvestmentAmount: string; - expiredAt: string; +export interface PwmOnchainEarnPositionItemV5 { + category: string; + productId: string; + coin: string; + stakeAmount: string; + apr: string; + positionId: string; + status?: string; } ⋮---- -export interface AdvanceEarnDualAssetQuoteProductV5 { - productId: string; - currentPrice: string; - buyLowPrice: AdvanceEarnDualAssetQuoteLevelV5[]; - sellHighPrice: AdvanceEarnDualAssetQuoteLevelV5[]; +export interface PwmOnchainEarnPositionsV5 { + totalInvestmentUsd: string; + accumulateYieldUsd: string; + items: PwmOnchainEarnPositionItemV5[]; } ⋮---- -/** GET /v5/earn/advance/product-extra-info?category=DualAssets&productId= */ -export interface AdvanceEarnProductExtraInfoDualAssetsV5 { - category: 'DualAssets'; - list: AdvanceEarnDualAssetQuoteProductV5[]; +export interface PwmInvestmentPlanPositionsV5 { + multiCoinsEarning?: PwmMultiCoinsEarningPositionsV5; + fixedYield?: PwmFixedYieldPositionsV5; + equityFunds?: PwmEquityFundsPositionsV5; + onchainEarn?: PwmOnchainEarnPositionsV5; + fundingAccount?: PwmCoinAmountV5[]; } ⋮---- -export type AdvanceEarnProductExtraInfoV5 = - | AdvanceEarnProductExtraInfoDiscountBuyV5 - | AdvanceEarnProductExtraInfoDualAssetsV5; +/** GET /v5/earn/pwm/investment-plan/list */ +export interface PwmInvestmentPlanSummaryV5 { + planId: string; + planName: string; + planType: string; + status: string; + currentAssetUsd?: string; + accumulateYieldUsd?: string; + weightedAvgApr?: string; + createdTime?: string; +} ⋮---- -export interface AdvanceEarnPlaceOrderResultV5 { - orderId: string; - orderLinkId: string; +export interface PwmInvestmentPlanListResultV5 { + list: PwmInvestmentPlanSummaryV5[]; } ⋮---- -export interface AdvanceEarnDiscountBuyPositionV5 { - positionId: string; - productId: string; - category: string; - coin: string; - underlyingAsset: string; - amount: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; +/** GET /v5/earn/pwm/investment-plan/detail */ +export interface PwmInvestmentPlanDetailV5 { + planId: string; + planName: string; + planType: string; status: string; - orderId: string; - duration: string; - settlementTime: string; - accountType: string; - toAccountType: string; - settleType: string; - expectReceiveAt: string; + currentAssetUsd: string; + accumulateYieldUsd: string; + weightedAvgApr: string; + currentAssets: PwmCoinAmountV5[]; + positions: PwmInvestmentPlanPositionsV5; + createdTime: string; } ⋮---- -export interface AdvanceEarnDualAssetsPositionV5 { - positionId: string; - productId: string; - category: string; - baseCoin: string; - quoteCoin: string; - investCoin: string; - amount: string; - apyE8: string; - direction: 'BuyLow' | 'SellHigh' | string; - targetPrice: string; - settlementTime: string; - status: string; - orderId: string; - duration: string; - expectReturnCoin: string; - expectReturnAmount: string; - accountType: string; - toAccountType: string; - yieldStartAt: string | number; - yieldEndAt: string | number; +export interface PwmEquityFundIntroductionV5 { + description: string; + historicalYieldRateMax: string; + historicalYieldRateMin: string; + sharpRatio: string; + maxDrawback: string; + lockupPeriod: string; } ⋮---- -export interface AdvanceEarnPositionListV5 { +export interface PwmPendingMultiCoinsEarningItemV5 { category: string; - list: (AdvanceEarnDiscountBuyPositionV5 | AdvanceEarnDualAssetsPositionV5)[]; - nextPageCursor: string; + productId: string; + coin: string; + configuredAmount: string; + apr: string; } ⋮---- -export interface AdvanceEarnDiscountBuyOrderV5 { - orderId: string; - orderLinkId: string; - productId: string; +export interface PwmPendingFixedYieldItemV5 { category: string; - orderType: string; - amount: string; + productId: string; coin: string; - underlyingAsset: string; - status: string; - createdTime: string; - purchasePrice: string; - knockoutPrice: string; - knockoutCouponE8: string; - duration: string; - settlementTime: string; - accountType: string; - toAccountType: string; - settleType: string; - settlementPrice: string; - settlementCoin: string; - settlementAmount: string; - isVip: boolean; - refundStatus: string; + configuredAmount: string; + apr: string; + duration: number; } ⋮---- -export interface AdvanceEarnDualAssetsOrderV5 { - orderId: string; - orderLinkId: string; - productId: string; +export interface PwmPendingEquityFundItemV5 { category: string; - orderType: string; - amount: string; + productId: string; + fundName: string; coin: string; - baseCoin: string; - quoteCoin: string; - status: string; - createdTime: string; - updatedTime: string; - direction: 'BuyLow' | 'SellHigh' | string; - targetPrice: string; - settlementTime: string | number; - estimateApyE8: string | number; - duration: string; - accountType: string; - toAccountType: string; - selectApyE8: string | number; - isVip: boolean; - settlementCoin: string; - settlementAmount: string; - orderMode: string; - settlementPrice: string; - refundStatus: string; - trialBonusAmount: string; - trialBonusPnl: string; + configuredAmount: string; + tags: string[]; + introduction: PwmEquityFundIntroductionV5; } ⋮---- -export interface AdvanceEarnOrderListV5 { +export interface PwmPendingOnchainEarnItemV5 { category: string; - list: (AdvanceEarnDiscountBuyOrderV5 | AdvanceEarnDualAssetsOrderV5)[]; - nextPageCursor: string; -} - -================ -File: src/types/response/v5-earn-fixed-term.ts -================ -export interface FixedTermEarnTieredApyV5 { - min: string; - max: string; - apy: string; -} -⋮---- -export interface FixedTermEarnInterestCoinApyV5 { + productId: string; coin: string; - apy: string; - expectUnitEarning: string; - currentPrice: string; + configuredAmount: string; + apr: string; } ⋮---- -export interface FixedTermEarnProductV5 { - productId: string; - category: 'FixedTermSaving' | 'FundPool' | 'FundPoolPremium' | string; - coin: string; - duration: string; - status: 'Available' | 'SoldOut' | 'NotStarted' | string; - tieredApyList: FixedTermEarnTieredApyV5[]; - minStakeAmount: string; - maxStakeAmount: string; - precision: number; - subscribeStartAt: string; - subscribeEndAt: string; - allowEarlyRedemption: boolean; - earlyRedemptionApy: string; - redemptionLimitDuration: string; - allowAutoReinvest: boolean; - interestCoinApyList: FixedTermEarnInterestCoinApyV5[]; - isVip: boolean; - creditTime: string; - specialUserGroupRequired: boolean; - specialUserGroupInfo: string; +export interface PwmPendingInvestmentPlanProductsV5 { + multiCoinsEarning?: { + configuredAmountUsd: string; + items: PwmPendingMultiCoinsEarningItemV5[]; + }; + fixedYield?: { + configuredAmountUsd: string; + items: PwmPendingFixedYieldItemV5[]; + }; + equityFunds?: { + configuredAmountUsd: string; + items: PwmPendingEquityFundItemV5[]; + }; + onchainEarn?: { + configuredAmountUsd: string; + items: PwmPendingOnchainEarnItemV5[]; + }; } ⋮---- -export interface FixedTermEarnProductListV5 { - list: FixedTermEarnProductV5[]; +/** GET /v5/earn/pwm/investment-plan/new-plan */ +export interface PwmPendingInvestmentPlanDetailV5 { + planId: string; + planName: string; + planType: string; + status: string; + source: string; + totalConfiguredAmountUsd: string; + products: PwmPendingInvestmentPlanProductsV5; + createdTime: string; } ⋮---- -export interface FixedTermEarnPlaceOrderResultV5 { - orderId: string; - orderLinkId: string; +/** POST /v5/earn/pwm/investment-plan/claim */ +export interface ClaimPwmWithdrawableFundsResultV5 { + planId: string; + toAccountType: number; + status: string; + createdTime: string; } ⋮---- -export interface RedeemFixedTermEarnResultV5 { - redeemAmount: string; - estEarnings: string; +export interface PwmAssetTrendDataPointV5 { + date: string; + assetValueUsd: string; } ⋮---- -export interface FixedTermEarnEarlyRedeemInfoV5 { - allowEarlyRedeem: boolean; - earlyRedeemEarning: string; - returnCoin: string; - redemptionLimitDuration: string; +/** GET /v5/earn/pwm/investment-plan/asset-trend */ +export interface PwmInvestmentPlanAssetTrendResultV5 { + planId: string; + dataPoints: PwmAssetTrendDataPointV5[]; } ⋮---- -export interface FixedTermEarnPositionInterestV5 { - coin: string; - apy: string; - expectReturnEarning: string; - price: string; +export interface PwmFundNavDataPointV5 { + date: string; + nav: string; } ⋮---- -export interface FixedTermEarnPositionV5 { - positionId: string; - productId: string; - category: string; +/** GET /v5/earn/pwm/investment-plan/fund-nav */ +export interface PwmFundHistoricalNavResultV5 { + fundId: string; + fundName: string; coin: string; - amount: string; - effectiveAmount: string; - duration: string; - status: string; - settlementTime: string; - createdAt: string; - orderId: string; - earlyRedeemInfo: FixedTermEarnEarlyRedeemInfoV5 | null; - allowAutoReinvest: boolean; - autoReinvest: string; - interestCoinApyList: FixedTermEarnPositionInterestV5[]; + currentNav: string; + dataPoints: PwmFundNavDataPointV5[]; } ⋮---- -export interface FixedTermEarnPositionListV5 { - list: FixedTermEarnPositionV5[]; +/** POST /v5/earn/pwm/investment-plan/subscribe */ +export interface SubscribePwmInvestmentPlanResultV5 { + planId: string; + status: string; + orderLinkId: string; } ⋮---- -export interface FixedTermEarnOrderYieldInfoV5 { +/** POST /v5/earn/pwm/investment-plan/invest-more */ +export interface InvestMorePwmInvestmentPlanResultV5 { + planId: string; + category: string; + productId: string; coin: string; amount: string; status: string; - createdAt: string; - apy: string; + orderLinkId: string; + orderId: string; } ⋮---- -export interface FixedTermEarnOrderV5 { +/** POST /v5/earn/pwm/investment-plan/redeem */ +export interface RedeemPwmInvestmentPlanResultV5 { orderId: string; - orderLinkId: string; - orderType: string; - status: string; - productId: string; + planId: string; category: string; + productId: string; + shares?: string; + amount?: string; + estimatedAmount?: string; coin: string; - amount: string; - duration: string; - accountType: string; - settlementTime: string; - createdAt: string; - yieldInfoList: FixedTermEarnOrderYieldInfoV5[]; + status: string; + orderLinkId: string; } ⋮---- -export interface FixedTermEarnOrderListV5 { - list: FixedTermEarnOrderV5[]; - nextPageCursor: string; -} - -================ -File: src/types/response/v5-earn-pwm.ts -================ -export interface PwmCoinAmountV5 { +/** GET /v5/earn/pwm/investment-plan/order */ +export interface PwmInvestmentPlanOrderV5 { + orderId: string; + planId: string; + type: string; + accountType: string; coin: string; amount: string; -} -⋮---- -export interface PwmMultiCoinsEarningPositionItemV5 { category: string; productId: string; - coin: string; - currentAmount: string; - accumulateYield: string; - apr: string; - positionId: string; - status?: string; + status: string; + orderTime: string; } ⋮---- -export interface PwmMultiCoinsEarningPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - weightedAvgApr: string; - items: PwmMultiCoinsEarningPositionItemV5[]; +export interface PwmInvestmentPlanOrdersResultV5 { + list: PwmInvestmentPlanOrderV5[]; + nextPageCursor: string; } ⋮---- -export interface PwmFixedYieldPositionItemV5 { +/** GET /v5/earn/pwm/customize-plan/product */ +export interface PwmSubscribableProductCardV5 { category: string; - productId: string; + productId?: string; + fundName?: string; coin: string; - currentAmount: string; - accumulateYield: string; - apr: string; - duration: number; - maturityTime: string; - autoReinvest: boolean; - positionId: string; - status?: string; + apr?: string; + aprRangeLow?: string; + aprRangeHigh?: string; + tags?: string[]; + introduction?: string; + aum?: string; + minInvestmentAmount?: string; + maxInvestmentAmount?: string; + duration?: number; + maxDrawdown?: string; + sharpRatio?: string; + estAPR?: string; } ⋮---- -export interface PwmFixedYieldPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - weightedAvgApr: string; - items: PwmFixedYieldPositionItemV5[]; +export interface PwmSubscribableProductGroupV5 { + type: string; + cards: PwmSubscribableProductCardV5[]; } ⋮---- -export interface PwmEquityFundPositionItemV5 { - category: string; - productId: string; +export interface PwmSubscribableProductInfoResultV5 { + products: PwmSubscribableProductGroupV5[]; +} +⋮---- +/** POST /v5/earn/pwm/customize-plan/create */ +export interface CreatePwmCustomizeInvestmentPlanResultV5 { + planId: string; + planName: string; + status: string; + orderLinkId?: string; +} +⋮---- +/** GET /v5/earn/pwm/asset-manager/all-funds */ +export interface PwmAssetManagerFundV5 { + fundId: string; fundName: string; coin: string; - tags: string[]; - nav: string; - userShares: string; - shareValue: string; - holdingValue: string; - accumulateYield: string; - apr30d: string; - aprTotal: string; - sharpRatio: string; - maxDrawdown: string; + status: string; + totalEquity: string; + totalShares: string; + currentNav: string; + currentAPR?: string; + accountUid: string; + subAccountList: string[]; + profitShareRate: string; + managementFeeRate: string; + uncollectedProfit: string; + collectedProfit: string; + totalLoan: string; createdTime: string; - runningDays: number; - positionId?: string; - status?: string; } ⋮---- -export interface PwmEquityFundsPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - weightedAvgApr: string; - items: PwmEquityFundPositionItemV5[]; +export interface PwmAllFundsResultV5 { + list: PwmAssetManagerFundV5[]; + nextPageCursor: string; } ⋮---- -export interface PwmOnchainEarnPositionItemV5 { - category: string; - productId: string; +/** POST /v5/earn/pwm/asset-manager/settle-profit */ +export interface SettlePwmFundProfitResultV5 { + fundId: string; + status: string; + totalProfitShared: string; + instIncome: string; coin: string; - stakeAmount: string; - apr: string; - positionId: string; - status?: string; -} -⋮---- -export interface PwmOnchainEarnPositionsV5 { - totalInvestmentUsd: string; - accumulateYieldUsd: string; - items: PwmOnchainEarnPositionItemV5[]; + createdTime: string; } ⋮---- -export interface PwmInvestmentPlanPositionsV5 { - multiCoinsEarning?: PwmMultiCoinsEarningPositionsV5; - fixedYield?: PwmFixedYieldPositionsV5; - equityFunds?: PwmEquityFundsPositionsV5; - onchainEarn?: PwmOnchainEarnPositionsV5; - fundingAccount?: PwmCoinAmountV5[]; +/** POST /v5/earn/pwm/asset-manager/create-fund */ +export interface CreatePwmFundResultV5 { + fundId: string; + fundName: string; + coin: string; + status: string; + profitShareRate: string; + managementFeeRate: string; + accountUid: string; + createdTime: string; } ⋮---- -/** GET /v5/earn/pwm/investment-plan/list */ -export interface PwmInvestmentPlanSummaryV5 { +/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ +export interface CreatePwmAssetManagerInvestmentPlanResultV5 { planId: string; - planName: string; planType: string; + accountUid: string; status: string; - currentAssetUsd?: string; - accumulateYieldUsd?: string; - weightedAvgApr?: string; - createdTime?: string; + createdTime: string; } ⋮---- -export interface PwmInvestmentPlanListResultV5 { - list: PwmInvestmentPlanSummaryV5[]; +/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ +export interface PwmAssetManagerInvestmentPlanDistributionV5 { + category: string; + coin: string; + productId: string; + currentAmount: string; } ⋮---- -/** GET /v5/earn/pwm/investment-plan/detail */ -export interface PwmInvestmentPlanDetailV5 { +export interface PwmAssetManagerInvestmentPlanV5 { planId: string; planName: string; planType: string; + subscriptionUid: string; status: string; + source: string; currentAssetUsd: string; accumulateYieldUsd: string; - weightedAvgApr: string; - currentAssets: PwmCoinAmountV5[]; - positions: PwmInvestmentPlanPositionsV5; + investmentDistribution: PwmAssetManagerInvestmentPlanDistributionV5[]; createdTime: string; } ⋮---- -export interface PwmEquityFundIntroductionV5 { - description: string; - historicalYieldRateMax: string; - historicalYieldRateMin: string; - sharpRatio: string; - maxDrawback: string; - lockupPeriod: string; +export interface PwmAssetManagerInvestmentPlansResultV5 { + list: PwmAssetManagerInvestmentPlanV5[]; + nextPageCursor: string; } ⋮---- -export interface PwmPendingMultiCoinsEarningItemV5 { - category: string; - productId: string; - coin: string; - configuredAmount: string; - apr: string; +/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ +export interface ManagePwmAssetManagerInvestmentPlanFundResultV5 { + fundId: string; + amount: string; } ⋮---- -export interface PwmPendingFixedYieldItemV5 { - category: string; - productId: string; - coin: string; - configuredAmount: string; - apr: string; - duration: number; +export interface ManagePwmAssetManagerInvestmentPlanResultV5 { + planId: string; + status: string; + updatedTime: string; + updateFunds: ManagePwmAssetManagerInvestmentPlanFundResultV5[]; } ⋮---- -export interface PwmPendingEquityFundItemV5 { - category: string; - productId: string; +/** GET /v5/earn/pwm/asset-manager/all-order */ +export interface PwmAssetManagerFundOrderV5 { + orderId: string; + fundId: string; fundName: string; + accountUid: string; + orderType: string; coin: string; - configuredAmount: string; - tags: string[]; - introduction: PwmEquityFundIntroductionV5; + amount: string; + shares: string; + status: string; + createdTime: string; } ⋮---- -export interface PwmPendingOnchainEarnItemV5 { - category: string; - productId: string; - coin: string; - configuredAmount: string; - apr: string; +export interface PwmAllFundOrdersResultV5 { + list: PwmAssetManagerFundOrderV5[]; + nextPageCursor: string; } ⋮---- -export interface PwmPendingInvestmentPlanProductsV5 { - multiCoinsEarning?: { - configuredAmountUsd: string; - items: PwmPendingMultiCoinsEarningItemV5[]; - }; - fixedYield?: { - configuredAmountUsd: string; - items: PwmPendingFixedYieldItemV5[]; - }; - equityFunds?: { - configuredAmountUsd: string; - items: PwmPendingEquityFundItemV5[]; - }; - onchainEarn?: { - configuredAmountUsd: string; - items: PwmPendingOnchainEarnItemV5[]; - }; +/** POST /v5/earn/pwm/asset-manager/manage-order */ +export interface ManagePwmFundOrderResultV5 { + orderId: string; + fundId: string; + accountUid: string; + orderStatus: string; + orderType: string; + action: string; + coin: string; + amount: string; + shares: string; + updatedTime: string; } ⋮---- -/** GET /v5/earn/pwm/investment-plan/new-plan */ -export interface PwmPendingInvestmentPlanDetailV5 { - planId: string; - planName: string; - planType: string; - status: string; - source: string; - totalConfiguredAmountUsd: string; - products: PwmPendingInvestmentPlanProductsV5; +/** POST /v5/earn/pwm/asset-manager/create-sub-account */ +export interface CreatePwmFundSubAccountResultV5 { + fundId: string; + subAccountUid: string; createdTime: string; + status: string; } ⋮---- -/** POST /v5/earn/pwm/investment-plan/claim */ -export interface ClaimPwmWithdrawableFundsResultV5 { - planId: string; - toAccountType: number; +/** POST /v5/earn/pwm/fund-transfer */ +export interface PwmFundTransferResultV5 { + transferId: string; status: string; - createdTime: string; } ⋮---- -export interface PwmAssetTrendDataPointV5 { - date: string; - assetValueUsd: string; +/** GET /v5/earn/pwm/query-fund-transfer-result */ +export interface PwmFundTransferRecordV5 { + transferId: string; + status: string; + fromUserId: number; + toUserId: number; + amount: string; + coin: string; } -⋮---- -/** GET /v5/earn/pwm/investment-plan/asset-trend */ -export interface PwmInvestmentPlanAssetTrendResultV5 { - planId: string; - dataPoints: PwmAssetTrendDataPointV5[]; + +================ +File: src/types/response/v5-rfq.ts +================ +export interface RFQConfigV5 { + deskCode: string; // Own deskCode, unique identification code + maxLegs: number; // Maximum number of legs + maxLP: number; // Maximum number of LPs selected in inquiry form + maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed + minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier + minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier + minLimitQtyOptionOrder: number; // Option minimum order multiplier + strategyTypes: { + strategyName: string; // Policy name + }[]; + counterparties: { + strategyName: string; // Policy name + }[]; } ⋮---- -export interface PwmFundNavDataPointV5 { - date: string; - nav: string; -} +deskCode: string; // Own deskCode, unique identification code +maxLegs: number; // Maximum number of legs +maxLP: number; // Maximum number of LPs selected in inquiry form +maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed +minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier +minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier +minLimitQtyOptionOrder: number; // Option minimum order multiplier ⋮---- -/** GET /v5/earn/pwm/investment-plan/fund-nav */ -export interface PwmFundHistoricalNavResultV5 { - fundId: string; - fundName: string; - coin: string; - currentNav: string; - dataPoints: PwmFundNavDataPointV5[]; -} +strategyName: string; // Policy name ⋮---- -/** POST /v5/earn/pwm/investment-plan/subscribe */ -export interface SubscribePwmInvestmentPlanResultV5 { - planId: string; - status: string; - orderLinkId: string; -} +strategyName: string; // Policy name ⋮---- -/** POST /v5/earn/pwm/investment-plan/invest-more */ -export interface InvestMorePwmInvestmentPlanResultV5 { - planId: string; - category: string; - productId: string; - coin: string; - amount: string; - status: string; - orderLinkId: string; - orderId: string; +export interface RFQCounterpartyV5 { + traderName: string; // Name of the bidder + deskCode: string; // Unique identification code of the quotation party + type: string | null; // Quoter type. LP is automated market maker, null means normal quote party } ⋮---- -/** POST /v5/earn/pwm/investment-plan/redeem */ -export interface RedeemPwmInvestmentPlanResultV5 { - orderId: string; - planId: string; - category: string; - productId: string; - shares?: string; - amount?: string; - estimatedAmount?: string; - coin: string; - status: string; - orderLinkId: string; -} +traderName: string; // Name of the bidder +deskCode: string; // Unique identification code of the quotation party +type: string | null; // Quoter type. LP is automated market maker, null means normal quote party ⋮---- -/** GET /v5/earn/pwm/investment-plan/order */ -export interface PwmInvestmentPlanOrderV5 { - orderId: string; - planId: string; - type: string; - accountType: string; - coin: string; - amount: string; - category: string; - productId: string; - status: string; - orderTime: string; +export interface CreateRFQResultV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Inquiry Custom ID + status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of the inquiry form + expiresAt: string; // Expiration time in milliseconds Unix timestamp + deskCode: string; // Inquiry party unique identification code } ⋮---- -export interface PwmInvestmentPlanOrdersResultV5 { - list: PwmInvestmentPlanOrderV5[]; - nextPageCursor: string; -} +rfqId: string; // Inquiry ID +rfqLinkId: string; // Inquiry Custom ID +status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of the inquiry form +expiresAt: string; // Expiration time in milliseconds Unix timestamp +deskCode: string; // Inquiry party unique identification code ⋮---- -/** GET /v5/earn/pwm/customize-plan/product */ -export interface PwmSubscribableProductCardV5 { - category: string; - productId?: string; - fundName?: string; - coin: string; - apr?: string; - aprRangeLow?: string; - aprRangeHigh?: string; - tags?: string[]; - introduction?: string; - aum?: string; - minInvestmentAmount?: string; - maxInvestmentAmount?: string; - duration?: number; - maxDrawdown?: string; - sharpRatio?: string; - estAPR?: string; +export interface CancelRFQResultV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Inquiry Custom ID } ⋮---- -export interface PwmSubscribableProductGroupV5 { - type: string; - cards: PwmSubscribableProductCardV5[]; -} +rfqId: string; // Inquiry ID +rfqLinkId: string; // Inquiry Custom ID ⋮---- -export interface PwmSubscribableProductInfoResultV5 { - products: PwmSubscribableProductGroupV5[]; +export interface CancelRFQItemV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Inquiry Custom ID + code: number; // Cancel success or failure, 0 means success + msg: string; // Cancellation failure reason } ⋮---- -/** POST /v5/earn/pwm/customize-plan/create */ -export interface CreatePwmCustomizeInvestmentPlanResultV5 { - planId: string; - planName: string; - status: string; - orderLinkId?: string; -} +rfqId: string; // Inquiry ID +rfqLinkId: string; // Inquiry Custom ID +code: number; // Cancel success or failure, 0 means success +msg: string; // Cancellation failure reason ⋮---- -/** GET /v5/earn/pwm/asset-manager/all-funds */ -export interface PwmAssetManagerFundV5 { - fundId: string; - fundName: string; - coin: string; - status: string; - totalEquity: string; - totalShares: string; - currentNav: string; - currentAPR?: string; - accountUid: string; - subAccountList: string[]; - profitShareRate: string; - managementFeeRate: string; - uncollectedProfit: string; - collectedProfit: string; - totalLoan: string; - createdTime: string; +export interface CancelAllRFQResultV5 { + data: CancelRFQItemV5[]; // Array of cancellation results } ⋮---- -export interface PwmAllFundsResultV5 { - list: PwmAssetManagerFundV5[]; - nextPageCursor: string; -} +data: CancelRFQItemV5[]; // Array of cancellation results ⋮---- -/** POST /v5/earn/pwm/asset-manager/settle-profit */ -export interface SettlePwmFundProfitResultV5 { - fundId: string; - status: string; - totalProfitShared: string; - instIncome: string; - coin: string; - createdTime: string; +export interface CreateRFQQuoteResultV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Quotation ID + quoteLinkId: string; // Quotation Custom ID + expiresAt: string; // Expiration time in milliseconds Unix timestamp + deskCode: string; // Quoter's unique identification code + status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of quotation } ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-fund */ -export interface CreatePwmFundResultV5 { - fundId: string; - fundName: string; - coin: string; - status: string; - profitShareRate: string; - managementFeeRate: string; - accountUid: string; - createdTime: string; -} +rfqId: string; // Inquiry ID +quoteId: string; // Quotation ID +quoteLinkId: string; // Quotation Custom ID +expiresAt: string; // Expiration time in milliseconds Unix timestamp +deskCode: string; // Quoter's unique identification code +status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of quotation ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-investment-plan */ -export interface CreatePwmAssetManagerInvestmentPlanResultV5 { - planId: string; - planType: string; - accountUid: string; - status: string; - createdTime: string; +export interface ExecuteRFQQuoteResultV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Inquiry Custom ID + quoteId: string; // Quotation ID + status: 'Processing' | 'Rejected'; // Order status + rejectParty: string; // Empty means passed, "Taker", "Maker", "Bybit" when rejected } ⋮---- -/** GET /v5/earn/pwm/asset-manager/get-investment-plan */ -export interface PwmAssetManagerInvestmentPlanDistributionV5 { - category: string; - coin: string; - productId: string; - currentAmount: string; +rfqId: string; // Inquiry ID +rfqLinkId: string; // Inquiry Custom ID +quoteId: string; // Quotation ID +status: 'Processing' | 'Rejected'; // Order status +rejectParty: string; // Empty means passed, "Taker", "Maker", "Bybit" when rejected +⋮---- +export interface CancelRFQQuoteResultV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Quotation ID + quoteLinkId: string; // Quotation Custom ID } ⋮---- -export interface PwmAssetManagerInvestmentPlanV5 { - planId: string; - planName: string; - planType: string; - subscriptionUid: string; - status: string; - source: string; - currentAssetUsd: string; - accumulateYieldUsd: string; - investmentDistribution: PwmAssetManagerInvestmentPlanDistributionV5[]; - createdTime: string; -} +rfqId: string; // Inquiry ID +quoteId: string; // Quotation ID +quoteLinkId: string; // Quotation Custom ID ⋮---- -export interface PwmAssetManagerInvestmentPlansResultV5 { - list: PwmAssetManagerInvestmentPlanV5[]; - nextPageCursor: string; +export interface CancelRFQQuoteItemV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Quotation ID + quoteLinkId: string; // Quotation Custom ID + code: number; // Cancel success or failure, 0 means success + msg: string; // Cancellation failure reason } ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-investment-plan */ -export interface ManagePwmAssetManagerInvestmentPlanFundResultV5 { - fundId: string; - amount: string; -} +rfqId: string; // Inquiry ID +quoteId: string; // Quotation ID +quoteLinkId: string; // Quotation Custom ID +code: number; // Cancel success or failure, 0 means success +msg: string; // Cancellation failure reason ⋮---- -export interface ManagePwmAssetManagerInvestmentPlanResultV5 { - planId: string; - status: string; - updatedTime: string; - updateFunds: ManagePwmAssetManagerInvestmentPlanFundResultV5[]; +export interface RFQLegV5 { + category: 'linear' | 'option' | 'spot'; // Product category + symbol: string; // The unique instrument ID + side: 'buy' | 'sell'; // Inquiry direction + qty: string; // Order quantity of the instrument + isLeverage?: boolean; // For spot lending } ⋮---- -/** GET /v5/earn/pwm/asset-manager/all-order */ -export interface PwmAssetManagerFundOrderV5 { - orderId: string; - fundId: string; - fundName: string; - accountUid: string; - orderType: string; - coin: string; - amount: string; - shares: string; - status: string; - createdTime: string; -} +category: 'linear' | 'option' | 'spot'; // Product category +symbol: string; // The unique instrument ID +side: 'buy' | 'sell'; // Inquiry direction +qty: string; // Order quantity of the instrument +isLeverage?: boolean; // For spot lending ⋮---- -export interface PwmAllFundOrdersResultV5 { - list: PwmAssetManagerFundOrderV5[]; - nextPageCursor: string; +export interface RFQHedgeLegItemV5 { + category: string; + symbol: string; + side: string; + qty: string; + price?: string; } ⋮---- -/** POST /v5/earn/pwm/asset-manager/manage-order */ -export interface ManagePwmFundOrderResultV5 { - orderId: string; - fundId: string; - accountUid: string; - orderStatus: string; - orderType: string; - action: string; - coin: string; - amount: string; - shares: string; - updatedTime: string; +export interface RFQItemV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Custom ID for inquiry form + counterparties: string[]; // List of bidders + expiresAt: string; // Expiration time in milliseconds Unix timestamp + strategyType: string; // Inquiry label + status: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status + acceptOtherQuoteStatus?: string; // Whether to accept non-LP quotes. "false": do not accept, "true": accept + deskCode: string; // Unique identification code of the inquiry party + anonymous?: boolean; + createdAt: number; // Time when the trade is created in epoch + updatedAt: number; // Time when the trade is updated in epoch + legs: RFQLegV5[]; // Combination transaction + hedge?: RFQHedgeLegItemV5[]; } ⋮---- -/** POST /v5/earn/pwm/asset-manager/create-sub-account */ -export interface CreatePwmFundSubAccountResultV5 { - fundId: string; - subAccountUid: string; - createdTime: string; - status: string; -} +rfqId: string; // Inquiry ID +rfqLinkId: string; // Custom ID for inquiry form +counterparties: string[]; // List of bidders +expiresAt: string; // Expiration time in milliseconds Unix timestamp +strategyType: string; // Inquiry label ⋮---- -/** POST /v5/earn/pwm/fund-transfer */ -export interface PwmFundTransferResultV5 { - transferId: string; - status: string; -} +| 'Failed'; // Status +acceptOtherQuoteStatus?: string; // Whether to accept non-LP quotes. "false": do not accept, "true": accept +deskCode: string; // Unique identification code of the inquiry party ⋮---- -/** GET /v5/earn/pwm/query-fund-transfer-result */ -export interface PwmFundTransferRecordV5 { - transferId: string; - status: string; - fromUserId: number; - toUserId: number; - amount: string; - coin: string; -} - -================ -File: src/types/response/v5-earn-token.ts -================ -/** - * Earn token product (e.g. BYUSDT) — /v5/earn/token/* - */ +createdAt: number; // Time when the trade is created in epoch +updatedAt: number; // Time when the trade is updated in epoch +legs: RFQLegV5[]; // Combination transaction ⋮---- -export interface EarnTokenProductV5 { - productId: string; - coin: string; - mintFeeRateE8: string; - redeemFeeRateE8: string; - minInvestment: string; - userHolding: string; - leftQuota: string; - canMint: boolean; - savingsBalance: string; - aprE8: string; - bonusAprE8: string; - bonusMaxAmount: string; - baseCoinPrecision: number; - tokenPrecision: number; +export interface GetRFQRealtimeResultV5 { + list: RFQItemV5[]; // Array of RFQ items } ⋮---- -export interface PlaceEarnTokenOrderResultV5 { - orderId: string; - orderLinkId: string; -} +list: RFQItemV5[]; // Array of RFQ items ⋮---- -export interface EarnTokenOrderV5 { - orderId: string; - orderLinkId: string; - orderType: 'Mint' | 'Redeem'; - fromCoin: string; - toCoin: string; - fromAmount: string; - toAmount: string; - serviceFee: string; - status: 'Success' | 'Processing' | 'Fail'; - createdTime: string; +export interface RFQHistory { + cursor: string; // Page turning mark + list: RFQItemV5[]; // Array of RFQ items } ⋮---- -export interface EarnTokenPositionV5 { - totalAmount: string; - totalYield: string; - yesterdayYield: string; - aprE8: number; - bonusAprE8: number; - bonusMaxAmount: string; - hasQuota: boolean; -} +cursor: string; // Page turning mark +list: RFQItemV5[]; // Array of RFQ items ⋮---- -export interface EarnTokenDailyYieldRecordV5 { - yield: string; - bonusYield: string; - status: 'Success' | 'Processing'; - createdTime: string; +export interface QuoteLegV5 { + category: 'spot' | 'linear' | 'option'; // Product type + symbol: string; // The unique instrument ID or name of trading contract + price: string; // Order price or quote price + qty?: string; // Order quantity + isLeverage?: boolean; // For spot lending + isHedge?: boolean; } ⋮---- -export interface EarnTokenHourlyYieldRecordV5 { - effectiveAmount: string; - yield: string; - rewardType: 0 | 1; - aprE8: string; - hourlyDate: string; - createdTime: string; -} +category: 'spot' | 'linear' | 'option'; // Product type +symbol: string; // The unique instrument ID or name of trading contract +price: string; // Order price or quote price +qty?: string; // Order quantity +isLeverage?: boolean; // For spot lending ⋮---- -export interface EarnTokenHistoryAprPointV5 { - timestamp: string; - aprE8: string; +export interface RFQQuoteItemV5 { + rfqId: string; // Inquiry ID + rfqLinkId: string; // Custom ID for inquiry form + quoteId: string; // Quotation ID + quoteLinkId: string; // Quotation custom ID + expiresAt: string; // Expiration time in milliseconds Unix timestamp + deskCode: string; // Unique identification code of quotation party + anonymous?: boolean; + status: + | 'Active' + | 'Canceled' + | 'PendingFill' + | 'Filled' + | 'Expired' + | 'Failed'; // Status + execQuoteSide: string; // Execute quote direction, buy or sell + createdAt: number; // Time when the trade is created in epoch + updatedAt: number; // Time when the trade is updated in epoch + quoteBuyList: QuoteLegV5[]; // Quotation buy direction + quoteSellList: QuoteLegV5[]; // Quotation sell direction } - -================ -File: src/types/response/v5-event.ts -================ -export type EventContractTypeV5 = 'Up_Down' | 'UpDown' | 'Target' | 'Range'; -export type EventContractDirectionV5 = - | 'UP' - | 'DOWN' - | 'ABOVE' - | 'BELOW' - | 'RANGE_IN' - | 'RANGE_OUT'; ⋮---- -export interface EventInstrumentFeeRateRuleV5 { - minSecToDelivery: number; - maxSecToDelivery: number; - baseMarkup: string; -} +rfqId: string; // Inquiry ID +rfqLinkId: string; // Custom ID for inquiry form +quoteId: string; // Quotation ID +quoteLinkId: string; // Quotation custom ID +expiresAt: string; // Expiration time in milliseconds Unix timestamp +deskCode: string; // Unique identification code of quotation party ⋮---- -export interface EventInstrumentQuotationLimitV5 { - minSecToDelivery: number; - maxSecToDelivery: number; - quoteMaxAmountPerUser: string; - quoteMinAmountPerUser: string; - quoteMinAmount: string; -} +| 'Failed'; // Status +execQuoteSide: string; // Execute quote direction, buy or sell +createdAt: number; // Time when the trade is created in epoch +updatedAt: number; // Time when the trade is updated in epoch +quoteBuyList: QuoteLegV5[]; // Quotation buy direction +quoteSellList: QuoteLegV5[]; // Quotation sell direction ⋮---- -export interface EventInstrumentLotSizeFilterV5 { - minOrderAmount: string; - maxOrderAmount: string; - orderAmountTickSize: string; - quoteMaxValidMs: number; - quoteMinIntervalPerUserMs: number; +export interface RFQTradeLegV5 { + category: 'linear' | 'option' | 'spot'; // Product category + orderId: string; // Bybit order ID + symbol: string; // The unique instrument ID + side: 'buy' | 'sell'; // Direction + price: string; // Execution price + qty: string; // Number of executions + isLeverage?: boolean; // For spot lending + markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot + execFee: string; // Fee for taker or maker in base currency + execId: string; // Unique exec(trade) ID from exchange + resultCode: number; // Status code, 0 means success + resultMessage: string; // Error message about resultCode + rejectParty: string; // Empty if Filled, "Taker"/"Maker"/"bybit" if Rejected } ⋮---- -export interface EventInstrumentInfoV5 { - symbol: string; - symbolId: number; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - eventContractType: EventContractTypeV5 | string; - durationWindow: string | number; - rvThreshold: string; - rebate: string; - takerFeeRate: string; - makerFeeRate: string; - launchTime: string; - deliveryTime: string; - status: string; - targetPrice: string; - lowerBound: string; - upperBound: string; - callOptionSymbolId: number; - putOptionSymbolId: number; - feeRateRule: EventInstrumentFeeRateRuleV5[]; - lotSizeFilter: EventInstrumentLotSizeFilterV5; - quotationLimit: EventInstrumentQuotationLimitV5[]; -} +category: 'linear' | 'option' | 'spot'; // Product category +orderId: string; // Bybit order ID +symbol: string; // The unique instrument ID +side: 'buy' | 'sell'; // Direction +price: string; // Execution price +qty: string; // Number of executions +isLeverage?: boolean; // For spot lending +markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot +execFee: string; // Fee for taker or maker in base currency +execId: string; // Unique exec(trade) ID from exchange +resultCode: number; // Status code, 0 means success +resultMessage: string; // Error message about resultCode +rejectParty: string; // Empty if Filled, "Taker"/"Maker"/"bybit" if Rejected ⋮---- -export interface EventInstrumentInfoResultV5 { - nextPageCursor: string; - list: EventInstrumentInfoV5[]; +export interface RFQTradeV5 { + rfqId: string; // Inquiry ID + quoteId: string; // Completed inquiry form and executed quotation ID + quoteSide: 'buy' | 'sell'; // Executed quotation direction + strategyType: string; // Inquiry label + status: 'Filled' | 'Rejected'; // Status + rfqDeskCode: string; // Unique identification code of inquiry party + quoteDestCode: string; // Unique identification code of quotation party + createdAt: number; // Time when trade is created in epoch + updatedAt: number; // Time when trade is updated in epoch + legs: RFQTradeLegV5[]; // Combination transaction } ⋮---- -/** REST Get Orderbook: each entry is [payoutRatio, orderValue] */ -export type EventOrderbookLevelV5 = [string, string]; +rfqId: string; // Inquiry ID +quoteId: string; // Completed inquiry form and executed quotation ID +quoteSide: 'buy' | 'sell'; // Executed quotation direction +strategyType: string; // Inquiry label +status: 'Filled' | 'Rejected'; // Status +rfqDeskCode: string; // Unique identification code of inquiry party +quoteDestCode: string; // Unique identification code of quotation party +createdAt: number; // Time when trade is created in epoch +updatedAt: number; // Time when trade is updated in epoch +legs: RFQTradeLegV5[]; // Combination transaction ⋮---- -export interface EventOrderbookV5 { - s: string; - r: EventOrderbookLevelV5[]; - ts: number; - u: number; - seq: number; - cts: number; +export interface RFQPublicTradeLegV5 { + category: 'linear' | 'option' | 'spot'; // Product category + symbol: string; // The unique instrument ID + side: 'buy' | 'sell'; // Inquiry direction + price: string; // Execution price + qty: string; // Number of executions + markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot } ⋮---- -export interface EventOrderHistoryItemV5 { - orderId: string; - orderLinkId: string; - orderStatus: string; - symbol: string; - symbolId: string; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - ecDirection: EventContractDirectionV5 | string; - ecDurationWindow: string; - ecTargetPrice: string; - ecContractType: EventContractTypeV5 | string; - ecLowerBound: string; - ecUpperBound: string; - settleTimeMs: string; - ecOrderValue: string; - ecIndexPrice: string; - orderAvgPayoutRatio: string; - cumExecValue: string; - payoutRatio: string; - tradeFee: string; - transTime: string; - createTime: string; - updateTime: string; - cumPayout: string; - cumExecFee: string; - cancelType: string; - createType: string; - rejectReason: string; - extraFees: string; -} +category: 'linear' | 'option' | 'spot'; // Product category +symbol: string; // The unique instrument ID +side: 'buy' | 'sell'; // Inquiry direction +price: string; // Execution price +qty: string; // Number of executions +markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot ⋮---- -export interface EventOrderHistoryResultV5 { - list: EventOrderHistoryItemV5[]; - cursor: string; +export interface RFQPublicTradeV5 { + rfqId: string; // Inquiry ID + strategyType: string; // Inquiry label + createdAt: number; // Time when trade is created in epoch + updatedAt: number; // Time when trade is updated in epoch + legs: RFQPublicTradeLegV5[]; // Combination transaction } ⋮---- -export interface EventActiveOrderV5 { - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: string; - side: string; - orderStatus: string; - payoutRatio: string; - cumExecValue: string; - cumExecFee: string; - leavesValue: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - ecOrderValue: string; - ecSettleTime: string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecDurationWindow: string; - ecIndexPrice: string; - orderAvgPayoutRatio: string; - createType: string; - createdTime: string; - updatedTime: string; -} +rfqId: string; // Inquiry ID +strategyType: string; // Inquiry label +createdAt: number; // Time when trade is created in epoch +updatedAt: number; // Time when trade is updated in epoch +legs: RFQPublicTradeLegV5[]; // Combination transaction ⋮---- -export interface EventActiveOrdersResultV5 { - list: EventActiveOrderV5[]; - nextPageCursor: string; +export interface AcceptNonLPQuoteResultV5 { + rfqId: string; // Inquiry ID } ⋮---- -export interface EventPositionV5 { +rfqId: string; // Inquiry ID +⋮---- +export interface RFQDetailQuoteLegV5 { + category: string; symbol: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - avgPayoutRatio: string; - positionValue: string; - ecSettleTime: string; - cumClosedPnl: string; - createdTime: string; - updatedTime: string; - seq: number; + price: string; + qty: string; + isHedge?: boolean; } ⋮---- -export interface EventPositionInfoResultV5 { - list: EventPositionV5[]; - nextPageCursor: string; +export interface RFQDetailQuoteV5 { + quoteId: string; + deskCode: string; + anonymous?: boolean; + status: string; + createdAt: string; + updatedAt: string; + expiresAt: string; + quoteBuyList?: RFQDetailQuoteLegV5[]; + quoteSellList?: RFQDetailQuoteLegV5[]; } ⋮---- -export interface EventTradeV5 { +export interface RFQDetailTradeLegV5 { + category: string; orderId: string; - orderLinkId: string; - execId: string; symbol: string; - baseCoin: string; - settleCoin: string; side: string; - execType: string; - execPrice: string; - execValue: string; + price: string; + qty: string; + markPrice: string; execFee: string; - execFeeRate: string; - orderPrice: string; - feeCoin: string; - transTime: string; - timeInForce: string; - crossSeq: string; - ecPayout: string; - ecDurationWindow: string; - settleTimeMs: string; - ecOrderValue: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; extraFees: string; + execId: string; + resultCode: number; + resultMessage: string; + rejectParty: string; } ⋮---- -export interface EventTradeHistoryResultV5 { - list: EventTradeV5[]; - cursor: string; -} -⋮---- -export interface EventSettlementV5 { - transId: string; - symbol: string; - symbolId: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: EventContractTypeV5 | string; - ecDirection: EventContractDirectionV5 | string; - settlePrice: string; - entryPrice: string; - grossPayoutRatio: string; - ecDurationWindow: string; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - transTime: string; - crossSeq: string; - execFee: string; - execFeeRate: string; - payout: string; - sessionRpl: string; - orderId: string; -} -⋮---- -export interface EventSettlementRecordsResultV5 { - list: EventSettlementV5[]; - cursor: string; -} -⋮---- -export interface EventQuoteResultV5 { - orderLinkId: string; - orderId: string; +export interface RFQDetailItemV5 { + rfqId: string; + rfqLinkId: string; + counterparties: string[]; + expiresAt: string; + strategyType: string; + status: string; + acceptOtherQuoteStatus?: boolean; + execQuoteId?: string; + execQuoteSide?: string; + deskCode: string; + anonymous?: boolean; + createdAt: string; + updatedAt: string; + legs: RFQLegV5[]; + hedge?: RFQHedgeLegItemV5[]; + quoteList?: RFQDetailQuoteV5[]; + tradeLegs?: RFQDetailTradeLegV5[]; } ================ -File: src/types/response/v5-rfq.ts +File: src/types/response/v5-rwa.ts ================ -export interface RFQConfigV5 { - deskCode: string; // Own deskCode, unique identification code - maxLegs: number; // Maximum number of legs - maxLP: number; // Maximum number of LPs selected in inquiry form - maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed - minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier - minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier - minLimitQtyOptionOrder: number; // Option minimum order multiplier - strategyTypes: { - strategyName: string; // Policy name - }[]; - counterparties: { - strategyName: string; // Policy name - }[]; -} -⋮---- -deskCode: string; // Own deskCode, unique identification code -maxLegs: number; // Maximum number of legs -maxLP: number; // Maximum number of LPs selected in inquiry form -maxActiveRfq: number; // Maximum number of unfinished inquiry orders allowed -minLimitQtySpotOrder: number; // Spot minimum order quantity multiplier -minLimitQtyContractOrder: number; // Contract minimum order quantity multiplier -minLimitQtyOptionOrder: number; // Option minimum order multiplier -⋮---- -strategyName: string; // Policy name -⋮---- -strategyName: string; // Policy name +/** + * V5 RWA (Real World Assets) earn responses. + */ ⋮---- -export interface RFQCounterpartyV5 { - traderName: string; // Name of the bidder - deskCode: string; // Unique identification code of the quotation party - type: string | null; // Quoter type. LP is automated market maker, null means normal quote party +export interface RWAProductV5 { + productId: number; + coin: string; + assetSymbol: string; + manager: string; + baseApr: string; + bonusApr: string; + savingType: 'Flexible' | 'Fixed' | string; + duration: number; + nav: string; + minStakeAmount: string; + maxStakeAmount: string; + userMaxAmount: string; + userQuota: string; + minRedeemShare: string; + redeemFeeRate: string; + subscriptionFee: string; + extLink: string; + amountPrecision: number; + sharePrecision: number; } ⋮---- -traderName: string; // Name of the bidder -deskCode: string; // Unique identification code of the quotation party -type: string | null; // Quoter type. LP is automated market maker, null means normal quote party -⋮---- -export interface CreateRFQResultV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Inquiry Custom ID - status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of the inquiry form - expiresAt: string; // Expiration time in milliseconds Unix timestamp - deskCode: string; // Inquiry party unique identification code +export interface RWAProductListResultV5 { + list: RWAProductV5[]; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Inquiry Custom ID -status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of the inquiry form -expiresAt: string; // Expiration time in milliseconds Unix timestamp -deskCode: string; // Inquiry party unique identification code -⋮---- -export interface CancelRFQResultV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Inquiry Custom ID +export interface PlaceRWAOrderResultV5 { + orderId: string; + orderLinkId: string; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Inquiry Custom ID -⋮---- -export interface CancelRFQItemV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Inquiry Custom ID - code: number; // Cancel success or failure, 0 means success - msg: string; // Cancellation failure reason +export interface RWAPositionV5 { + productId: number; + coin: string; + assetSymbol: string; + effectiveShare: string; + processingStakeAmount: string; + processingRedeemShare: string; + bonusEarned: string; + nav: string; + holdAmount: string; + duration: number; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Inquiry Custom ID -code: number; // Cancel success or failure, 0 means success -msg: string; // Cancellation failure reason -⋮---- -export interface CancelAllRFQResultV5 { - data: CancelRFQItemV5[]; // Array of cancellation results +export interface RWAPositionListResultV5 { + list: RWAPositionV5[]; } ⋮---- -data: CancelRFQItemV5[]; // Array of cancellation results -⋮---- -export interface CreateRFQQuoteResultV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Quotation ID - quoteLinkId: string; // Quotation Custom ID - expiresAt: string; // Expiration time in milliseconds Unix timestamp - deskCode: string; // Quoter's unique identification code - status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of quotation +export interface RWAOrderV5 { + orderId: string; + orderLinkId: string; + orderType: 'Stake' | 'Redeem'; + productId: number; + coin: string; + stakeAmount?: string; + redeemShares?: string; + status: 'Processing' | 'Success' | 'Failed' | string; + accountType: 'FUND' | 'UNIFIED' | string; + createdTime: number; + updatedTime: number; + settledShares?: string; + settledAmount?: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Quotation ID -quoteLinkId: string; // Quotation Custom ID -expiresAt: string; // Expiration time in milliseconds Unix timestamp -deskCode: string; // Quoter's unique identification code -status: 'Active' | 'Canceled' | 'Filled' | 'Expired' | 'Failed'; // Status of quotation +export interface RWAOrderListResultV5 { + list: RWAOrderV5[]; + nextPageCursor: string; +} ⋮---- -export interface ExecuteRFQQuoteResultV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Inquiry Custom ID - quoteId: string; // Quotation ID - status: 'Processing' | 'Rejected'; // Order status - rejectParty: string; // Empty means passed, "Taker", "Maker", "Bybit" when rejected +export interface RWANavChartPointV5 { + date: string; + nav: string; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Inquiry Custom ID -quoteId: string; // Quotation ID -status: 'Processing' | 'Rejected'; // Order status -rejectParty: string; // Empty means passed, "Taker", "Maker", "Bybit" when rejected +export interface RWANavChartResultV5 { + productId: number; + list: RWANavChartPointV5[]; +} + +================ +File: src/types/response/v5-strategy.ts +================ +import { + OrderSideV5, + PositionIdx, + PovModeV5, + StrategyCategoryV5, + StrategyPreferV5, + StrategyTypeV5, +} from '../shared-v5'; ⋮---- -export interface CancelRFQQuoteResultV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Quotation ID - quoteLinkId: string; // Quotation Custom ID +export interface CreateStrategyOrderResultV5 { + strategyId: string; + /** null when creation succeeded */ + result: string | null; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Quotation ID -quoteLinkId: string; // Quotation Custom ID +/** null when creation succeeded */ ⋮---- -export interface CancelRFQQuoteItemV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Quotation ID - quoteLinkId: string; // Quotation Custom ID - code: number; // Cancel success or failure, 0 means success - msg: string; // Cancellation failure reason +export interface StopStrategyResultV5 { + strategyId: string; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Quotation ID -quoteLinkId: string; // Quotation Custom ID -code: number; // Cancel success or failure, 0 means success -msg: string; // Cancellation failure reason -⋮---- -export interface RFQLegV5 { - category: 'linear' | 'option' | 'spot'; // Product category - symbol: string; // The unique instrument ID - side: 'buy' | 'sell'; // Inquiry direction - qty: string; // Order quantity of the instrument - isLeverage?: boolean; // For spot lending +export interface StrategyListItemV5 { + strategyId: string; + category: StrategyCategoryV5; + symbol: string; + side: OrderSideV5; + size: string; + strategyType: StrategyTypeV5; + /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ + status: 2 | 3 | 4 | 5 | 6; + executedSize: string; + executedAvgPrice: string; + executedStartTimeE3: string; + executedEndTimeE3: string; + createdTimeE3: string; + updatedTimeE3: string; + reduceOnly: boolean; + triggerPrice: string; + isTriggered: boolean; + leverageType: 0 | 1; + terminateType: number; + terminateRemark: string; + triggerCount: string; + tradingCount: string; + realizedPnl: string; + strategyName: string; + strategyPrefer: StrategyPreferV5 | string; + duration: number; + executedDuration: number; + isRandom: boolean; + interval: number; + limitPrice: string; + chasePercentE4: string; + chaseDistance: string; + maxChasePrice: string; + chaseOrderPrice: string; + chasePrice: string; + postOnly: number; + isRebalance: boolean; + orderType: string; + orderPriceOffset: string; + strategySl: string; + strategyTp: string; + arbitrageOrders: unknown[]; + positionValue: string; + filledPositionValue: string; + /** POV only */ + mode?: PovModeV5 | string; + participationRate?: string; + referenceWindow?: string; + depthReference?: string; } ⋮---- -category: 'linear' | 'option' | 'spot'; // Product category -symbol: string; // The unique instrument ID -side: 'buy' | 'sell'; // Inquiry direction -qty: string; // Order quantity of the instrument -isLeverage?: boolean; // For spot lending +/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ ⋮---- -export interface RFQHedgeLegItemV5 { - category: string; - symbol: string; - side: string; - qty: string; - price?: string; -} +/** POV only */ ⋮---- -export interface RFQItemV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Custom ID for inquiry form - counterparties: string[]; // List of bidders - expiresAt: string; // Expiration time in milliseconds Unix timestamp - strategyType: string; // Inquiry label - status: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status - acceptOtherQuoteStatus?: string; // Whether to accept non-LP quotes. "false": do not accept, "true": accept - deskCode: string; // Unique identification code of the inquiry party - anonymous?: boolean; - createdAt: number; // Time when the trade is created in epoch - updatedAt: number; // Time when the trade is updated in epoch - legs: RFQLegV5[]; // Combination transaction - hedge?: RFQHedgeLegItemV5[]; +export interface StrategyListResultV5 { + list: StrategyListItemV5[]; + nextCursor: string; + prevCursor: string; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Custom ID for inquiry form -counterparties: string[]; // List of bidders -expiresAt: string; // Expiration time in milliseconds Unix timestamp -strategyType: string; // Inquiry label +export interface StrategyOrderListItemV5 { + strategyId: string; + orderId: string; + symbol: string; + side: OrderSideV5; + size: string; + price: string; + /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ + status: string; + executedSize: string; + dealTimeE3: string; + parentOrderId: string; + createdTimeE3: string; + updatedTimeE3: string; + code: number; + msg: string; + category: StrategyCategoryV5; + positionIdx: PositionIdx; + leverageType: 0 | 1; + tpPrice: string; + slPrice: string; + orderType: string; + orderPriceOffset: string; + positionValue: string; + filledPositionValue: string; +} ⋮---- -| 'Failed'; // Status -acceptOtherQuoteStatus?: string; // Whether to accept non-LP quotes. "false": do not accept, "true": accept -deskCode: string; // Unique identification code of the inquiry party +/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ ⋮---- -createdAt: number; // Time when the trade is created in epoch -updatedAt: number; // Time when the trade is updated in epoch -legs: RFQLegV5[]; // Combination transaction +export interface StrategyOrderListResultV5 { + list: StrategyOrderListItemV5[]; + nextCursor: string; + prevCursor: string; +} + +================ +File: src/types/response/v5-tax.ts +================ +export interface TaxBatchExportResultV5 { + batchId: string; +} ⋮---- -export interface GetRFQRealtimeResultV5 { - list: RFQItemV5[]; // Array of RFQ items +export interface TaxBatchExportTaskV5 { + type: string; + number: string; + /** 0 queued, 1 processing, 2 succeeded, -1 failed */ + status: 0 | 1 | 2 | -1; + url: string; + queryId: string; } ⋮---- -list: RFQItemV5[]; // Array of RFQ items +/** 0 queued, 1 processing, 2 succeeded, -1 failed */ ⋮---- -export interface RFQHistory { - cursor: string; // Page turning mark - list: RFQItemV5[]; // Array of RFQ items +export interface TaxBatchExportStatusV5 { + items: TaxBatchExportTaskV5[]; } + +================ +File: src/types/shared.ts +================ +import { RestClientV5 } from '../rest-client-v5'; +import { SpotClientV3 } from '../spot-client-v3'; ⋮---- -cursor: string; // Page turning mark -list: RFQItemV5[]; // Array of RFQ items +export type RESTClient = SpotClientV3 | RestClientV5; ⋮---- -export interface QuoteLegV5 { - category: 'spot' | 'linear' | 'option'; // Product type - symbol: string; // The unique instrument ID or name of trading contract - price: string; // Order price or quote price - qty?: string; // Order quantity - isLeverage?: boolean; // For spot lending - isHedge?: boolean; -} +export type numberInString = string; ⋮---- -category: 'spot' | 'linear' | 'option'; // Product type -symbol: string; // The unique instrument ID or name of trading contract -price: string; // Order price or quote price -qty?: string; // Order quantity -isLeverage?: boolean; // For spot lending +export type OrderSide = 'Buy' | 'Sell'; ⋮---- -export interface RFQQuoteItemV5 { - rfqId: string; // Inquiry ID - rfqLinkId: string; // Custom ID for inquiry form - quoteId: string; // Quotation ID - quoteLinkId: string; // Quotation custom ID - expiresAt: string; // Expiration time in milliseconds Unix timestamp - deskCode: string; // Unique identification code of quotation party - anonymous?: boolean; - status: - | 'Active' - | 'Canceled' - | 'PendingFill' - | 'Filled' - | 'Expired' - | 'Failed'; // Status - execQuoteSide: string; // Execute quote direction, buy or sell - createdAt: number; // Time when the trade is created in epoch - updatedAt: number; // Time when the trade is updated in epoch - quoteBuyList: QuoteLegV5[]; // Quotation buy direction - quoteSellList: QuoteLegV5[]; // Quotation sell direction +export type KlineInterval = + | '1m' + | '3m' + | '5m' + | '15m' + | '30m' + | '1h' + | '2h' + | '4h' + | '6h' + | '12h' + | '1d' + | '1w' + | '1M'; +⋮---- +export type KlineIntervalV3 = + | '1' + | '3' + | '5' + | '15' + | '30' + | '60' + | '120' + | '240' + | '360' + | '720' + | 'D' + | 'W' + | 'M'; +⋮---- +export interface APIRateLimit { + /** Remaining requests to this endpoint before the next reset */ + remainingRequests: number; + /** Max requests for this endpoint per rollowing window (before next reset) */ + maxRequests: number; + /** + * Timestamp when the rate limit resets if you have exceeded your current maxRequests. + * Otherwise, this is approximately your current timestamp. + */ + resetAtTimestamp: number; } ⋮---- -rfqId: string; // Inquiry ID -rfqLinkId: string; // Custom ID for inquiry form -quoteId: string; // Quotation ID -quoteLinkId: string; // Quotation custom ID -expiresAt: string; // Expiration time in milliseconds Unix timestamp -deskCode: string; // Unique identification code of quotation party +/** Remaining requests to this endpoint before the next reset */ ⋮---- -| 'Failed'; // Status -execQuoteSide: string; // Execute quote direction, buy or sell -createdAt: number; // Time when the trade is created in epoch -updatedAt: number; // Time when the trade is updated in epoch -quoteBuyList: QuoteLegV5[]; // Quotation buy direction -quoteSellList: QuoteLegV5[]; // Quotation sell direction +/** Max requests for this endpoint per rollowing window (before next reset) */ ⋮---- -export interface RFQTradeLegV5 { - category: 'linear' | 'option' | 'spot'; // Product category - orderId: string; // Bybit order ID - symbol: string; // The unique instrument ID - side: 'buy' | 'sell'; // Direction - price: string; // Execution price - qty: string; // Number of executions - isLeverage?: boolean; // For spot lending - markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot - execFee: string; // Fee for taker or maker in base currency - execId: string; // Unique exec(trade) ID from exchange - resultCode: number; // Status code, 0 means success - resultMessage: string; // Error message about resultCode - rejectParty: string; // Empty if Filled, "Taker"/"Maker"/"bybit" if Rejected -} -⋮---- -category: 'linear' | 'option' | 'spot'; // Product category -orderId: string; // Bybit order ID -symbol: string; // The unique instrument ID -side: 'buy' | 'sell'; // Direction -price: string; // Execution price -qty: string; // Number of executions -isLeverage?: boolean; // For spot lending -markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot -execFee: string; // Fee for taker or maker in base currency -execId: string; // Unique exec(trade) ID from exchange -resultCode: number; // Status code, 0 means success -resultMessage: string; // Error message about resultCode -rejectParty: string; // Empty if Filled, "Taker"/"Maker"/"bybit" if Rejected +/** + * Timestamp when the rate limit resets if you have exceeded your current maxRequests. + * Otherwise, this is approximately your current timestamp. + */ ⋮---- -export interface RFQTradeV5 { - rfqId: string; // Inquiry ID - quoteId: string; // Completed inquiry form and executed quotation ID - quoteSide: 'buy' | 'sell'; // Executed quotation direction - strategyType: string; // Inquiry label - status: 'Filled' | 'Rejected'; // Status - rfqDeskCode: string; // Unique identification code of inquiry party - quoteDestCode: string; // Unique identification code of quotation party - createdAt: number; // Time when trade is created in epoch - updatedAt: number; // Time when trade is updated in epoch - legs: RFQTradeLegV5[]; // Combination transaction +export interface APIResponseV3 { + retCode: number; + retMsg: 'OK' | string; + result: TResult; + retExtInfo: TExtInfo; + /** + * These are per-UID per-endpoint rate limits, automatically parsed from response headers if available. + * + * Note: + * - this is primarily for V5 (or newer) APIs. + * - these rate limits are per-endpoint per-account, so will not appear for public API calls + */ + rateLimitApi?: APIRateLimit; } ⋮---- -rfqId: string; // Inquiry ID -quoteId: string; // Completed inquiry form and executed quotation ID -quoteSide: 'buy' | 'sell'; // Executed quotation direction -strategyType: string; // Inquiry label -status: 'Filled' | 'Rejected'; // Status -rfqDeskCode: string; // Unique identification code of inquiry party -quoteDestCode: string; // Unique identification code of quotation party -createdAt: number; // Time when trade is created in epoch -updatedAt: number; // Time when trade is updated in epoch -legs: RFQTradeLegV5[]; // Combination transaction -⋮---- -export interface RFQPublicTradeLegV5 { - category: 'linear' | 'option' | 'spot'; // Product category - symbol: string; // The unique instrument ID - side: 'buy' | 'sell'; // Inquiry direction - price: string; // Execution price - qty: string; // Number of executions - markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot -} +/** + * These are per-UID per-endpoint rate limits, automatically parsed from response headers if available. + * + * Note: + * - this is primarily for V5 (or newer) APIs. + * - these rate limits are per-endpoint per-account, so will not appear for public API calls + */ ⋮---- -category: 'linear' | 'option' | 'spot'; // Product category -symbol: string; // The unique instrument ID -side: 'buy' | 'sell'; // Inquiry direction -price: string; // Execution price -qty: string; // Number of executions -markPrice: string; // MarkPrice (contract) at transaction time, indexPrice for spot +export type APIResponseV3WithTime = APIResponseV3< + TResult, + TExtInfo +> & { time: number }; ⋮---- -export interface RFQPublicTradeV5 { - rfqId: string; // Inquiry ID - strategyType: string; // Inquiry label - createdAt: number; // Time when trade is created in epoch - updatedAt: number; // Time when trade is updated in epoch - legs: RFQPublicTradeLegV5[]; // Combination transaction +/** Flat response envelope used by the P2P chat APIs. */ +export interface APIP2PChatResponse { + ret_code: number; + ret_msg: string; + result: TResult; + rateLimitApi?: APIRateLimit; } ⋮---- -rfqId: string; // Inquiry ID -strategyType: string; // Inquiry label -createdAt: number; // Time when trade is created in epoch -updatedAt: number; // Time when trade is updated in epoch -legs: RFQPublicTradeLegV5[]; // Combination transaction -⋮---- -export interface AcceptNonLPQuoteResultV5 { - rfqId: string; // Inquiry ID +export interface APIP2PResponse { + ret_code: number; + ret_msg: string; + result: { + result: TResult; + totalRows: string; + totalPages: string; + currentPage: string; + dayLimit: string; + showDayLimit: boolean; + }; + ext_code: string; + ext_info: TExtInfo; + time_now: string; } ⋮---- -rfqId: string; // Inquiry ID +/** + * Request Parameter Types + */ +export interface SymbolParam { + symbol: string; +} ⋮---- -export interface RFQDetailQuoteLegV5 { - category: string; +export interface SymbolLimitParam { symbol: string; - price: string; - qty: string; - isHedge?: boolean; + limit?: TLimit; } ⋮---- -export interface RFQDetailQuoteV5 { - quoteId: string; - deskCode: string; - anonymous?: boolean; - status: string; - createdAt: string; - updatedAt: string; - expiresAt: string; - quoteBuyList?: RFQDetailQuoteLegV5[]; - quoteSellList?: RFQDetailQuoteLegV5[]; +export interface SymbolPeriodLimitParam { + symbol: string; + period: string; + limit?: TLimit; } ⋮---- -export interface RFQDetailTradeLegV5 { - category: string; - orderId: string; +export interface SymbolFromLimitParam { symbol: string; - side: string; - price: string; - qty: string; - markPrice: string; - execFee: string; - extraFees: string; - execId: string; - resultCode: number; - resultMessage: string; - rejectParty: string; + from?: number; + limit?: number; } ⋮---- -export interface RFQDetailItemV5 { - rfqId: string; - rfqLinkId: string; - counterparties: string[]; - expiresAt: string; - strategyType: string; - status: string; - acceptOtherQuoteStatus?: boolean; - execQuoteId?: string; - execQuoteSide?: string; - deskCode: string; - anonymous?: boolean; - createdAt: string; - updatedAt: string; - legs: RFQLegV5[]; - hedge?: RFQHedgeLegItemV5[]; - quoteList?: RFQDetailQuoteV5[]; - tradeLegs?: RFQDetailTradeLegV5[]; +export interface SymbolIntervalFromLimitParam { + symbol: string; + interval: string; + from: number; + limit?: number; } - -================ -File: src/types/response/v5-rwa.ts -================ -/** - * V5 RWA (Real World Assets) earn responses. - */ ⋮---- -export interface RWAProductV5 { - productId: number; +export interface CoinParam { coin: string; - assetSymbol: string; - manager: string; - baseApr: string; - bonusApr: string; - savingType: 'Flexible' | 'Fixed' | string; - duration: number; - nav: string; - minStakeAmount: string; - maxStakeAmount: string; - userMaxAmount: string; - userQuota: string; - minRedeemShare: string; - redeemFeeRate: string; - subscriptionFee: string; - extLink: string; - amountPrecision: number; - sharePrecision: number; } ⋮---- -export interface RWAProductListResultV5 { - list: RWAProductV5[]; +export interface WalletFundRecordsReq { + start_date?: string; + end_date?: string; + currency?: string; + coin?: string; + wallet_fund_type?: string; + page?: number; + limit?: number; } ⋮---- -export interface PlaceRWAOrderResultV5 { - orderId: string; - orderLinkId: string; +export interface WithdrawRecordsReq { + start_date?: string; + end_date?: string; + coin?: string; + status?: string; + page?: number; + limit?: number; } ⋮---- -export interface RWAPositionV5 { - productId: number; - coin: string; - assetSymbol: string; - effectiveShare: string; - processingStakeAmount: string; - processingRedeemShare: string; - bonusEarned: string; - nav: string; - holdAmount: string; - duration: number; +export interface AssetExchangeRecordsReq { + limit?: number; + from?: number; + direction?: string; } ⋮---- -export interface RWAPositionListResultV5 { - list: RWAPositionV5[]; -} +/** + * Response types + */ ⋮---- -export interface RWAOrderV5 { - orderId: string; - orderLinkId: string; - orderType: 'Stake' | 'Redeem'; - productId: number; - coin: string; - stakeAmount?: string; - redeemShares?: string; - status: 'Processing' | 'Success' | 'Failed' | string; - accountType: 'FUND' | 'UNIFIED' | string; - createdTime: number; - updatedTime: number; - settledShares?: string; - settledAmount?: string; +export interface LeverageFilter { + min_leverage: numberInString; + max_leverage: numberInString; + leverage_step: numberInString; } -⋮---- -export interface RWAOrderListResultV5 { - list: RWAOrderV5[]; - nextPageCursor: string; +export interface PriceFilter { + min_price: numberInString; + max_price: numberInString; + tick_size: numberInString; } ⋮---- -export interface RWANavChartPointV5 { - date: string; - nav: string; +export interface LotSizeFilter { + max_trading_qty: number; + min_trading_qty: number; + qty_step: number; } ⋮---- -export interface RWANavChartResultV5 { - productId: number; - list: RWANavChartPointV5[]; +export interface SymbolInfo { + name: string; + alias: string; + status: 'Trading' | string; + base_currency: string; + quote_currency: string; + price_scale: number; + taker_fee: numberInString; + maker_fee: numberInString; + leverage_filter: LeverageFilter; + price_filter: PriceFilter; + lot_size_filter: LotSizeFilter; } ================ -File: src/types/response/v5-spreadtrading.ts +File: webpack/webpack.config.js ================ -export interface SpreadInstrumentInfoV5 { - symbol: string; - contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; - status: 'Trading' | 'Settling'; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - tickSize: string; - minPrice: string; - maxPrice: string; - lotSize: string; - minSize: string; - maxSize: string; - launchTime: string; - deliveryTime: string; - legs: { - symbol: string; - contractType: 'LinearPerpetual' | 'LinearFutures' | 'Spot'; - }[]; -} +function generateConfig(name) ⋮---- -export interface SpreadOrderbookResponseV5 { - s: string; // Symbol - b: [string, string][]; // Bids array [price, size] - a: [string, string][]; // Asks array [price, size] - u: number; // Update ID - ts: number; // Timestamp - seq: number; // Sequence - cts: number; // Cross timestamp -} +// Add '.ts' and '.tsx' as resolvable extensions. ⋮---- -s: string; // Symbol -b: [string, string][]; // Bids array [price, size] -a: [string, string][]; // Asks array [price, size] -u: number; // Update ID -ts: number; // Timestamp -seq: number; // Sequence -cts: number; // Cross timestamp +// Node.js core modules not available in browsers +// The REST client's https.Agent (for keepAlive) is Node.js-only and won't work in browsers ⋮---- -export interface SpreadTickerV5 { - symbol: string; // Spread combination symbol name - bidPrice: string; // Bid 1 price - bidSize: string; // Bid 1 size - askPrice: string; // Ask 1 price - askSize: string; // Ask 1 size - lastPrice: string; // Last trade price - highPrice24h: string; // The highest price in the last 24 hours - lowPrice24h: string; // The lowest price in the last 24 hours - prevPrice24h: string; // Price 24 hours ago - volume24h: string; // Volume for 24h -} +// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. ⋮---- -symbol: string; // Spread combination symbol name -bidPrice: string; // Bid 1 price -bidSize: string; // Bid 1 size -askPrice: string; // Ask 1 price -askSize: string; // Ask 1 size -lastPrice: string; // Last trade price -highPrice24h: string; // The highest price in the last 24 hours -lowPrice24h: string; // The lowest price in the last 24 hours -prevPrice24h: string; // Price 24 hours ago -volume24h: string; // Volume for 24h +// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. + +================ +File: .npmrc +================ +min-release-age=30 +save-exact=true + +================ +File: .nvmrc +================ +v24.18.0 + +================ +File: jest.config.ts +================ +/** + * For a detailed explanation regarding each configuration property, visit: + * https://jestjs.io/docs/configuration + */ ⋮---- -export interface SpreadRecentTradeV5 { - execId: string; // Execution ID - symbol: string; // Spread combination symbol name - price: string; // Trade price - size: string; // Trade size - side: 'Buy' | 'Sell'; // Side of taker - time: string; // Trade time (ms) - seq?: string; -} +import type { Config } from 'jest'; ⋮---- -execId: string; // Execution ID -symbol: string; // Spread combination symbol name -price: string; // Trade price -size: string; // Trade size -side: 'Buy' | 'Sell'; // Side of taker -time: string; // Trade time (ms) +// All imported modules in your tests should be mocked automatically +// automock: false, ⋮---- -export interface SpreadOpenOrderV5 { - symbol: string; - baseCoin: string; - orderType: 'Market' | 'Limit'; - orderLinkId: string; - side: 'Buy' | 'Sell'; - timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; - orderId: string; - leavesQty: string; - orderStatus: 'New' | 'PartiallyFilled'; - cumExecQty: string; - price: string; - qty: string; - createdTime: string; - updatedTime: string; -} +// Stop running tests after `n` failures +// bail: 0, +bail: false, // enable to stop test when an error occur, ⋮---- -export interface SpreadOrderHistoryV5 { - symbol: string; - orderType: 'Market' | 'Limit'; - orderLinkId: string; - orderId: string; - contractType: 'FundingRateArb' | 'CarryTrade' | 'FutureSpread' | 'PerpBasis'; - orderStatus: 'Rejected' | 'Cancelled' | 'Filled'; - price: string; - orderQty: string; - timeInForce: 'GTC' | 'FOK' | 'IOC' | 'PostOnly'; - baseCoin: string; - createdAt: string; - updatedAt: string; - side: 'Buy' | 'Sell'; - leavesQty: string; - settleCoin: string; - cumExecQty: string; - qty: string; - leg1Symbol: string; - leg1ProdType: 'Futures' | 'Spot'; - leg1OrderId: string; - leg1Side: string; - leg2ProdType: 'Futures' | 'Spot'; - leg2OrderId: string; - leg2Symbol: string; - leg2Side: string; - cxlRejReason: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee -} +// The directory where Jest should store its cached dependency information +// cacheDirectory: "/private/var/folders/kf/2k3sz4px6c9cbyzj1h_b192h0000gn/T/jest_dx", ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee +// Automatically clear mock calls, instances, contexts and results before every test ⋮---- -export interface SpreadTradeLegV5 { - symbol: string; - side: 'Buy' | 'Sell'; - execPrice: string; - execTime: string; - execValue: string; - execType: string; - category: 'linear' | 'spot'; - execQty: string; - execFee: string; - feeCurrency: string; // Trading fee currency - execId: string; -} +// Indicates whether the coverage information should be collected while executing the test ⋮---- -feeCurrency: string; // Trading fee currency +// An array of glob patterns indicating a set of files for which coverage information should be collected ⋮---- -export interface SpreadTradeV5 { - symbol: string; - orderLinkId: string; - side: 'Buy' | 'Sell'; - orderId: string; - execPrice: string; - execTime: string; - execType: 'Trade'; - execQty: string; - execId: string; - legs: SpreadTradeLegV5[]; - extraFees: string; -} +// The directory where Jest should output its coverage files ⋮---- -/** GET /v5/spread/max-qty */ -export interface SpreadMaxQtyResultV5 { - /** Maximum order quantity (available balance for the spread order). */ - ab: string; -} +// An array of regexp pattern strings used to skip coverage collection +// coveragePathIgnorePatterns: [ +// "/node_modules/" +// ], ⋮---- -/** Maximum order quantity (available balance for the spread order). */ - -================ -File: src/types/response/v5-strategy.ts -================ -import { - OrderSideV5, - PositionIdx, - PovModeV5, - StrategyCategoryV5, - StrategyPreferV5, - StrategyTypeV5, -} from '../shared-v5'; +// Indicates which provider should be used to instrument code for coverage ⋮---- -export interface CreateStrategyOrderResultV5 { - strategyId: string; - /** null when creation succeeded */ - result: string | null; -} +// A list of reporter names that Jest uses when writing coverage reports +// coverageReporters: [ +// "json", +// "text", +// "lcov", +// "clover" +// ], ⋮---- -/** null when creation succeeded */ +// An object that configures minimum threshold enforcement for coverage results +// coverageThreshold: undefined, ⋮---- -export interface StopStrategyResultV5 { - strategyId: string; -} +// A path to a custom dependency extractor +// dependencyExtractor: undefined, ⋮---- -export interface StrategyListItemV5 { - strategyId: string; - category: StrategyCategoryV5; - symbol: string; - side: OrderSideV5; - size: string; - strategyType: StrategyTypeV5; - /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ - status: 2 | 3 | 4 | 5 | 6; - executedSize: string; - executedAvgPrice: string; - executedStartTimeE3: string; - executedEndTimeE3: string; - createdTimeE3: string; - updatedTimeE3: string; - reduceOnly: boolean; - triggerPrice: string; - isTriggered: boolean; - leverageType: 0 | 1; - terminateType: number; - terminateRemark: string; - triggerCount: string; - tradingCount: string; - realizedPnl: string; - strategyName: string; - strategyPrefer: StrategyPreferV5 | string; - duration: number; - executedDuration: number; - isRandom: boolean; - interval: number; - limitPrice: string; - chasePercentE4: string; - chaseDistance: string; - maxChasePrice: string; - chaseOrderPrice: string; - chasePrice: string; - postOnly: number; - isRebalance: boolean; - orderType: string; - orderPriceOffset: string; - strategySl: string; - strategyTp: string; - arbitrageOrders: unknown[]; - positionValue: string; - filledPositionValue: string; - /** POV only */ - mode?: PovModeV5 | string; - participationRate?: string; - referenceWindow?: string; - depthReference?: string; -} +// Make calling deprecated APIs throw helpful error messages +// errorOnDeprecated: false, ⋮---- -/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ +// The default configuration for fake timers +// fakeTimers: { +// "enableGlobally": false +// }, ⋮---- -/** POV only */ +// Force coverage collection from ignored files using an array of glob patterns +// forceCoverageMatch: [], ⋮---- -export interface StrategyListResultV5 { - list: StrategyListItemV5[]; - nextCursor: string; - prevCursor: string; -} +// A path to a module which exports an async function that is triggered once before all test suites +// globalSetup: undefined, ⋮---- -export interface StrategyOrderListItemV5 { - strategyId: string; - orderId: string; - symbol: string; - side: OrderSideV5; - size: string; - price: string; - /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ - status: string; - executedSize: string; - dealTimeE3: string; - parentOrderId: string; - createdTimeE3: string; - updatedTimeE3: string; - code: number; - msg: string; - category: StrategyCategoryV5; - positionIdx: PositionIdx; - leverageType: 0 | 1; - tpPrice: string; - slPrice: string; - orderType: string; - orderPriceOffset: string; - positionValue: string; - filledPositionValue: string; -} +// A path to a module which exports an async function that is triggered once after all test suites +// globalTeardown: undefined, ⋮---- -/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ +// A set of global variables that need to be available in all test environments +// globals: {}, ⋮---- -export interface StrategyOrderListResultV5 { - list: StrategyOrderListItemV5[]; - nextCursor: string; - prevCursor: string; -} - -================ -File: src/types/response/v5-tax.ts -================ -export interface TaxBatchExportResultV5 { - batchId: string; -} +// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. +// maxWorkers: "50%", ⋮---- -export interface TaxBatchExportTaskV5 { - type: string; - number: string; - /** 0 queued, 1 processing, 2 succeeded, -1 failed */ - status: 0 | 1 | 2 | -1; - url: string; - queryId: string; -} +// An array of directory names to be searched recursively up from the requiring module's location +// moduleDirectories: [ +// "node_modules" +// ], ⋮---- -/** 0 queued, 1 processing, 2 succeeded, -1 failed */ +// An array of file extensions your modules use +// moduleFileExtensions: [ +// "js", +// "mjs", +// "cjs", +// "jsx", +// "ts", +// "tsx", +// "json", +// "node" +// ], ⋮---- -export interface TaxBatchExportStatusV5 { - items: TaxBatchExportTaskV5[]; -} - -================ -File: src/types/shared.ts -================ -import { RestClientV5 } from '../rest-client-v5'; -import { SpotClientV3 } from '../spot-client-v3'; +// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module +// moduleNameMapper: {}, ⋮---- -export type RESTClient = SpotClientV3 | RestClientV5; +// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader +// modulePathIgnorePatterns: [], ⋮---- -export type numberInString = string; +// Activates notifications for test results +// notify: false, ⋮---- -export type OrderSide = 'Buy' | 'Sell'; +// An enum that specifies notification mode. Requires { notify: true } +// notifyMode: "failure-change", ⋮---- -export type KlineInterval = - | '1m' - | '3m' - | '5m' - | '15m' - | '30m' - | '1h' - | '2h' - | '4h' - | '6h' - | '12h' - | '1d' - | '1w' - | '1M'; +// A preset that is used as a base for Jest's configuration +// preset: undefined, ⋮---- -export type KlineIntervalV3 = - | '1' - | '3' - | '5' - | '15' - | '30' - | '60' - | '120' - | '240' - | '360' - | '720' - | 'D' - | 'W' - | 'M'; +// Run tests from one or more projects +// projects: undefined, ⋮---- -export interface APIRateLimit { - /** Remaining requests to this endpoint before the next reset */ - remainingRequests: number; - /** Max requests for this endpoint per rollowing window (before next reset) */ - maxRequests: number; - /** - * Timestamp when the rate limit resets if you have exceeded your current maxRequests. - * Otherwise, this is approximately your current timestamp. - */ - resetAtTimestamp: number; -} +// Use this configuration option to add custom reporters to Jest +// reporters: undefined, ⋮---- -/** Remaining requests to this endpoint before the next reset */ +// Automatically reset mock state before every test +// resetMocks: false, ⋮---- -/** Max requests for this endpoint per rollowing window (before next reset) */ +// Reset the module registry before running each individual test +// resetModules: false, ⋮---- -/** - * Timestamp when the rate limit resets if you have exceeded your current maxRequests. - * Otherwise, this is approximately your current timestamp. - */ +// A path to a custom resolver +// resolver: undefined, ⋮---- -export interface APIResponseV3 { - retCode: number; - retMsg: 'OK' | string; - result: TResult; - retExtInfo: TExtInfo; - /** - * These are per-UID per-endpoint rate limits, automatically parsed from response headers if available. - * - * Note: - * - this is primarily for V5 (or newer) APIs. - * - these rate limits are per-endpoint per-account, so will not appear for public API calls - */ - rateLimitApi?: APIRateLimit; -} +// Automatically restore mock state and implementation before every test +// restoreMocks: false, ⋮---- -/** - * These are per-UID per-endpoint rate limits, automatically parsed from response headers if available. - * - * Note: - * - this is primarily for V5 (or newer) APIs. - * - these rate limits are per-endpoint per-account, so will not appear for public API calls - */ +// The root directory that Jest should scan for tests and modules within +// rootDir: undefined, ⋮---- -export type APIResponseV3WithTime = APIResponseV3< - TResult, - TExtInfo -> & { time: number }; +// A list of paths to directories that Jest should use to search for files in +// roots: [ +// "" +// ], ⋮---- -/** Flat response envelope used by the P2P chat APIs. */ -export interface APIP2PChatResponse { - ret_code: number; - ret_msg: string; - result: TResult; - rateLimitApi?: APIRateLimit; -} +// Allows you to use a custom runner instead of Jest's default test runner +// runner: "jest-runner", ⋮---- -export interface APIP2PResponse { - ret_code: number; - ret_msg: string; - result: { - result: TResult; - totalRows: string; - totalPages: string; - currentPage: string; - dayLimit: string; - showDayLimit: boolean; - }; - ext_code: string; - ext_info: TExtInfo; - time_now: string; -} +// The paths to modules that run some code to configure or set up the testing environment before each test +// setupFiles: [], ⋮---- -/** - * Request Parameter Types - */ -export interface SymbolParam { - symbol: string; -} +// A list of paths to modules that run some code to configure or set up the testing framework before each test +// setupFilesAfterEnv: [], ⋮---- -export interface SymbolLimitParam { - symbol: string; - limit?: TLimit; -} +// The number of seconds after which a test is considered as slow and reported as such in the results. +// slowTestThreshold: 5, ⋮---- -export interface SymbolPeriodLimitParam { - symbol: string; - period: string; - limit?: TLimit; -} +// A list of paths to snapshot serializer modules Jest should use for snapshot testing +// snapshotSerializers: [], ⋮---- -export interface SymbolFromLimitParam { - symbol: string; - from?: number; - limit?: number; +// The test environment that will be used for testing +// testEnvironment: "jest-environment-node", +⋮---- +// Options that will be passed to the testEnvironment +// testEnvironmentOptions: {}, +⋮---- +// Adds a location field to test results +// testLocationInResults: false, +⋮---- +// The glob patterns Jest uses to detect test files +⋮---- +// "**/__tests__/**/*.[jt]s?(x)", +⋮---- +// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped +// testPathIgnorePatterns: [ +// "/node_modules/" +// ], +⋮---- +// The regexp pattern or array of patterns that Jest uses to detect test files +// testRegex: [], +⋮---- +// This option allows the use of a custom results processor +// testResultsProcessor: undefined, +⋮---- +// This option allows use of a custom test runner +// testRunner: "jest-circus/runner", +⋮---- +// A map from regular expressions to paths to transformers +// transform: undefined, +⋮---- +// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation +// transformIgnorePatterns: [ +// "/node_modules/", +// "\\.pnp\\.[^\\/]+$" +// ], +⋮---- +// Prevents import esm module error from v1 axios release, issue #5026 +⋮---- +// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them +// unmockedModulePathPatterns: undefined, +⋮---- +// Indicates whether each individual test should be reported during the run +// verbose: undefined, +verbose: true, // report individual test +⋮---- +// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode +// watchPathIgnorePatterns: [], +⋮---- +// Whether to use watchman for file crawling +// watchman: true, + +================ +File: src/types/request/v5-account.ts +================ +import { + AccountTypeV5, + CategoryV5, + InstrumentSymbolTypeV5, + TransactionTypeV5, +} from '../shared-v5'; +⋮---- +export interface GetWalletBalanceParamsV5 { + accountType: AccountTypeV5; + coin?: string; } ⋮---- -export interface SymbolIntervalFromLimitParam { - symbol: string; - interval: string; - from: number; +export interface GetBorrowHistoryParamsV5 { + currency?: string; + startTime?: number; + endTime?: number; limit?: number; + cursor?: string; } ⋮---- -export interface CoinParam { - coin: string; +export interface GetFeeRateParamsV5 { + category: CategoryV5; + symbol?: string; + baseCoin?: string; } ⋮---- -export interface WalletFundRecordsReq { - start_date?: string; - end_date?: string; +export interface GetTransactionLogParamsV5 { + accountType?: AccountTypeV5; + category?: CategoryV5; currency?: string; - coin?: string; - wallet_fund_type?: string; - page?: number; + baseCoin?: string; + type?: TransactionTypeV5; + /** + * Transaction sub type, "movePosition", used to filter trans logs of Move Position only + */ + transSubType?: string; + startTime?: number; + endTime?: number; limit?: number; + cursor?: string; } ⋮---- -export interface WithdrawRecordsReq { - start_date?: string; - end_date?: string; +/** + * Transaction sub type, "movePosition", used to filter trans logs of Move Position only + */ +⋮---- +export interface MMPModifyParamsV5 { + baseCoin: string; + window: string; + frozenPeriod: string; + qtyLimit: string; + deltaLimit: string; + vegaLimit?: string; +} +⋮---- +export interface RepayLiabilityParamsV5 { coin?: string; - status?: string; - page?: number; - limit?: number; } ⋮---- -export interface AssetExchangeRecordsReq { +export interface SetCollateralCoinParamsV5 { + coin: string; + collateralSwitch: 'ON' | 'OFF'; +} +⋮---- +export interface GetClassicTransactionLogsParamsV5 { + currency?: string; + baseCoin?: string; + type?: string; + startTime?: number; + endTime?: number; limit?: number; - from?: number; - direction?: string; + cursor?: string; +} +⋮---- +export interface SetLimitPriceActionParamsV5 { + category: CategoryV5; + modifyEnable: boolean; } ⋮---- /** - * Response types + * Set Delta Neutral Mode. POST /v5/account/set-delta-mode + * 1: enable, 0: disable. */ -⋮---- -export interface LeverageFilter { - min_leverage: numberInString; - max_leverage: numberInString; - leverage_step: numberInString; +export interface SetDeltaNeutralModeParamsV5 { + deltaEnable: '1' | '0'; } -export interface PriceFilter { - min_price: numberInString; - max_price: numberInString; - tick_size: numberInString; +⋮---- +export interface GetAccountInstrumentsInfoParamsV5 { + category: 'spot' | 'linear' | 'inverse'; + symbol?: string; + /** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ + symbolType?: InstrumentSymbolTypeV5; + limit?: number; + cursor?: string; } ⋮---- -export interface LotSizeFilter { - max_trading_qty: number; - min_trading_qty: number; - qty_step: number; +/** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ +⋮---- +/** GET /v5/account/pay-info */ +export interface GetPayInfoParamsV5 { + coin?: string; } ⋮---- -export interface SymbolInfo { - name: string; - alias: string; - status: 'Trading' | string; - base_currency: string; - quote_currency: string; - price_scale: number; - taker_fee: numberInString; - maker_fee: numberInString; - leverage_filter: LeverageFilter; - price_filter: PriceFilter; - lot_size_filter: LotSizeFilter; +/** GET /v5/account/trade-info-for-analysis */ +export interface GetTradeInfoForAnalysisParamsV5 { + symbol: string; + startTime?: number; + endTime?: number; } - -================ -File: webpack/webpack.config.js -================ -function generateConfig(name) ⋮---- -// Add '.ts' and '.tsx' as resolvable extensions. -⋮---- -// Node.js core modules not available in browsers -// The REST client's https.Agent (for keepAlive) is Node.js-only and won't work in browsers -⋮---- -// All files with a '.ts' or '.tsx' extension will be handled by 'ts-loader'. +export interface ManualRepayParamsV5 { + coin?: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. + */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +} ⋮---- -// All output '.js' files will have any sourcemaps re-processed by 'source-map-loader'. - -================ -File: .npmrc -================ -min-release-age=30 -save-exact=true - -================ -File: .nvmrc -================ -v24.18.0 +/** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. + */ ================ -File: jest.config.ts +File: src/types/request/v5-asset.ts ================ -/** - * For a detailed explanation regarding each configuration property, visit: - * https://jestjs.io/docs/configuration - */ +import { AccountTypeV5, CategoryV5 } from '../shared-v5'; ⋮---- -import type { Config } from 'jest'; +export interface GetCoinExchangeRecordParamsV5 { + fromCoin?: string; + toCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -// All imported modules in your tests should be mocked automatically -// automock: false, +export interface GetDeliveryRecordParamsV5 { + category: CategoryV5; + symbol?: string; + startTime?: number; + endTime?: number; + expDate?: string; + limit?: number; + cursor?: string; +} ⋮---- -// Stop running tests after `n` failures -// bail: 0, -bail: false, // enable to stop test when an error occur, +export interface GetSettlementRecordParamsV5 { + category: CategoryV5; + symbol?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// The directory where Jest should store its cached dependency information -// cacheDirectory: "/private/var/folders/kf/2k3sz4px6c9cbyzj1h_b192h0000gn/T/jest_dx", +export interface GetAssetInfoParamsV5 { + accountType: AccountTypeV5; + coin?: string; +} ⋮---- -// Automatically clear mock calls, instances, contexts and results before every test +export interface GetAllCoinsBalanceParamsV5 { + memberId?: string; + accountType: AccountTypeV5; + coin?: string; + withBonus?: number; +} ⋮---- -// Indicates whether the coverage information should be collected while executing the test +export interface GetAccountCoinBalanceParamsV5 { + memberId?: string; + toMemberId?: string; + accountType: AccountTypeV5; + coin: string; + toAccountType?: AccountTypeV5; + withBonus?: number; + withTransferSafeAmount?: 0 | 1; + withLtvTransferSafeAmount?: 0 | 1; +} ⋮---- -// An array of glob patterns indicating a set of files for which coverage information should be collected +export interface GetInternalTransferParamsV5 { + transferId?: string; + coin?: string; + status?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// The directory where Jest should output its coverage files +export interface UniversalTransferParamsV5 { + transferId: string; + coin: string; + amount: string; + fromMemberId: number; + toMemberId: number; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; +} ⋮---- -// An array of regexp pattern strings used to skip coverage collection -// coveragePathIgnorePatterns: [ -// "/node_modules/" -// ], +export interface GetUniversalTransferRecordsParamsV5 { + transferId?: string; + coin?: string; + status?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; + fromMemberId?: string; + toMemberId?: string; +} ⋮---- -// Indicates which provider should be used to instrument code for coverage +export interface GetAllowedDepositCoinInfoParamsV5 { + coin?: string; + chain?: string; + limit?: number; + cursor?: string; +} ⋮---- -// A list of reporter names that Jest uses when writing coverage reports -// coverageReporters: [ -// "json", -// "text", -// "lcov", -// "clover" -// ], +export interface GetDepositRecordParamsV5 { + id?: string; + txID?: string; + coin?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// An object that configures minimum threshold enforcement for coverage results -// coverageThreshold: undefined, +export interface GetSubAccountDepositRecordParamsV5 { + id?: string; + txID?: string; + subMemberId: string; + coin?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// A path to a custom dependency extractor -// dependencyExtractor: undefined, +export interface GetInternalDepositRecordParamsV5 { + txID?: string; + startTime?: number; + endTime?: number; + coin?: string; + cursor?: string; + limit?: number; +} ⋮---- -// Make calling deprecated APIs throw helpful error messages -// errorOnDeprecated: false, +export interface GetWithdrawalRecordsParamsV5 { + withdrawID?: string; + txID?: string; + coin?: string; + withdrawType?: number; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// The default configuration for fake timers -// fakeTimers: { -// "enableGlobally": false -// }, +export interface GetWithdrawalAddressListParamsV5 { + coin?: string; + chain?: string; + addressType?: 0 | 1 | 2; + limit?: number; + cursor?: string; +} ⋮---- -// Force coverage collection from ignored files using an array of glob patterns -// forceCoverageMatch: [], +export interface SubmitDepositOriginatorInfoParamsV5 { + depositId: number; + subAccountId?: number; + /** Travel Rule questionnaire JSON string. See Questionnaire docs. */ + questionnaire: string; +} ⋮---- -// A path to a module which exports an async function that is triggered once before all test suites -// globalSetup: undefined, +/** Travel Rule questionnaire JSON string. See Questionnaire docs. */ ⋮---- -// A path to a module which exports an async function that is triggered once after all test suites -// globalTeardown: undefined, +export interface WithdrawParamsV5 { + coin: string; + /** + * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. + */ + chain?: string; + address: string; + tag?: string; + amount: string; + timestamp: number; + forceChain?: number; + /** + * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). + * SPOT is legacy if still supported for older integrations. + */ + accountType: string; + feeType?: 0 | 1; + requestId?: string; + /** + * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. + */ + transactionPurpose?: string; + /** + * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. + */ + questionnaire?: string; + beneficiary?: { + vaspEntityId?: string; + beneficiaryName?: string; + beneficiaryLegalType?: string; + beneficiaryWalletType?: string; + beneficiaryUnhostedWalletType?: string; + beneficiaryPoiNumber?: string; + beneficiaryPoiType?: string; + beneficiaryPoiIssuingCountry?: string; + beneficiaryPoiExpiredDate?: string; + }; +} ⋮---- -// A set of global variables that need to be available in all test environments -// globals: {}, +/** + * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. + */ ⋮---- -// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers. -// maxWorkers: "50%", +/** + * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). + * SPOT is legacy if still supported for older integrations. + */ ⋮---- -// An array of directory names to be searched recursively up from the requiring module's location -// moduleDirectories: [ -// "node_modules" -// ], -⋮---- -// An array of file extensions your modules use -// moduleFileExtensions: [ -// "js", -// "mjs", -// "cjs", -// "jsx", -// "ts", -// "tsx", -// "json", -// "node" -// ], -⋮---- -// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module -// moduleNameMapper: {}, -⋮---- -// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader -// modulePathIgnorePatterns: [], -⋮---- -// Activates notifications for test results -// notify: false, -⋮---- -// An enum that specifies notification mode. Requires { notify: true } -// notifyMode: "failure-change", -⋮---- -// A preset that is used as a base for Jest's configuration -// preset: undefined, -⋮---- -// Run tests from one or more projects -// projects: undefined, -⋮---- -// Use this configuration option to add custom reporters to Jest -// reporters: undefined, -⋮---- -// Automatically reset mock state before every test -// resetMocks: false, -⋮---- -// Reset the module registry before running each individual test -// resetModules: false, -⋮---- -// A path to a custom resolver -// resolver: undefined, +/** + * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. + */ ⋮---- -// Automatically restore mock state and implementation before every test -// restoreMocks: false, +/** + * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. + */ ⋮---- -// The root directory that Jest should scan for tests and modules within -// rootDir: undefined, +export interface ConvertCoinsParamsV5 { + coin?: string; + side?: number; + accountType: + | 'eb_convert_funding' + | 'eb_convert_uta' + | 'eb_convert_spot' + | 'eb_convert_contract' + | 'eb_convert_inverse'; +} ⋮---- -// A list of paths to directories that Jest should use to search for files in -// roots: [ -// "" -// ], +export interface RequestConvertQuoteParamsV5 { + fromCoin: string; + toCoin: string; + fromCoinType?: string; + toCoinType?: string; + requestCoin: string; + requestAmount: string; + accountType: + | 'eb_convert_funding' + | 'eb_convert_uta' + | 'eb_convert_spot' + | 'eb_convert_contract' + | 'eb_convert_inverse'; + requestId?: string; +} ⋮---- -// Allows you to use a custom runner instead of Jest's default test runner -// runner: "jest-runner", +export interface GetConvertHistoryParamsV5 { + accountType?: string; + index?: number; + limit?: number; +} ⋮---- -// The paths to modules that run some code to configure or set up the testing environment before each test -// setupFiles: [], +export interface GetSmallBalanceListParamsV5 { + accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet + fromCoin?: string; // Source currency +} ⋮---- -// A list of paths to modules that run some code to configure or set up the testing framework before each test -// setupFilesAfterEnv: [], +accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet +fromCoin?: string; // Source currency ⋮---- -// The number of seconds after which a test is considered as slow and reported as such in the results. -// slowTestThreshold: 5, +export interface GetFiatTradingPairListParamsV5 { + side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) +} ⋮---- -// A list of paths to snapshot serializer modules Jest should use for snapshot testing -// snapshotSerializers: [], +side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) ⋮---- -// The test environment that will be used for testing -// testEnvironment: "jest-environment-node", +/** Funding Account Transaction History. Interval createTimeFrom-createTimeTo max 7 days. */ +export interface GetFundingAccountTransactionHistoryParamsV5 { + createTimeFrom?: string; + createTimeTo?: string; + limit?: string; + cursor?: string; +} ⋮---- -// Options that will be passed to the testEnvironment -// testEnvironmentOptions: {}, +/** Asset Overview. memberId required when querying sub account via master API key. */ +export interface GetAssetOverviewParamsV5 { + memberId?: string; + /** Fiat currency for valuation; defaults to USD if omitted. */ + valuationCurrency?: string; + /** Account type filter; returns all if omitted. */ + accountType?: string; +} ⋮---- -// Adds a location field to test results -// testLocationInResults: false, +/** Fiat currency for valuation; defaults to USD if omitted. */ ⋮---- -// The glob patterns Jest uses to detect test files +/** Account type filter; returns all if omitted. */ ⋮---- -// "**/__tests__/**/*.[jt]s?(x)", +/** GET /v5/asset/portfolio-margin */ +export interface GetPortfolioMarginInfoParamsV5 { + baseCoin?: string; +} ⋮---- -// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped -// testPathIgnorePatterns: [ -// "/node_modules/" -// ], +/** GET /v5/asset/total-members-assets */ +export interface GetTotalMembersAssetsParamsV5 { + /** If omitted, defaults to BTC. Total is quoted in this coin. */ + coin?: string; +} ⋮---- -// The regexp pattern or array of patterns that Jest uses to detect test files -// testRegex: [], +/** If omitted, defaults to BTC. Total is quoted in this coin. */ + +================ +File: src/types/request/v5-event.ts +================ +export interface GetEventInstrumentsInfoParamsV5 { + symbol?: string; + status?: 'PreLaunch' | 'Trading' | 'Delivering' | 'Closed'; + limit?: number; + cursor?: string; +} ⋮---- -// This option allows the use of a custom results processor -// testResultsProcessor: undefined, +export interface GetEventOrderbookParamsV5 { + symbol: string; +} ⋮---- -// This option allows use of a custom test runner -// testRunner: "jest-circus/runner", +export interface GetEventOrderHistoryParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// A map from regular expressions to paths to transformers -// transform: undefined, +export interface GetEventActiveOrdersParamsV5 { + symbol?: string; + orderId?: string; + orderLinkId?: string; + limit?: number; + cursor?: string; +} ⋮---- -// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation -// transformIgnorePatterns: [ -// "/node_modules/", -// "\\.pnp\\.[^\\/]+$" -// ], +export interface GetEventPositionInfoParamsV5 { + symbol?: string; + baseCoin?: string; + settleCoin?: string; + limit?: number; + cursor?: string; +} ⋮---- -// Prevents import esm module error from v1 axios release, issue #5026 +export interface GetEventTradeHistoryParamsV5 { + symbol: string; + orderId?: string; + orderLinkId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them -// unmockedModulePathPatterns: undefined, +export interface GetEventSettlementRecordsParamsV5 { + symbol: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; +} ⋮---- -// Indicates whether each individual test should be reported during the run -// verbose: undefined, -verbose: true, // report individual test +export interface SubmitEventQuoteParamsV5 { + symbol: string; + orderLinkId: string; + grossPayoutRatio: string; + amount: string; + /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ + cancelAfterMs?: number; +} ⋮---- -// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode -// watchPathIgnorePatterns: [], +/** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ ⋮---- -// Whether to use watchman for file crawling -// watchman: true, - -================ -File: src/types/request/v5-earn-liquidity-mining.ts -================ -/** - * GET /v5/earn/liquidity-mining/product (public, 50 req/s per IP) - */ -export interface GetLiquidityMiningProductParamsV5 { - baseCoin?: string; - quoteCoin?: string; +export interface CancelEventQuoteParamsV5 { + orderLinkId?: string; + orderId?: string; } ⋮---- -export interface ReinvestLiquidityMiningParamsV5 { - productId: string; - orderLinkId: string; - positionId: string; - leverage?: string; +export interface CancelAllEventQuotesParamsV5 { + symbol: string; } ================ @@ -8443,154 +8526,142 @@ export interface GetP2PChatMessagesParamsV5 { /** AES encrypted session ID. */ ================ -File: src/types/request/v5-spot-leverage-token.ts +File: src/types/request/v5-strategy.ts ================ -import { LTOrderTypeV5 } from '../shared-v5'; -⋮---- -export interface PurchaseSpotLeveragedTokenParamsV5 { - ltCoin: string; - amount: string; - serialNo?: string; -} -⋮---- -export interface RedeemSpotLeveragedTokenParamsV5 { - ltCoin: string; - quantity: string; - serialNo?: string; -} -⋮---- -export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { - ltCoin?: string; - orderId?: string; - startTime?: number; - endTime?: number; - limit?: number; - ltOrderType?: LTOrderTypeV5; - serialNo?: string; -} -⋮---- -export interface GetVIPMarginDataParamsV5 { - vipLevel?: string; - currency?: string; -} -⋮---- -export interface GetSpotMarginCurrencyDataParamsV5 { - currency?: string; -} +import { + OrderSideV5, + PositionIdx, + PovModeV5, + StrategyCategoryV5, + StrategyPreferV5, + StrategyTypeV5, +} from '../shared-v5'; ⋮---- -// Spot Margin Trade (UTA) endpoints -export interface ManualBorrowParamsV5 { - coin: string; - amount: string; +/** POST /v5/strategy/create */ +export interface CreateStrategyOrderParamsV5 { + category: StrategyCategoryV5; + symbol: string; + side: OrderSideV5; + strategyType: StrategyTypeV5; + /** Total order quantity (coin). Either size or positionValue is required */ + size?: string; + /** Total order quantity (value). Either size or positionValue is required */ + positionValue?: string; + reduceOnly?: boolean; + positionIdx?: PositionIdx; + /** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ + leverageType?: 0 | 1; + /** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ + duration?: number; + /** TWAP / POV: sub-order placement interval (seconds) */ + interval?: 5 | 10 | 15 | 30 | 60 | 120; + /** TWAP: randomize each sub-order quantity by ±20% */ + isRandom?: boolean; + /** Advanced: activate when market price reaches this value */ + triggerPrice?: string; + /** Advanced: terminate when last traded price reaches this value */ + maxChasePrice?: string; + /** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ + chaseDistance?: string; + /** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ + chasePercentE4?: number; + /** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ + chasePrice?: string; + strategyPrefer?: StrategyPreferV5; + limitPrice?: string; + strategySl?: string; + strategyTp?: string; + /** Iceberg: 0 = taker allowed, 1 = post-only */ + postOnly?: 0 | 1; + isRebalance?: boolean; + /** 1: market, 2: limit */ + orderType?: 1 | 2; + orderPriceOffset?: string; + strategyName?: string; + /** POV execution mode */ + mode?: PovModeV5; + /** POV participation rate */ + participationRate?: string; + /** POV: historical traded volume window (seconds), range [60, 14400] */ + referenceWindow?: string; + /** POV: book depth reference levels [1, 10] */ + depthReference?: string; } ⋮---- -export interface GetMaxBorrowableAmountParamsV5 { - currency: string; -} +/** Total order quantity (coin). Either size or positionValue is required */ ⋮---- -export interface GetPositionTiersParamsV5 { - currency?: string; -} +/** Total order quantity (value). Either size or positionValue is required */ ⋮---- -export interface GetCoinStateParamsV5 { - currency?: string; -} +/** Spot leverage type. 0: normal, 1: borrow to trade (UTA_SPOT only) */ ⋮---- -export interface GetAvailableAmountToRepayParamsV5 { - currency: string; -} +/** TWAP / POV: total execution duration (seconds). Range [300, 86400]; TWAP must be divisible by interval */ ⋮---- -export interface SetSpotMarginLeverageParamsV5 { - leverage: string; - currency?: string; -} +/** TWAP / POV: sub-order placement interval (seconds) */ ⋮---- -export interface ManualRepayWithoutConversionParamsV5 { - coin: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; -} +/** TWAP: randomize each sub-order quantity by ±20% */ ⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - */ +/** Advanced: activate when market price reaches this value */ ⋮---- -export interface GetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, returns all currencies -} +/** Advanced: terminate when last traded price reaches this value */ ⋮---- -currency?: string; // Coin name, uppercase only. If not passed, returns all currencies +/** Limit chase: absolute distance from best bid/ask. Mutually exclusive with chasePercentE4 */ ⋮---- -export interface SetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies - autoRepayMode: '0' | '1'; // 0: Off, 1: On -} +/** Limit chase: offset in basis points (1/10000). Mutually exclusive with chaseDistance */ ⋮---- -currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies -autoRepayMode: '0' | '1'; // 0: Off, 1: On +/** Chase / Iceberg: reference price side, e.g. Bid1, Ask1 */ ⋮---- -export interface GetSpotMarginLiabilityInfoParamsV5 { - currency: string; -} +/** Iceberg: 0 = taker allowed, 1 = post-only */ ⋮---- -export interface FixedRateBorrowParamsV5 { - orderCurrency: string; - orderAmount: string; - /** e.g. 0.02 = 2% p.a. */ - annualRate: string; - /** 7, 14, 30, 90, 180 (days) */ - term: string; - /** 1: auto repayment; 2: transfer to flexible loan */ - repayType?: '1' | '2'; -} +/** 1: market, 2: limit */ ⋮---- -/** e.g. 0.02 = 2% p.a. */ +/** POV execution mode */ ⋮---- -/** 7, 14, 30, 90, 180 (days) */ +/** POV participation rate */ ⋮---- -/** 1: auto repayment; 2: transfer to flexible loan */ +/** POV: historical traded volume window (seconds), range [60, 14400] */ ⋮---- -export interface GetFixedRateBorrowOrderInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - state?: string; - term?: string; - limit?: string; - cursor?: string; -} +/** POV: book depth reference levels [1, 10] */ ⋮---- -export interface GetFixedRateBorrowContractInfoParamsV5 { - orderId?: string; - orderCurrency?: string; - term?: string; - limit?: string; +/** + * GET /v5/strategy/list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ +export interface GetStrategyListParamsV5 { + strategyId?: string; + symbol?: string; + /** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ + status?: '2' | '3' | '4' | '5' | '6'; + category?: StrategyCategoryV5; + strategyType?: StrategyTypeV5; + beginTimeE0?: number; + endTimeE0?: number; + pageSize?: number; cursor?: string; } ⋮---- -export interface GetFixedRateBorrowOrderQuoteParamsV5 { - orderCurrency: string; - term?: string; - orderBy?: 'apy' | 'term' | 'quantity'; - sort?: 0 | 1; - limit?: number; -} +/** 2: running, 3: terminated, 4: terminated unfilled, 5: paused, 6: untriggered */ ⋮---- -export interface RenewFixedRateBorrowParamsV5 { - loanId: string; - qty?: string; +/** + * GET /v5/strategy/order-list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ +export interface GetStrategyOrderListParamsV5 { + strategyId: string; + /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ + status?: '2' | '3' | '4' | '5' | '6' | '7'; + symbol?: string; + strategyType?: StrategyTypeV5; + beginTimeE0?: number; + endTimeE0?: number; + pageSize?: number; + cursor?: string; } ⋮---- -export interface GetFlexibleAvailableInventoryParamsV5 { - currency: string; -} +/** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ ⋮---- -export interface GetFixedRateAvailableInventoryParamsV5 { - currency: string; - term: string; - annualRate: string; +/** POST /v5/strategy/stop */ +export interface StopStrategyParamsV5 { + strategyId: string; } ================ @@ -8767,1392 +8838,1383 @@ export interface BatchCancelOrderParamsV5 { } ================ -File: src/types/response/v5-earn-liquidity-mining.ts +File: src/types/request/v5-user.ts ================ -export interface LiquidityMiningApyBreakdownV5 { - coin: string; - apy: string; +import { PermissionsV5 } from '../shared-v5'; +⋮---- +export interface CreateSubMemberParamsV5 { + username: string; + password?: string; + /** + * 1: normal, 6: custodial + */ + memberType: 1 | 6; + /** + * 0: quick login disabled (default), 1: quick login enabled + */ + switch?: 0 | 1; + isUta?: boolean; + note?: string; } ⋮---- -export interface LiquidityMiningProductV5 { - productId: string; - baseCoin: string; - quoteCoin: string; - status: 'Available' | 'NotAvailable' | string; - maxLeverage: number; - minInvestmentQuote: string; - minInvestmentBase: string; - maxInvestmentQuote: string; - maxInvestmentBase: string; - minWithdrawalAmount: string; - minReinvestAmount: string; - baseCoinPrecision: number; - quoteCoinPrecision: number; - yieldCoins: string[]; - apyE8: string; - apy7dE8: string; - poolLiquidityValue: string; - dailyYield: string; - slippageRateE8List: string[]; - apyBreakdown: LiquidityMiningApyBreakdownV5[]; - apy7dBreakdown: LiquidityMiningApyBreakdownV5[]; - slippage_levels?: string[]; +/** + * 1: normal, 6: custodial + */ +⋮---- +/** + * 0: quick login disabled (default), 1: quick login enabled + */ +⋮---- +export interface CreateSubApiKeyParamsV5 { + subuid: number; + note?: string; + readOnly: 0 | 1; + ips?: string; + permissions: PermissionsV5; } ⋮---- -export interface LiquidityMiningProductResultV5 { - products: LiquidityMiningProductV5[]; +export interface UpdateApiKeyParamsV5 { + apikey?: string; + readOnly?: 0 | 1; + permissions: PermissionsV5; } ⋮---- -export interface ReinvestLiquidityMiningResultV5 { - orderId: string; - orderLinkId: string; +export interface UpdateSubApiKeyUpdateParamsV5 { + readOnly?: number; + ips?: string[]; + permissions: PermissionsV5; } - -================ -File: src/types/response/v5-p2p-trading.ts -================ -import { P2PTradingPreferenceSetV5 } from '../request/v5-p2p-trading'; ⋮---- -export interface P2PCoinBalanceV5 { - coin: string; - transferBalance: string; - walletBalance: string; - bonus: string; +export interface DeleteSubMemberParamsV5 { + subMemberId: string; } ⋮---- -export interface P2PAccountCoinsBalanceV5 { - memberId: string; - accountType: string; - balance: P2PCoinBalanceV5[]; +export interface GetSubAccountAllApiKeysParamsV5 { + subMemberId: string; + limit?: number; + cursor?: string; } ⋮---- -export interface P2POnlineAdV5 { - id: string; - nickName: string; - tokenId: string; - currencyId: string; - side: string; - price: string; - lastQuantity: string; - minAmount: string; - maxAmount: string; - payments: string[]; - recentOrderNum: number; - recentExecuteRate: number; - isOnline: boolean; - authTag: string[]; - paymentPeriod: number; - accountId: number; - userId: number; - priceType: number; - premium: string; - quantity: string; - frozenQuantity: string; - executedQuantity: string; - remark: string; - status: number; - createDate: string; - orderNum: string; - finishNum: string; - fee: string; - lastLogoutTime: string; - blocked: string; - makerContact: boolean; - symbolInfo: { - id: string; - exchangeId: string; - orgId: string; - tokenId: string; - currencyId: string; - status: string; - lowerLimitAlarm: number; - upperLimitAlarm: number; - itemDownRange: string; - itemUpRange: string; - currencyMinQuote: string; - currencyMaxQuote: string; - currencyLowerMaxQuote: string; - tokenMinQuote: string; - tokenMaxQuote: string; - kycCurrencyLimit: string; - itemSideLimit: string; - buyFeeRate: string; - sellFeeRate: string; - orderAutoCancelMinute: number; - orderFinishMinute: number; - tradeSide: number; - currency: { - id: string; - exchangeId: string; - orgId: string; - currencyId: string; - scale: number; - }; - token: { - id: string; - exchangeId: string; - orgId: string; - tokenId: string; - scale: number; - sequence: number; - }; - buyAd: number; - sellAd: number; - }; - tradingPreferenceSet: { - hasUnPostAd: number; - isKyc: number; - isEmail: number; - isMobile: number; - hasRegisterTime: number; - registerTimeThreshold: number; - orderFinishNumberDay30: number; - completeRateDay30: number; - nationalLimit: number; - hasOrderFinishNumberDay30: number; - hasCompleteRateDay30: number; - hasNationalLimit: number; - }; - version: number; - authStatus: number; - recommend: boolean; - recommendTag: string; - userType: string; - itemType: string; +export interface GetAffiliateUserListParamsV5 { + size?: number; + cursor?: string; + needDeposit?: boolean; + need30?: boolean; + need365?: boolean; + startDate?: string; + endDate?: string; } ⋮---- -export interface P2POnlineAdsResponseV5 { - count: number; - items: P2POnlineAdV5[]; +/** GET /v5/affiliate/affiliate-sub-list */ +export interface GetAffiliateSubAffiliateListParamsV5 { + cursor?: string; + /** [0, 100]. Default: 0 */ + size?: number; + /** YYYY-MM-DD. Range with endDate max 3 months */ + startDate?: string; + /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ + endDate?: string; + /** Exact sub-affiliate ID. 0 or omit for all */ + subAffId?: number; } ⋮---- -export interface P2PCreateAdResponseV5 { - itemId: string; - securityRiskToken: string; - riskTokenType: string; - riskVersion: string; - needSecurityRisk: boolean; +/** [0, 100]. Default: 0 */ +⋮---- +/** YYYY-MM-DD. Range with endDate max 3 months */ +⋮---- +/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ +⋮---- +/** Exact sub-affiliate ID. 0 or omit for all */ +⋮---- +export interface GetAffiliateUserInfoParamsV5 { + /** The master account UID of affiliate's client */ + uid: string; + /** Coin type for filtering, e.g. USDT */ + coin?: string; + /** + * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + */ + business?: '1' | '2' | '3' | '4' | '5'; } ⋮---- -export interface P2PPaymentTermV5 { - id: string; - realName: string; - paymentType: number; - bankName: string; - branchName: string; - accountNo: string; - qrcode: string; - visible: number; - payMessage: string; - firstName: string; - lastName: string; - secondLastName: string; - clabe: string; - debitCardNumber: string; - mobile: string; - businessName: string; - concept: string; - paymentExt1: string; - paymentExt2: string; - paymentExt3: string; - paymentExt4: string; - paymentExt5: string; - paymentExt6: string; - paymentTemplateVersion: number; - paymentConfig: { - paymentType: number; - paymentName: string; - paymentDialect: string; - }; - realNameVerified: boolean; +/** The master account UID of affiliate's client */ +⋮---- +/** Coin type for filtering, e.g. USDT */ +⋮---- +/** + * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + */ +⋮---- +/** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */ +export interface GetFriendReferralsParamsV5 { + status?: string; + size?: string; + cursor?: string; } ⋮---- -export interface P2PAdDetailV5 { - id: string; - accountId: string; - userId: string; - nickName: string; - tokenId: string; - tokenName: string; - currencyId: string; - side: number; - priceType: number; - price: string; - premium: string; - lastQuantity: string; - quantity: string; - frozenQuantity: string; - executedQuantity: string; - minAmount: string; - maxAmount: string; - remark: string; - status: number; - createDate: string; - payments: string[]; - /** Personal ads list only. Empty string means the ad is not hidden. */ - hiddenReason?: string; - orderNum: number; - finishNum: number; - recentOrderNum: number; - recentExecuteRate: number; - fee: string; - isOnline: boolean; - lastLogoutTime: string; - symbolInfo: { - id: string; - exchangeId: string; - orgId: string; - tokenId: string; - currencyId: string; - status: number; - lowerLimitAlarm: number; - upperLimitAlarm: number; - itemDownRange: string; - itemUpRange: string; - currencyMinQuote: string; - currencyMaxQuote: string; - currencyLowerMaxQuote: string; - tokenMinQuote: string; - tokenMaxQuote: string; - kycCurrencyLimit: string; - itemSideLimit: number; - buyFeeRate: string; - sellFeeRate: string; - orderAutoCancelMinute: number; - orderFinishMinute: number; - tradeSide: number; - currency: { - id: string; - exchangeId: string; - orgId: string; - currencyId: string; - scale: number; - }; - token: { - id: string; - exchangeId: string; - orgId: string; - tokenId: string; - scale: number; - sequence: number; - }; - buyAd: { - paymentPeriods: number[]; - }; - sellAd: { - paymentPeriods: number[]; - }; - }; - tradingPreferenceSet: P2PTradingPreferenceSetV5; - paymentTerms: P2PPaymentTermV5[]; - version: number; - updateDate: string; - feeRate: string; - paymentPeriod: number; - itemType: string; -} +/** + * Referral product line. + * + * 0 unknown, 1 spot, 2 contracts, 3 options, 4 USDC perpetual, 6 TradeFi, 9 Alpha. + * Unrecognized response values are returned as 0. + */ +export type ReferralProductLineV5 = 0 | 1 | 2 | 3 | 4 | 6 | 9; ⋮---- -/** Personal ads list only. Empty string means the ad is not hidden. */ +/** + * Invitee status (`friendStatus`). + * + * 0 unknown, 1 signed up, 2 first deposit, 3 first trade, 4 qualified, + * 5 not qualified, 6 historical invitation, 7 boost in progress, + * 8 boost qualified, 9 boost failed, 10 boost user signed up. + */ +export type ReferralFriendStatusV5 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; ⋮---- -export interface P2PPersonalAdsResponseV5 { - count: number; - items: P2PAdDetailV5[]; - hiddenFlag: boolean; +/** + * POST /v5/referral/commission/records + * + * All fields are optional. Send `{}` when no filter is needed. An empty + * `userIdList` does not filter by invitee. `page` 0 is treated as 1. + * `pageSize` 0 or greater than 200 is treated as 10. + * Times are `YYYY-MM-DD HH:mm:ss`. Property names are the proto camelCase + * names; gateway serialization is not independently verified. + */ +export interface GetReferralCommissionRecordsParamsV5 { + /** Invitee IDs. An empty list does not filter by invitee. */ + userIdList?: number[]; + /** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ + startTime?: string; + /** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ + endTime?: string; + /** One-based page. `0` is treated as `1`. */ + page?: number; + /** Page size. `0` or a value greater than 200 is treated as 10. */ + pageSize?: number; + productLine?: ReferralProductLineV5; } ⋮---- -export interface P2POrderExtensionV5 { - isDelayWithdraw: boolean; - delayTime: string; - startTime: string; -} +/** Invitee IDs. An empty list does not filter by invitee. */ ⋮---- -export interface P2POrderV5 { - id: string; - side: number; - tokenId: string; - orderType: string; - amount: string; - currencyId: string; - price: string; - notifyTokenQuantity?: string; - notifyTokenId?: string; - fee: string; - targetNickName: string; - targetUserId: string; - /** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ - targetUserMaskId?: string; - status: number; - selfUnreadMsgCount: string; - createDate: string; - transferLastSeconds: string; - appealLastSeconds: string; - userId: string; - sellerRealName: string; - buyerRealName: string; - judgeInfo: { - autoJudgeUnlockTime: string; - dissentResult: string; - preDissent: string; - postDissent: string; - }; - unreadMsgCount: string; - extension: P2POrderExtensionV5; - bulkOrderFlag: boolean; -} +/** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ ⋮---- -/** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ +/** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ ⋮---- -export interface P2POrdersResponseV5 { - count: number; - items: P2POrderV5[]; -} +/** One-based page. `0` is treated as `1`. */ ⋮---- -export interface P2PPaymentConfigItemV5 { - view: boolean; - name: string; - label: string; - placeholder: string; - type: string; - maxLength: string; - required: boolean; -} +/** Page size. `0` or a value greater than 200 is treated as 10. */ ⋮---- -export interface P2PPaymentConfigV5 { - paymentType: string; - checkType: number; - sort: number; - paymentName: string; - addTips: string; - itemTips: string; - online: number; - items: P2PPaymentConfigItemV5[]; +/** + * POST /v5/referral/user/invitations + * + * All fields are optional. An empty `userIdList` does not filter by invitee. + * Invalid or empty times are passed downstream as `0`. + */ +export interface GetReferralUserInvitationsParamsV5 { + /** Invitee IDs. An empty list does not filter by invitee. */ + userIdList?: number[]; + /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ + startTime?: string; + /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ + endTime?: string; + /** Page number. `0` is treated as `1`. */ + page?: number; + /** Page size. `0` or a value greater than 200 is treated as 10. */ + pageSize?: number; + friendStatus?: ReferralFriendStatusV5; } ⋮---- -export interface P2PPaymentTermDetailV5 { - id: string; - realName: string; - paymentType: number; - bankName: string; - branchName: string; - accountNo: string; - qrcode: string; - visible: number; - payMessage: string; - firstName: string; - lastName: string; - secondLastName: string; - clabe: string; - debitCardNumber: string; - mobile: string; - businessName: string; - concept: string; - online: string; - paymentExt1: string; - paymentExt2: string; - paymentExt3: string; - paymentExt4: string; - paymentExt5: string; - paymentExt6: string; - paymentTemplateVersion: number; - paymentConfigVo: P2PPaymentConfigV5; - ruPaymentPrompt: boolean; -} +/** Invitee IDs. An empty list does not filter by invitee. */ ⋮---- -export interface P2PAppraiseInfoV5 { - anonymous: string; - appraiseContent: string; - appraiseId: string; - appraiseType: string; - modifyFlag: string; - updateDate: string; -} +/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ ⋮---- -export interface P2PJudgeInfoV5 { - autoJudgeUnlockTime: string; - dissentResult: string; - preDissent: string; - postDissent: string; +/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ +⋮---- +/** Page number. `0` is treated as `1`. */ +⋮---- +/** Page size. `0` or a value greater than 200 is treated as 10. */ +⋮---- +/** Sign Agreement. Only master account. + * - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`. + * - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable. + * - Either `category` or `categoryV2` must be sent. */ +export interface SignAgreementParamsV5 { + agree: boolean; + category?: 2 | 3; + categoryV2?: number; } + +================ +File: src/types/response/v5-event.ts +================ +export type EventContractTypeV5 = 'Up_Down' | 'UpDown' | 'Target' | 'Range'; +export type EventContractDirectionV5 = + | 'UP' + | 'DOWN' + | 'ABOVE' + | 'BELOW' + | 'RANGE_IN' + | 'RANGE_OUT'; ⋮---- -export interface P2POrderDetailV5 { - id: string; - side: number; - itemId: string; - accountId: string; - userId: string; - nickName: string; - makerUserId: string; - targetAccountId: string; - targetUserId: string; - targetNickName: string; - /** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ - targetUserMaskId: string; - targetFirstName: string; - targetSecondName: string; - targetUserAuthStatus: number; - targetConnectInformation: string; - payerRealName: string; - sellerRealName: string; - buyerRealName: string; - tokenId: string; - tokenName: string; - currencyId: string; - price: string; - quantity: string; - amount: string; - payCode: string; - paymentType: number; - transferDate: string; - status: number; - createDate: string; - paymentTermList: P2PPaymentTermDetailV5[]; - remark: string; - transferLastSeconds: string; - recentOrderNum: number; - recentExecuteRate: number; - appealLastSeconds: string; - appealContent: string; - appealType: number; - appealNickName: string; - canAppeal: string; - totalAppealTimes: string; - appealedTimes: string; - paymentTermResult: P2PPaymentTermDetailV5; - orderFinishMinute: number; - confirmedPayTerm: P2PPaymentTermDetailV5; - makerFee: string; - takerFee: string; - fee: string; - showContact: boolean; - tokenBalance: string; - fiatBalance: string; - unreadMsgCount: string; - updateDate: string; - extension: P2POrderExtensionV5; - selfUnreadMsgCount: string; - judgeType: string; - canReport: boolean; - canReportDisagree: boolean; - canReportType: string[]; - canReportDisagreeType: string[]; - appraiseStatus: string; - appraiseInfo: P2PAppraiseInfoV5; - canReportDisagreeTypes: string[]; - canReportTypes: string[]; - orderType: string; - middleToken: string; - beforePrice: string; - beforeQuantity: string; - beforeToken: string; - alternative: string; - appealUserId: string; - notifyTokenId: string; - notifyTokenQuantity: string; - cancelResponsible: string; - chainType: string; - chainAddress: string; - tradeHashCode: string; - estimatedGasFee: string; - gasFeeTokenId: string; - tradingFeeTokenId: string; - onChainInfo: string; - transactionId: string; - displayRefund: string; - chainWithdrawLastSeconds: string; - chainTransferLastSeconds: string; - orderSource: string; - cancelReason: string; - sellerCancelExamineRemainTime: string; - needSellerExamineCancel: boolean; - /** True when the buyer must review a pending seller cancel request. */ - needBuyerExamineCancel: boolean; - couponCurrencyAmount: string; - totalCurrencyAmount: string; - usedCoupon: boolean; - couponTokenId: string; - couponQuantity: string; - completedOrderAppealCount: number; - totalCompletedOrderAppealCount: number; - realOrderStatus: number; - appealVersion: number; - judgeInfo: P2PJudgeInfoV5; - helpType: string; - appealFlowStatus: string; - appealSubStatus: string; - bulkOrderFlag: boolean; - targetUserType: string; - targetUserDisplays: string[]; - appealProcessChangeFlag: boolean; - appealNegotiationNode: number; +export interface EventInstrumentFeeRateRuleV5 { + minSecToDelivery: number; + maxSecToDelivery: number; + baseMarkup: string; } ⋮---- -/** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ -⋮---- -/** True when the buyer must review a pending seller cancel request. */ -⋮---- -export interface P2POrderMessageV5 { - id: string; - message: string; - userId: string; - msgType: number; - msgCode: number; - createDate: string; - contentType: string; - orderId: string; - msgUuid: string; - nickName: string; - fileName: string; - accountId: string; - isRead: number; - read: number; - roleType: string; - onlyForCustomer: number; +export interface EventInstrumentQuotationLimitV5 { + minSecToDelivery: number; + maxSecToDelivery: number; + quoteMaxAmountPerUser: string; + quoteMinAmountPerUser: string; + quoteMinAmount: string; } ⋮---- -export interface P2PChatSessionV5 { - sessionName: string; - sessionId: string; - type: 'GROUP' | 'SINGLE'; - /** The docs specify integers, but response examples use strings. */ - id: string | number; - unreadCount: string | number; +export interface EventInstrumentLotSizeFilterV5 { + minOrderAmount: string; + maxOrderAmount: string; + orderAmountTickSize: string; + quoteMaxValidMs: number; + quoteMinIntervalPerUserMs: number; } ⋮---- -/** The docs specify integers, but response examples use strings. */ -⋮---- -export interface P2PChatSessionsResponseV5 { - chatSession: P2PChatSessionV5[]; +export interface EventInstrumentInfoV5 { + symbol: string; + symbolId: number; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + eventContractType: EventContractTypeV5 | string; + durationWindow: string | number; + rvThreshold: string; + rebate: string; + takerFeeRate: string; + makerFeeRate: string; + launchTime: string; + deliveryTime: string; + status: string; + targetPrice: string; + lowerBound: string; + upperBound: string; + callOptionSymbolId: number; + putOptionSymbolId: number; + feeRateRule: EventInstrumentFeeRateRuleV5[]; + lotSizeFilter: EventInstrumentLotSizeFilterV5; + quotationLimit: EventInstrumentQuotationLimitV5[]; } ⋮---- -export interface P2PChatMessageV5 { - /** The docs specify integers, but response examples use strings. */ - id: string | number; - sendUserNickName: string; - contentType: 'str' | 'pic' | 'pdf' | 'video'; - /** JSON string containing content, msgCode, msgType, fileName and size. */ - message: string; - /** Creation timestamp in milliseconds. Examples use strings. */ - createDate: string | number; +export interface EventInstrumentInfoResultV5 { + nextPageCursor: string; + list: EventInstrumentInfoV5[]; } ⋮---- -/** The docs specify integers, but response examples use strings. */ +/** REST Get Orderbook: each entry is [payoutRatio, orderValue] */ +export type EventOrderbookLevelV5 = [string, string]; ⋮---- -/** JSON string containing content, msgCode, msgType, fileName and size. */ +export interface EventOrderbookV5 { + s: string; + r: EventOrderbookLevelV5[]; + ts: number; + u: number; + seq: number; + cts: number; +} ⋮---- -/** Creation timestamp in milliseconds. Examples use strings. */ +export interface EventOrderHistoryItemV5 { + orderId: string; + orderLinkId: string; + orderStatus: string; + symbol: string; + symbolId: string; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + ecDirection: EventContractDirectionV5 | string; + ecDurationWindow: string; + ecTargetPrice: string; + ecContractType: EventContractTypeV5 | string; + ecLowerBound: string; + ecUpperBound: string; + settleTimeMs: string; + ecOrderValue: string; + ecIndexPrice: string; + orderAvgPayoutRatio: string; + cumExecValue: string; + payoutRatio: string; + tradeFee: string; + transTime: string; + createTime: string; + updateTime: string; + cumPayout: string; + cumExecFee: string; + cancelType: string; + createType: string; + rejectReason: string; + extraFees: string; +} ⋮---- -export interface P2PChatMessagesResponseV5 { - messages: P2PChatMessageV5[]; +export interface EventOrderHistoryResultV5 { + list: EventOrderHistoryItemV5[]; + cursor: string; } ⋮---- -export interface P2PUserInfoV5 { - nickName: string; - defaultNickName: boolean; - isOnline: boolean; - kycLevel: string; - email: string; - mobile: string; - lastLogoutTime: string; - recentRate: string; - totalFinishCount: number; - totalFinishSellCount: number; - totalFinishBuyCount: number; - recentFinishCount: number; - averageReleaseTime: string; - averageTransferTime: string; - accountCreateDays: number; - firstTradeDays: number; - realName: string; - recentTradeAmount: string; - totalTradeAmount: string; - registerTime: string; - authStatus: number; - kycCountryCode: string; - blocked: string; - goodAppraiseRate: string; - goodAppraiseCount: number; - badAppraiseCount: number; - accountId: number; - paymentCount: number; - contactCount: number; - vipLevel: number; - userCancelCountLimit: number; - paymentRealNameUneditable: boolean; - userId: string; - realNameEn: string; +export interface EventActiveOrderV5 { + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: string; + side: string; + orderStatus: string; + payoutRatio: string; + cumExecValue: string; + cumExecFee: string; + leavesValue: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + ecOrderValue: string; + ecSettleTime: string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecDurationWindow: string; + ecIndexPrice: string; + orderAvgPayoutRatio: string; + createType: string; + createdTime: string; + updatedTime: string; } ⋮---- -export interface P2PCounterpartyUserInfoV5 { - nickName: string; - defaultNickName: boolean; - whiteFlag: number; - contactConfig: boolean; - isOnline: boolean; - email: string; - mobile: string; - kycLevel: number; - lastLogoutTime: string; - recentRate: number; - totalFinishCount: number; - totalFinishSellCount: number; - totalFinishBuyCount: number; - recentFinishCount: number; - averageReleaseTime: string; - averageTransferTime: string; - accountCreateDays: number; - firstTradeDays: number; - realName: string; - recentTradeAmount: string; - totalTradeAmount: string; - executeNum: number; - orderNum: number; - hasUnPostAd: number; - registerTime: string; - authStatus: number; - kycCountryCode: string; - blocked: string; - goodAppraiseRate: string; - goodAppraiseCount: number; - badAppraiseCount: number; - accountId: string; - paymentCount: number; - contactCount: number; - realNameMask: string; - vipLevel: number; - vipProfit: []; - userTag: []; - userCancelCountLimit: number; - paymentRealNameUneditable: boolean; - lostRoleAffected: boolean; - userCurPrivilege: string[]; - userType: string; - userId: string; - realNameEn: string; - canSubOnline: boolean; - curPrivilegeInfo: []; - openApiSwitch: number; +export interface EventActiveOrdersResultV5 { + list: EventActiveOrderV5[]; + nextPageCursor: string; } ⋮---- -export interface P2PUserPaymentV5 { - id: string; - realName: string; - paymentType: string; - bankName: string; - branchName: string; - accountNo: string; - qrcode: string; - visible: number; - payMessage: string; - firstName: string; - lastName: string; - secondLastName: string; - clabe: string; - debitCardNumber: string; - mobile: string; - businessName: string; - concept: string; - online: string; - countNo: string; - paymentExt1: string; - paymentExt2: string; - paymentExt3: string; - paymentExt4: string; - paymentExt5: string; - paymentExt6: string; - paymentTemplateVersion: number; - hasPaymentTemplateChanged: boolean; - paymentConfigVo: P2PPaymentConfigV5; - realNameVerified: boolean; - channel: string; - currencyBalance: string[]; +export interface EventPositionV5 { + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + avgPayoutRatio: string; + positionValue: string; + ecSettleTime: string; + cumClosedPnl: string; + createdTime: string; + updatedTime: string; + seq: number; } - -================ -File: src/types/response/v5-spot-x.ts -================ -export interface LaunchpoolPoolV5 { - poolId: string; - stakeCoin: string; - apr: string; - totalStakedAmount: string; - participantCount: string; +⋮---- +export interface EventPositionInfoResultV5 { + list: EventPositionV5[]; + nextPageCursor: string; } ⋮---- -export interface LaunchpoolProjectV5 { - projectId: string; - activityCoin: string; - rewardCoin: string; - status: number; - totalReward: string; - stakeStartTime: string; - stakeEndTime: string; - totalParticipantCount: string; - pools: LaunchpoolPoolV5[]; +export interface EventTradeV5 { + orderId: string; + orderLinkId: string; + execId: string; + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + execType: string; + execPrice: string; + execValue: string; + execFee: string; + execFeeRate: string; + orderPrice: string; + feeCoin: string; + transTime: string; + timeInForce: string; + crossSeq: string; + ecPayout: string; + ecDurationWindow: string; + settleTimeMs: string; + ecOrderValue: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + extraFees: string; } ⋮---- -export interface LaunchpoolProjectListResultV5 { - list: LaunchpoolProjectV5[]; - nextPageCursor: string; +export interface EventTradeHistoryResultV5 { + list: EventTradeV5[]; + cursor: string; } ⋮---- -export interface LaunchpoolActivityLogItemV5 { - stakeCoin: string; - rewardCoin: string; - amount: string; - type: number; - status: number; - createdTime: string; +export interface EventSettlementV5 { + transId: string; + symbol: string; + symbolId: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: EventContractTypeV5 | string; + ecDirection: EventContractDirectionV5 | string; + settlePrice: string; + entryPrice: string; + grossPayoutRatio: string; + ecDurationWindow: string; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + transTime: string; + crossSeq: string; + execFee: string; + execFeeRate: string; + payout: string; + sessionRpl: string; orderId: string; } ⋮---- -export interface LaunchpoolActivityLogResultV5 { - list: LaunchpoolActivityLogItemV5[]; - total: number; - pageSize: number; - current: number; +export interface EventSettlementRecordsResultV5 { + list: EventSettlementV5[]; + cursor: string; } ⋮---- -export interface LaunchpoolStakingPositionV5 { - stakeCoin: string; - rewardCoin: string; - stakeAmount: string; - totalReward: string; - autoRedeemDate: string; +export interface EventQuoteResultV5 { + orderLinkId: string; + orderId: string; } ⋮---- -export interface LaunchpoolCurrentStakingResultV5 { - totalInvestmentUsd: string; - totalEarningsUsd: string; - todayEarningsUsd: string; - list: LaunchpoolStakingPositionV5[]; +export interface CancelAllEventQuotesResultV5 { + list: EventQuoteResultV5[]; + /** 1: success; 0: failed */ + success: '1' | '0'; } ⋮---- -export interface LaunchpoolUserHistoryItemV5 { - stakeCoin: string; - rewardCoin: string; - totalReward: string; - stakeStartTime: string; - stakeEndTime: string; -} -⋮---- -export interface LaunchpoolUserHistoryResultV5 { - list: LaunchpoolUserHistoryItemV5[]; - total: number; - pageSize: number; - current: number; -} +/** 1: success; 0: failed */ + +================ +File: src/types/response/v5-p2p-trading.ts +================ +import { P2PTradingPreferenceSetV5 } from '../request/v5-p2p-trading'; ⋮---- -export interface PuzzleProjectV5 { - projectId: string; - activityCoin: string; - rewardCoin: string; - status: number; - startTime: string; - endTime: string; - totalReward: string; - participantCount: string; +export interface P2PCoinBalanceV5 { + coin: string; + transferBalance: string; + walletBalance: string; + bonus: string; } ⋮---- -export interface PuzzleProjectListResultV5 { - list: PuzzleProjectV5[]; - nextPageCursor: string; +export interface P2PAccountCoinsBalanceV5 { + memberId: string; + accountType: string; + balance: P2PCoinBalanceV5[]; } ⋮---- -export interface TokenSplashProjectV5 { +export interface P2POnlineAdV5 { + id: string; + nickName: string; + tokenId: string; + currencyId: string; + side: string; + price: string; + lastQuantity: string; + minAmount: string; + maxAmount: string; + payments: string[]; + recentOrderNum: number; + recentExecuteRate: number; + isOnline: boolean; + authTag: string[]; + paymentPeriod: number; + accountId: number; + userId: number; + priceType: number; + premium: string; + quantity: string; + frozenQuantity: string; + executedQuantity: string; + remark: string; status: number; - projectId: string; - activityCoin: string; - rewardCoin: string; - totalReward: string; - participantCount: string; - registrationStartTime: string; - activityEndTime: string; -} -⋮---- -export interface TokenSplashProjectListResultV5 { - list: TokenSplashProjectV5[]; - nextPageCursor: string; -} -⋮---- -export interface TokenSplashTradeTaskV5 { - tradeRequiredAmount: string; - tradeUnit: string; - /** Token counted by the trade task. On-chain tasks use the activity token ID. */ - tradeToken?: string; - tradedAmount: string; - maxRewardAmount: string; - estimatedRewardAmount: string; - rewardCoin: string; + createDate: string; + orderNum: string; + finishNum: string; + fee: string; + lastLogoutTime: string; + blocked: string; + makerContact: boolean; + symbolInfo: { + id: string; + exchangeId: string; + orgId: string; + tokenId: string; + currencyId: string; + status: string; + lowerLimitAlarm: number; + upperLimitAlarm: number; + itemDownRange: string; + itemUpRange: string; + currencyMinQuote: string; + currencyMaxQuote: string; + currencyLowerMaxQuote: string; + tokenMinQuote: string; + tokenMaxQuote: string; + kycCurrencyLimit: string; + itemSideLimit: string; + buyFeeRate: string; + sellFeeRate: string; + orderAutoCancelMinute: number; + orderFinishMinute: number; + tradeSide: number; + currency: { + id: string; + exchangeId: string; + orgId: string; + currencyId: string; + scale: number; + }; + token: { + id: string; + exchangeId: string; + orgId: string; + tokenId: string; + scale: number; + sequence: number; + }; + buyAd: number; + sellAd: number; + }; + tradingPreferenceSet: { + hasUnPostAd: number; + isKyc: number; + isEmail: number; + isMobile: number; + hasRegisterTime: number; + registerTimeThreshold: number; + orderFinishNumberDay30: number; + completeRateDay30: number; + nationalLimit: number; + hasOrderFinishNumberDay30: number; + hasCompleteRateDay30: number; + hasNationalLimit: number; + }; + version: number; + authStatus: number; + recommend: boolean; + recommendTag: string; + userType: string; + itemType: string; } ⋮---- -/** Token counted by the trade task. On-chain tasks use the activity token ID. */ -⋮---- -export interface TokenSplashUserActivityItemV5 { - projectId: string; - activityCoin: string; - tradeTask: TokenSplashTradeTaskV5; +export interface P2POnlineAdsResponseV5 { + count: number; + items: P2POnlineAdV5[]; } ⋮---- -export interface TokenSplashUserActivityResultV5 { - list: TokenSplashUserActivityItemV5[]; +export interface P2PCreateAdResponseV5 { + itemId: string; + securityRiskToken: string; + riskTokenType: string; + riskVersion: string; + needSecurityRisk: boolean; } - -================ -File: src/types/response/v5-trade.ts -================ -import { - CategoryV5, - OrderCancelTypeV5, - OrderCreateTypeV5, - OrderRejectReasonV5, - OrderSideV5, - OrderStatusV5, - OrderTimeInForceV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - StopOrderTypeV5, -} from '../shared-v5'; ⋮---- -export interface OrderResultV5 { - orderId: string; - orderLinkId: string; +export interface P2PPaymentTermV5 { + id: string; + realName: string; + paymentType: number; + bankName: string; + branchName: string; + accountNo: string; + qrcode: string; + visible: number; + payMessage: string; + firstName: string; + lastName: string; + secondLastName: string; + clabe: string; + debitCardNumber: string; + mobile: string; + businessName: string; + concept: string; + paymentExt1: string; + paymentExt2: string; + paymentExt3: string; + paymentExt4: string; + paymentExt5: string; + paymentExt6: string; + paymentTemplateVersion: number; + paymentConfig: { + paymentType: number; + paymentName: string; + paymentDialect: string; + }; + realNameVerified: boolean; } ⋮---- -export interface AccountOrderV5 { - orderId: string; - orderLinkId: string; - parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) - blockTradeId: string; - symbol: string; +export interface P2PAdDetailV5 { + id: string; + accountId: string; + userId: string; + nickName: string; + tokenId: string; + tokenName: string; + currencyId: string; + side: number; + priceType: number; price: string; - qty: string; - side: OrderSideV5; - isLeverage: '0' | '1'; - positionIdx: PositionIdx; - orderStatus: OrderStatusV5; - createType: OrderCreateTypeV5; - cancelType: OrderCancelTypeV5; - rejectReason: OrderRejectReasonV5; - avgPrice: string; - leavesQty: string; - leavesValue: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - timeInForce: OrderTimeInForceV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - orderIv: string; - marketUnit: 'baseCoin' | 'quoteCoin'; - slippageToleranceType: string; - slippageTolerance: string; - triggerPrice: string; - takeProfit: string; - stopLoss: string; - tpslMode: 'Full' | 'Partial' | ''; - ocoTriggerType: - | 'OcoTriggerByUnknown' - | 'OcoTriggerTp' - | 'OcoTriggerBySl' - | ''; - tpLimitPrice: string; - slLimitPrice: string; - tpTriggerBy: OrderTriggerByV5; - slTriggerBy: OrderTriggerByV5; - triggerDirection: 1 | 2; - triggerBy: OrderTriggerByV5; - lastPriceOnCreated: string; - basePrice: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - placeType: 'iv' | 'price' | ''; - smpType: string; - smpGroup: string; - smpOrderId: string; - createdTime: string; - updatedTime: string; - extraFees: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee - rpiTakerAccess?: boolean; - rpiMatchedQty?: string; - fromAccount?: string; - toAccount?: string; - externalEventType?: string; + premium: string; + lastQuantity: string; + quantity: string; + frozenQuantity: string; + executedQuantity: string; + minAmount: string; + maxAmount: string; + remark: string; + status: number; + createDate: string; + payments: string[]; + /** Personal ads list only. Empty string means the ad is not hidden. */ + hiddenReason?: string; + orderNum: number; + finishNum: number; + recentOrderNum: number; + recentExecuteRate: number; + fee: string; + isOnline: boolean; + lastLogoutTime: string; + symbolInfo: { + id: string; + exchangeId: string; + orgId: string; + tokenId: string; + currencyId: string; + status: number; + lowerLimitAlarm: number; + upperLimitAlarm: number; + itemDownRange: string; + itemUpRange: string; + currencyMinQuote: string; + currencyMaxQuote: string; + currencyLowerMaxQuote: string; + tokenMinQuote: string; + tokenMaxQuote: string; + kycCurrencyLimit: string; + itemSideLimit: number; + buyFeeRate: string; + sellFeeRate: string; + orderAutoCancelMinute: number; + orderFinishMinute: number; + tradeSide: number; + currency: { + id: string; + exchangeId: string; + orgId: string; + currencyId: string; + scale: number; + }; + token: { + id: string; + exchangeId: string; + orgId: string; + tokenId: string; + scale: number; + sequence: number; + }; + buyAd: { + paymentPeriods: number[]; + }; + sellAd: { + paymentPeriods: number[]; + }; + }; + tradingPreferenceSet: P2PTradingPreferenceSetV5; + paymentTerms: P2PPaymentTermV5[]; + version: number; + updateDate: string; + feeRate: string; + paymentPeriod: number; + itemType: string; } ⋮---- -parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) -⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee +/** Personal ads list only. Empty string means the ad is not hidden. */ ⋮---- -export interface BatchCreateOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; - createAt?: string; +export interface P2PPersonalAdsResponseV5 { + count: number; + items: P2PAdDetailV5[]; + hiddenFlag: boolean; } ⋮---- -export interface BatchOrdersRetExtInfoV5 { - list: { - code: number; - msg: string; - }[]; +export interface P2POrderExtensionV5 { + isDelayWithdraw: boolean; + delayTime: string; + startTime: string; } ⋮---- -export interface BatchAmendOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; +export interface P2POrderV5 { + id: string; + side: number; + tokenId: string; + orderType: string; + amount: string; + currencyId: string; + price: string; + notifyTokenQuantity?: string; + notifyTokenId?: string; + fee: string; + targetNickName: string; + targetUserId: string; + /** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ + targetUserMaskId?: string; + status: number; + selfUnreadMsgCount: string; + createDate: string; + transferLastSeconds: string; + appealLastSeconds: string; + userId: string; + sellerRealName: string; + buyerRealName: string; + judgeInfo: { + autoJudgeUnlockTime: string; + dissentResult: string; + preDissent: string; + postDissent: string; + }; + unreadMsgCount: string; + extension: P2POrderExtensionV5; + bulkOrderFlag: boolean; } ⋮---- -export interface BatchCancelOrderResultV5 { - category: CategoryV5; - symbol: string; - orderId: string; - orderLinkId: string; -} +/** Pending orders. Pass this to getP2PChatSessionId as userMaskId. */ ⋮---- -export interface SpotBorrowCheckResultV5 { - symbol: string; - side: OrderSideV5; - maxTradeQty: string; - maxTradeAmount: string; - spotMaxTradeQty: string; - spotMaxTradeAmount: string; - borrowCoin: string; +export interface P2POrdersResponseV5 { + count: number; + items: P2POrderV5[]; } ⋮---- -export interface PreCheckOrderResultV5 { - orderId: string; - orderLinkId: string; - preImrE4: number; // Initial margin rate before checking (in basis points) - preMmrE4: number; // Maintenance margin rate before checking (in basis points) - postImrE4: number; // Initial margin rate after checking (in basis points) - postMmrE4: number; // Maintenance margin rate after checking (in basis points) +export interface P2PPaymentConfigItemV5 { + view: boolean; + name: string; + label: string; + placeholder: string; + type: string; + maxLength: string; + required: boolean; } ⋮---- -preImrE4: number; // Initial margin rate before checking (in basis points) -preMmrE4: number; // Maintenance margin rate before checking (in basis points) -postImrE4: number; // Initial margin rate after checking (in basis points) -postMmrE4: number; // Maintenance margin rate after checking (in basis points) - -================ -File: src/types/request/v5-account.ts -================ -import { - AccountTypeV5, - CategoryV5, - InstrumentSymbolTypeV5, - TransactionTypeV5, -} from '../shared-v5'; +export interface P2PPaymentConfigV5 { + paymentType: string; + checkType: number; + sort: number; + paymentName: string; + addTips: string; + itemTips: string; + online: number; + items: P2PPaymentConfigItemV5[]; +} ⋮---- -export interface GetWalletBalanceParamsV5 { - accountType: AccountTypeV5; - coin?: string; +export interface P2PPaymentTermDetailV5 { + id: string; + realName: string; + paymentType: number; + bankName: string; + branchName: string; + accountNo: string; + qrcode: string; + visible: number; + payMessage: string; + firstName: string; + lastName: string; + secondLastName: string; + clabe: string; + debitCardNumber: string; + mobile: string; + businessName: string; + concept: string; + online: string; + paymentExt1: string; + paymentExt2: string; + paymentExt3: string; + paymentExt4: string; + paymentExt5: string; + paymentExt6: string; + paymentTemplateVersion: number; + paymentConfigVo: P2PPaymentConfigV5; + ruPaymentPrompt: boolean; } ⋮---- -export interface GetBorrowHistoryParamsV5 { - currency?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface P2PAppraiseInfoV5 { + anonymous: string; + appraiseContent: string; + appraiseId: string; + appraiseType: string; + modifyFlag: string; + updateDate: string; } ⋮---- -export interface GetFeeRateParamsV5 { - category: CategoryV5; - symbol?: string; - baseCoin?: string; +export interface P2PJudgeInfoV5 { + autoJudgeUnlockTime: string; + dissentResult: string; + preDissent: string; + postDissent: string; } ⋮---- -export interface GetTransactionLogParamsV5 { - accountType?: AccountTypeV5; - category?: CategoryV5; - currency?: string; - baseCoin?: string; - type?: TransactionTypeV5; - /** - * Transaction sub type, "movePosition", used to filter trans logs of Move Position only - */ - transSubType?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface P2POrderDetailV5 { + id: string; + side: number; + itemId: string; + accountId: string; + userId: string; + nickName: string; + makerUserId: string; + targetAccountId: string; + targetUserId: string; + targetNickName: string; + /** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ + targetUserMaskId: string; + targetFirstName: string; + targetSecondName: string; + targetUserAuthStatus: number; + targetConnectInformation: string; + payerRealName: string; + sellerRealName: string; + buyerRealName: string; + tokenId: string; + tokenName: string; + currencyId: string; + price: string; + quantity: string; + amount: string; + payCode: string; + paymentType: number; + transferDate: string; + status: number; + createDate: string; + paymentTermList: P2PPaymentTermDetailV5[]; + remark: string; + transferLastSeconds: string; + recentOrderNum: number; + recentExecuteRate: number; + appealLastSeconds: string; + appealContent: string; + appealType: number; + appealNickName: string; + canAppeal: string; + totalAppealTimes: string; + appealedTimes: string; + paymentTermResult: P2PPaymentTermDetailV5; + orderFinishMinute: number; + confirmedPayTerm: P2PPaymentTermDetailV5; + makerFee: string; + takerFee: string; + fee: string; + showContact: boolean; + tokenBalance: string; + fiatBalance: string; + unreadMsgCount: string; + updateDate: string; + extension: P2POrderExtensionV5; + selfUnreadMsgCount: string; + judgeType: string; + canReport: boolean; + canReportDisagree: boolean; + canReportType: string[]; + canReportDisagreeType: string[]; + appraiseStatus: string; + appraiseInfo: P2PAppraiseInfoV5; + canReportDisagreeTypes: string[]; + canReportTypes: string[]; + orderType: string; + middleToken: string; + beforePrice: string; + beforeQuantity: string; + beforeToken: string; + alternative: string; + appealUserId: string; + notifyTokenId: string; + notifyTokenQuantity: string; + cancelResponsible: string; + chainType: string; + chainAddress: string; + tradeHashCode: string; + estimatedGasFee: string; + gasFeeTokenId: string; + tradingFeeTokenId: string; + onChainInfo: string; + transactionId: string; + displayRefund: string; + chainWithdrawLastSeconds: string; + chainTransferLastSeconds: string; + orderSource: string; + cancelReason: string; + sellerCancelExamineRemainTime: string; + needSellerExamineCancel: boolean; + /** True when the buyer must review a pending seller cancel request. */ + needBuyerExamineCancel: boolean; + couponCurrencyAmount: string; + totalCurrencyAmount: string; + usedCoupon: boolean; + couponTokenId: string; + couponQuantity: string; + completedOrderAppealCount: number; + totalCompletedOrderAppealCount: number; + realOrderStatus: number; + appealVersion: number; + judgeInfo: P2PJudgeInfoV5; + helpType: string; + appealFlowStatus: string; + appealSubStatus: string; + bulkOrderFlag: boolean; + targetUserType: string; + targetUserDisplays: string[]; + appealProcessChangeFlag: boolean; + appealNegotiationNode: number; } ⋮---- -/** - * Transaction sub type, "movePosition", used to filter trans logs of Move Position only - */ -⋮---- -export interface MMPModifyParamsV5 { - baseCoin: string; - window: string; - frozenPeriod: string; - qtyLimit: string; - deltaLimit: string; - vegaLimit?: string; -} +/** Counterparty mask ID. Pass this to getP2PChatSessionId as userMaskId. */ ⋮---- -export interface RepayLiabilityParamsV5 { - coin?: string; -} +/** True when the buyer must review a pending seller cancel request. */ ⋮---- -export interface SetCollateralCoinParamsV5 { - coin: string; - collateralSwitch: 'ON' | 'OFF'; +export interface P2POrderMessageV5 { + id: string; + message: string; + userId: string; + msgType: number; + msgCode: number; + createDate: string; + contentType: string; + orderId: string; + msgUuid: string; + nickName: string; + fileName: string; + accountId: string; + isRead: number; + read: number; + roleType: string; + onlyForCustomer: number; } ⋮---- -export interface GetClassicTransactionLogsParamsV5 { - currency?: string; - baseCoin?: string; - type?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface P2PChatSessionV5 { + sessionName: string; + sessionId: string; + type: 'GROUP' | 'SINGLE'; + /** The docs specify integers, but response examples use strings. */ + id: string | number; + unreadCount: string | number; } ⋮---- -export interface SetLimitPriceActionParamsV5 { - category: CategoryV5; - modifyEnable: boolean; -} +/** The docs specify integers, but response examples use strings. */ ⋮---- -/** - * Set Delta Neutral Mode. POST /v5/account/set-delta-mode - * 1: enable, 0: disable. - */ -export interface SetDeltaNeutralModeParamsV5 { - deltaEnable: '1' | '0'; +export interface P2PChatSessionsResponseV5 { + chatSession: P2PChatSessionV5[]; } ⋮---- -export interface GetAccountInstrumentsInfoParamsV5 { - category: 'spot' | 'linear' | 'inverse'; - symbol?: string; - /** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ - symbolType?: InstrumentSymbolTypeV5; - limit?: number; - cursor?: string; +export interface P2PChatMessageV5 { + /** The docs specify integers, but response examples use strings. */ + id: string | number; + sendUserNickName: string; + contentType: 'str' | 'pic' | 'pdf' | 'video'; + /** JSON string containing content, msgCode, msgType, fileName and size. */ + message: string; + /** Creation timestamp in milliseconds. Examples use strings. */ + createDate: string | number; } ⋮---- -/** Filter by `symbolType` (e.g. `commodity`, `stock`, `forex` for linear). */ +/** The docs specify integers, but response examples use strings. */ ⋮---- -/** GET /v5/account/pay-info */ -export interface GetPayInfoParamsV5 { - coin?: string; -} +/** JSON string containing content, msgCode, msgType, fileName and size. */ ⋮---- -/** GET /v5/account/trade-info-for-analysis */ -export interface GetTradeInfoForAnalysisParamsV5 { - symbol: string; - startTime?: number; - endTime?: number; -} +/** Creation timestamp in milliseconds. Examples use strings. */ ⋮---- -export interface ManualRepayParamsV5 { - coin?: string; - amount?: string; - /** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. - */ - repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; +export interface P2PChatMessagesResponseV5 { + messages: P2PChatMessageV5[]; } ⋮---- -/** - * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. - * If neither `coin` nor `amount` is set, this must be ALL (repay all liabilities) or the request is rejected. - */ - -================ -File: src/types/request/v5-asset.ts -================ -import { AccountTypeV5, CategoryV5 } from '../shared-v5'; -⋮---- -export interface GetCoinExchangeRecordParamsV5 { - fromCoin?: string; - toCoin?: string; - limit?: number; - cursor?: string; +export interface P2PUserInfoV5 { + nickName: string; + defaultNickName: boolean; + isOnline: boolean; + kycLevel: string; + email: string; + mobile: string; + lastLogoutTime: string; + recentRate: string; + totalFinishCount: number; + totalFinishSellCount: number; + totalFinishBuyCount: number; + recentFinishCount: number; + averageReleaseTime: string; + averageTransferTime: string; + accountCreateDays: number; + firstTradeDays: number; + realName: string; + recentTradeAmount: string; + totalTradeAmount: string; + registerTime: string; + authStatus: number; + kycCountryCode: string; + blocked: string; + goodAppraiseRate: string; + goodAppraiseCount: number; + badAppraiseCount: number; + accountId: number; + paymentCount: number; + contactCount: number; + vipLevel: number; + userCancelCountLimit: number; + paymentRealNameUneditable: boolean; + userId: string; + realNameEn: string; } ⋮---- -export interface GetDeliveryRecordParamsV5 { - category: CategoryV5; - symbol?: string; - startTime?: number; - endTime?: number; - expDate?: string; - limit?: number; - cursor?: string; +export interface P2PCounterpartyUserInfoV5 { + nickName: string; + defaultNickName: boolean; + whiteFlag: number; + contactConfig: boolean; + isOnline: boolean; + email: string; + mobile: string; + kycLevel: number; + lastLogoutTime: string; + recentRate: number; + totalFinishCount: number; + totalFinishSellCount: number; + totalFinishBuyCount: number; + recentFinishCount: number; + averageReleaseTime: string; + averageTransferTime: string; + accountCreateDays: number; + firstTradeDays: number; + realName: string; + recentTradeAmount: string; + totalTradeAmount: string; + executeNum: number; + orderNum: number; + hasUnPostAd: number; + registerTime: string; + authStatus: number; + kycCountryCode: string; + blocked: string; + goodAppraiseRate: string; + goodAppraiseCount: number; + badAppraiseCount: number; + accountId: string; + paymentCount: number; + contactCount: number; + realNameMask: string; + vipLevel: number; + vipProfit: []; + userTag: []; + userCancelCountLimit: number; + paymentRealNameUneditable: boolean; + lostRoleAffected: boolean; + userCurPrivilege: string[]; + userType: string; + userId: string; + realNameEn: string; + canSubOnline: boolean; + curPrivilegeInfo: []; + openApiSwitch: number; } ⋮---- -export interface GetSettlementRecordParamsV5 { - category: CategoryV5; - symbol?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface P2PUserPaymentV5 { + id: string; + realName: string; + paymentType: string; + bankName: string; + branchName: string; + accountNo: string; + qrcode: string; + visible: number; + payMessage: string; + firstName: string; + lastName: string; + secondLastName: string; + clabe: string; + debitCardNumber: string; + mobile: string; + businessName: string; + concept: string; + online: string; + countNo: string; + paymentExt1: string; + paymentExt2: string; + paymentExt3: string; + paymentExt4: string; + paymentExt5: string; + paymentExt6: string; + paymentTemplateVersion: number; + hasPaymentTemplateChanged: boolean; + paymentConfigVo: P2PPaymentConfigV5; + realNameVerified: boolean; + channel: string; + currencyBalance: string[]; +} + +================ +File: src/types/response/v5-spot-x.ts +================ +export interface LaunchpoolPoolV5 { + poolId: string; + stakeCoin: string; + apr: string; + totalStakedAmount: string; + participantCount: string; } ⋮---- -export interface GetAssetInfoParamsV5 { - accountType: AccountTypeV5; - coin?: string; +export interface LaunchpoolProjectV5 { + projectId: string; + activityCoin: string; + rewardCoin: string; + status: number; + totalReward: string; + stakeStartTime: string; + stakeEndTime: string; + totalParticipantCount: string; + pools: LaunchpoolPoolV5[]; } ⋮---- -export interface GetAllCoinsBalanceParamsV5 { - memberId?: string; - accountType: AccountTypeV5; - coin?: string; - withBonus?: number; +export interface LaunchpoolProjectListResultV5 { + list: LaunchpoolProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface GetAccountCoinBalanceParamsV5 { - memberId?: string; - toMemberId?: string; - accountType: AccountTypeV5; - coin: string; - toAccountType?: AccountTypeV5; - withBonus?: number; - withTransferSafeAmount?: 0 | 1; - withLtvTransferSafeAmount?: 0 | 1; +export interface LaunchpoolActivityLogItemV5 { + stakeCoin: string; + rewardCoin: string; + amount: string; + type: number; + status: number; + createdTime: string; + orderId: string; } ⋮---- -export interface GetInternalTransferParamsV5 { - transferId?: string; - coin?: string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface LaunchpoolActivityLogResultV5 { + list: LaunchpoolActivityLogItemV5[]; + total: number; + pageSize: number; + current: number; } ⋮---- -export interface UniversalTransferParamsV5 { - transferId: string; - coin: string; - amount: string; - fromMemberId: number; - toMemberId: number; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; +export interface LaunchpoolStakingPositionV5 { + stakeCoin: string; + rewardCoin: string; + stakeAmount: string; + totalReward: string; + autoRedeemDate: string; } ⋮---- -export interface GetUniversalTransferRecordsParamsV5 { - transferId?: string; - coin?: string; - status?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; - fromMemberId?: string; - toMemberId?: string; +export interface LaunchpoolCurrentStakingResultV5 { + totalInvestmentUsd: string; + totalEarningsUsd: string; + todayEarningsUsd: string; + list: LaunchpoolStakingPositionV5[]; } ⋮---- -export interface GetAllowedDepositCoinInfoParamsV5 { - coin?: string; - chain?: string; - limit?: number; - cursor?: string; +export interface LaunchpoolUserHistoryItemV5 { + stakeCoin: string; + rewardCoin: string; + totalReward: string; + stakeStartTime: string; + stakeEndTime: string; } ⋮---- -export interface GetDepositRecordParamsV5 { - id?: string; - txID?: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface LaunchpoolUserHistoryResultV5 { + list: LaunchpoolUserHistoryItemV5[]; + total: number; + pageSize: number; + current: number; } ⋮---- -export interface GetSubAccountDepositRecordParamsV5 { - id?: string; - txID?: string; - subMemberId: string; - coin?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface PuzzleProjectV5 { + projectId: string; + activityCoin: string; + rewardCoin: string; + status: number; + startTime: string; + endTime: string; + totalReward: string; + participantCount: string; } ⋮---- -export interface GetInternalDepositRecordParamsV5 { - txID?: string; - startTime?: number; - endTime?: number; - coin?: string; - cursor?: string; - limit?: number; +export interface PuzzleProjectListResultV5 { + list: PuzzleProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface GetWithdrawalRecordsParamsV5 { - withdrawID?: string; - txID?: string; - coin?: string; - withdrawType?: number; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface TokenSplashProjectV5 { + status: number; + projectId: string; + activityCoin: string; + rewardCoin: string; + totalReward: string; + participantCount: string; + registrationStartTime: string; + activityEndTime: string; } ⋮---- -export interface GetWithdrawalAddressListParamsV5 { - coin?: string; - chain?: string; - addressType?: 0 | 1 | 2; - limit?: number; - cursor?: string; +export interface TokenSplashProjectListResultV5 { + list: TokenSplashProjectV5[]; + nextPageCursor: string; } ⋮---- -export interface SubmitDepositOriginatorInfoParamsV5 { - depositId: number; - subAccountId?: number; - /** Travel Rule questionnaire JSON string. See Questionnaire docs. */ - questionnaire: string; +export interface TokenSplashTradeTaskV5 { + tradeRequiredAmount: string; + tradeUnit: string; + /** Token counted by the trade task. On-chain tasks use the activity token ID. */ + tradeToken?: string; + tradedAmount: string; + maxRewardAmount: string; + estimatedRewardAmount: string; + rewardCoin: string; } ⋮---- -/** Travel Rule questionnaire JSON string. See Questionnaire docs. */ +/** Token counted by the trade task. On-chain tasks use the activity token ID. */ ⋮---- -export interface WithdrawParamsV5 { - coin: string; - /** - * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. - */ - chain?: string; - address: string; - tag?: string; - amount: string; - timestamp: number; - forceChain?: number; - /** - * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). - * SPOT is legacy if still supported for older integrations. - */ - accountType: string; - feeType?: 0 | 1; - requestId?: string; - /** - * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. - */ - transactionPurpose?: string; - /** - * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. - */ - questionnaire?: string; - beneficiary?: { - vaspEntityId?: string; - beneficiaryName?: string; - beneficiaryLegalType?: string; - beneficiaryWalletType?: string; - beneficiaryUnhostedWalletType?: string; - beneficiaryPoiNumber?: string; - beneficiaryPoiType?: string; - beneficiaryPoiIssuingCountry?: string; - beneficiaryPoiExpiredDate?: string; - }; +export interface TokenSplashUserActivityItemV5 { + projectId: string; + activityCoin: string; + tradeTask: TokenSplashTradeTaskV5; } ⋮---- -/** - * When forceChain is 0 or 1, required. When forceChain is 2 (Bybit UID withdraw), may be null/omitted. - */ +export interface TokenSplashUserActivityResultV5 { + list: TokenSplashUserActivityItemV5[]; +} + +================ +File: src/types/response/v5-trade.ts +================ +import { + CategoryV5, + OrderCancelTypeV5, + OrderCreateTypeV5, + OrderRejectReasonV5, + OrderSideV5, + OrderStatusV5, + OrderTimeInForceV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + StopOrderTypeV5, +} from '../shared-v5'; ⋮---- -/** - * FUND, UTA, or EARN; or comma combo e.g. FUND,UTA,EARN (funding first, then UTA and Earn for remainder). - * SPOT is legacy if still supported for older integrations. - */ +export interface OrderResultV5 { + orderId: string; + orderLinkId: string; +} ⋮---- -/** - * Required for Bybit Turkey (TR) site users when creating a withdrawal. Omitted for other regions unless the API requires it. - */ +export interface AccountOrderV5 { + orderId: string; + orderLinkId: string; + parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) + blockTradeId: string; + symbol: string; + price: string; + qty: string; + side: OrderSideV5; + isLeverage: '0' | '1'; + positionIdx: PositionIdx; + orderStatus: OrderStatusV5; + createType: OrderCreateTypeV5; + cancelType: OrderCancelTypeV5; + rejectReason: OrderRejectReasonV5; + avgPrice: string; + leavesQty: string; + leavesValue: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + timeInForce: OrderTimeInForceV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + orderIv: string; + marketUnit: 'baseCoin' | 'quoteCoin'; + slippageToleranceType: string; + slippageTolerance: string; + triggerPrice: string; + takeProfit: string; + stopLoss: string; + tpslMode: 'Full' | 'Partial' | ''; + ocoTriggerType: + | 'OcoTriggerByUnknown' + | 'OcoTriggerTp' + | 'OcoTriggerBySl' + | ''; + tpLimitPrice: string; + slLimitPrice: string; + tpTriggerBy: OrderTriggerByV5; + slTriggerBy: OrderTriggerByV5; + triggerDirection: 1 | 2; + triggerBy: OrderTriggerByV5; + lastPriceOnCreated: string; + basePrice: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + placeType: 'iv' | 'price' | ''; + smpType: string; + smpGroup: string; + smpOrderId: string; + createdTime: string; + updatedTime: string; + extraFees: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee + rpiTakerAccess?: boolean; + rpiMatchedQty?: string; + fromAccount?: string; + toAccount?: string; + externalEventType?: string; +} ⋮---- -/** - * Travel Rule questionnaire JSON string (max 16384 bytes). Takes precedence over `beneficiary` / `transactionPurpose` when both are set. - */ +parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) ⋮---- -export interface ConvertCoinsParamsV5 { - coin?: string; - side?: number; - accountType: - | 'eb_convert_funding' - | 'eb_convert_uta' - | 'eb_convert_spot' - | 'eb_convert_contract' - | 'eb_convert_inverse'; -} +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee ⋮---- -export interface RequestConvertQuoteParamsV5 { - fromCoin: string; - toCoin: string; - fromCoinType?: string; - toCoinType?: string; - requestCoin: string; - requestAmount: string; - accountType: - | 'eb_convert_funding' - | 'eb_convert_uta' - | 'eb_convert_spot' - | 'eb_convert_contract' - | 'eb_convert_inverse'; - requestId?: string; +export interface BatchCreateOrderResultV5 { + category: CategoryV5; + symbol: string; + orderId: string; + orderLinkId: string; + createAt?: string; } ⋮---- -export interface GetConvertHistoryParamsV5 { - accountType?: string; - index?: number; - limit?: number; +export interface BatchOrdersRetExtInfoV5 { + list: { + code: number; + msg: string; + }[]; } ⋮---- -export interface GetSmallBalanceListParamsV5 { - accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet - fromCoin?: string; // Source currency +export interface BatchAmendOrderResultV5 { + category: CategoryV5; + symbol: string; + orderId: string; + orderLinkId: string; } ⋮---- -accountType: 'eb_convert_uta'; // Wallet type, only supports Unified wallet -fromCoin?: string; // Source currency -⋮---- -export interface GetFiatTradingPairListParamsV5 { - side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) -} -⋮---- -side?: 0 | 1; // 0: buy (buy crypto, sell fiat), 1: sell (sell crypto, buy fiat) -⋮---- -/** Funding Account Transaction History. Interval createTimeFrom-createTimeTo max 7 days. */ -export interface GetFundingAccountTransactionHistoryParamsV5 { - createTimeFrom?: string; - createTimeTo?: string; - limit?: string; - cursor?: string; -} -⋮---- -/** Asset Overview. memberId required when querying sub account via master API key. */ -export interface GetAssetOverviewParamsV5 { - memberId?: string; - /** Fiat currency for valuation; defaults to USD if omitted. */ - valuationCurrency?: string; - /** Account type filter; returns all if omitted. */ - accountType?: string; +export interface BatchCancelOrderResultV5 { + category: CategoryV5; + symbol: string; + orderId: string; + orderLinkId: string; } ⋮---- -/** Fiat currency for valuation; defaults to USD if omitted. */ -⋮---- -/** Account type filter; returns all if omitted. */ -⋮---- -/** GET /v5/asset/portfolio-margin */ -export interface GetPortfolioMarginInfoParamsV5 { - baseCoin?: string; +export interface SpotBorrowCheckResultV5 { + symbol: string; + side: OrderSideV5; + maxTradeQty: string; + maxTradeAmount: string; + spotMaxTradeQty: string; + spotMaxTradeAmount: string; + borrowCoin: string; } ⋮---- -/** GET /v5/asset/total-members-assets */ -export interface GetTotalMembersAssetsParamsV5 { - /** If omitted, defaults to BTC. Total is quoted in this coin. */ - coin?: string; +export interface PreCheckOrderResultV5 { + orderId: string; + orderLinkId: string; + preImrE4: number; // Initial margin rate before checking (in basis points) + preMmrE4: number; // Maintenance margin rate before checking (in basis points) + postImrE4: number; // Initial margin rate after checking (in basis points) + postMmrE4: number; // Maintenance margin rate after checking (in basis points) } ⋮---- -/** If omitted, defaults to BTC. Total is quoted in this coin. */ +preImrE4: number; // Initial margin rate before checking (in basis points) +preMmrE4: number; // Maintenance margin rate before checking (in basis points) +postImrE4: number; // Initial margin rate after checking (in basis points) +postMmrE4: number; // Maintenance margin rate after checking (in basis points) ================ File: src/types/request/v5-crypto-loan.ts @@ -10442,1234 +10504,1530 @@ token: string; // Coin name quantity: string; // The qty to be repaid ================ -File: src/types/request/v5-user.ts +File: src/types/request/v5-earn.ts ================ -import { PermissionsV5 } from '../shared-v5'; -⋮---- -export interface CreateSubMemberParamsV5 { - username: string; - password?: string; - /** - * 1: normal, 6: custodial - */ - memberType: 1 | 6; - /** - * 0: quick login disabled (default), 1: quick login enabled - */ - switch?: 0 | 1; - isUta?: boolean; - note?: string; +export interface GetEarnCouponListParamsV5 { + category: 'FlexibleSaving' | 'DualAssets'; } ⋮---- -/** - * 1: normal, 6: custodial - */ -⋮---- -/** - * 0: quick login disabled (default), 1: quick login enabled - */ +/** GET /v5/earn/flexible-saving/auto-savings. coins is a repeated query param, max 50. */ +export interface GetFlexibleSavingAutoSavingsParamsV5 { + coins?: string[]; +} ⋮---- -export interface CreateSubApiKeyParamsV5 { - subuid: number; - note?: string; - readOnly: 0 | 1; - ips?: string; - permissions: PermissionsV5; +/** POST /v5/earn/flexible-saving/auto-savings. Omit coin to update the global setting. */ +export interface SetFlexibleSavingAutoSavingsParamsV5 { + coin?: string; + isSelected: boolean; + purchaseImmediately?: boolean; } ⋮---- -export interface UpdateApiKeyParamsV5 { - apikey?: string; - readOnly?: 0 | 1; - permissions: PermissionsV5; +export interface SubmitStakeRedeemParamsV5 { + category: string; + orderType: 'Stake' | 'Redeem'; + accountType: 'FUND' | 'UNIFIED'; + amount: string; + coin: string; + productId: string; + orderLinkId: string; + toAccountType?: 'FUND' | 'UNIFIED'; } ⋮---- -export interface UpdateSubApiKeyUpdateParamsV5 { - readOnly?: number; - ips?: string[]; - permissions: PermissionsV5; +export interface GetEarnOrderHistoryParamsV5 { + category: string; + orderId?: string; + orderLinkId?: string; + productId?: string; + startTime?: number; + endTime?: number; + limit?: number; + cursor?: string; } ⋮---- -export interface DeleteSubMemberParamsV5 { - subMemberId: string; +export interface GetEarnPositionParamsV5 { + category: string; + productId?: string; + coin?: string; } ⋮---- -export interface GetSubAccountAllApiKeysParamsV5 { - subMemberId: string; +export interface GetEarnYieldHistoryParamsV5 { + category: string; + productId?: string; + startTime?: number; + endTime?: number; limit?: number; cursor?: string; } ⋮---- -export interface GetAffiliateUserListParamsV5 { - size?: number; +export interface GetEarnHourlyYieldHistoryParamsV5 { + category: string; + productId?: string; + startTime?: number; + endTime?: number; + limit?: number; cursor?: string; - needDeposit?: boolean; - need30?: boolean; - need365?: boolean; - startDate?: string; - endDate?: string; } ⋮---- -/** GET /v5/affiliate/affiliate-sub-list */ -export interface GetAffiliateSubAffiliateListParamsV5 { - cursor?: string; - /** [0, 100]. Default: 0 */ - size?: number; - /** YYYY-MM-DD. Range with endDate max 3 months */ - startDate?: string; - /** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ - endDate?: string; - /** Exact sub-affiliate ID. 0 or omit for all */ - subAffId?: number; +export interface ModifyEarnPositionParamsV5 { + category: 'OnChain'; + productId: number; + positionId: number; + autoReinvest: 0 | 1; } ⋮---- -/** [0, 100]. Default: 0 */ -⋮---- -/** YYYY-MM-DD. Range with endDate max 3 months */ -⋮---- -/** YYYY-MM-DD. Must be provided with startDate or both omitted (T-1 default) */ -⋮---- -/** Exact sub-affiliate ID. 0 or omit for all */ +export interface GetEarnAprHistoryParamsV5 { + category: 'FlexibleSaving' | 'OnChain'; + productId: string; + startTime?: number; + endTime?: number; +} ⋮---- -export interface GetAffiliateUserInfoParamsV5 { - /** The master account UID of affiliate's client */ - uid: string; - /** Coin type for filtering, e.g. USDT */ +/** + * GET /v5/earn/advance/product — Advanced Earn: Dual Asset, Double Win, Smart Leverage, etc. + * Public, no auth. Rate limit: 50 req/s per IP. + */ +export interface GetAdvanceEarnProductParamsV5 { + category: 'DualAssets' | 'DoubleWin' | 'SmartLeverage' | 'DiscountBuy'; coin?: string; /** - * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). */ - business?: '1' | '2' | '3' | '4' | '5'; + duration?: string; } ⋮---- -/** The master account UID of affiliate's client */ -⋮---- -/** Coin type for filtering, e.g. USDT */ -⋮---- /** - * Business line filter. 1: Derivatives, 2: Spot, 3: ByFi, 4: USDC, 5: Options + * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). */ ⋮---- -/** Get Friend Referrals - invitation relationship status. 0: alive; 1: invalid */ -export interface GetFriendReferralsParamsV5 { - status?: string; - size?: string; +/** GET /v5/earn/hold-to-earn/yield-history — Hold to Earn airdrop daily PnL (Earn permission) */ +export interface GetHoldToEarnAirdropYieldHistoryParamsV5 { + /** Unix seconds. Cannot be earlier than now minus 3 months */ + timeStart?: number; + /** Unix seconds. Requires timeStart ≤ timeEnd */ + timeEnd?: number; + /** Page size [1, 49] */ + limit: number; + /** Pagination cursor from previous `nextCursor` */ cursor?: string; } ⋮---- -/** - * Referral product line. - * - * 0 unknown, 1 spot, 2 contracts, 3 options, 4 USDC perpetual, 6 TradeFi, 9 Alpha. - * Unrecognized response values are returned as 0. - */ -export type ReferralProductLineV5 = 0 | 1 | 2 | 3 | 4 | 6 | 9; +/** Unix seconds. Cannot be earlier than now minus 3 months */ ⋮---- -/** - * Invitee status (`friendStatus`). - * - * 0 unknown, 1 signed up, 2 first deposit, 3 first trade, 4 qualified, - * 5 not qualified, 6 historical invitation, 7 boost in progress, - * 8 boost qualified, 9 boost failed, 10 boost user signed up. - */ -export type ReferralFriendStatusV5 = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10; +/** Unix seconds. Requires timeStart ≤ timeEnd */ ⋮---- -/** - * POST /v5/referral/commission/records - * - * All fields are optional. Send `{}` when no filter is needed. An empty - * `userIdList` does not filter by invitee. `page` 0 is treated as 1. - * `pageSize` 0 or greater than 200 is treated as 10. - * Times are `YYYY-MM-DD HH:mm:ss`. Property names are the proto camelCase - * names; gateway serialization is not independently verified. - */ -export interface GetReferralCommissionRecordsParamsV5 { - /** Invitee IDs. An empty list does not filter by invitee. */ - userIdList?: number[]; - /** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ - startTime?: string; - /** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ - endTime?: string; - /** One-based page. `0` is treated as `1`. */ - page?: number; - /** Page size. `0` or a value greater than 200 is treated as 10. */ - pageSize?: number; - productLine?: ReferralProductLineV5; -} +/** Page size [1, 49] */ ⋮---- -/** Invitee IDs. An empty list does not filter by invitee. */ -⋮---- -/** Start time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ -⋮---- -/** End time, `YYYY-MM-DD HH:mm:ss`. An unparsable value is sent downstream as `""`. */ -⋮---- -/** One-based page. `0` is treated as `1`. */ -⋮---- -/** Page size. `0` or a value greater than 200 is treated as 10. */ -⋮---- -/** - * POST /v5/referral/user/invitations - * - * All fields are optional. An empty `userIdList` does not filter by invitee. - * Invalid or empty times are passed downstream as `0`. - */ -export interface GetReferralUserInvitationsParamsV5 { - /** Invitee IDs. An empty list does not filter by invitee. */ - userIdList?: number[]; - /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ - startTime?: string; - /** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ - endTime?: string; - /** Page number. `0` is treated as `1`. */ - page?: number; - /** Page size. `0` or a value greater than 200 is treated as 10. */ - pageSize?: number; - friendStatus?: ReferralFriendStatusV5; -} -⋮---- -/** Invitee IDs. An empty list does not filter by invitee. */ -⋮---- -/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ -⋮---- -/** `YYYY-MM-DD HH:mm:ss`. Invalid or empty values are passed downstream as `0`. */ -⋮---- -/** Page number. `0` is treated as `1`. */ -⋮---- -/** Page size. `0` or a value greater than 200 is treated as 10. */ -⋮---- -/** Sign Agreement. Only master account. - * - `category` (legacy): 2 = metals (XAU/XAG perps; stock perps share this); 3 = crude oil. New enum values are not added here; prefer `categoryV2`. - * - `categoryV2` (recommended): 1 = metals; 2 = crude oil. Additional values may be added by the API; use a numeric literal or variable. - * - Either `category` or `categoryV2` must be sent. */ -export interface SignAgreementParamsV5 { - agree: boolean; - category?: 2 | 3; - categoryV2?: number; -} +/** Pagination cursor from previous `nextCursor` */ ================ -File: src/types/response/v5-crypto-loan.ts +File: src/types/request/v5-spot-leverage-token.ts ================ -export interface CollateralCoinV5 { - collateralAccuracy: number; - initialLTV: string; - liquidationLTV: string; - marginCallLTV: string; - maxLimit: string; -} -⋮---- -export interface VipCollateralCoinsV5 { - list: CollateralCoinV5[]; - vipLevel: string; -} +import { LTOrderTypeV5 } from '../shared-v5'; ⋮---- -export interface BorrowableCoinV5 { - borrowingAccuracy: number; - currency: string; - flexibleHourlyInterestRate: string; - hourlyInterestRate7D: string; - hourlyInterestRate14D: string; - hourlyInterestRate30D: string; - hourlyInterestRate90D: string; - hourlyInterestRate180D: string; - maxBorrowingAmount: string; - minBorrowingAmount: string; +export interface PurchaseSpotLeveragedTokenParamsV5 { + ltCoin: string; + amount: string; + serialNo?: string; } ⋮---- -export interface VipBorrowableCoinsV5 { - list: BorrowableCoinV5[]; - vipLevel: string; +export interface RedeemSpotLeveragedTokenParamsV5 { + ltCoin: string; + quantity: string; + serialNo?: string; } ⋮---- -export interface AccountBorrowCollateralLimitV5 { - collateralCurrency: string; - loanCurrency: string; - maxCollateralAmount: string; - maxLoanAmount: string; - minCollateralAmount: string; - minLoanAmount: string; +export interface GetSpotLeveragedTokenOrderHistoryParamsV5 { + ltCoin?: string; + orderId?: string; + startTime?: number; + endTime?: number; + limit?: number; + ltOrderType?: LTOrderTypeV5; + serialNo?: string; } ⋮---- -export interface UnpaidLoanOrderV5 { - collateralAmount: string; - collateralCurrency: string; - currentLTV: string; - expirationTime: string; - hourlyInterestRate: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - residualInterest: string; - residualPenaltyInterest: string; - totalDebt: string; +export interface GetVIPMarginDataParamsV5 { + vipLevel?: string; + currency?: string; } ⋮---- -export interface RepaymentHistoryV5 { - collateralCurrency: string; - collateralReturn: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: string; - repayType: string; +export interface GetSpotMarginCurrencyDataParamsV5 { + currency?: string; } ⋮---- -export interface CompletedLoanOrderV5 { - borrowTime: string; - collateralCurrency: string; - expirationTime: string; - hourlyInterestRate: string; - initialCollateralAmount: string; - initialLoanAmount: string; - loanCurrency: string; - loanTerm: string; - orderId: string; - repaidInterest: string; - repaidPenaltyInterest: string; - status: number; -} -export interface LoanLTVAdjustmentHistoryV5 { - collateralCurrency: string; - orderId: string; - adjustId: string; - adjustTime: string; - preLTV: string; - afterLTV: string; - direction: number; +// Spot Margin Trade (UTA) endpoints +export interface ManualBorrowParamsV5 { + coin: string; amount: string; } ⋮---- -// New Crypto Loan Types -⋮---- -export interface BorrowCoinV5 { +export interface GetMaxBorrowableAmountParamsV5 { currency: string; - fixedBorrowable: boolean; - fixedBorrowingAccuracy: number; - flexibleBorrowable: boolean; - flexibleBorrowingAccuracy: number; - maxBorrowingAmount: string; - minFixedBorrowingAmount: string; - minFlexibleBorrowingAmount: string; - vipLevel: string; - flexibleAnnualizedInterestRate: string; - annualizedInterestRate7D: string; - annualizedInterestRate14D: string; - annualizedInterestRate30D: string; - annualizedInterestRate60D: string; - annualizedInterestRate90D: string; - annualizedInterestRate180D: string; } ⋮---- -export interface CollateralRatioV5 { - collateralRatio: string; - maxValue: string; - minValue: string; +export interface GetPositionTiersParamsV5 { + currency?: string; } ⋮---- -export interface CollateralRatioConfigV5 { - collateralRatioList: CollateralRatioV5[]; - currencies: string; +export interface GetCoinStateParamsV5 { + currency?: string; } ⋮---- -export interface CurrencyLiquidationV5 { +export interface GetAvailableAmountToRepayParamsV5 { currency: string; - liquidationOrder: number; } ⋮---- -export interface CollateralDataV5 { - collateralRatioConfigList: CollateralRatioConfigV5[]; - currencyLiquidationList: CurrencyLiquidationV5[]; +export interface SetSpotMarginLeverageParamsV5 { + leverage: string; + currency?: string; } ⋮---- -// Additional New Crypto Loan Types -⋮---- -export interface AdjustCollateralAmountV5 { - adjustId: number; +export interface ManualRepayWithoutConversionParamsV5 { + coin: string; + amount?: string; + /** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ + repaymentType?: 'ALL' | 'FIXED' | 'FLEXIBLE'; } ⋮---- -export interface CollateralAdjustmentHistoryV5 { - adjustId: number; - adjustTime: number; - afterLTV: string; - amount: string; - collateralCurrency: string; - direction: number; - preLTV: string; - status: number; -} +/** + * ALL: fixed + floating (floating first); FIXED: fixed only; FLEXIBLE: floating only. Default: FLEXIBLE. + */ ⋮---- -export interface BorrowListV5 { - fixedTotalDebt: string; - fixedTotalDebtUSD: string; - flexibleHourlyInterestRate: string; - flexibleTotalDebt: string; - flexibleTotalDebtUSD: string; - loanCurrency: string; +export interface GetAutoRepayModeParamsV5 { + currency?: string; // Coin name, uppercase only. If not passed, returns all currencies } ⋮---- -export interface CollateralListV5 { - amount: string; - amountUSD: string; - currency: string; - ltv: string; -} +currency?: string; // Coin name, uppercase only. If not passed, returns all currencies ⋮---- -export interface SupplyListV5 { - amount: string; - amountUSD: string; - currency: string; +export interface SetAutoRepayModeParamsV5 { + /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ + currency?: string; + autoRepayMode: '0' | '1'; // 0: Off, 1: On } ⋮---- -export interface CryptoLoanPositionV5 { - borrowList: BorrowListV5[]; - collateralList: CollateralListV5[]; - supplyList: SupplyListV5[]; - totalCollateral: string; - totalDebt: string; - totalSupply: string; - colRes?: string; -} +/** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ ⋮---- -// Flexible Loan Types +autoRepayMode: '0' | '1'; // 0: Off, 1: On ⋮---- -export interface BorrowFlexibleV5 { - orderId: string; +export interface SetTradeAutoRepayParamsV5 { + /** 1: enable trade auto repayment; 0: disable */ + autoRepay: '0' | '1'; } ⋮---- -export interface RepayFlexibleV5 { - repayId: string; -} +/** 1: enable trade auto repayment; 0: disable */ ⋮---- -export interface OngoingFlexibleLoanV5 { - hourlyInterestRate: string; - loanCurrency: string; - totalDebt: string; - unpaidAmount: string; - unpaidInterest: string; +export interface GetSpotMarginLiabilityInfoParamsV5 { + currency: string; } ⋮---- -export interface BorrowHistoryFlexibleV5 { - borrowTime: number; - initialLoanAmount: string; - loanCurrency: string; - orderId: string; - status: number; +export interface FixedRateBorrowParamsV5 { + orderCurrency: string; + orderAmount: string; + /** e.g. 0.02 = 2% p.a. */ + annualRate: string; + /** 7, 14, 30, 90, 180 (days) */ + term: string; + /** 1: auto repayment; 2: transfer to flexible loan */ + repayType?: '1' | '2'; } ⋮---- -export interface RepaymentHistoryFlexibleV5 { - loanCurrency: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: number; - repayType: number; -} +/** e.g. 0.02 = 2% p.a. */ ⋮---- -// Fixed Loan Types +/** 7, 14, 30, 90, 180 (days) */ ⋮---- -export interface SupplyOrderQuoteFixedV5 { - orderCurrency: string; - term: number; - annualRate: string; - qty: string; -} +/** 1: auto repayment; 2: transfer to flexible loan */ ⋮---- -export interface BorrowOrderQuoteFixedV5 { - orderCurrency: string; - term: number; - annualRate: string; - qty: string; +export interface GetFixedRateBorrowOrderInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + state?: string; + term?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface CreateBorrowOrderFixedV5 { - orderId: string; +export interface GetFixedRateBorrowContractInfoParamsV5 { + orderId?: string; + orderCurrency?: string; + term?: string; + limit?: string; + cursor?: string; } ⋮---- -export interface CreateSupplyOrderFixedV5 { - orderId: string; +export interface GetFixedRateBorrowOrderQuoteParamsV5 { + orderCurrency: string; + term?: string; + orderBy?: 'apy' | 'term' | 'quantity'; + sort?: 0 | 1; + limit?: number; } ⋮---- -export interface BorrowContractInfoFixedV5 { - annualRate: string; - autoRepay: string; // Deprecated - borrowCurrency: string; - borrowTime: string; - interestPaid: string; +export interface RenewFixedRateBorrowParamsV5 { loanId: string; - orderId: string; - repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment - repaymentTime: string; - residualPenaltyInterest: string; - residualPrincipal: string; - status: number; - term: string; + qty?: string; } ⋮---- -autoRepay: string; // Deprecated -⋮---- -repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} ⋮---- -export interface SupplyContractInfoFixedV5 { - annualRate: string; - supplyCurrency: string; - supplyTime: string; - supplyAmount: string; - interestPaid: string; - supplyId: string; +export interface CancelFixedRateBorrowOrderParamsV5 { orderId: string; - redemptionTime: string; - penaltyInterest: string; - actualRedemptionTime: string; - status: number; - term: string; } ⋮---- -export interface BorrowOrderInfoFixedV5 { - annualRate: string; - orderId: number; - orderTime: string; - filledQty: string; - orderQty: string; - orderCurrency: string; - state: number; - term: number; - repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment - strategyType?: 'PARTIAL' | 'FULL' | string; +export interface GetFlexibleAvailableInventoryParamsV5 { + currency: string; } ⋮---- -repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment -⋮---- -export interface FixedLoanAvailableInventoryV5 { +export interface GetFixedRateAvailableInventoryParamsV5 { currency: string; term: string; annualRate: string; - availableInventory: string; - updateTime: string; } + +================ +File: src/types/response/v5-account.ts +================ +import { + AccountMarginModeV5, + AccountTypeV5, + CategoryV5, + TransactionTypeV5, + UnifiedUpdateStatusV5, +} from '../shared-v5'; ⋮---- -export interface FlexibleLoanAvailableInventoryV5 { - currency: string; - availableInventory: string; - updateTime: string; +export interface WalletBalanceV5Coin { + coin: string; + equity: string; + usdValue: string; + walletBalance: string; + free: string; // spot only + locked: string; // spot only + borrowAmount: string; + availableToBorrow: string; // deprecated field + availableToWithdraw: string; + accruedInterest: string; + totalOrderIM: string; + totalPositionIM: string; + totalPositionMM: string; + unrealisedPnl: string; + cumRealisedPnl: string; + bonus: string; + marginCollateral: boolean; + collateralSwitch: boolean; + spotBorrow: string; + colRes?: string; } ⋮---- -export interface SupplyOrderInfoFixedV5 { - annualRate: string; - orderId: number; - orderTime: string; - filledQty: string; - orderQty: string; - orderCurrency: string; - state: number; - term: number; -} +free: string; // spot only +locked: string; // spot only ⋮---- -export interface RepayFixedV5 { - repayId: string; +availableToBorrow: string; // deprecated field +⋮---- +export interface WalletBalanceV5 { + accountType: AccountTypeV5; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; + totalEquity: string; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WalletBalanceV5Coin[]; } ⋮---- -export interface RepaymentHistoryFixedV5 { - details: { - loanCurrency: string; - loanId: string; - repayAmount: string; - }[]; - loanCurrency: string; - repayAmount: string; - repayId: string; - repayStatus: number; - repayTime: number; - repayType: number; +export interface UnifiedAccountUpgradeResultV5 { + unifiedUpdateStatus: UnifiedUpdateStatusV5; + unifiedUpdateMsg: { + msg: string[] | null; + }; } ⋮---- -export interface RenewBorrowOrderFixedV5 { - orderId: string; +export interface BorrowHistoryRecordV5 { + currency: string; + createdTime: number; + borrowCost: string; + hourlyBorrowRate: string; + InterestBearingBorrowSize: string; + costExemption: string; + borrowAmount: string; + unrealisedLoss: string; + freeBorrowedAmount: string; } ⋮---- -export interface RenewOrderInfoFixedV5 { - amount: string; - autoRepay: number; - borrowCurrency: string; - contractNo: string; - dueTime: string; - loanId: string; - orderId: number; - renewLoanNo: string; - time: string; +export interface CollateralInfoV5 { + currency: string; + hourlyBorrowRate: string; + maxBorrowingAmount: string; + freeBorrowAmount: string; + freeBorrowingLimit: string; + borrowAmount: string; + availableToBorrow: string; + borrowable: boolean; + borrowUsageRate: string; + marginCollateral: boolean; + collateralSwitch: boolean; + collateralRatio: string; } ⋮---- -// Institutional Loan Types +export interface CoinGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; +} ⋮---- -export interface InstitutionalLendingProductInfoV5 { - productId: string; - leverage: string; - supportSpot: number; - supportContract: number; - supportMarginTrading: number; - withdrawLine: string; - transferLine: string; - spotBuyLine: string; - spotSellLine: string; - contractOpenLine: string; - liquidationLine: string; - stopLiquidationLine: string; - contractLeverage: string; - transferRatio: string; - spotSymbols: unknown[]; - contractSymbols: unknown[]; - supportUSDCContract: number; - supportUSDCOptions: number; - USDTPerpetualOpenLine?: string; - USDCContractOpenLine?: string; - USDCOptionsOpenLine?: string; - USDTPerpetualCloseLine?: string; - USDCContractCloseLine?: string; - USDCOptionsCloseLine?: string; - USDTPerpetualLeverage?: { symbol: string; leverage: string }[]; - USDCContractLeverage?: { symbol: string; leverage: string }[]; - deferredLiquidationLine?: string; - deferredLiquidationTime?: string; - marginLeverage?: string; - /** `0`: Default, `1`: CTA, `2`: Hedge */ - productType?: '0' | '1' | '2' | string; +export interface FeeRateV5 { + symbol: string; + baseCoin: string; + takerFeeRate: string; + makerFeeRate: string; + rpiMakerFeeRate?: string; } ⋮---- -/** `0`: Default, `1`: CTA, `2`: Hedge */ -⋮---- -export interface InstitutionalLendingCoinDeltaItemV5 { - coin: string; - coinDeltaSize: string; - coinDeltaAvailableAmount: string; - coinDeltaAmount: string; +export interface AccountInfoV5 { + unifiedMarginStatus: number; + marginMode: AccountMarginModeV5; + isMasterTrader: boolean; + spotHedgingStatus: string; + updatedTime: string; } ⋮---- -export interface InstitutionalLendingCoinDeltaAmountV5 { - riskUnitDeltaAmount: string; - riskUnitDeltaAvailableAmount: string; - riskUnitDelta?: string; - list: InstitutionalLendingCoinDeltaItemV5[]; +/** + * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` + */ +export interface UserSettingConfigV5 { + lpaSpot: boolean; + lpaPerp: boolean; + /** Spot MNT fee deduction enabled. */ + smsef?: boolean; + /** Futures MNT fee deduction enabled. */ + fmsef?: boolean; + /** Delta Neutral mode; may be absent on older API responses. */ + deltaEnable?: boolean; + smpType?: '0' | '1' | '2' | '3' | string; } ⋮---- -export interface InstitutionalLendingDelayLiquidationStatusV5 { - ltv: string; - /** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ - liquidationStatus: 0 | 1 | 2 | 3; - delayLiqStartTime: string; - delayLiqRemainingSec: string; -} +/** Spot MNT fee deduction enabled. */ ⋮---- -/** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ +/** Futures MNT fee deduction enabled. */ ⋮---- -export interface UnpaidInfoV5 { - token: string; // Coin - unpaidQty: string; // Unpaid principle - unpaidInterest: string; // Unpaid interest -} +/** Delta Neutral mode; may be absent on older API responses. */ ⋮---- -token: string; // Coin -unpaidQty: string; // Unpaid principle -unpaidInterest: string; // Unpaid interest +export interface TransactionLogV5 { + symbol: string; + category: CategoryV5; + side: string; + transactionTime: string; + type: TransactionTypeV5; + qty: string; + size: string; + currency: string; + tradePrice: string; + funding: string; + fee: string; + cashFlow: string; + change: string; + cashBalance: string; + feeRate: string; + bonusChange: string; + tradeId: string; + orderId: string; + orderLinkId: string; + extraFees: string; + transSubType: string; + displayType?: string; +} ⋮---- -export interface BalanceInfoV5 { - token: string; // Margin coin - price: string; // Margin coin price - qty: string; // Margin coin quantity - convertedAmount: string; // Margin conversion amount +export interface MMPStateV5 { + baseCoin: string; + mmpEnabled: boolean; + window: string; + frozenPeriod: string; + qtyLimit: string; + deltaLimit: string; + vegaLimit?: string; + mmpFrozenUntil: string; + mmpFrozen: boolean; } ⋮---- -token: string; // Margin coin -price: string; // Margin coin price -qty: string; // Margin coin quantity -convertedAmount: string; // Margin conversion amount +export interface RepayLiabilityResultV5 { + coin: string; + repaymentQty: string; +} ⋮---- -export interface LTVInfoV5 { - ltv: string; // Risk rate (when liqStatus != 0, returns empty string) - rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) - parentUid: string; // The designated Risk Unit ID - subAccountUids: string[]; // Bound user IDs - unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) - unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) - balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) - balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) - liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +export interface DCPInfoV5 { + product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; + dcpStatus: 'ON'; + timeWindow: string; } ⋮---- -ltv: string; // Risk rate (when liqStatus != 0, returns empty string) -rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) -parentUid: string; // The designated Risk Unit ID -subAccountUids: string[]; // Bound user IDs -unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) -unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) -balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) -balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) -liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +export interface ManualRepayResultV5 { + resultStatus: 'P' | 'SU' | 'FA'; +} ⋮---- -export interface InstitutionalLoanLTVV5 { - ltvInfo: LTVInfoV5[]; // LTV info array - liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ +export interface OptionAssetInfoRowV5 { + coin: string; + totalDelta: string; + totalRPL: string; + totalUPL: string; + assetIM: string; + assetMM: string; + sendTime: number; } ⋮---- -ltvInfo: LTVInfoV5[]; // LTV info array -liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +export interface OptionAssetInfoNestedResultV5 { + result: OptionAssetInfoRowV5[]; +} ⋮---- -export interface RepayInstitutionalLoanResultV5 { - repayOrderStatus: string; // P: processing +/** GET /v5/account/pay-info */ +export interface PayInfoCollateralItemV5 { + coin: string; + availableSize: string; + availableValue: string; + coinScale: number; + borrowSize: string; + spotHedgeAmount: string; + assetFrozen: string; } ⋮---- -repayOrderStatus: string; // P: processing +export interface PayInfoBorrowBlockV5 { + coin?: string; + borrowSize: string; + borrowValue?: string; + assetFrozen: string; + availableBalance: string; +} ⋮---- -// Max Loan Amount Response Types +export interface PayInfoResultV5 { + collateralInfo: { + collateralList: PayInfoCollateralItemV5[]; + }; + borrowInfo: PayInfoBorrowBlockV5; +} ⋮---- -export interface MaxLoanAmountV5 { - currency: string; // Coin to borrow - maxLoan: string; // Maximum borrowable amount based on current collateral - notionalUsd: string; // Notional USD value - remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) +/** GET /v5/account/trade-info-for-analysis */ +export interface TradeInfoAnalysisDailyV5 { + day: string; + sumBuyExecValue: string; + sumSellExecValue: string; + sumExecValue: string; } ⋮---- -currency: string; // Coin to borrow -maxLoan: string; // Maximum borrowable amount based on current collateral -notionalUsd: string; // Notional USD value -remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) +export interface TradeInfoForAnalysisResultV5 { + symbolRnl: string; + netExecQty: string; + sumExecValue: string; + sumExecQty: string; + avgBuyExecPrice: string; + sumBuyExecValue: string; + sumBuyExecQty: string; + sumBuyExecFee: string; + sumBuyOrderQty: string; + avgSellExecPrice: string; + sumSellExecValue: string; + sumSellExecQty: string; + sumSellExecFee: string; + sumSellOrderQty: string; + maxMarginVersion: number; + baseCoin: string; + settleCoin: string; + sumPriceList?: TradeInfoAnalysisDailyV5[]; +} ================ -File: src/types/response/v5-spot-leverage-token.ts +File: src/types/response/v5-crypto-loan.ts ================ -import { - LeverageTokenStatusV5, - LTOrderStatusV5, - LTOrderTypeV5, -} from '../shared-v5'; +export interface CollateralCoinV5 { + collateralAccuracy: number; + initialLTV: string; + liquidationLTV: string; + marginCallLTV: string; + maxLimit: string; +} ⋮---- -export interface LeverageTokenInfoV5 { - ltCoin: string; - ltName: string; - maxPurchase: string; - minPurchase: string; - maxPurchaseDaily: string; - maxRedeem: string; - minRedeem: string; - maxRedeemDaily: string; - purchaseFeeRate: string; - redeemFeeRate: string; - ltStatus: LeverageTokenStatusV5; - fundFee: string; - fundFeeTime: string; - manageFeeRate: string; - manageFeeTime: string; - value: string; - netValue: string; - total: string; +export interface VipCollateralCoinsV5 { + list: CollateralCoinV5[]; + vipLevel: string; } ⋮---- -export interface LeveragedTokenMarketResultV5 { - ltCoin: string; - nav: string; - navTime: string; - circulation: string; - basket: string; - leverage: string; +export interface BorrowableCoinV5 { + borrowingAccuracy: number; + currency: string; + flexibleHourlyInterestRate: string; + hourlyInterestRate7D: string; + hourlyInterestRate14D: string; + hourlyInterestRate30D: string; + hourlyInterestRate90D: string; + hourlyInterestRate180D: string; + maxBorrowingAmount: string; + minBorrowingAmount: string; } ⋮---- -export interface PurchaseSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - execQty: string; - execAmt: string; - amount: string; - purchaseId: string; - serialNo: string; - valueCoin: string; -} -export interface RedeemSpotLeveragedTokenResultV5 { - ltCoin: string; - ltOrderStatus: LTOrderStatusV5; - quantity: string; - execQty: string; - execAmt: string; - redeemId: string; - serialNo: string; - valueCoin: string; +export interface VipBorrowableCoinsV5 { + list: BorrowableCoinV5[]; + vipLevel: string; } ⋮---- -export interface SpotLeveragedTokenOrderHistoryV5 { - ltCoin: string; - orderId: string; - ltOrderType: LTOrderTypeV5; - orderTime: number; - updateTime: number; - ltOrderStatus: LTOrderStatusV5; - fee: string; - amount: string; - value: string; - valueCoin: string; - serialNo: string; +export interface AccountBorrowCollateralLimitV5 { + collateralCurrency: string; + loanCurrency: string; + maxCollateralAmount: string; + maxLoanAmount: string; + minCollateralAmount: string; + minLoanAmount: string; } ⋮---- -export interface VIPMarginDataV5 { - vipCoinList: { - list: { - borrowable: boolean; - collateralRatio: string; - currency: string; - hourlyBorrowRate: string; - liquidationOrder: string; - marginCollateral: boolean; - maxBorrowingAmount: string; - }[]; - vipLevel: string; - }[]; +export interface UnpaidLoanOrderV5 { + collateralAmount: string; + collateralCurrency: string; + currentLTV: string; + expirationTime: string; + hourlyInterestRate: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + residualInterest: string; + residualPenaltyInterest: string; + totalDebt: string; } ⋮---- -export interface SpotMarginCurrencyDataV5 { - currency: string; - flexibleManualBorrowable: boolean; - minFlexibleManualBorrowQty: string; - flexibleManualBorrowAccuracy: string; - fixedManualBorrowable: boolean; - minFixedManualBorrowQty: string; - fixedManualBorrowAccuracy: string; - fixedInterestRateAccuracy: string; - minFixedInterestRate: string; - maxFixedInterestRate: string; +export interface RepaymentHistoryV5 { + collateralCurrency: string; + collateralReturn: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: string; + repayType: string; } ⋮---- -export interface SpotMarginStateV5 { - spotLeverage: string; - spotMarginMode: '1' | '0'; - effectiveLeverage: string; +export interface CompletedLoanOrderV5 { + borrowTime: string; + collateralCurrency: string; + expirationTime: string; + hourlyInterestRate: string; + initialCollateralAmount: string; + initialLoanAmount: string; + loanCurrency: string; + loanTerm: string; + orderId: string; + repaidInterest: string; + repaidPenaltyInterest: string; + status: number; } -⋮---- -// Spot Margin Trade (UTA) response types -export interface ManualBorrowResultV5 { - coin: string; +export interface LoanLTVAdjustmentHistoryV5 { + collateralCurrency: string; + orderId: string; + adjustId: string; + adjustTime: string; + preLTV: string; + afterLTV: string; + direction: number; amount: string; } ⋮---- -export interface MaxBorrowableAmountV5 { - currency: string; - /** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. - */ - maxLoan: string; -} -⋮---- -/** - * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or - * when no collateral coins are enabled. The app can still show a borrow - * amount after a collateral coin is selected. Undocumented; Bybit API staff - * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, - * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and - * `toggleSpotMarginTrade()` first. - */ +// New Crypto Loan Types ⋮---- -export interface PositionTierV5 { - tier: string; - borrowLimit: string; - positionMMR: string; - positionIMR: string; - maxLeverage: string; +export interface BorrowCoinV5 { + currency: string; + fixedBorrowable: boolean; + fixedBorrowingAccuracy: number; + flexibleBorrowable: boolean; + flexibleBorrowingAccuracy: number; + maxBorrowingAmount: string; + minFixedBorrowingAmount: string; + minFlexibleBorrowingAmount: string; + vipLevel: string; + flexibleAnnualizedInterestRate: string; + annualizedInterestRate7D: string; + annualizedInterestRate14D: string; + annualizedInterestRate30D: string; + annualizedInterestRate60D: string; + annualizedInterestRate90D: string; + annualizedInterestRate180D: string; } ⋮---- -export interface CurrencyPositionTiersV5 { - currency: string; - positionTiersRatioList: PositionTierV5[]; +export interface CollateralRatioV5 { + collateralRatio: string; + maxValue: string; + minValue: string; } ⋮---- -export interface CoinStateV5 { - currency: string; - spotLeverage: string; +export interface CollateralRatioConfigV5 { + collateralRatioList: CollateralRatioV5[]; + currencies: string; } ⋮---- -export interface AvailableAmountToRepayV5 { +export interface CurrencyLiquidationV5 { currency: string; - lossLessRepaymentAmount: string; + liquidationOrder: number; } ⋮---- -export interface ManualRepayWithoutConversionResultV5 { - /** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed - */ - resultStatus: 'P' | 'SU' | 'FA'; +export interface CollateralDataV5 { + collateralRatioConfigList: CollateralRatioConfigV5[]; + currencyLiquidationList: CurrencyLiquidationV5[]; } ⋮---- -/** - * Result status: - * - P: Processing - * - SU: Success - * - FA: Failed - */ +// Additional New Crypto Loan Types ⋮---- -export interface AutoRepayModeItemV5 { - currency: string; // Coin name, uppercase only - autoRepayMode: '0' | '1'; // 0: Off, 1: On +export interface AdjustCollateralAmountV5 { + adjustId: number; } ⋮---- -currency: string; // Coin name, uppercase only -autoRepayMode: '0' | '1'; // 0: Off, 1: On +export interface CollateralAdjustmentHistoryV5 { + adjustId: number; + adjustTime: number; + afterLTV: string; + amount: string; + collateralCurrency: string; + direction: number; + preLTV: string; + status: number; +} ⋮---- -export interface AutoRepayModeResultV5 { - data: AutoRepayModeItemV5[]; +export interface BorrowListV5 { + fixedTotalDebt: string; + fixedTotalDebtUSD: string; + flexibleHourlyInterestRate: string; + flexibleTotalDebt: string; + flexibleTotalDebtUSD: string; + loanCurrency: string; } ⋮---- -export interface SpotMarginLiabilityInfoV5 { +export interface CollateralListV5 { + amount: string; + amountUSD: string; currency: string; - totalBorrowAmount: string; - fixedBorrowAmount: string; - flexibleBorrowAmount: string; - spotTotalBorrow: string; - derivativesBorrow: string; + ltv: string; } ⋮---- -export interface FixedRateBorrowResultV5 { +export interface SupplyListV5 { + amount: string; + amountUSD: string; + currency: string; +} +⋮---- +export interface CryptoLoanPositionV5 { + borrowList: BorrowListV5[]; + collateralList: CollateralListV5[]; + supplyList: SupplyListV5[]; + totalCollateral: string; + totalDebt: string; + totalSupply: string; + colRes?: string; +} +⋮---- +// Flexible Loan Types +⋮---- +export interface BorrowFlexibleV5 { orderId: string; } ⋮---- -export interface FixedRateBorrowOrderInfoV5 { - annualRate: string; +export interface RepayFlexibleV5 { + repayId: string; +} +⋮---- +export interface OngoingFlexibleLoanV5 { + hourlyInterestRate: string; + loanCurrency: string; + totalDebt: string; + unpaidAmount: string; + unpaidInterest: string; +} +⋮---- +export interface BorrowHistoryFlexibleV5 { + borrowTime: number; + initialLoanAmount: string; + loanCurrency: string; orderId: string; - orderTime: string; - filledQty: string; - orderQty: string; + status: number; +} +⋮---- +export interface RepaymentHistoryFlexibleV5 { + loanCurrency: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: number; + repayType: number; +} +⋮---- +// Fixed Loan Types +⋮---- +export interface SupplyOrderQuoteFixedV5 { orderCurrency: string; - state: number; term: number; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; + annualRate: string; + qty: string; } ⋮---- -export interface FixedRateBorrowContractInfoV5 { +export interface BorrowOrderQuoteFixedV5 { + orderCurrency: string; + term: number; + annualRate: string; + qty: string; +} +⋮---- +export interface CreateBorrowOrderFixedV5 { + orderId: string; +} +⋮---- +export interface CreateSupplyOrderFixedV5 { + orderId: string; +} +⋮---- +export interface BorrowContractInfoFixedV5 { annualRate: string; + autoRepay: string; // Deprecated borrowCurrency: string; borrowTime: string; interestPaid: string; loanId: string; orderId: string; + repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment repaymentTime: string; residualPenaltyInterest: string; residualPrincipal: string; status: number; term: string; - repayType: string; - strategyType: 'PARTIAL' | 'FULL'; } ⋮---- -export interface FixedRateBorrowQuoteV5 { +autoRepay: string; // Deprecated +⋮---- +repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment +⋮---- +export interface SupplyContractInfoFixedV5 { + annualRate: string; + supplyCurrency: string; + supplyTime: string; + supplyAmount: string; + interestPaid: string; + supplyId: string; + orderId: string; + redemptionTime: string; + penaltyInterest: string; + actualRedemptionTime: string; + status: number; + term: string; +} +⋮---- +export interface BorrowOrderInfoFixedV5 { + annualRate: string; + orderId: number; + orderTime: string; + filledQty: string; + orderQty: string; orderCurrency: string; + state: number; term: number; - annualRate: string; - qty: string; + repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment + strategyType?: 'PARTIAL' | 'FULL' | string; } ⋮---- -export interface FlexibleAvailableInventoryV5 { +repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment +⋮---- +export interface FixedLoanAvailableInventoryV5 { currency: string; + term: string; + annualRate: string; availableInventory: string; updateTime: string; } ⋮---- -export interface FixedRateAvailableInventoryV5 { +export interface FlexibleLoanAvailableInventoryV5 { currency: string; - term: string; - annualRate: string; availableInventory: string; updateTime: string; } - -================ -File: src/websocket-client.ts -================ -/* eslint-disable @typescript-eslint/no-unused-vars */ -⋮---- -import { - MessageEventLike, - WSCategoryV5, - WSClientConfigurableOptions, - WsKey, - WsMarket, - WsTopic, -} from './types'; -import { - Exact, - WSAPIOperation, - WsAPIOperationResponseMap, - WSAPIRequest, - WsAPITopicRequestParamMap, - WsAPIWsKeyTopicMap, - WsOperation, - WsRequestOperationBybit, -} from './types/websockets/ws-api'; -import { - APIID, - DefaultLogger, - getMaxTopicsPerSubscribeEvent, - getNormalisedTopicRequests, - getPromiseRefForWSAPIRequest, - getTopicsPerWSKey, - getWsKeyForTopic, - getWsUrl, - isPrivateWsTopic, - isTopicSubscriptionConfirmation, - isTopicSubscriptionSuccess, - isWSAPIResponse, - isWsPong, - neverGuard, - WS_AUTH_ON_CONNECT_KEYS, - WS_KEY_MAP, - WSConnectedResult, - WsTopicRequest, -} from './util'; -import { - BaseWebsocketClient, - EmittableEvent, - MidflightWsRequestEvent, -} from './util/BaseWSClient'; -import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; ⋮---- -export interface WSAPIRequestFlags { - /** If true, will skip auth requirement for WS API connection */ - authIsOptional?: boolean | undefined; +export interface SupplyOrderInfoFixedV5 { + annualRate: string; + orderId: number; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; } ⋮---- -/** If true, will skip auth requirement for WS API connection */ -⋮---- -export class WebsocketClient extends BaseWebsocketClient< -⋮---- -constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) -⋮---- -/** - * Request connection of all dependent (public & private) websockets, instead of waiting - * for automatic connection by SDK. - */ -public connectAll(): Promise[] +export interface RepayFixedV5 { + repayId: string; +} ⋮---- -/** - * Ensures the WS API connection is active and ready. - * - * You do not need to call this, but if you call this before making any WS API requests, - * it can accelerate the first request (by preparing the connection in advance). - */ -public connectWSAPI(): Promise +export interface RepaymentHistoryFixedV5 { + details: { + loanCurrency: string; + loanId: string; + repayAmount: string; + }[]; + loanCurrency: string; + repayAmount: string; + repayId: string; + repayStatus: number; + repayTime: number; + repayType: number; +} ⋮---- -/** This call automatically ensures the connection is active AND authenticated before resolving */ +export interface RenewBorrowOrderFixedV5 { + orderId: string; +} ⋮---- -public connectPublic(): Promise[] +export interface RenewOrderInfoFixedV5 { + amount: string; + autoRepay: number; + borrowCurrency: string; + contractNo: string; + dueTime: string; + loanId: string; + orderId: number; + renewLoanNo: string; + time: string; +} ⋮---- -public connectPrivate(): Promise +// Institutional Loan Types ⋮---- -/** - * Subscribe to V5 topics & track/persist them. - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). - * The value is only important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this - * to mark a topic as private (if the topic isn't recognised yet) - */ -public subscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, -): Promise[] +export interface InstitutionalLendingProductInfoV5 { + productId: string; + leverage: string; + supportSpot: number; + supportContract: number; + supportMarginTrading: number; + withdrawLine: string; + transferLine: string; + spotBuyLine: string; + spotSellLine: string; + contractOpenLine: string; + liquidationLine: string; + stopLiquidationLine: string; + contractLeverage: string; + transferRatio: string; + spotSymbols: unknown[]; + contractSymbols: unknown[]; + supportUSDCContract: number; + supportUSDCOptions: number; + USDTPerpetualOpenLine?: string; + USDCContractOpenLine?: string; + USDCOptionsOpenLine?: string; + USDTPerpetualCloseLine?: string; + USDCContractCloseLine?: string; + USDCOptionsCloseLine?: string; + USDTPerpetualLeverage?: { symbol: string; leverage: string }[]; + USDCContractLeverage?: { symbol: string; leverage: string }[]; + deferredLiquidationLine?: string; + deferredLiquidationTime?: string; + marginLeverage?: string; + /** `0`: Default, `1`: CTA, `2`: Hedge */ + productType?: '0' | '1' | '2' | string; +} ⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here +/** `0`: Default, `1`: CTA, `2`: Hedge */ ⋮---- -// Prevent duplicate requests to the same topic +export interface InstitutionalLendingCoinDeltaItemV5 { + coin: string; + coinDeltaSize: string; + coinDeltaAvailableAmount: string; + coinDeltaAmount: string; +} ⋮---- -// Batch sub topics per ws key +export interface InstitutionalLendingCoinDeltaAmountV5 { + riskUnitDeltaAmount: string; + riskUnitDeltaAvailableAmount: string; + riskUnitDelta?: string; + list: InstitutionalLendingCoinDeltaItemV5[]; +} ⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) +export interface InstitutionalLendingDelayLiquidationStatusV5 { + ltv: string; + /** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ + liquidationStatus: 0 | 1 | 2 | 3; + delayLiqStartTime: string; + delayLiqRemainingSec: string; +} ⋮---- -/** - * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the - * connection reconnects. - * - * @param wsTopics - topic or list of topics - * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only - * important when connecting to public topics and will be ignored for private topics. - * @param isPrivateTopic - optional - the library will try to detect private topics, you can - * use this to mark a topic as private (if the topic isn't recognised yet) - */ -public unsubscribeV5( - wsTopics: WsTopic[] | WsTopic, - category: WSCategoryV5, - isPrivateTopic?: boolean, -): Promise[] +/** 0 normal, 1 passive liquidation, 2 callback liquidation, 3 delay liquidation */ ⋮---- -// Sort into per-WsKey batches, in case there is a mix of topics here +export interface UnpaidInfoV5 { + token: string; // Coin + unpaidQty: string; // Unpaid principle + unpaidInterest: string; // Unpaid interest +} ⋮---- -// Batch sub topics per ws key +token: string; // Coin +unpaidQty: string; // Unpaid principle +unpaidInterest: string; // Unpaid interest ⋮---- -// Return promise to resolve midflight WS request (only works if already connected before request) +export interface BalanceInfoV5 { + token: string; // Margin coin + price: string; // Margin coin price + qty: string; // Margin coin quantity + convertedAmount: string; // Margin conversion amount +} ⋮---- -/** - * Note: subscribeV5() might be simpler to use. The end result is the same. - * - * Request subscription to one or more topics. Pass topics as either an array of strings, - * or array of objects (if the topic has parameters). - * - * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. - * - * - Subscriptions are automatically routed to the correct websocket connection. - * - Authentication/connection is automatic. - * - Resubscribe after network issues is automatic. - * - * Call `unsubscribe(topics)` to remove topics - */ -public subscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - requestedWsKey?: WsKey, -) +token: string; // Margin coin +price: string; // Margin coin price +qty: string; // Margin coin quantity +convertedAmount: string; // Margin conversion amount ⋮---- -// Batch sub topics per ws key +export interface LTVInfoV5 { + ltv: string; // Risk rate (when liqStatus != 0, returns empty string) + rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) + parentUid: string; // The designated Risk Unit ID + subAccountUids: string[]; // Bound user IDs + unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) + unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) + balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) + balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) + liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +} ⋮---- -/** - * Note: unsubscribe() might be simpler to use. The end result is the same. - * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. - * - * - Requests are automatically routed to the correct websocket connection. - * - These topics will be removed from the topic cache, so they won't be subscribed to again. - */ -public unsubscribe( - requests: - | (WsTopicRequest | WsTopic) - | (WsTopicRequest | WsTopic)[], - wsKey?: WsKey, -) +ltv: string; // Risk rate (when liqStatus != 0, returns empty string) +rst: string; // Remaining liquidation time in UTC seconds (when liqStatus != 0, returns empty string) +parentUid: string; // The designated Risk Unit ID +subAccountUids: string[]; // Bound user IDs +unpaidAmount: string; // Total debt in USDT (when liqStatus != 0, returns empty string) +unpaidInfo: UnpaidInfoV5[]; // Debt details (when liqStatus != 0, returns empty array) +balance: string; // Total asset in USDT (when liqStatus != 0, returns empty string) +balanceInfo: BalanceInfoV5[]; // Asset details (when liqStatus != 0, returns empty array) +liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress ⋮---- -// Batch sub topics per ws key +export interface InstitutionalLoanLTVV5 { + ltvInfo: LTVInfoV5[]; // LTV info array + liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress +} ⋮---- -/** - * - * - * - * WS API Methods - similar to the REST API, but via WebSockets - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - * - * - * - */ +ltvInfo: LTVInfoV5[]; // LTV info array +liqStatus?: number; // Liquidation status: 0=Normal, 1=Under liquidation, 2=Manual repayment in progress, 3=Transfer in progress ⋮---- -/** - * Send a Websocket API command/request on a connection. Returns a promise that resolves on reply. - * - * WS API Documentation for list of operations and parameters: - * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline - * - * Returned promise is rejected if: - * - an exception is detected in the reply, OR - * - the connection disconnects for any reason (even if automatic reconnect will happen). - * - * Authentication is automatic. If you didn't request authentication yourself, there might - * be a small delay after your first request, while the SDK automatically authenticates. - * - * @param wsKey - The connection this event is for. Currently only "v5PrivateTrade" is supported - * for Bybit, since that is the dedicated WS API connection. - * @param operation - The command being sent, e.g. "order.create" to submit a new order. - * @param params - Any request parameters for the command. E.g. `OrderParamsV5` to submit a new - * order. Only send parameters for the request body. Everything else is automatically handled. - * @returns Promise - tries to resolve with async WS API response. Rejects if disconnected or exception is seen in async WS API response - */ +export interface RepayInstitutionalLoanResultV5 { + repayOrderStatus: string; // P: processing +} ⋮---- -// This overload allows the caller to omit the 3rd param, if it isn't required -sendWSAPIRequest< - TWSKey extends keyof WsAPIWsKeyTopicMap, - TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], - TWSParams extends Exact, - >( - wsKey: TWSKey, - operation: TWSOperation, - params?: TWSParams extends void | never ? undefined : TWSParams, - requestFlags?: WSAPIRequestFlags, - ): Promise; +repayOrderStatus: string; // P: processing ⋮---- -// These overloads give stricter types than mapped generics, since generic constraints -// do not trigger excess property checks -// Without these overloads, TypeScript won't complain if you include an -// unexpected property with your request (if it doesn't clash with an existing property) -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +// Max Loan Amount Response Types ⋮---- -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +export interface MaxLoanAmountV5 { + currency: string; // Coin to borrow + maxLoan: string; // Maximum borrowable amount based on current collateral + notionalUsd: string; // Notional USD value + remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) +} ⋮---- -sendWSAPIRequest( - wsKey: typeof WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: WsAPITopicRequestParamMap[TWSOperation], - requestFlags?: WSAPIRequestFlags, - ): Promise; +currency: string; // Coin to borrow +maxLoan: string; // Maximum borrowable amount based on current collateral +notionalUsd: string; // Notional USD value +remainingQuota: string; // Remaining individual platform borrowing limit (shared between main and sub accounts) + +================ +File: src/types/response/v5-position.ts +================ +import { + CategoryV5, + ExecTypeV5, + OrderSideV5, + OrderTypeV5, + PositionIdx, + PositionSideV5, + PositionStatusV5, + StopOrderTypeV5, + TPSLModeV5, + TradeModeV5, +} from '../shared-v5'; ⋮---- -async sendWSAPIRequest< - TWSKey extends keyof WsAPIWsKeyTopicMap, - TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], - TWSParams extends Exact, - TWSAPIResponse extends - WsAPIOperationResponseMap[TWSOperation] = WsAPIOperationResponseMap[TWSOperation], - >( - wsKey: WsKey = WS_KEY_MAP.v5PrivateTrade, - operation: TWSOperation, - params: TWSParams, - requestFlags?: WSAPIRequestFlags, -): Promise +export interface FuturesLeverageItemV5 { + symbol: string; + leverage: string; + side: OrderSideV5 | ''; + positionIdx: PositionIdx; +} ⋮---- -// Some commands don't require authentication. +export interface FuturesLeverageResultV5 { + category: 'linear' | 'inverse'; + list: FuturesLeverageItemV5[]; +} ⋮---- -// Sign, if needed +export interface PositionV5 { + positionIdx: PositionIdx; + riskId: number; + riskLimitValue: string; + symbol: string; + side: PositionSideV5; + size: string; + avgPrice: string; + positionValue: string; + tradeMode: TradeModeV5; + autoAddMargin?: number; + positionStatus: PositionStatusV5; + leverage?: string; + breakEvenPrice?: string; // Break even price, only for linear & inverse + markPrice: string; + liqPrice: string | ''; + bustPrice?: string; + positionIM?: string; + positionMM?: string; + positionBalance?: string; + tpslMode?: TPSLModeV5; + takeProfit?: string; + stopLoss?: string; + trailingStop?: string; + sessionAvgPrice: string | ''; + delta?: string; + gamma?: string; + vega?: string; + theta?: string; + unrealisedPnl: string; + curRealisedPnl: string; + cumRealisedPnl: string; + adlRankIndicator: number; + isReduceOnly: boolean; + mmrSysUpdatedTime: string | ''; + leverageSysUpdatedTime: string | ''; + createdTime: string; + updatedTime: string; + /** Position open timestamp (ms). Default `0` when not set. */ + openTime: number; + positionIMByMp: string; + positionMMByMp: string; + seq: number; + netDeltaRatio?: string; +} ⋮---- -// Store deferred promise, resolved within the "resolveEmittableEvents" method while parsing incoming events +breakEvenPrice?: string; // Break even price, only for linear & inverse ⋮---- -// eslint-disable-next-line @typescript-eslint/no-explicit-any +/** Position open timestamp (ms). Default `0` when not set. */ ⋮---- -// Enrich returned promise with request context for easier debugging +export interface SetRiskLimitResultV5 { + category: CategoryV5; + riskId: number; + riskLimitValue: string; +} ⋮---- -// throw e; +export interface AddOrReduceMarginResultV5 { + category: CategoryV5; + symbol: string; + positionIdx: PositionIdx; + riskId: number; + riskLimitValue: string; + size: string; + avgPrice: string; + liqPrice: string; + bustPrice: string; + markPrice: string; + positionValue: string; + leverage: string; + autoAddMargin: 0 | 1; + positionStatus: PositionStatusV5; + positionIM: string; + positionMM: string; + takeProfit: string; + stopLoss: string; + trailingStop: string; + unrealisedPnl: string; + cumRealisedPnl: string; + createdTime: string; + updatedTime: string; +} ⋮---- -// Send event +export interface ExecutionV5 { + symbol: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + orderType: OrderTypeV5; + stopOrderType?: StopOrderTypeV5; + execFee: string; + execFeeV2: string; + feeCurrency: string; // Trading fee currency + execId: string; + execPrice: string; + execQty: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + tradeIv?: string; + markIv?: string; + markPrice: string; + indexPrice: string; + underlyingPrice?: string; + blockTradeId?: string; + closedSize?: string; + seq: number; + extraFees: string; +} ⋮---- -// Return deferred promise, so caller can await this call +feeCurrency: string; // Trading fee currency ⋮---- -/** - * - * - * Internal methods - not intended for public use - * - * - */ +export interface ClosedPnLV5 { + symbol: string; + orderId: string; + side: string; + qty: string; + orderPrice: string; + orderType: OrderTypeV5; + execType: ExecTypeV5; + closedSize: string; + openFee: string; + closeFee: string; + cumEntryValue: string; + avgEntryPrice: string; + cumExitValue: string; + avgExitPrice: string; + closedPnl: string; + fillCount: string; + leverage: string; + createdTime: string; + updatedTime: string; +} ⋮---- -/** - * Note: implementing this method will wipe the WsStore state for this WsKey, once this method returns - */ -protected isCustomReconnectionNeeded(): boolean +export interface MovePositionResultV5 { + blockTradeId: string; + status: 'Processing' | 'Rejected'; + rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; +} ⋮---- -protected async triggerCustomReconnectionWorkflow(): Promise +export interface MovePositionHistoryV5 { + blockTradeId: string; + category: 'linear' | 'spot' | 'option'; + orderId: string; + userId: number; + symbol: string; + side: 'Buy' | 'Sell'; + price: string; + qty: string; + execFee: string; + status: 'Processing' | 'Filled' | 'Rejected'; + execId: string; + resultCode: number; + resultMessage: string; + createdAt: number; + updatedAt: number; + rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; +} ⋮---- -/** - * @returns The WS URL to connect to for this WS key - */ -protected async getWsUrl(wsKey: WsKey): Promise +export interface ClosedOptionsPositionV5 { + symbol: string; + side: 'Buy' | 'Sell'; + totalOpenFee: string; + deliveryFee: string; + totalCloseFee: string; + qty: string; + closeTime: number; + avgExitPrice: string; + deliveryPrice: string; + openTime: number; + avgEntryPrice: string; + totalPnl: string; +} + +================ +File: src/websocket-client.ts +================ +/* eslint-disable @typescript-eslint/no-unused-vars */ ⋮---- -// If auth is needed for this wsKey URL, this returns a suffix +import { + MessageEventLike, + WSCategoryV5, + WSClientConfigurableOptions, + WsKey, + WsMarket, + WsTopic, +} from './types'; +import { + Exact, + WSAPIOperation, + WsAPIOperationResponseMap, + WSAPIRequest, + WsAPITopicRequestParamMap, + WsAPIWsKeyTopicMap, + WsOperation, + WsRequestOperationBybit, +} from './types/websockets/ws-api'; +import { + APIID, + DefaultLogger, + getMaxTopicsPerSubscribeEvent, + getNormalisedTopicRequests, + getPromiseRefForWSAPIRequest, + getTopicsPerWSKey, + getWsKeyForTopic, + getWsUrl, + isPrivateWsTopic, + isTopicSubscriptionConfirmation, + isTopicSubscriptionSuccess, + isWSAPIResponse, + isWsPong, + neverGuard, + WS_AUTH_ON_CONNECT_KEYS, + WS_KEY_MAP, + WSConnectedResult, + WsTopicRequest, +} from './util'; +import { + BaseWebsocketClient, + EmittableEvent, + MidflightWsRequestEvent, +} from './util/BaseWSClient'; +import { SignAlgorithm, signMessage } from './util/webCryptoAPI'; ⋮---- -/** +export interface WSAPIRequestFlags { + /** If true, will skip auth requirement for WS API connection */ + authIsOptional?: boolean | undefined; +} +⋮---- +/** If true, will skip auth requirement for WS API connection */ +⋮---- +export class WebsocketClient extends BaseWebsocketClient< +⋮---- +constructor(options?: WSClientConfigurableOptions, logger?: DefaultLogger) +⋮---- +/** + * Request connection of all dependent (public & private) websockets, instead of waiting + * for automatic connection by SDK. + */ +public connectAll(): Promise[] +⋮---- +/** + * Ensures the WS API connection is active and ready. + * + * You do not need to call this, but if you call this before making any WS API requests, + * it can accelerate the first request (by preparing the connection in advance). + */ +public connectWSAPI(): Promise +⋮---- +/** This call automatically ensures the connection is active AND authenticated before resolving */ +⋮---- +public connectPublic(): Promise[] +⋮---- +public connectPrivate(): Promise +⋮---- +/** + * Subscribe to V5 topics & track/persist them. + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). + * The value is only important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can use this + * to mark a topic as private (if the topic isn't recognised yet) + */ +public subscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, + ): Promise[] +⋮---- +// Sort into per-WsKey batches, in case there is a mix of topics here +⋮---- +// Prevent duplicate requests to the same topic +⋮---- +// Batch sub topics per ws key +⋮---- +// Return promise to resolve midflight WS request (only works if already connected before request) +⋮---- +/** + * Unsubscribe from V5 topics & remove them from memory. They won't be re-subscribed to if the + * connection reconnects. + * + * @param wsTopics - topic or list of topics + * @param category - the API category this topic is for (e.g. "linear", or "event" for Event Contract public topics). The value is only + * important when connecting to public topics and will be ignored for private topics. + * @param isPrivateTopic - optional - the library will try to detect private topics, you can + * use this to mark a topic as private (if the topic isn't recognised yet) + */ +public unsubscribeV5( + wsTopics: WsTopic[] | WsTopic, + category: WSCategoryV5, + isPrivateTopic?: boolean, + ): Promise[] +⋮---- +// Sort into per-WsKey batches, in case there is a mix of topics here +⋮---- +// Batch sub topics per ws key +⋮---- +// Return promise to resolve midflight WS request (only works if already connected before request) +⋮---- +/** + * Note: subscribeV5() might be simpler to use. The end result is the same. + * + * Request subscription to one or more topics. Pass topics as either an array of strings, + * or array of objects (if the topic has parameters). + * + * Objects should be formatted as {topic: string, params: object, category: WSCategoryV5}. + * + * - Subscriptions are automatically routed to the correct websocket connection. + * - Authentication/connection is automatic. + * - Resubscribe after network issues is automatic. + * + * Call `unsubscribe(topics)` to remove topics + */ +public subscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + requestedWsKey?: WsKey, + ) +⋮---- +// Batch sub topics per ws key +⋮---- +/** + * Note: unsubscribe() might be simpler to use. The end result is the same. + * Unsubscribe from one or more topics. Similar to subscribe() but in reverse. + * + * - Requests are automatically routed to the correct websocket connection. + * - These topics will be removed from the topic cache, so they won't be subscribed to again. + */ +public unsubscribe( + requests: + | (WsTopicRequest | WsTopic) + | (WsTopicRequest | WsTopic)[], + wsKey?: WsKey, + ) +⋮---- +// Batch sub topics per ws key +⋮---- +/** + * + * + * + * WS API Methods - similar to the REST API, but via WebSockets + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + * + * + * + */ +⋮---- +/** + * Send a Websocket API command/request on a connection. Returns a promise that resolves on reply. + * + * WS API Documentation for list of operations and parameters: + * https://bybit-exchange.github.io/docs/v5/websocket/trade/guideline + * + * Returned promise is rejected if: + * - an exception is detected in the reply, OR + * - the connection disconnects for any reason (even if automatic reconnect will happen). + * + * Authentication is automatic. If you didn't request authentication yourself, there might + * be a small delay after your first request, while the SDK automatically authenticates. + * + * @param wsKey - The connection this event is for. Currently only "v5PrivateTrade" is supported + * for Bybit, since that is the dedicated WS API connection. + * @param operation - The command being sent, e.g. "order.create" to submit a new order. + * @param params - Any request parameters for the command. E.g. `OrderParamsV5` to submit a new + * order. Only send parameters for the request body. Everything else is automatically handled. + * @returns Promise - tries to resolve with async WS API response. Rejects if disconnected or exception is seen in async WS API response + */ +⋮---- +// This overload allows the caller to omit the 3rd param, if it isn't required +sendWSAPIRequest< + TWSKey extends keyof WsAPIWsKeyTopicMap, + TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], + TWSParams extends Exact, + >( + wsKey: TWSKey, + operation: TWSOperation, + params?: TWSParams extends void | never ? undefined : TWSParams, + requestFlags?: WSAPIRequestFlags, + ): Promise; +⋮---- +// These overloads give stricter types than mapped generics, since generic constraints +// do not trigger excess property checks +// Without these overloads, TypeScript won't complain if you include an +// unexpected property with your request (if it doesn't clash with an existing property) +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; +⋮---- +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; +⋮---- +sendWSAPIRequest( + wsKey: typeof WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: WsAPITopicRequestParamMap[TWSOperation], + requestFlags?: WSAPIRequestFlags, + ): Promise; +⋮---- +async sendWSAPIRequest< + TWSKey extends keyof WsAPIWsKeyTopicMap, + TWSOperation extends WsAPIWsKeyTopicMap[TWSKey], + TWSParams extends Exact, + TWSAPIResponse extends + WsAPIOperationResponseMap[TWSOperation] = WsAPIOperationResponseMap[TWSOperation], + >( + wsKey: WsKey = WS_KEY_MAP.v5PrivateTrade, + operation: TWSOperation, + params: TWSParams, + requestFlags?: WSAPIRequestFlags, + ): Promise +⋮---- +// Some commands don't require authentication. +⋮---- +// Sign, if needed +⋮---- +// Store deferred promise, resolved within the "resolveEmittableEvents" method while parsing incoming events +⋮---- +// eslint-disable-next-line @typescript-eslint/no-explicit-any +⋮---- +// Enrich returned promise with request context for easier debugging +⋮---- +// throw e; +⋮---- +// Send event +⋮---- +// Return deferred promise, so caller can await this call +⋮---- +/** + * + * + * Internal methods - not intended for public use + * + * + */ +⋮---- +/** + * Note: implementing this method will wipe the WsStore state for this WsKey, once this method returns + */ +protected isCustomReconnectionNeeded(): boolean +⋮---- +protected async triggerCustomReconnectionWorkflow(): Promise +⋮---- +/** + * @returns The WS URL to connect to for this WS key + */ +protected async getWsUrl(wsKey: WsKey): Promise +⋮---- +// If auth is needed for this wsKey URL, this returns a suffix +⋮---- +/** * Return params required to make authorized request */ private async getWsAuthURLSuffix(): Promise @@ -11679,21 +12037,21 @@ private async signMessage( secret: string, method?: 'hex' | 'base64', algorithm: SignAlgorithm = 'SHA-256', -): Promise + ): Promise ⋮---- protected async getWsAuthRequestEvent( wsKey: WsKey, -): Promise> + ): Promise> ⋮---- private async getWsAuthSignature( wsKey: WsKey, -): Promise< + ): Promise<{ expiresAt: number; signature: string }> ⋮---- undefined, // Let the function automatically determine encoding based on key type ⋮---- private async signWSAPIRequest( requestEvent: WSAPIRequest, -): Promise> + ): Promise> ⋮---- // Not needed for Bybit. Auth happens only on connection open, automatically. ⋮---- @@ -11715,7 +12073,7 @@ protected async getWsRequestEvents( requests: WsTopicRequest[], // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars _wsKey: WsKey, -): Promise>[]> + ): Promise>[]> ⋮---- // eslint-disable-next-line @typescript-eslint/no-unused-vars, no-unused-vars ⋮---- @@ -11746,7 +12104,7 @@ protected isWsPong(msg: any): boolean protected resolveEmittableEvents( wsKey: WsKey, event: MessageEventLike, -): EmittableEvent[] + ): EmittableEvent[] ⋮---- // this.logger.trace('resolveEmittableEvents', { // ...WS_LOGGER_CATEGORY, @@ -11777,3263 +12135,2960 @@ protected resolveEmittableEvents( // In case of catastrophic failure, fallback to noisy emit update ================ -File: src/types/request/v5-earn.ts +File: src/types/response/v5-earn.ts ================ -export interface GetEarnCouponListParamsV5 { - category: 'FlexibleSaving' | 'DualAssets'; -} -⋮---- -/** GET /v5/earn/flexible-saving/auto-savings. coins is a repeated query param, max 50. */ -export interface GetFlexibleSavingAutoSavingsParamsV5 { - coins?: string[]; +export interface EarnInterestCardV5 { + awardId: number; + specCode: string; + coin: string; + apy: string; + duration: number; + claimedAt: number; + expireAt: number; + usedAt: number; + status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; + currentPnl: string; + limitPnl: string; + positionEffectiveAmount: string; + productId: number; + category: 'FlexibleSaving' | 'DualAssets' | string; } ⋮---- -/** POST /v5/earn/flexible-saving/auto-savings. Omit coin to update the global setting. */ -export interface SetFlexibleSavingAutoSavingsParamsV5 { - coin?: string; - isSelected: boolean; - purchaseImmediately?: boolean; -} -⋮---- -export interface SubmitStakeRedeemParamsV5 { - category: string; - orderType: 'Stake' | 'Redeem'; - accountType: 'FUND' | 'UNIFIED'; +export interface EarnAwardCardV5 { + awardId: number; + specCode: string; + claimedAt: number; + usedAt: number; + expireAt: number; + status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; amount: string; - coin: string; - productId: string; - orderLinkId: string; - toAccountType?: 'FUND' | 'UNIFIED'; + limitPnlPercentage: string; + baseCoin: string; + quoteCoin: string; + direction: 1 | 2; + category: 'FlexibleSaving' | 'DualAssets' | string; } ⋮---- -export interface GetEarnOrderHistoryParamsV5 { - category: string; - orderId?: string; - orderLinkId?: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface EarnCouponListResultV5 { + interestCards: EarnInterestCardV5[]; + awardCards: EarnAwardCardV5[]; } ⋮---- -export interface GetEarnPositionParamsV5 { - category: string; - productId?: string; - coin?: string; +export interface FlexibleSavingAutoSavingsCoinV5 { + coin: string; + isSelected: boolean; + maxStakingAmount: string; + apr: string; } ⋮---- -export interface GetEarnYieldHistoryParamsV5 { - category: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; +export interface FlexibleSavingAutoSavingsV5 { + selectedAll: boolean; + coins: FlexibleSavingAutoSavingsCoinV5[]; } ⋮---- -export interface GetEarnHourlyYieldHistoryParamsV5 { +export interface EarnProductV5 { category: string; - productId?: string; - startTime?: number; - endTime?: number; - limit?: number; - cursor?: string; -} -⋮---- -export interface ModifyEarnPositionParamsV5 { - category: 'OnChain'; - productId: number; - positionId: number; - autoReinvest: 0 | 1; + estimateApr: string; + coin: string; + minStakeAmount: string; + maxStakeAmount: string; + precision: string; + productId: string; + status: 'Available' | 'NotAvailable'; } ⋮---- -export interface GetEarnAprHistoryParamsV5 { - category: 'FlexibleSaving' | 'OnChain'; +export interface EarnOrderHistoryV5 { + coin: string; + orderValue: string; + orderType: 'Redeem' | 'Stake'; + orderId: string; + orderLinkId: string; + status: 'Success' | 'Fail' | 'Pending'; + createdAt: string; productId: string; - startTime?: number; - endTime?: number; + updatedAt: string; + swapOrderValue: string; + estimateRedeemTime: string; + estimateStakeTime: string; } ⋮---- -/** - * GET /v5/earn/advance/product — Advanced Earn: Dual Asset, Double Win, Smart Leverage, etc. - * Public, no auth. Rate limit: 50 req/s per IP. - */ -export interface GetAdvanceEarnProductParamsV5 { - category: 'DualAssets' | 'DoubleWin' | 'SmartLeverage' | 'DiscountBuy'; - coin?: string; - /** - * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). - */ - duration?: string; +export interface EarnPositionFreezeDetailV5 { + amount: string; + description: string; } ⋮---- -/** - * Product duration, e.g. 8h, 1d, 2d, 3d, 6d, 7d, 12d (depends on product). - */ -⋮---- -/** GET /v5/earn/hold-to-earn/yield-history — Hold to Earn airdrop daily PnL (Earn permission) */ -export interface GetHoldToEarnAirdropYieldHistoryParamsV5 { - /** Unix seconds. Cannot be earlier than now minus 3 months */ - timeStart?: number; - /** Unix seconds. Requires timeStart ≤ timeEnd */ - timeEnd?: number; - /** Page size [1, 49] */ - limit: number; - /** Pagination cursor from previous `nextCursor` */ - cursor?: string; +export interface EarnPositionV5 { + coin: string; + productId: string; + amount: string; + totalPnl: string; + claimableYield: string; + id?: string; + status?: string; + orderId?: string; + estimateRedeemTime?: string; + estimateStakeTime?: string; + estimateInterestCalculationTime?: string; + settlementTime?: string; + autoReinvest?: string; + /** Redeemable amount */ + availableAmount: string; + freezeDetails: EarnPositionFreezeDetailV5[]; } ⋮---- -/** Unix seconds. Cannot be earlier than now minus 3 months */ -⋮---- -/** Unix seconds. Requires timeStart ≤ timeEnd */ -⋮---- -/** Page size [1, 49] */ -⋮---- -/** Pagination cursor from previous `nextCursor` */ - -================ -File: src/types/response/v5-account.ts -================ -import { - AccountMarginModeV5, - AccountTypeV5, - CategoryV5, - TransactionTypeV5, - UnifiedUpdateStatusV5, -} from '../shared-v5'; +/** Redeemable amount */ ⋮---- -export interface WalletBalanceV5Coin { +export interface EarnYieldHistoryV5 { + productId: string; coin: string; - equity: string; - usdValue: string; - walletBalance: string; - free: string; // spot only - locked: string; // spot only - borrowAmount: string; - availableToBorrow: string; // deprecated field - availableToWithdraw: string; - accruedInterest: string; - totalOrderIM: string; - totalPositionIM: string; - totalPositionMM: string; - unrealisedPnl: string; - cumRealisedPnl: string; - bonus: string; - marginCollateral: boolean; - collateralSwitch: boolean; - spotBorrow: string; - colRes?: string; + id: string; + amount: string; + yieldType: string; + distributionMode: string; + effectiveStakingAmount: string; + orderId: string; + status: 'Pending' | 'Success' | 'Fail'; + createdAt: string; } ⋮---- -free: string; // spot only -locked: string; // spot only +export interface EarnHourlyYieldHistoryV5 { + productId: string; + coin: string; + id: string; + amount: string; + effectiveStakingAmount: string; + status: 'Pending' | 'Success' | 'Fail'; + hourlyDate: string; + createdAt: string; +} ⋮---- -availableToBorrow: string; // deprecated field +export interface EarnAprHistoryPointV5 { + timestamp: string; + apr: string; +} ⋮---- -export interface WalletBalanceV5 { - accountType: AccountTypeV5; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WalletBalanceV5Coin[]; +/** + * Advanced Earn — Dual Asset product (GET /v5/earn/advance/product). + */ +export interface AdvanceEarnDualAssetProductV5 { + category: string; + productId: string; + baseCoin: string; + quoteCoin: string; + expectReceiveAt: string; + duration: string; + status: 'Available' | 'NotAvailable'; + isVipProduct: boolean; + subscribeStartAt: string; + subscribeEndAt: string; + applyStartAt: string; + settlementTime: string; + minPurchaseQuoteAmount: string; + minPurchaseBaseAmount: string; + remainingAmountQuote: string; + remainingAmountBase: string; + orderPrecisionDigitalQuote: number; + orderPrecisionDigitalBase: number; } ⋮---- -export interface UnifiedAccountUpgradeResultV5 { - unifiedUpdateStatus: UnifiedUpdateStatusV5; - unifiedUpdateMsg: { - msg: string[] | null; - }; -} -⋮---- -export interface BorrowHistoryRecordV5 { - currency: string; - createdTime: number; - borrowCost: string; - hourlyBorrowRate: string; - InterestBearingBorrowSize: string; - costExemption: string; - borrowAmount: string; - unrealisedLoss: string; - freeBorrowedAmount: string; -} -⋮---- -export interface CollateralInfoV5 { - currency: string; - hourlyBorrowRate: string; - maxBorrowingAmount: string; - freeBorrowAmount: string; - freeBorrowingLimit: string; - borrowAmount: string; - availableToBorrow: string; - borrowable: boolean; - borrowUsageRate: string; - marginCollateral: boolean; - collateralSwitch: boolean; - collateralRatio: string; -} -⋮---- -export interface CoinGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; -} -⋮---- -export interface FeeRateV5 { - symbol: string; - baseCoin: string; - takerFeeRate: string; - makerFeeRate: string; - rpiMakerFeeRate?: string; -} -⋮---- -export interface AccountInfoV5 { - unifiedMarginStatus: number; - marginMode: AccountMarginModeV5; - isMasterTrader: boolean; - spotHedgingStatus: string; - updatedTime: string; +export interface AdvanceEarnDualAssetProductInfoV5 { + category: string; + list: AdvanceEarnDualAssetProductV5[]; } ⋮---- /** - * Get Trade Behaviour Config / `getLimitPriceAction()` — `/v5/account/user-setting-config` + * Advanced Earn — Double Win (GET /v5/earn/advance/product?category=DoubleWin). */ -export interface UserSettingConfigV5 { - lpaSpot: boolean; - lpaPerp: boolean; - /** Spot MNT fee deduction enabled. */ - smsef?: boolean; - /** Futures MNT fee deduction enabled. */ - fmsef?: boolean; - /** Delta Neutral mode; may be absent on older API responses. */ - deltaEnable?: boolean; - smpType?: '0' | '1' | '2' | '3' | string; -} -⋮---- -/** Spot MNT fee deduction enabled. */ -⋮---- -/** Futures MNT fee deduction enabled. */ -⋮---- -/** Delta Neutral mode; may be absent on older API responses. */ -⋮---- -export interface TransactionLogV5 { - symbol: string; - category: CategoryV5; - side: string; - transactionTime: string; - type: TransactionTypeV5; - qty: string; - size: string; - currency: string; - tradePrice: string; - funding: string; - fee: string; - cashFlow: string; - change: string; - cashBalance: string; - feeRate: string; - bonusChange: string; - tradeId: string; - orderId: string; - orderLinkId: string; - extraFees: string; - transSubType: string; - displayType?: string; -} -⋮---- -export interface MMPStateV5 { - baseCoin: string; - mmpEnabled: boolean; - window: string; - frozenPeriod: string; - qtyLimit: string; - deltaLimit: string; - vegaLimit?: string; - mmpFrozenUntil: string; - mmpFrozen: boolean; -} -⋮---- -export interface RepayLiabilityResultV5 { - coin: string; - repaymentQty: string; -} -⋮---- -export interface DCPInfoV5 { - product: 'SPOT' | 'DERIVATIVES' | 'OPTIONS'; - dcpStatus: 'ON'; - timeWindow: string; -} -⋮---- -export interface ManualRepayResultV5 { - resultStatus: 'P' | 'SU' | 'FA'; -} -⋮---- -/** GET /v5/account/option-asset-info — response `result` wraps a nested `result` array. */ -export interface OptionAssetInfoRowV5 { - coin: string; - totalDelta: string; - totalRPL: string; - totalUPL: string; - assetIM: string; - assetMM: string; - sendTime: number; -} -⋮---- -export interface OptionAssetInfoNestedResultV5 { - result: OptionAssetInfoRowV5[]; -} -⋮---- -/** GET /v5/account/pay-info */ -export interface PayInfoCollateralItemV5 { - coin: string; - availableSize: string; - availableValue: string; - coinScale: number; - borrowSize: string; - spotHedgeAmount: string; - assetFrozen: string; -} -⋮---- -export interface PayInfoBorrowBlockV5 { - coin?: string; - borrowSize: string; - borrowValue?: string; - assetFrozen: string; - availableBalance: string; -} -⋮---- -export interface PayInfoResultV5 { - collateralInfo: { - collateralList: PayInfoCollateralItemV5[]; - }; - borrowInfo: PayInfoBorrowBlockV5; -} -⋮---- -/** GET /v5/account/trade-info-for-analysis */ -export interface TradeInfoAnalysisDailyV5 { - day: string; - sumBuyExecValue: string; - sumSellExecValue: string; - sumExecValue: string; -} -⋮---- -export interface TradeInfoForAnalysisResultV5 { - symbolRnl: string; - netExecQty: string; - sumExecValue: string; - sumExecQty: string; - avgBuyExecPrice: string; - sumBuyExecValue: string; - sumBuyExecQty: string; - sumBuyExecFee: string; - sumBuyOrderQty: string; - avgSellExecPrice: string; - sumSellExecValue: string; - sumSellExecQty: string; - sumSellExecFee: string; - sumSellOrderQty: string; - maxMarginVersion: number; - baseCoin: string; - settleCoin: string; - sumPriceList?: TradeInfoAnalysisDailyV5[]; +export interface AdvanceEarnDoubleWinProductV5 { + category: string; + productId: string; + investCoin: string; + underlyingAsset: string; + duration: string; + subscribeStartAt: string; + subscribeEndAt: string; + settlementTime: string; + expectReceiveAt: string; + minPurchaseAmount: string; + orderPrecisionDigital: number; + isRfqProduct: boolean; + lowerPriceBuffer: string; + upperPriceBuffer: string; + minDeviationRatio: string; + maxDeviationRatio: string; + priceTickSize: string; } - -================ -File: src/types/response/v5-position.ts -================ -import { - CategoryV5, - ExecTypeV5, - OrderSideV5, - OrderTypeV5, - PositionIdx, - PositionSideV5, - PositionStatusV5, - StopOrderTypeV5, - TPSLModeV5, - TradeModeV5, -} from '../shared-v5'; ⋮---- -export interface FuturesLeverageItemV5 { - symbol: string; +/** + * Advanced Earn — Smart Leverage (GET /v5/earn/advance/product?category=SmartLeverage). + */ +export interface AdvanceEarnSmartLeverageProductV5 { + category: string; + productId: string; + investCoin: string; + underlyingAsset: string; + direction: 'Long' | 'Short'; leverage: string; - side: OrderSideV5 | ''; - positionIdx: PositionIdx; -} -⋮---- -export interface FuturesLeverageResultV5 { - category: 'linear' | 'inverse'; - list: FuturesLeverageItemV5[]; -} -⋮---- -export interface PositionV5 { - positionIdx: PositionIdx; - riskId: number; - riskLimitValue: string; - symbol: string; - side: PositionSideV5; - size: string; - avgPrice: string; - positionValue: string; - tradeMode: TradeModeV5; - autoAddMargin?: number; - positionStatus: PositionStatusV5; - leverage?: string; - breakEvenPrice?: string; // Break even price, only for linear & inverse - markPrice: string; - liqPrice: string | ''; - bustPrice?: string; - positionIM?: string; - positionMM?: string; - positionBalance?: string; - tpslMode?: TPSLModeV5; - takeProfit?: string; - stopLoss?: string; - trailingStop?: string; - sessionAvgPrice: string | ''; - delta?: string; - gamma?: string; - vega?: string; - theta?: string; - unrealisedPnl: string; - curRealisedPnl: string; - cumRealisedPnl: string; - adlRankIndicator: number; - isReduceOnly: boolean; - mmrSysUpdatedTime: string | ''; - leverageSysUpdatedTime: string | ''; - createdTime: string; - updatedTime: string; - /** Position open timestamp (ms). Default `0` when not set. */ - openTime: number; - positionIMByMp: string; - positionMMByMp: string; - seq: number; - netDeltaRatio?: string; -} -⋮---- -breakEvenPrice?: string; // Break even price, only for linear & inverse -⋮---- -/** Position open timestamp (ms). Default `0` when not set. */ -⋮---- -export interface SetRiskLimitResultV5 { - category: CategoryV5; - riskId: number; - riskLimitValue: string; -} -⋮---- -export interface AddOrReduceMarginResultV5 { - category: CategoryV5; - symbol: string; - positionIdx: PositionIdx; - riskId: number; - riskLimitValue: string; - size: string; - avgPrice: string; - liqPrice: string; - bustPrice: string; - markPrice: string; - positionValue: string; - leverage: string; - autoAddMargin: 0 | 1; - positionStatus: PositionStatusV5; - positionIM: string; - positionMM: string; - takeProfit: string; - stopLoss: string; - trailingStop: string; - unrealisedPnl: string; - cumRealisedPnl: string; - createdTime: string; - updatedTime: string; -} -⋮---- -export interface ExecutionV5 { - symbol: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - orderType: OrderTypeV5; - stopOrderType?: StopOrderTypeV5; - execFee: string; - execFeeV2: string; - feeCurrency: string; // Trading fee currency - execId: string; - execPrice: string; - execQty: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - tradeIv?: string; - markIv?: string; - markPrice: string; - indexPrice: string; - underlyingPrice?: string; - blockTradeId?: string; - closedSize?: string; - seq: number; - extraFees: string; -} -⋮---- -feeCurrency: string; // Trading fee currency -⋮---- -export interface ClosedPnLV5 { - symbol: string; - orderId: string; - side: string; - qty: string; - orderPrice: string; - orderType: OrderTypeV5; - execType: ExecTypeV5; - closedSize: string; - openFee: string; - closeFee: string; - cumEntryValue: string; - avgEntryPrice: string; - cumExitValue: string; - avgExitPrice: string; - closedPnl: string; - fillCount: string; - leverage: string; - createdTime: string; - updatedTime: string; -} -⋮---- -export interface MovePositionResultV5 { - blockTradeId: string; - status: 'Processing' | 'Rejected'; - rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; -} -⋮---- -export interface MovePositionHistoryV5 { - blockTradeId: string; - category: 'linear' | 'spot' | 'option'; - orderId: string; - userId: number; - symbol: string; - side: 'Buy' | 'Sell'; - price: string; - qty: string; - execFee: string; - status: 'Processing' | 'Filled' | 'Rejected'; - execId: string; - resultCode: number; - resultMessage: string; - createdAt: number; - updatedAt: number; - rejectParty: '' | 'Taker' | 'Maker' | 'bybit'; -} -⋮---- -export interface ClosedOptionsPositionV5 { - symbol: string; - side: 'Buy' | 'Sell'; - totalOpenFee: string; - deliveryFee: string; - totalCloseFee: string; - qty: string; - closeTime: number; - avgExitPrice: string; - deliveryPrice: string; - openTime: number; - avgEntryPrice: string; - totalPnl: string; -} - -================ -File: src/types/websockets/ws-general.ts -================ -import { AxiosRequestConfig } from 'axios'; -import type { ClientRequestArgs } from 'http'; -import WebSocket from 'isomorphic-ws'; -⋮---- -import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; -⋮---- -/** For spot markets, spotV3 is recommended */ -export type APIMarket = 'v5'; -⋮---- -// Same as inverse futures -export type WsPublicInverseTopic = - | 'orderBookL2_25' - | 'orderBookL2_200' - | 'trade' - | 'insurance' - | 'instrument_info' - | 'klineV2'; -⋮---- -export type WsPublicUSDTPerpTopic = - | 'orderBookL2_25' - | 'orderBookL2_200' - | 'trade' - | 'insurance' - | 'instrument_info' - | 'kline'; -⋮---- -export type WsPublicSpotV1Topic = - | 'trade' - | 'realtimes' - | 'kline' - | 'depth' - | 'mergedDepth' - | 'diffDepth'; -⋮---- -export type WsPublicSpotV2Topic = - | 'depth' - | 'kline' - | 'trade' - | 'bookTicker' - | 'realtimes'; -⋮---- -export type WsPublicTopics = - | WsPublicInverseTopic - | WsPublicUSDTPerpTopic - | WsPublicSpotV1Topic - | WsPublicSpotV2Topic - | string; -⋮---- -// Same as inverse futures -export type WsPrivateInverseTopic = - | 'position' - | 'execution' - | 'order' - | 'stop_order'; -⋮---- -export type WsPrivateUSDTPerpTopic = - | 'position' - | 'execution' - | 'order' - | 'stop_order' - | 'wallet'; -⋮---- -export type WsPrivateSpotTopic = - | 'outboundAccountInfo' - | 'executionReport' - | 'ticketInfo'; -⋮---- -export type WsPrivateTopic = - | WsPrivateInverseTopic - | WsPrivateUSDTPerpTopic - | WsPrivateSpotTopic - | string; -⋮---- -export type WsTopic = WsPublicTopics | WsPrivateTopic; -⋮---- -/** This is used to differentiate between each of the available websocket streams (as bybit has multiple websockets) */ -export type WsKey = (typeof WS_KEY_MAP)[keyof typeof WS_KEY_MAP]; -export type WsMarket = 'all'; -⋮---- -export interface WSClientConfigurableOptions { - /** Your API key */ - key?: string; - - /** Your API secret */ - secret?: string; - - /** - * Set to `true` to connect to Bybit's testnet environment. - * - * Notes: - * - * - If demo trading, `testnet` should be set to false! - * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. - */ - testnet?: boolean; - - /** - * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo - * - * Only the "V5" "market" is supported here. - */ - demoTrading?: boolean; - - /** - * The API group this client should connect to. The V5 market is currently used by default. - * - * Only the "V5" "market" is supported here. - */ - market?: APIMarket; - - /** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ - recvWindow?: number; - - /** How often to check if the connection is alive */ - pingInterval?: number; - - /** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ - pongTimeout?: number; - - /** Delay in milliseconds before respawning the connection */ - reconnectTimeout?: number; - - /** - * Select WebSocket routing with the same region values as REST. Uses a - * dedicated mainnet stream when Bybit documents one for that region. - * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. - */ - apiRegion?: APIRegion; - - /** - * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. - * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. - * Keep passing it only if a remaining site still requires `x-site-id`. - */ - siteId?: string; - - /** - * REST options reused for WebSocket routing. - * Regional and site ID values are retained as fallbacks; prefer the matching - * top-level `apiRegion` and `siteId` options. - */ - restOptions?: RestClientOptions; - requestOptions?: AxiosRequestConfig; - - wsOptions?: { - protocols?: string[]; - agent?: any; - } & ( - | Omit, 'agent'> - | Omit, 'agent'> - ); - - wsUrl?: string; - - /** - * Default: false. - * - * When enabled, any calls to the subscribe method will return a promise. - * Note: internally, subscription requests are sent in batches. This may not behave as expected when - * subscribing to a large number of topics, especially if you are not yet connected when subscribing. - */ - promiseSubscribeRequests?: boolean; - - /** - * 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; + duration: string; + subscribeStartAt: string; + subscribeEndAt: string; + settlementTime: string; + expectReceiveAt: string; + minPurchaseAmount: string; + remainingAmount: string; + orderPrecisionDigital: number; } ⋮---- -/** Your API key */ +/** + * Advanced Earn — Discount Buy (GET /v5/earn/advance/product?category=DiscountBuy). + */ +export interface AdvanceEarnDiscountBuyProductV5 { + category: string; + productId: string; + coin: string; + underlyingAsset: string; + settlementTime: string; + duration: string; + isVipProduct: boolean; + subscribeStartAt: string; + subscribeEndAt: string; + minPurchaseAmount: string; + remainingAmount: string; + orderPrecisionDigital: number; + expectReceiveAt: string; +} ⋮---- -/** Your API secret */ +export type AdvanceEarnAdvanceProductListItemV5 = + | AdvanceEarnDualAssetProductV5 + | AdvanceEarnDoubleWinProductV5 + | AdvanceEarnSmartLeverageProductV5 + | AdvanceEarnDiscountBuyProductV5; ⋮---- -/** - * Set to `true` to connect to Bybit's testnet environment. - * - * Notes: - * - * - If demo trading, `testnet` should be set to false! - * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. - */ +export interface AdvanceEarnAdvanceProductInfoV5 { + category: string; + list: AdvanceEarnAdvanceProductListItemV5[]; +} ⋮---- -/** - * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo - * - * Only the "V5" "market" is supported here. - */ +/** GET /v5/earn/hold-to-earn/product — Hold to Earn airdrop products */ +export type HoldToEarnAirdropProductStatusV5 = + | 'NotStarted' + | 'Online' + | 'Ended'; ⋮---- -/** - * The API group this client should connect to. The V5 market is currently used by default. - * - * Only the "V5" "market" is supported here. - */ +export interface HoldToEarnAirdropProductYieldV5 { + coinName: string; + /** Yesterday's APR for display, e.g. "10%", "0%" */ + apy: string; + personalApy?: string; + multiplier?: string; +} ⋮---- -/** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ +/** Yesterday's APR for display, e.g. "10%", "0%" */ ⋮---- -/** How often to check if the connection is alive */ +export interface HoldToEarnAirdropProductV5 { + coinName: string; + yields: HoldToEarnAirdropProductYieldV5[]; + status: HoldToEarnAirdropProductStatusV5; + announcementUrl: string; + /** Yesterday's avg APR across yield coins */ + apy: string; + personalApy?: string; +} ⋮---- -/** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ +/** Yesterday's avg APR across yield coins */ ⋮---- -/** Delay in milliseconds before respawning the connection */ +export interface HoldToEarnAirdropProductsResultV5 { + products: HoldToEarnAirdropProductV5[]; +} ⋮---- -/** - * Select WebSocket routing with the same region values as REST. Uses a - * dedicated mainnet stream when Bybit documents one for that region. - * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. - */ +/** GET /v5/earn/hold-to-earn/yield-history */ +export interface HoldToEarnAirdropDailyPnlV5 { + coinName: string; + yieldCoinName: string; + effectiveAmount: string; + pnl: string; + apy: string; + createdAt: number; +} ⋮---- -/** - * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. - * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. - * Keep passing it only if a remaining site still requires `x-site-id`. - */ +export interface HoldToEarnAirdropYieldHistoryResultV5 { + nextCursor: string; + airdropDailyPnls: HoldToEarnAirdropDailyPnlV5[]; +} + +================ +File: src/types/response/v5-spot-leverage-token.ts +================ +import { + LeverageTokenStatusV5, + LTOrderStatusV5, + LTOrderTypeV5, +} from '../shared-v5'; ⋮---- -/** - * REST options reused for WebSocket routing. - * Regional and site ID values are retained as fallbacks; prefer the matching - * top-level `apiRegion` and `siteId` options. - */ +export interface LeverageTokenInfoV5 { + ltCoin: string; + ltName: string; + maxPurchase: string; + minPurchase: string; + maxPurchaseDaily: string; + maxRedeem: string; + minRedeem: string; + maxRedeemDaily: string; + purchaseFeeRate: string; + redeemFeeRate: string; + ltStatus: LeverageTokenStatusV5; + fundFee: string; + fundFeeTime: string; + manageFeeRate: string; + manageFeeTime: string; + value: string; + netValue: string; + total: string; +} ⋮---- -/** - * Default: false. - * - * When enabled, any calls to the subscribe method will return a promise. - * Note: internally, subscription requests are sent in batches. This may not behave as expected when - * subscribing to a large number of topics, especially if you are not yet connected when subscribing. - */ +export interface LeveragedTokenMarketResultV5 { + ltCoin: string; + nav: string; + navTime: string; + circulation: string; + basket: string; + leverage: string; +} ⋮---- -/** - * 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. - */ +export interface PurchaseSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + execQty: string; + execAmt: string; + amount: string; + purchaseId: string; + serialNo: string; + valueCoin: string; +} +export interface RedeemSpotLeveragedTokenResultV5 { + ltCoin: string; + ltOrderStatus: LTOrderStatusV5; + quantity: string; + execQty: string; + execAmt: string; + redeemId: string; + serialNo: string; + valueCoin: string; +} ⋮---- -/** - * WS configuration that's always defined, regardless of user configuration - * (usually comes from defaults if there's no user-provided values) - */ -export interface WebsocketClientOptions extends WSClientConfigurableOptions { - market: APIMarket; - pongTimeout: number; - pingInterval: number; - reconnectTimeout: number; - recvWindow: number; - - /** - * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) - */ - requireConnectionReadyConfirmation: boolean; - authPrivateConnectionsOnConnect: boolean; - authPrivateRequests: boolean; - reauthWSAPIOnReconnect: boolean; - +export interface SpotLeveragedTokenOrderHistoryV5 { + ltCoin: string; + orderId: string; + ltOrderType: LTOrderTypeV5; + orderTime: number; + updateTime: number; + ltOrderStatus: LTOrderStatusV5; + fee: string; + amount: string; + value: string; + valueCoin: string; + serialNo: string; +} +⋮---- +export interface VIPMarginDataV5 { + vipCoinList: { + list: { + borrowable: boolean; + collateralRatio: string; + currency: string; + hourlyBorrowRate: string; + liquidationOrder: string; + marginCollateral: boolean; + maxBorrowingAmount: string; + }[]; + vipLevel: string; + }[]; +} +⋮---- +export interface SpotMarginCurrencyDataV5 { + currency: string; + flexibleManualBorrowable: boolean; + minFlexibleManualBorrowQty: string; + flexibleManualBorrowAccuracy: string; + fixedManualBorrowable: boolean; + minFixedManualBorrowQty: string; + fixedManualBorrowAccuracy: string; + fixedInterestRateAccuracy: string; + minFixedInterestRate: string; + maxFixedInterestRate: string; +} +⋮---- +export interface SpotMarginStateV5 { + spotLeverage: string; + spotMarginMode: '1' | '0'; + effectiveLeverage: string; +} +⋮---- +// Spot Margin Trade (UTA) response types +export interface ManualBorrowResultV5 { + coin: string; + amount: string; +} +⋮---- +export interface MaxBorrowableAmountV5 { + currency: string; /** - * Whether to use native WebSocket ping/pong frames for heartbeats + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. */ - useNativeHeartbeats: boolean; + maxLoan: string; } ⋮---- /** - * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) + * Maximum borrowable amount. Can be `"0"` when spot margin mode is off, or + * when no collateral coins are enabled. The app can still show a borrow + * amount after a collateral coin is selected. Undocumented; Bybit API staff + * confirmed this on 15 Oct 2026. Check `getSpotMarginState()`, + * `setCollateralCoin()` (`POST /v5/account/set-collateral-switch`), and + * `toggleSpotMarginTrade()` first. */ ⋮---- -/** - * Whether to use native WebSocket ping/pong frames for heartbeats - */ +export interface PositionTierV5 { + tier: string; + borrowLimit: string; + positionMMR: string; + positionIMR: string; + maxLeverage: string; +} ⋮---- -export type WsEventInternalSrc = 'event' | 'function' | 'frame'; - -================ -File: .gitignore -================ -!.gitkeep -.DS_STORE -*.log -npm-debug.log* -yarn-debug.log* -yarn-error.log* -lerna-debug.log* -report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json -pids -*.pid -*.seed -*.pid.lock -node_modules/ -.npm -.eslintcache -.node_repl_history -*.tgz -.yarn-integrity -.env -.env.test -.cache -lib -dist -doc -bundleReport.html -.history/ -rawReq.ts -localtest.sh -localtest.ts -privaterepotracker -restClientRegex.ts -repomix.sh - -examples/ignored -examples/ts-testnet-private.ts -examples/ts-testnet-trade.ts -examples/ts-testnet.ts -*.pem -.issue* -docs/research -tmp - -================ -File: examples/Rest/rest-v5-custom-url.ts -================ -import { RestClientV5 } from '../../src/index'; +export interface CurrencyPositionTiersV5 { + currency: string; + positionTiersRatioList: PositionTierV5[]; +} ⋮---- -// or -// import { RestClientV5 } from 'bybit-api'; +export interface CoinStateV5 { + currency: string; + spotLeverage: string; +} ⋮---- -/** - * The first parameter of the REST client allows you to pass any configuration parameters supported by the SDK. - * - * These include API keys, if you wish to use private endpoints, but also expose other features such as - * setting a custom base URL (e.g. for Turkish users). - * - * Refer to the API documentation for a complete list of domains: https://bybit-exchange.github.io/docs/v5/guide#authentication - */ +export interface AvailableAmountToRepayV5 { + currency: string; + lossLessRepaymentAmount: string; +} ⋮---- -/** - * You can pass a completely custom base URL, - * e.g. if you're trying to use a domain that hasn't been added yet (please let us know) - */ -// baseUrl: 'https://api5.bybit.com', -// -// -/** - * - * Predefined API regions are available through the `apiRegion` property. - * Choose the region where your Bybit account is registered: - * +export interface ManualRepayWithoutConversionResultV5 { + /** + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed */ -// -// -// default: routes to api.bybit.com -// apiRegion: 'default', -// -// -// bytick: routes to api.bytick.com -// apiRegion: 'bytick', -// -// -// NL: Bybit removed api.bybit.nl from Integration Guidance on 2026-09-22. apiRegion no longer includes NL. -// -// -// TK: routes to api.bybit.tr (for Turkey users) -// apiRegion: 'TK', -// -// -// KZ: routes to api.bybit.kz (for Kazakhstan users) -// apiRegion: 'KZ', -// -// -// HK: routes to api.spark-fintech.com and adds x-refer-site-id: HKG -// Testnet routes to api-testnet.spark-fintech.com -// apiRegion: 'HK', -// -// -// GE: routes to api.bybitgeorgia.ge (for Georgia users) -// apiRegion: 'GE', -// -// -// UAE: routes to api.bybit.ae (for United Arab Emirates users) -// apiRegion: 'UAE', -// -// -// EU: routes to api.bybit.eu (for EU and EEA users) -// apiRegion: 'EU', -// -// -// ID: routes to api.bybit.id (for Indonesian users) -// apiRegion: 'ID', -// -// -// JP: routes to api.manepa.jp (for Japan users) -// Testnet routes to api-testnet.manepa.jp -// apiRegion: 'JP', -// -// + resultStatus: 'P' | 'SU' | 'FA'; +} +⋮---- /** - * Brazil and Argentina international accounts use the global API domain - * with an x-site-id header. Choose the site ID for your account: + * Result status: + * - P: Processing + * - SU: Success + * - FA: Failed */ -// siteId: 'BRA_BTL', -// siteId: 'ARG_BTL', - -================ -File: src/types/response/v5-asset.ts -================ -import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5'; ⋮---- -export interface CoinExchangeRecordV5 { - fromCoin: string; - fromAmount: string; - toCoin: string; - toAmount: string; - exchangeRate: string; - createdTime: string; - exchangeTxId: string; +export interface AutoRepayModeItemV5 { + currency: string; // Coin name, uppercase only + autoRepayMode: '0' | '1'; // 0: Off, 1: On } ⋮---- -export interface DeliveryRecordV5 { - deliveryTime: number; - symbol: string; - side: OrderSideV5; - position: string; - deliveryPrice: string; - strike: string; - fee: string; - deliveryRpl: string; - entryPrice: string; +currency: string; // Coin name, uppercase only +autoRepayMode: '0' | '1'; // 0: Off, 1: On +⋮---- +export interface AutoRepayModeResultV5 { + data: AutoRepayModeItemV5[]; } ⋮---- -export interface SettlementRecordV5 { - symbol: string; - side: string; - size: number; - sessionAvgPrice: string; - markPrice: string; - realisedPnl: string; - createdTime: string; +export interface TradeAutoRepayResultV5 { + /** Saved switch state. 1: enabled; 0: disabled */ + autoRepay: '0' | '1'; } ⋮---- -export interface AssetInfoAssetV5 { - coin: string; - frozen: string; - free: string; - withdraw: string; +/** Saved switch state. 1: enabled; 0: disabled */ +⋮---- +export interface SpotMarginLiabilityInfoV5 { + currency: string; + totalBorrowAmount: string; + fixedBorrowAmount: string; + flexibleBorrowAmount: string; + spotTotalBorrow: string; + derivativesBorrow: string; +} +⋮---- +export interface FixedRateBorrowResultV5 { + orderId: string; +} +⋮---- +export interface FixedRateBorrowOrderInfoV5 { + annualRate: string; + orderId: string; + orderTime: string; + filledQty: string; + orderQty: string; + orderCurrency: string; + state: number; + term: number; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; +} +⋮---- +export interface FixedRateBorrowContractInfoV5 { + annualRate: string; + borrowCurrency: string; + borrowTime: string; + interestPaid: string; + loanId: string; + orderId: string; + repaymentTime: string; + residualPenaltyInterest: string; + residualPrincipal: string; + status: number; + term: string; + repayType: string; + strategyType: 'PARTIAL' | 'FULL'; } ⋮---- -export interface AssetInfoV5 { - status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; - assets: AssetInfoAssetV5[]; +export interface FixedRateBorrowQuoteV5 { + orderCurrency: string; + term: number; + annualRate: string; + qty: string; } ⋮---- -export interface CoinBalanceV5 { - coin: string; - walletBalance: string; - transferBalance: string; - bonus?: string; +export interface FixedRateBorrowInterestAccruedV5 { + refId: string; + currency: string; + orderId: string; + loanAmt: string; + interest: string; + interestRate: string; + ts: string; } ⋮---- -export interface AllCoinsBalanceV5 { - accountType: AccountTypeV5; - memberId?: string; - balance: CoinBalanceV5[]; +export interface FlexibleAvailableInventoryV5 { + currency: string; + availableInventory: string; + updateTime: string; } ⋮---- -export interface AccountCoinBalanceV5 { - accountType: AccountTypeV5; - bizType: number; - accountId: string; - memberId: string; - balance: { - coin: string; - walletBalance: string; - transferBalance: string; - bonus: string; - transferSafeAmount: string; - ltvTransferSafeAmount: string; - }; +export interface FixedRateAvailableInventoryV5 { + currency: string; + term: string; + annualRate: string; + availableInventory: string; + updateTime: string; } + +================ +File: src/types/websockets/ws-events.ts +================ +import WebSocket from 'isomorphic-ws'; ⋮---- -export interface InternalTransferRecordV5 { - transferId: string; - coin: string; - amount: string; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; - timestamp: string; - status: string; -} +import { + RFQItemV5, + RFQPublicTradeV5, + RFQQuoteItemV5, + RFQTradeV5, +} from '../response/v5-rfq'; +import { + CategoryV5, + ExecTypeV5, + OCOTriggerTypeV5, + OrderCancelTypeV5, + OrderCreateTypeV5, + OrderRejectReasonV5, + OrderSideV5, + OrderSMPTypeV5, + OrderStatusV5, + OrderTimeInForceV5, + OrderTriggerByV5, + OrderTypeV5, + PositionIdx, + PositionSideV5, + PositionStatusV5, + StopOrderTypeV5, + SystemStatusItemV5, + TPSLModeV5, + TradeModeV5, +} from '../shared-v5'; +import { WsKey } from './ws-general'; ⋮---- -export interface UniversalTransferRecordV5 { - transferId: string; - coin: string; - amount: string; - fromMemberId: string; - toMemberId: string; - fromAccountType: AccountTypeV5; - toAccountType: AccountTypeV5; - timestamp: string; - status: string; - withdrawReqId?: string; - depositReqId?: string; +export interface MessageEventLike { + target: WebSocket; + type: 'message'; + data: string; } ⋮---- -export interface AllowedDepositCoinInfoV5 { - coin: string; - chain: string; - coinShowName: string; - chainType: string; - blockConfirmNumber: number; - minDepositAmount: string; -} +export function isMessageEvent(msg: unknown): msg is MessageEventLike ⋮---- -export interface DepositRecordV5 { - id: string; - coin: string; - chain: string; - amount: string; - txID: string; - status: number; - toAddress: string; - tag: string; - depositFee: string; - successAt: string; - confirmations: string; - txIndex: string; - blockHash: string; - batchReleaseLimit: string; - depositType: string; - fromAddress: string; - travelRuleStatus?: string; +export interface WSPublicTopicEventV5 { + id?: string; + topic: TTopic; + type: TType; + /** Cross sequence */ + cs?: number; + /** Event timestamp */ + ts: number; + data: TData; + /** + * matching engine timestamp (correlated with T from public trade channel) + */ + cts: number; + /** + * Internal reference, can be used to determine if this is spot/linear/inverse/etc + */ + wsKey: WsKey; } ⋮---- -export interface SubmitDepositOriginatorInfoResultV5 { - travelRuleStatus: number; -} +/** Cross sequence */ ⋮---- -export interface InternalDepositRecordV5 { - id: string; - type: 1; - coin: string; - amount: string; - status: 1 | 2 | 3; - address: string; - createdTime: string; - txID: string; - complianceStatus?: string; -} +/** Event timestamp */ ⋮---- -export interface DepositAddressChainV5 { - chainType: string; - addressDeposit: string; - tagDeposit: string; - chain: string; - batchReleaseLimit: string; - contractAddress: string; +/** + * matching engine timestamp (correlated with T from public trade channel) + */ +⋮---- +/** + * Internal reference, can be used to determine if this is spot/linear/inverse/etc + */ +⋮---- +export interface WSPrivateTopicEventV5 { + id?: string; + topic: TTopic; + creationTime: number; + data: TData; + wsKey: WsKey; } ⋮---- -export interface DepositAddressResultV5 { - coin: string; - chains: DepositAddressChainV5[]; +export interface WSOrderbookV5 { + /** Symbol */ + s: string; + /** [price, qty][] */ + b: [string, string][]; + /** [price, qty][] */ + a: [string, string][]; + /** Update ID */ + u: number; + /** Cross sequence */ + seq: number; } ⋮---- -export interface CoinInfoV5 { - name: string; - coin: string; - /** @deprecated Use `chains[].withdrawMax` instead */ - remainAmount: string; - chains: { - chain: string; - chainType: string; - confirmation: string; - withdrawFee: string; - depositMin: string; - withdrawMin: string; - minAccuracy: string; - chainDeposit: string; - chainWithdraw: string; - withdrawPercentageFee: string; - contractAddress: string; - safeConfirmNumber: string; - /** Max withdraw amount per transaction per chain. `-1` means no limit */ - withdrawMax: string; - }[]; +/** Symbol */ +⋮---- +/** [price, qty][] */ +⋮---- +/** [price, qty][] */ +⋮---- +/** Update ID */ +⋮---- +/** Cross sequence */ +⋮---- +export type WSOrderbookEventV5 = WSPublicTopicEventV5< + string, + 'delta' | 'snapshot', + WSOrderbookV5 +>; +⋮---- +export interface WSTradeV5 { + T: number; + s: string; + S: OrderSideV5; + v: string; + p: string; + L?: string; + i: string; + BT: boolean; + RPI?: boolean; + mP?: string; + iP?: string; + mIv?: string; + iv?: string; } ⋮---- -/** @deprecated Use `chains[].withdrawMax` instead */ +export type WSTradeEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSTradeV5[] +>; +⋮---- +export interface WSEventOrderbookV5 { + s: string; + r: [string, string][]; + u: number; + seq: number; +} ⋮---- -/** Max withdraw amount per transaction per chain. `-1` means no limit */ +export type WSEventOrderbookEventV5 = WSPublicTopicEventV5< + string, + 'delta' | 'snapshot', + WSEventOrderbookV5 +>; ⋮---- -export interface WithdrawalRecordV5 { - withdrawId: string; - txID: string; - withdrawType: WithdrawalTypeV5; - coin: string; - chain: string; - amount: string; - withdrawFee: string; - status: string; - toAddress: string; - tag: string; - createTime: string; - updateTime: string; +export interface WSEventPublicTradeV5 { + T: number; + s: string; + r: string; + a: string; + i: string; + seq: number; } ⋮---- -export interface WithdrawalAddressV5 { - coin: string; - chain: string; - address: string; - tag: string; - remark: string; - status: number; - addressType: number; - verified: number; - createdAt: string; -} +export type WSEventPublicTradeEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSEventPublicTradeV5[] +>; ⋮---- -export interface WithdrawableAccountSliceV5 { - coin: string; - withdrawableAmount: string; - availableBalance: string; +/** + * WSTickerV5 is the data structure for the "linear" ticker channel + * */ +export interface WSTickerV5 { + symbol: string; + tickDirection: string; + price24hPcnt: string; + lastPrice: string; + prevPrice24h: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice1h: string; + markPrice: string; + indexPrice: string; + openInterest: string; + openInterestValue: string; + singleOpenInterest?: string; + singleOpenInterestValue?: string; + turnover24h: string; + volume24h: string; + nextFundingTime: string; + fundingRate: string; + bid1Price: string; + bid1Size: string; + ask1Price: string; + ask1Size: string; + deliveryTime?: string; + basisRate?: string; + deliveryFeeRate?: string; + predictedDeliveryPrice?: string; + preOpenPrice?: string; + preQty?: string; + curPreListingPhase?: string; + fundingIntervalHour?: string; + fundingCap?: string; + basisRateYear?: string; } ⋮---- -/** - * GET /v5/asset/withdraw/withdrawable-amount. Only keys with data are returned - * (e.g. UTA, FUND, EARN; EARN when the coin can be withdrawn from Earn; SPOT if present). - */ -export interface WithdrawableAmountV5 { - limitAmountUsd: string; - withdrawableAmount: { - SPOT?: WithdrawableAccountSliceV5; - FUND?: WithdrawableAccountSliceV5; - UTA?: WithdrawableAccountSliceV5; - EARN?: WithdrawableAccountSliceV5; - }; +export interface WSTickerOptionV5 { + symbol: string; + bidPrice: string; + bidSize: string; + bidIv: string; + askPrice: string; + askSize: string; + askIv: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + markPrice: string; + indexPrice: string; + markPriceIv: string; + underlyingPrice: string; + openInterest: string; + turnover24h: string; + volume24h: string; + totalVolume: string; + totalTurnover: string; + delta: string; + gamma: string; + vega: string; + theta: string; + predictedDeliveryPrice: string; + change24h: string; } ⋮---- -export interface VaspEntityV5 { - vaspEntityId: string; - vaspName: string; +export interface WSTickerSpotV5 { + symbol: string; + lastPrice: string; + highPrice24h: string; + lowPrice24h: string; + prevPrice24h: string; + volume24h: string; + turnover24h: string; + price24hPcnt: string; + usdIndexPrice: string; } ⋮---- -export interface ConvertCoinSpecV5 { - coin: string; - fullName: string; - icon: string; - iconNight: string; - accuracyLength: number; - coinType: string; - balance: string; - uBalance: string; - singleFromMinLimit: string; - singleFromMaxLimit: string; - disableFrom: boolean; - disableTo: boolean; - timePeriod: number; - singleToMinLimit: string; - singleToMaxLimit: string; - dailyFromMinLimit: string; - dailyFromMaxLimit: string; - dailyToMinLimit: string; - dailyToMaxLimit: string; +export type WSTickerEventV5 = WSPublicTopicEventV5< + string, + 'snapshot' | 'delta', + WSTickerV5 | WSTickerOptionV5 | WSTickerSpotV5 +>; +⋮---- +export interface WSKlineV5 { + start: number; + end: number; + interval: string; + open: string; + close: string; + high: string; + low: string; + volume: string; + turnover: string; + confirm: boolean; + timestamp: number; } ⋮---- -export interface ConvertQuoteV5 { - quoteTxId: string; - exchangeRate: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - expiredTime: string; - requestId: string; - extTaxAndFee: string[]; +export type WSKlineEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSKlineV5[] +>; +⋮---- +export interface WSLiquidationV5 { + T: number; + s: string; + S: OrderSideV5; + v: string; + p: string; } ⋮---- -export interface ConvertStatusV5 { - accountType: string; - exchangeTxId: string; - userId: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; - extInfo: { paramType: string; paramValue: string }; - convertRate: string; - createdAt: string; +export type WSLiquidationEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSLiquidationV5[] +>; +⋮---- +export interface WSPositionV5 { + category: string; + symbol: string; + side: PositionSideV5; + size: string; + positionIdx: PositionIdx; + tradeMode: TradeModeV5; + positionValue: string; + riskId: number; + riskLimitValue: string; + entryPrice: string; + markPrice: string; + leverage: string; + breakEvenPrice?: string; // Break even price, only for linear & inverse + positionBalance: string; + autoAddMargin: number; + positionMM: string; + positionIM: string; + positionIMByMp: string; + positionMMByMp: string; + liqPrice: string; + bustPrice: string; + tpslMode: string; + takeProfit: string; + stopLoss: string; + trailingStop: string; + unrealisedPnl: string; + curRealisedPnl: string; + sessionAvgPrice: string; + delta: string; + gamma: string; + vega: string; + theta: string; + cumRealisedPnl: string; + positionStatus: PositionStatusV5; + adlRankIndicator: number; + isReduceOnly: boolean; + mmrSysUpdatedTime: string; + leverageSysUpdatedTime: string; + createdTime: string; + updatedTime: string; + /** Position open timestamp (ms). Default `0` when not set. */ + openTime: number; + seq: number; + netDeltaRatio?: string; } ⋮---- -export interface ConvertHistoryRecordV5 { - accountType: string; - exchangeTxId: string; - userId: string; - fromCoin: string; - fromCoinType: string; - toCoin: string; - toCoinType: string; - fromAmount: string; - toAmount: string; - exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; - extInfo: { paramType: string; paramValue: string }; - convertRate: string; - createdAt: string; -} +breakEvenPrice?: string; // Break even price, only for linear & inverse ⋮---- -export interface SmallBalanceCoinV5 { - fromCoin: string; // Source currency - supportConvert: 1 | 2; // 1: support, 2: not supported - availableBalance: string; // Available balance - baseValue: string; // USDT equivalent value - toAmount: string; // Reserved field - exchangeRate: string; // Reserved field - feeInfo: null; // Reserved field - taxFeeInfo: null; // Reserved field +/** Position open timestamp (ms). Default `0` when not set. */ +⋮---- +export type WSPositionEventV5 = WSPrivateTopicEventV5< + 'position', + WSPositionV5[] +>; +⋮---- +export interface WSEventPositionV5 { + symbol: string; + baseCoin: string; + settleCoin: string; + side: string; + ecContractType: string; + ecDirection: string; + avgPayoutRatio: string; + positionValue: string; + ecSettleTime: string; + cumClosedPnl: string; + createdTime: string; + updatedTime: string; + seq: number; } ⋮---- -fromCoin: string; // Source currency -supportConvert: 1 | 2; // 1: support, 2: not supported -availableBalance: string; // Available balance -baseValue: string; // USDT equivalent value -toAmount: string; // Reserved field -exchangeRate: string; // Reserved field -feeInfo: null; // Reserved field -taxFeeInfo: null; // Reserved field +export type WSEventPositionEventV5 = WSPrivateTopicEventV5< + 'position.event', + WSEventPositionV5[] +>; ⋮---- -export interface SmallBalanceListV5 { - smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info - supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) +export interface WSAccountOrderV5 { + category: CategoryV5; + orderId: string; + orderLinkId: string; + parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) + isLeverage: string; + blockTradeId: string; + symbol: string; + price: string; + qty: string; + side: OrderSideV5; + positionIdx: PositionIdx; + orderStatus: OrderStatusV5; + createType: OrderCreateTypeV5; + cancelType: OrderCancelTypeV5; + rejectReason?: OrderRejectReasonV5; + avgPrice?: string; + leavesQty?: string; + leavesValue?: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + closedPnl: string; + feeCurrency: string; + timeInForce: OrderTimeInForceV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + ocoTriggerType?: OCOTriggerTypeV5; + orderIv: string; + marketUnit?: 'baseCoin' | 'quoteCoin'; + triggerPrice: string; + takeProfit: string; + stopLoss: string; + tpslMode?: TPSLModeV5; + tpLimitPrice?: string; + slLimitPrice?: string; + tpTriggerBy: string; + slTriggerBy: string; + triggerDirection: number; + triggerBy: OrderTriggerByV5; + lastPriceOnCreated: string; + reduceOnly: boolean; + closeOnTrigger: boolean; + placeType: string; + smpType: OrderSMPTypeV5; + smpGroup: string; + smpOrderId: string; + createdTime: string; + updatedTime: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency + rpiTakerAccess?: boolean; + rpiMatchedQty?: string; } ⋮---- -smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info -supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) +parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) ⋮---- -export interface FiatCoinInfoV5 { - coin: string; // Fiat coin code - fullName: string; // Fiat full coin name - icon: string; // Coin icon url - iconNight: string; // Coin icon url (dark mode) - precision: number; // Fiat precision - disable: boolean; // true: the coin is disabled, false: the coin is allowed - singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction - singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +⋮---- +export type WSAccountOrderEventV5 = WSPrivateTopicEventV5< + 'order', + WSAccountOrderV5[] +>; +⋮---- +export interface WSEventOrderV5 { + category: 'event' | string; + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: number; + side: string; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + orderStatus: string; + ecContractType: string; + ecDirection: string; + ecDurationWindow: number; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecOrderValue: string; + ecIndexPrice: string; + ecSettleTime: string; + payoutRatio: string; + orderAvgPayoutRatio: string; + cumExecValue: string; + cumExecFee: string; + leavesValue: string; + cumPayout: string; + createType: number; + cancelType: string; + rejectReason: string; + extraFees: unknown[]; + transTime: string; + createdTime: string; + updatedTime: string; } ⋮---- -coin: string; // Fiat coin code -fullName: string; // Fiat full coin name -icon: string; // Coin icon url -iconNight: string; // Coin icon url (dark mode) -precision: number; // Fiat precision -disable: boolean; // true: the coin is disabled, false: the coin is allowed -singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction -singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction +export type WSEventOrderEventV5 = WSPrivateTopicEventV5< + 'order' | 'order.event', + WSEventOrderV5[] +>; ⋮---- -export interface CryptoCoinInfoV5 { - coin: string; // Crypto coin code - fullName: string; // Crypto full coin name - icon: string; // Coin icon url - iconNight: string; // Coin icon url (dark mode) - precision: number; // Crypto precision - disable: boolean; // true: the coin is disabled, false: the coin is allowed - singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction - singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction +export interface WSExecutionV5 { + category: CategoryV5; + symbol: string; + isLeverage: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + createType: OrderCreateTypeV5; + orderType: OrderTypeV5; + stopOrderType: StopOrderTypeV5; + execFee: string; + feeCurrency: string; // Trading fee currency + execId: string; + execPrice: string; + execQty: string; + execPnl: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; + tradeIv: string; + markIv: string; + markPrice: string; + indexPrice: string; + underlyingPrice: string; + blockTradeId: string; + closedSize: string; + extraFees: string; + seq: number; + marketUnit: string; } ⋮---- -coin: string; // Crypto coin code -fullName: string; // Crypto full coin name -icon: string; // Coin icon url -iconNight: string; // Coin icon url (dark mode) -precision: number; // Crypto precision -disable: boolean; // true: the coin is disabled, false: the coin is allowed -singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction -singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction +feeCurrency: string; // Trading fee currency ⋮---- -export interface FiatTradingPairListV5 { - fiats: FiatCoinInfoV5[]; // Fiat coin list - cryptos: CryptoCoinInfoV5[]; // Crypto coin list +export type WSExecutionEventV5 = WSPrivateTopicEventV5< + 'execution', + WSExecutionV5[] +>; +⋮---- +export interface WSEventExecutionV5 { + category: 'event' | string; + transId: string; + execId: string; + orderId: string; + orderLinkId: string; + symbol: string; + symbolId: number; + baseCoin: string; + quoteCoin: string; + settleCoin: string; + side: string; + feeCoin: string; + execType: string; + execPrice: string; + execValue: string; + execFee: string; + execFeeRate: string; + orderPrice: string; + ecContractType: number | string; + ecDirection: number | string; + ecDurationWindow: number; + ecTargetPrice: string; + ecLowerBound: string; + ecUpperBound: string; + ecOrderValue: string; + ecIndexPrice?: string; + ecPayout: string; + entryPrice: string; + settlePrice: string; + grossPayoutRatio: string; + sessionRpl: string; + transTime: string; + settleTimeMs: string; + crossSeq: string; + timeInForce: string; + extraFees: unknown[]; } ⋮---- -fiats: FiatCoinInfoV5[]; // Fiat coin list -cryptos: CryptoCoinInfoV5[]; // Crypto coin list +export type WSEventExecutionEventV5 = WSPrivateTopicEventV5< + 'execution' | 'execution.event', + WSEventExecutionV5[] +>; ⋮---- -export interface FundingAccountTransactionRecordV5 { - memberId: string; - currency: string; - ioDirection: string; - txnAmt: string; - afterAmt: string; - createTime: string; - showBusiType: string; - showBusiTypeEn: string; - description: string; - descriptionEn: string; - currcCursor?: string; +export interface WSExecutionFastV5 { + category: CategoryV5; + symbol: string; + execId: string; + execPrice: string; + execQty: string; + orderId: string; + isMaker: boolean; + orderLinkId: string; + side: OrderSideV5; + execTime: string; + seq: number; + liquidity?: string; } ⋮---- -/** When accountType=Alpha and category is farm, under `coinDetail` in sub-categories. */ -export interface AssetOverviewCoinExtMapV5 { - priceUpper?: string; - priceLower?: string; - equityUnit?: string; -} +export type WSExecutionFastEventV5 = WSPrivateTopicEventV5< + 'execution.fast', + WSExecutionFastV5[] +>; ⋮---- -export interface AssetOverviewCoinDetailV5 { +export interface WSCoinV5 { coin: string; equity: string; - extMap?: AssetOverviewCoinExtMapV5; -} -⋮---- -export interface AssetOverviewCategoryV5 { - category: string; - equity: string; - coinDetail: AssetOverviewCoinDetailV5[]; + usdValue: string; + walletBalance: string; + free?: string; + locked: string; + spotHedgingQty: string; + borrowAmount: string; + availableToBorrow: string; + availableToWithdraw: string; + accruedInterest: string; + totalOrderIM: string; + totalPositionIM: string; + totalPositionMM: string; + unrealisedPnl: string; + cumRealisedPnl: string; + bonus: string; + collateralSwitch: boolean; + marginCollateral: boolean; + spotBorrow: string; + colRes?: string; } ⋮---- -export interface AssetOverviewAccountItemV5 { +export interface WSWalletV5 { accountType: string; + accountLTV: string; + accountIMRate: string; + accountMMRate: string; + accountIMRateByMp: string; + accountMMRateByMp: string; + totalInitialMarginByMp: string; + totalMaintenanceMarginByMp: string; totalEquity: string; - valuationCurrency: string; - snapshotTime: string; - coinDetail?: AssetOverviewCoinDetailV5[]; - categories?: AssetOverviewCategoryV5[]; -} -⋮---- -export interface AssetOverviewResultV5 { - totalEquity: string; - list: AssetOverviewAccountItemV5[]; + totalWalletBalance: string; + totalMarginBalance: string; + totalAvailableBalance: string; + totalPerpUPL: string; + totalInitialMargin: string; + totalMaintenanceMargin: string; + coin: WSCoinV5[]; } ⋮---- -// --- GET /v5/asset/portfolio-margin (portfolio margin P&L ranges) --- +export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; ⋮---- -export interface PortfolioMarginWalletV5 { - equity: string; - cashBalance: string; - marginBalance: string; - availableBalance: string; - accountIM: string; - accountMM: string; - accountMMRate: string; - accountIMRate: string; +export interface WSGreeksV5 { + baseCoin: string; + totalDelta: string; + totalGamma: string; + totalVega: string; + totalTheta: string; } ⋮---- -export interface PortfolioMarginPnlRangePointV5 { - priceScale: string; - pnls: string[]; -} +export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; ⋮---- -export interface PortfolioMarginContractBucketPnlV5 { - pnlRanges: PortfolioMarginPnlRangePointV5[]; +export interface WSSpreadOrderV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + parentOrderId: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderStatus: OrderStatusV5; + cancelType: OrderCancelTypeV5; + rejectReason: OrderRejectReasonV5; + timeInForce: OrderTimeInForceV5; + price: string; + qty: string; + avgPrice: string; + leavesQty: string; + leavesValue: string; + cumExecQty: string; + cumExecValue: string; + cumExecFee: string; + orderType: OrderTypeV5; + isLeverage: string; + createdTime: string; + updatedTime: string; + feeCurrency: string; + createType: OrderCreateTypeV5; + closedPnl: string; + cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency } ⋮---- -export interface PortfolioMarginTotalPnlRangesV5 { - ALL?: PortfolioMarginContractBucketPnlV5; - PERPETUAL?: PortfolioMarginContractBucketPnlV5; - OPTION?: PortfolioMarginContractBucketPnlV5; -} +cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency ⋮---- -export interface PortfolioMarginPerpPositionPnlV5 { - symbolName: string; - position: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - sessionAvgPrice: string; +export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< + 'spread.order', + WSSpreadOrderV5[] +>; +⋮---- +export interface WSSpreadExecutionV5 { + category: 'combination' | 'spot_leg' | 'future_leg'; + symbol: string; + isLeverage: string; + orderId: string; + orderLinkId: string; + side: OrderSideV5; + orderPrice: string; + orderQty: string; + leavesQty: string; + createType: OrderCreateTypeV5; + orderType: OrderTypeV5; + execFee: string; + execFeeV2: string; + feeCurrency: string; // Trading fee currency + parentExecId: string; + execId: string; + execPrice: string; + execQty: string; + execPnl: string; + execType: ExecTypeV5; + execValue: string; + execTime: string; + isMaker: boolean; + feeRate: string; markPrice: string; - orderSize: string; - contractType: number; - settleCoin: string; - symbolAlias?: string; + closedSize: string; + seq: number; } ⋮---- -export interface PortfolioMarginOptionPositionPnlV5 { - symbolName: string; - position: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - sessionAvgPrice: string; - markPrice: string; - orderSize: string; - contractType: number; - settleCoin: string; +feeCurrency: string; // Trading fee currency +⋮---- +export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< + 'spread.execution', + WSSpreadExecutionV5[] +>; +⋮---- +export interface WSInsuranceV5 { + coin: string; + symbols: string; + balance: string; + updateTime: string; } ⋮---- -export interface PortfolioMarginOptionExpiryPnlV5 { - expiryDateRepresentation: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; - optionPositionPnlRanges: PortfolioMarginOptionPositionPnlV5[]; +export type WSInsuranceEventV5 = WSPublicTopicEventV5< + 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', + 'snapshot' | 'delta', + WSInsuranceV5[] +>; +⋮---- +export interface WSPriceLimitV5 { + symbol: string; + buyLmt: string; + sellLmt: string; } ⋮---- -export interface PortfolioMarginContingencyV5 { - optionContingency: string; - futureDeltaContingency: string; - optionVegaContingency: string; - contingencyComponents: string; - usdtUsdcContingency: string; - futureContingency: string; -} +export type WSPriceLimitEventV5 = WSPublicTopicEventV5< + string, + 'snapshot', + WSPriceLimitV5 +>; ⋮---- -export interface PortfolioMarginAssetBlockV5 { - coin: string; - assetIM: string; - assetMM: string; +export interface WSADLAlertV5 { + c: string; // Token of the insurance pool + s: string; // Trading pair name + b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) + mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours + i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL + pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped + adl_tt: string; // Trigger threshold for contract PnL drawdown ADL + adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL } ⋮---- -export interface PortfolioMarginSpotHedgeInfoV5 { - hedgeSpotSize: string; - walletBalance: string; - usdIndexPrice: string; - pnlRanges: PortfolioMarginPnlRangePointV5[]; -} +c: string; // Token of the insurance pool +s: string; // Trading pair name +b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) +mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours +i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL +pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped +adl_tt: string; // Trigger threshold for contract PnL drawdown ADL +adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL ⋮---- -export interface PortfolioMarginByBaseCoinV5 { - baseCoin: string; - totalPnlRanges: PortfolioMarginTotalPnlRangesV5; - perpPositionPnlRanges: PortfolioMarginPerpPositionPnlV5[]; - optionExpiryDatePnlRanges: PortfolioMarginOptionExpiryPnlV5[]; - contingency: PortfolioMarginContingencyV5; - asset: PortfolioMarginAssetBlockV5; - maxLossPriceMove: string; - maxLossIvShock: string; - totalClosePzFee: string; - spotHedgeInfo: PortfolioMarginSpotHedgeInfoV5; - maxLossIvShockList: string[]; -} +export type WSADLAlertEventV5 = WSPublicTopicEventV5< + 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', + 'snapshot', + WSADLAlertV5[] +>; ⋮---- -export interface PortfolioMarginInfoResultV5 { - wallet: PortfolioMarginWalletV5; - assetPnlRange: PortfolioMarginByBaseCoinV5[]; -} +export type WSSystemStatusEventV5 = WSPublicTopicEventV5< + 'system.status', + 'snapshot', + SystemStatusItemV5[] +>; ⋮---- -// --- GET /v5/asset/total-members-assets --- +/** + * RFQ WebSocket Events + */ ⋮---- -export interface TotalMembersAccountBreakdownItemV5 { - type: string; - origb: string; - quoteb: string; - stat: number; -} +/** + * RFQ Inquiry Channel + * Private push for RFQ inquiries sent or received by the user + * Topics: rfq.open.rfqs, rfq.site.rfqs + */ +export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< + 'rfq.open.rfqs' | 'rfq.site.rfqs', + RFQItemV5[] +>; ⋮---- -export interface TotalMembersMemberEntryV5 { - uid: number; - isM?: boolean; - type?: number; - stat: number; - origb: string; - quoteb?: string; - items: TotalMembersAccountBreakdownItemV5[]; -} +/** + * RFQ Quote Channel + * Private push for quotes sent or received by the user + * Topics: rfq.open.quotes, rfq.site.quotes + */ +export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< + 'rfq.open.quotes' | 'rfq.site.quotes', + RFQQuoteItemV5[] +>; ⋮---- -export interface TotalMembersAssetsResultV5 { - total: string; - quoteTotal: string; - stat: number; - list: TotalMembersMemberEntryV5[]; -} +/** + * RFQ Trade Channel + * Private push for block trades executed by the user + * Topics: rfq.open.trades, rfq.site.trades + */ +export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< + 'rfq.open.trades' | 'rfq.site.trades', + RFQTradeV5[] +>; +⋮---- +/** + * RFQ Public Trade Channel + * Public push for all block trades + * Topics: rfq.open.public.trades, rfq.site.public.trades + */ +export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< + 'rfq.open.public.trades' | 'rfq.site.public.trades', + 'snapshot', + RFQPublicTradeV5[] +>; ================ -File: src/types/response/v5-earn.ts +File: src/types/websockets/ws-general.ts ================ -export interface EarnInterestCardV5 { - awardId: number; - specCode: string; - coin: string; - apy: string; - duration: number; - claimedAt: number; - expireAt: number; - usedAt: number; - status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; - currentPnl: string; - limitPnl: string; - positionEffectiveAmount: string; - productId: number; - category: 'FlexibleSaving' | 'DualAssets' | string; -} +import { AxiosRequestConfig } from 'axios'; +import type { ClientRequestArgs } from 'http'; +import WebSocket from 'isomorphic-ws'; ⋮---- -export interface EarnAwardCardV5 { - awardId: number; - specCode: string; - claimedAt: number; - usedAt: number; - expireAt: number; - status: 'InUse' | 'NotUse' | 'Expired' | 'AlreadyUsed' | string; - amount: string; - limitPnlPercentage: string; - baseCoin: string; - quoteCoin: string; - direction: 1 | 2; - category: 'FlexibleSaving' | 'DualAssets' | string; -} +import { APIRegion, RestClientOptions, WS_KEY_MAP } from '../../util'; ⋮---- -export interface EarnCouponListResultV5 { - interestCards: EarnInterestCardV5[]; - awardCards: EarnAwardCardV5[]; -} +/** For spot markets, spotV3 is recommended */ +export type APIMarket = 'v5'; ⋮---- -export interface FlexibleSavingAutoSavingsCoinV5 { - coin: string; - isSelected: boolean; - maxStakingAmount: string; - apr: string; -} +// Same as inverse futures +export type WsPublicInverseTopic = + | 'orderBookL2_25' + | 'orderBookL2_200' + | 'trade' + | 'insurance' + | 'instrument_info' + | 'klineV2'; ⋮---- -export interface FlexibleSavingAutoSavingsV5 { - selectedAll: boolean; - coins: FlexibleSavingAutoSavingsCoinV5[]; -} +export type WsPublicUSDTPerpTopic = + | 'orderBookL2_25' + | 'orderBookL2_200' + | 'trade' + | 'insurance' + | 'instrument_info' + | 'kline'; ⋮---- -export interface EarnProductV5 { - category: string; - estimateApr: string; - coin: string; - minStakeAmount: string; - maxStakeAmount: string; - precision: string; - productId: string; - status: 'Available' | 'NotAvailable'; -} +export type WsPublicSpotV1Topic = + | 'trade' + | 'realtimes' + | 'kline' + | 'depth' + | 'mergedDepth' + | 'diffDepth'; ⋮---- -export interface EarnOrderHistoryV5 { - coin: string; - orderValue: string; - orderType: 'Redeem' | 'Stake'; - orderId: string; - orderLinkId: string; - status: 'Success' | 'Fail' | 'Pending'; - createdAt: string; - productId: string; - updatedAt: string; - swapOrderValue: string; - estimateRedeemTime: string; - estimateStakeTime: string; -} +export type WsPublicSpotV2Topic = + | 'depth' + | 'kline' + | 'trade' + | 'bookTicker' + | 'realtimes'; ⋮---- -export interface EarnPositionFreezeDetailV5 { - amount: string; - description: string; -} +export type WsPublicTopics = + | WsPublicInverseTopic + | WsPublicUSDTPerpTopic + | WsPublicSpotV1Topic + | WsPublicSpotV2Topic + | string; +⋮---- +// Same as inverse futures +export type WsPrivateInverseTopic = + | 'position' + | 'execution' + | 'order' + | 'stop_order'; +⋮---- +export type WsPrivateUSDTPerpTopic = + | 'position' + | 'execution' + | 'order' + | 'stop_order' + | 'wallet'; ⋮---- -export interface EarnPositionV5 { - coin: string; - productId: string; - amount: string; - totalPnl: string; - claimableYield: string; - id?: string; - status?: string; - orderId?: string; - estimateRedeemTime?: string; - estimateStakeTime?: string; - estimateInterestCalculationTime?: string; - settlementTime?: string; - autoReinvest?: string; - /** Redeemable amount */ - availableAmount: string; - freezeDetails: EarnPositionFreezeDetailV5[]; -} +export type WsPrivateSpotTopic = + | 'outboundAccountInfo' + | 'executionReport' + | 'ticketInfo'; ⋮---- -/** Redeemable amount */ +export type WsPrivateTopic = + | WsPrivateInverseTopic + | WsPrivateUSDTPerpTopic + | WsPrivateSpotTopic + | string; ⋮---- -export interface EarnYieldHistoryV5 { - productId: string; - coin: string; - id: string; - amount: string; - yieldType: string; - distributionMode: string; - effectiveStakingAmount: string; - orderId: string; - status: 'Pending' | 'Success' | 'Fail'; - createdAt: string; -} +export type WsTopic = WsPublicTopics | WsPrivateTopic; ⋮---- -export interface EarnHourlyYieldHistoryV5 { - productId: string; - coin: string; - id: string; - amount: string; - effectiveStakingAmount: string; - status: 'Pending' | 'Success' | 'Fail'; - hourlyDate: string; - createdAt: string; -} +/** This is used to differentiate between each of the available websocket streams (as bybit has multiple websockets) */ +export type WsKey = (typeof WS_KEY_MAP)[keyof typeof WS_KEY_MAP]; +export type WsMarket = 'all'; ⋮---- -export interface EarnAprHistoryPointV5 { - timestamp: string; - apr: string; +export interface WSClientConfigurableOptions { + /** Your API key */ + key?: string; + + /** Your API secret */ + secret?: string; + + /** + * Set to `true` to connect to Bybit's testnet environment. + * + * Notes: + * + * - If demo trading, `testnet` should be set to false! + * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. + */ + testnet?: boolean; + + /** + * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo + * + * Only the "V5" "market" is supported here. + */ + demoTrading?: boolean; + + /** + * The API group this client should connect to. The V5 market is currently used by default. + * + * Only the "V5" "market" is supported here. + */ + market?: APIMarket; + + /** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ + recvWindow?: number; + + /** How often to check if the connection is alive */ + pingInterval?: number; + + /** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ + pongTimeout?: number; + + /** Delay in milliseconds before respawning the connection */ + reconnectTimeout?: number; + + /** + * Select WebSocket routing with the same region values as REST. Uses a + * dedicated mainnet stream when Bybit documents one for that region. + * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. + */ + apiRegion?: APIRegion; + + /** + * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. + * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. + * Keep passing it only if a remaining site still requires `x-site-id`. + */ + siteId?: string; + + /** + * REST options reused for WebSocket routing. + * Regional and site ID values are retained as fallbacks; prefer the matching + * top-level `apiRegion` and `siteId` options. + */ + restOptions?: RestClientOptions; + requestOptions?: AxiosRequestConfig; + + wsOptions?: { + protocols?: string[]; + agent?: any; + } & ( + | Omit, 'agent'> + | Omit, 'agent'> + ); + + wsUrl?: string; + + /** + * Default: false. + * + * When enabled, any calls to the subscribe method will return a promise. + * Note: internally, subscription requests are sent in batches. This may not behave as expected when + * subscribing to a large number of topics, especially if you are not yet connected when subscribing. + */ + promiseSubscribeRequests?: boolean; + + /** + * 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; } ⋮---- -/** - * Advanced Earn — Dual Asset product (GET /v5/earn/advance/product). - */ -export interface AdvanceEarnDualAssetProductV5 { - category: string; - productId: string; - baseCoin: string; - quoteCoin: string; - expectReceiveAt: string; - duration: string; - status: 'Available' | 'NotAvailable'; - isVipProduct: boolean; - subscribeStartAt: string; - subscribeEndAt: string; - applyStartAt: string; - settlementTime: string; - minPurchaseQuoteAmount: string; - minPurchaseBaseAmount: string; - remainingAmountQuote: string; - remainingAmountBase: string; - orderPrecisionDigitalQuote: number; - orderPrecisionDigitalBase: number; -} +/** Your API key */ ⋮---- -export interface AdvanceEarnDualAssetProductInfoV5 { - category: string; - list: AdvanceEarnDualAssetProductV5[]; -} +/** Your API secret */ ⋮---- /** - * Advanced Earn — Double Win (GET /v5/earn/advance/product?category=DoubleWin). - */ -export interface AdvanceEarnDoubleWinProductV5 { - category: string; - productId: string; - investCoin: string; - underlyingAsset: string; - duration: string; - subscribeStartAt: string; - subscribeEndAt: string; - settlementTime: string; - expectReceiveAt: string; - minPurchaseAmount: string; - orderPrecisionDigital: number; - isRfqProduct: boolean; - lowerPriceBuffer: string; - upperPriceBuffer: string; - minDeviationRatio: string; - maxDeviationRatio: string; - priceTickSize: string; -} + * Set to `true` to connect to Bybit's testnet environment. + * + * Notes: + * + * - If demo trading, `testnet` should be set to false! + * - If testing a strategy, use demo trading instead. Testnet market data is very different from real market conditions. + */ ⋮---- /** - * Advanced Earn — Smart Leverage (GET /v5/earn/advance/product?category=SmartLeverage). - */ -export interface AdvanceEarnSmartLeverageProductV5 { - category: string; - productId: string; - investCoin: string; - underlyingAsset: string; - direction: 'Long' | 'Short'; - leverage: string; - duration: string; - subscribeStartAt: string; - subscribeEndAt: string; - settlementTime: string; - expectReceiveAt: string; - minPurchaseAmount: string; - remainingAmount: string; - orderPrecisionDigital: number; -} + * Set to `true` to connect to Bybit's V5 demo trading: https://bybit-exchange.github.io/docs/v5/demo + * + * Only the "V5" "market" is supported here. + */ ⋮---- /** - * Advanced Earn — Discount Buy (GET /v5/earn/advance/product?category=DiscountBuy). - */ -export interface AdvanceEarnDiscountBuyProductV5 { - category: string; - productId: string; - coin: string; - underlyingAsset: string; - settlementTime: string; - duration: string; - isVipProduct: boolean; - subscribeStartAt: string; - subscribeEndAt: string; - minPurchaseAmount: string; - remainingAmount: string; - orderPrecisionDigital: number; - expectReceiveAt: string; -} + * The API group this client should connect to. The V5 market is currently used by default. + * + * Only the "V5" "market" is supported here. + */ ⋮---- -export type AdvanceEarnAdvanceProductListItemV5 = - | AdvanceEarnDualAssetProductV5 - | AdvanceEarnDoubleWinProductV5 - | AdvanceEarnSmartLeverageProductV5 - | AdvanceEarnDiscountBuyProductV5; +/** Define a recv window when preparing a private websocket signature. This is in milliseconds, so 5000 == 5 seconds */ +⋮---- +/** How often to check if the connection is alive */ ⋮---- -export interface AdvanceEarnAdvanceProductInfoV5 { - category: string; - list: AdvanceEarnAdvanceProductListItemV5[]; -} +/** How long to wait for a pong (heartbeat reply) before assuming the connection is dead */ ⋮---- -/** GET /v5/earn/hold-to-earn/product — Hold to Earn airdrop products */ -export type HoldToEarnAirdropProductStatusV5 = - | 'NotStarted' - | 'Online' - | 'Ended'; +/** Delay in milliseconds before respawning the connection */ ⋮---- -export interface HoldToEarnAirdropProductYieldV5 { - coinName: string; - /** Yesterday's APR for display, e.g. "10%", "0%" */ - apy: string; - personalApy?: string; - multiplier?: string; -} +/** + * Select WebSocket routing with the same region values as REST. Uses a + * dedicated mainnet stream when Bybit documents one for that region. + * Top-level `apiRegion` takes precedence over `restOptions.apiRegion`. + */ ⋮---- -/** Yesterday's APR for display, e.g. "10%", "0%" */ +/** + * Site ID sent as `x-site-id` during the Node.js WebSocket handshake. + * Brazil and Argentina internal accounts now use `stream.bybit.com` without this header. + * Keep passing it only if a remaining site still requires `x-site-id`. + */ ⋮---- -export interface HoldToEarnAirdropProductV5 { - coinName: string; - yields: HoldToEarnAirdropProductYieldV5[]; - status: HoldToEarnAirdropProductStatusV5; - announcementUrl: string; - /** Yesterday's avg APR across yield coins */ - apy: string; - personalApy?: string; -} +/** + * REST options reused for WebSocket routing. + * Regional and site ID values are retained as fallbacks; prefer the matching + * top-level `apiRegion` and `siteId` options. + */ ⋮---- -/** Yesterday's avg APR across yield coins */ +/** + * Default: false. + * + * When enabled, any calls to the subscribe method will return a promise. + * Note: internally, subscription requests are sent in batches. This may not behave as expected when + * subscribing to a large number of topics, especially if you are not yet connected when subscribing. + */ ⋮---- -export interface HoldToEarnAirdropProductsResultV5 { - products: HoldToEarnAirdropProductV5[]; -} +/** + * 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. + */ ⋮---- -/** GET /v5/earn/hold-to-earn/yield-history */ -export interface HoldToEarnAirdropDailyPnlV5 { - coinName: string; - yieldCoinName: string; - effectiveAmount: string; - pnl: string; - apy: string; - createdAt: number; +/** + * WS configuration that's always defined, regardless of user configuration + * (usually comes from defaults if there's no user-provided values) + */ +export interface WebsocketClientOptions extends WSClientConfigurableOptions { + market: APIMarket; + pongTimeout: number; + pingInterval: number; + reconnectTimeout: number; + recvWindow: number; + + /** + * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) + */ + requireConnectionReadyConfirmation: boolean; + authPrivateConnectionsOnConnect: boolean; + authPrivateRequests: boolean; + reauthWSAPIOnReconnect: boolean; + + /** + * Whether to use native WebSocket ping/pong frames for heartbeats + */ + useNativeHeartbeats: boolean; } ⋮---- -export interface HoldToEarnAirdropYieldHistoryResultV5 { - nextCursor: string; - airdropDailyPnls: HoldToEarnAirdropDailyPnlV5[]; -} +/** + * If true, require a "receipt" that the connection is ready for use (e.g. a specific event type) + */ +⋮---- +/** + * Whether to use native WebSocket ping/pong frames for heartbeats + */ +⋮---- +export type WsEventInternalSrc = 'event' | 'function' | 'frame'; ================ -File: src/types/response/v5-user.ts +File: .gitignore ================ -import { - ReferralFriendStatusV5, - ReferralProductLineV5, -} from '../request/v5-user'; -import { PermissionsV5 } from '../shared-v5'; +!.gitkeep +.DS_STORE +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +pids +*.pid +*.seed +*.pid.lock +node_modules/ +.npm +.eslintcache +.node_repl_history +*.tgz +.yarn-integrity +.env +.env.test +.cache +lib +dist +doc +bundleReport.html +.history/ +rawReq.ts +localtest.sh +localtest.ts +privaterepotracker +restClientRegex.ts +repomix.sh + +examples/ignored +examples/ts-testnet-private.ts +examples/ts-testnet-trade.ts +examples/ts-testnet.ts +*.pem +.issue* +docs/research +tmp + +================ +File: examples/Rest/rest-v5-custom-url.ts +================ +import { RestClientV5 } from '../../src/index'; ⋮---- -export interface CreateSubMemberResultV5 { - uid: string; - username: string; - memberType: number; - status: number; - remark: string; -} +// or +// import { RestClientV5 } from 'bybit-api'; +⋮---- +/** + * The first parameter of the REST client allows you to pass any configuration parameters supported by the SDK. + * + * These include API keys, if you wish to use private endpoints, but also expose other features such as + * setting a custom base URL (e.g. for Turkish users). + * + * Refer to the API documentation for a complete list of domains: https://bybit-exchange.github.io/docs/v5/guide#authentication + */ +⋮---- +/** + * You can pass a completely custom base URL, + * e.g. if you're trying to use a domain that hasn't been added yet (please let us know) + */ +// baseUrl: 'https://api5.bybit.com', +// +// +/** + * + * Predefined API regions are available through the `apiRegion` property. + * Choose the region where your Bybit account is registered: + * + */ +// +// +// default: routes to api.bybit.com +// apiRegion: 'default', +// +// +// bytick: routes to api.bytick.com +// apiRegion: 'bytick', +// +// +// NL: Bybit removed api.bybit.nl from Integration Guidance on 2026-09-22. apiRegion no longer includes NL. +// +// +// TK: routes to api.bybit.tr (for Turkey users) +// apiRegion: 'TK', +// +// +// KZ: routes to api.bybit.kz (for Kazakhstan users) +// apiRegion: 'KZ', +// +// +// HK: routes to api.spark-fintech.com and adds x-refer-site-id: HKG +// Testnet routes to api-testnet.spark-fintech.com +// apiRegion: 'HK', +// +// +// GE: routes to api.bybitgeorgia.ge (for Georgia users) +// apiRegion: 'GE', +// +// +// UAE: routes to api.bybit.ae (for United Arab Emirates users) +// apiRegion: 'UAE', +// +// +// EU: routes to api.bybit.eu (for EU and EEA users) +// apiRegion: 'EU', +// +// +// ID: routes to api.bybit.id (for Indonesian users) +// apiRegion: 'ID', +// +// +// JP: routes to api.manepa.jp (for Japan users) +// Testnet routes to api-testnet.manepa.jp +// apiRegion: 'JP', +// +// +/** + * Brazil and Argentina international accounts use the global API domain + * with an x-site-id header. Choose the site ID for your account: + */ +// siteId: 'BRA_BTL', +// siteId: 'ARG_BTL', + +================ +File: src/types/request/index.ts +================ + + +================ +File: src/types/response/index.ts +================ + + +================ +File: src/types/response/v5-asset.ts +================ +import { AccountTypeV5, OrderSideV5, WithdrawalTypeV5 } from '../shared-v5'; ⋮---- -export interface CreateSubApiKeyResultV5 { - id: string; - note: string; - apiKey: string; - readOnly: number; - secret: string; - permissions: PermissionsV5; +export interface CoinExchangeRecordV5 { + fromCoin: string; + fromAmount: string; + toCoin: string; + toAmount: string; + exchangeRate: string; + createdTime: string; + exchangeTxId: string; } ⋮---- -export interface SubMemberV5 { - uid: string; - username: string; - memberType: number; - status: number; - accountMode: number; - remark: string; +export interface DeliveryRecordV5 { + deliveryTime: number; + symbol: string; + side: OrderSideV5; + position: string; + deliveryPrice: string; + strike: string; + fee: string; + deliveryRpl: string; + entryPrice: string; } -export type ApiKeyType = 1 | 2; ⋮---- -export interface ApiKeyPermissionsV5 { - ContractTrade: string[]; - Spot: string[]; - Wallet: string[]; - Options: string[]; - Derivatives: string[]; - CopyTrading: string[]; - BlockTrade: string[]; - Exchange: string[]; - NFT: string[]; - Affiliate: string[]; - Earn?: string[]; - FiatP2P?: string[]; - FiatBitPay?: string[]; - FiatConvertBroker?: string[]; - /** @deprecated */ - FiatGlobalPay?: string[]; - BitCard?: string[]; - ByXPost?: string[]; +export interface SettlementRecordV5 { + symbol: string; + side: string; + size: number; + sessionAvgPrice: string; + markPrice: string; + realisedPnl: string; + createdTime: string; } ⋮---- -/** @deprecated */ -⋮---- -export interface ApiKeyInfoV5 { - id: string; - note: string; - apiKey: string; - readOnly: 0 | 1; - secret: string; - permissions: ApiKeyPermissionsV5; - ips: string[]; - type: 1 | 2; // 1: personal, 2: connected to third-party app - deadlineDay: number; - expiredAt: string; - createdAt: string; - /** @deprecated */ - unified: number; - uta: 0 | 1; // 0: regular account, 1: unified trade account - userID: number; - inviterID: number; - vipLevel: string; - mktMakerLevel: string; - affiliateID: number; - rsaPublicKey: string; - isMaster: boolean; - parentUid: string; - kycLevel: 'LEVEL_DEFAULT' | 'LEVEL_1' | 'LEVEL_2'; - kycRegion: string; - isFixApi?: boolean; +export interface AssetInfoAssetV5 { + coin: string; + frozen: string; + free: string; + withdraw: string; } ⋮---- -type: 1 | 2; // 1: personal, 2: connected to third-party app -⋮---- -/** @deprecated */ -⋮---- -uta: 0 | 1; // 0: regular account, 1: unified trade account -⋮---- -export interface UpdateApiKeyResultV5 { - id: string; - note: string; - apiKey: string; - readOnly: 0 | 1; - secret: string; - permissions: PermissionsV5; - ips: string[]; +export interface AssetInfoV5 { + status: 'ACCOUNT_STATUS_NORMAL' | 'ACCOUNT_STATUS_UNSPECIFIED'; + assets: AssetInfoAssetV5[]; } ⋮---- -export interface SubAccountAllApiKeysResultV5 { - result: { - id: string; - ips?: string[]; - apiKey: string; - note: string; - status: number; - expiredAt?: string; - createdAt: string; - type: ApiKeyType; - permissions: PermissionsV5; - secret: string; - readOnly: 0 | 1; - deadlineDay?: number; - flag: string; - }[]; - nextPageCursor: string; +export interface CoinBalanceV5 { + coin: string; + walletBalance: string; + transferBalance: string; + bonus?: string; } ⋮---- -export interface AffiliateUserListItemV5 { - userId: string; - registerTime: string; - source: string; - remarks: string; - isKyc: boolean; - takerVol30Day: string; - makerVol30Day: string; - tradeVol30Day: string; - depositAmount30Day: string; - takerVol365Day: string; - makerVol365Day: string; - tradeVol365Day: string; - depositAmount365Day: string; - takerVol: string; - makerVol: string; - tradeVol: string; - startDate: string; - endDate: string; - /** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ - tradfiTradeVol?: string; - /** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ - tradfiTradeVol30Day?: string; - /** tradfi trade volume in past year. 0 when startDate/endDate in params */ - tradfiTradeVol365Day?: string; - /** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ - commissionsVol?: Record; - /** Commission in last 30 days. Coin -> amount */ - commissions30Day?: Record; - /** Commission in past year. Coin -> amount */ - commissions365Day?: Record; +export interface AllCoinsBalanceV5 { + accountType: AccountTypeV5; + memberId?: string; + balance: CoinBalanceV5[]; } ⋮---- -/** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ -⋮---- -/** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ -⋮---- -/** tradfi trade volume in past year. 0 when startDate/endDate in params */ -⋮---- -/** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ -⋮---- -/** Commission in last 30 days. Coin -> amount */ -⋮---- -/** Commission in past year. Coin -> amount */ -⋮---- -export interface AffiliateUserInfoV5 { - uid: string; - vipLevel: string; - takerVol30Day: string; - makerVol30Day: string; - tradeVol30Day: string; - depositAmount30Day: string; - takerVol365Day: string; - makerVol365Day: string; - tradeVol365Day: string; - depositAmount365Day: string; - totalWalletBalance: '1' | '2' | '3' | '4'; - depositUpdateTime: string; - volUpdateTime: string; - KycLevel: 0 | 1 | 2; - /** tradfi trade volume in last 30 days (USDT) */ - tradfiTradeVol30Day?: string; - /** tradfi trade volume in past year (USDT) */ - tradfiTradeVol365Day?: string; - /** tradfi commissions in last 30 days. Coin -> amount */ - commissions30Day?: Record; - /** tradfi commissions in past year. Coin -> amount */ - commissions365Day?: Record; - /** Payment amount in the last 30 days */ - paySendAmount30Day: string; - /** Pay first transaction amount */ - payFtt: string; - /** Card first-time transaction amount */ - cardFtt: string; +export interface AccountCoinBalanceV5 { + accountType: AccountTypeV5; + bizType: number; + accountId: string; + memberId: string; + balance: { + coin: string; + walletBalance: string; + transferBalance: string; + bonus: string; + transferSafeAmount: string; + ltvTransferSafeAmount: string; + }; } ⋮---- -/** tradfi trade volume in last 30 days (USDT) */ -⋮---- -/** tradfi trade volume in past year (USDT) */ -⋮---- -/** tradfi commissions in last 30 days. Coin -> amount */ -⋮---- -/** tradfi commissions in past year. Coin -> amount */ -⋮---- -/** Payment amount in the last 30 days */ -⋮---- -/** Pay first transaction amount */ -⋮---- -/** Card first-time transaction amount */ +export interface InternalTransferRecordV5 { + transferId: string; + coin: string; + amount: string; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; + timestamp: string; + status: string; +} ⋮---- -export interface AffiliateSubAffiliateListItemV5 { - subAffId: string; - userId: string; - name: string; - email: string; - /** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ - commissionsVol: Record; - commissionsForUsdt: string; - becameAffTime: string; - startDate: string; - endDate: string; +export interface UniversalTransferRecordV5 { + transferId: string; + coin: string; + amount: string; + fromMemberId: string; + toMemberId: string; + fromAccountType: AccountTypeV5; + toAccountType: AccountTypeV5; + timestamp: string; + status: string; + withdrawReqId?: string; + depositReqId?: string; } ⋮---- -/** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ -⋮---- -export interface AffiliateSubAffiliateListResultV5 { - list: AffiliateSubAffiliateListItemV5[]; - nextPageCursor: string; +export interface AllowedDepositCoinInfoV5 { + coin: string; + chain: string; + coinShowName: string; + chainType: string; + blockConfirmNumber: number; + minDepositAmount: string; } ⋮---- -export interface FriendReferralRecordV5 { +export interface DepositRecordV5 { id: string; - inviteeUid: string; + requestId?: string; + coin: string; + chain: string; + amount: string; + txID: string; status: number; - createdAt: string; - updatedAt: string; + toAddress: string; + tag: string; + depositFee: string; + successAt: string; + confirmations: string; + txIndex: string; + blockHash: string; + batchReleaseLimit: string; + depositType: string; + fromAddress: string; + travelRuleStatus?: string; } ⋮---- -export interface ReferralCodeItemV5 { - referralCode: string; - referralLink: string; - scene: number; +export interface SubmitDepositOriginatorInfoResultV5 { + travelRuleStatus: number; } ⋮---- -export interface ReferralCodesResultV5 { - referralCodes: ReferralCodeItemV5[]; +export interface InternalDepositRecordV5 { + id: string; + type: 1; + coin: string; + amount: string; + status: 1 | 2 | 3; + address: string; + createdTime: string; + txID: string; + complianceStatus?: string; } ⋮---- -/** 0 unknown, 1 awaiting credit, 2 settled. Unrecognized values are returned as 0. */ -export type ReferralCommissionStatusV5 = 0 | 1 | 2; -⋮---- -export interface ReferralCommissionRecordV5 { - /** Masked invitee ID: first character + `***` + last character. */ - userId: string; - /** Commission payment time, Unix seconds. */ - paymentTime: number; - /** Commission rate. */ - rate: string; - businessUnit: ReferralProductLineV5; - commissionOriginCoin: string; - /** Commission amount in the original currency. */ - commissionOriginAmount: string; - /** Commission value in USDT. */ - commissionUsdtAmount: string; - commissionStatus: ReferralCommissionStatusV5; - /** - * Whether the invitee is a Boost user. May be omitted. - */ - isBoostM2?: boolean; +export interface DepositAddressChainV5 { + chainType: string; + addressDeposit: string; + tagDeposit: string; + chain: string; + batchReleaseLimit: string; + contractAddress: string; } ⋮---- -/** Masked invitee ID: first character + `***` + last character. */ -⋮---- -/** Commission payment time, Unix seconds. */ -⋮---- -/** Commission rate. */ -⋮---- -/** Commission amount in the original currency. */ -⋮---- -/** Commission value in USDT. */ -⋮---- -/** - * Whether the invitee is a Boost user. May be omitted. - */ -⋮---- -export interface ReferralCommissionRecordsResultV5 { - records: ReferralCommissionRecordV5[]; - total: number; +export interface DepositAddressResultV5 { + coin: string; + chains: DepositAddressChainV5[]; } ⋮---- -export interface ReferralRebateRatioRuleV5 { - /** Referral commission rate, from 0 to 100. */ - rebateRatio: number; - /** Required number of qualified invitees. */ - referralCount: number; - /** Whether the tier requires trading volume. */ - hasTradeCondition: boolean; - /** Trading-volume threshold for the tier. */ - tradeAmountCondition: number; +export interface CoinInfoV5 { + name: string; + coin: string; + /** @deprecated Use `chains[].withdrawMax` instead */ + remainAmount: string; + chains: { + chain: string; + chainType: string; + confirmation: string; + withdrawFee: string; + depositMin: string; + withdrawMin: string; + minAccuracy: string; + chainDeposit: string; + chainWithdraw: string; + withdrawPercentageFee: string; + contractAddress: string; + safeConfirmNumber: string; + /** Max withdraw amount per transaction per chain. `-1` means no limit */ + withdrawMax: string; + }[]; } ⋮---- -/** Referral commission rate, from 0 to 100. */ -⋮---- -/** Required number of qualified invitees. */ -⋮---- -/** Whether the tier requires trading volume. */ +/** @deprecated Use `chains[].withdrawMax` instead */ ⋮---- -/** Trading-volume threshold for the tier. */ +/** Max withdraw amount per transaction per chain. `-1` means no limit */ ⋮---- -export interface ReferralRebateRuleV5 { - /** Deposit threshold. Currency and precision are not specified. */ - depositAmount: number; - /** Trading threshold. Currency and precision are not specified. */ - tradeAmount: number; - rebateRatioRules: ReferralRebateRatioRuleV5[]; - /** Number of days that the referral commission lasts. */ - rebateDurationDays: number; - /** - * Currently not populated. A default of `0` does not confirm a threshold. - */ - tradefiDepositAmount?: number; - /** - * Currently not populated. A default of `0` does not confirm a threshold. - */ - tradefiTradeAmount?: number; +export interface WithdrawalRecordV5 { + withdrawId: string; + txID: string; + withdrawType: WithdrawalTypeV5; + coin: string; + chain: string; + amount: string; + withdrawFee: string; + status: string; + toAddress: string; + tag: string; + createTime: string; + updateTime: string; } ⋮---- -/** Deposit threshold. Currency and precision are not specified. */ -⋮---- -/** Trading threshold. Currency and precision are not specified. */ -⋮---- -/** Number of days that the referral commission lasts. */ -⋮---- -/** - * Currently not populated. A default of `0` does not confirm a threshold. - */ -⋮---- -/** - * Currently not populated. A default of `0` does not confirm a threshold. - */ -⋮---- -/** - * Task reward type. See Bybit enum `awardType`. - * `100` loads reward-packet details. Types `95` and `97` do not currently - * include assembled reward details. - */ -export type ReferralAwardTypeV5 = - | 0 - | 1 - | 2 - | 3 - | 4 - | 5 - | 6 - | 7 - | 8 - | 9 - | 10 - | 11 - | 12 - | 13 - | 14 - | 15 - | 16 - | 17 - | 18 - | 19 - | 95 - | 96 - | 97 - | 98 - | 99 - | 100; -⋮---- -export interface ReferralCampaignAwardV5 { - /** Regular reward ID or reward packet ID. */ - id: number; - /** - * English reward name. Reward packets use `UP TO ` or - * `EARN `. - */ - name: string; - /** English reward type. Always `Packet` for reward packets. */ - type: string; - /** English product type. Empty for reward packets. */ - productLine: string; - /** UTC RFC 3339. Empty when unavailable or for reward packets. */ - startTime: string; - /** UTC RFC 3339. Empty when unavailable. */ - endTime: string; +export interface WithdrawalAddressV5 { + coin: string; + chain: string; + address: string; + tag: string; + remark: string; + status: number; + addressType: number; + verified: number; + createdAt: string; } ⋮---- -/** Regular reward ID or reward packet ID. */ +export interface WithdrawableAccountSliceV5 { + coin: string; + withdrawableAmount: string; + availableBalance: string; +} ⋮---- /** - * English reward name. Reward packets use `UP TO ` or - * `EARN `. - */ + * GET /v5/asset/withdraw/withdrawable-amount. Only keys with data are returned + * (e.g. UTA, FUND, EARN; EARN when the coin can be withdrawn from Earn; SPOT if present). + */ +export interface WithdrawableAmountV5 { + limitAmountUsd: string; + withdrawableAmount: { + SPOT?: WithdrawableAccountSliceV5; + FUND?: WithdrawableAccountSliceV5; + UTA?: WithdrawableAccountSliceV5; + EARN?: WithdrawableAccountSliceV5; + }; +} ⋮---- -/** English reward type. Always `Packet` for reward packets. */ +export interface VaspEntityV5 { + vaspEntityId: string; + vaspName: string; +} ⋮---- -/** English product type. Empty for reward packets. */ +export interface ConvertCoinSpecV5 { + coin: string; + fullName: string; + icon: string; + iconNight: string; + accuracyLength: number; + coinType: string; + balance: string; + uBalance: string; + singleFromMinLimit: string; + singleFromMaxLimit: string; + disableFrom: boolean; + disableTo: boolean; + timePeriod: number; + singleToMinLimit: string; + singleToMaxLimit: string; + dailyFromMinLimit: string; + dailyFromMaxLimit: string; + dailyToMinLimit: string; + dailyToMaxLimit: string; +} ⋮---- -/** UTC RFC 3339. Empty when unavailable or for reward packets. */ +export interface ConvertQuoteV5 { + quoteTxId: string; + exchangeRate: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + expiredTime: string; + requestId: string; + extTaxAndFee: string[]; +} ⋮---- -/** UTC RFC 3339. Empty when unavailable. */ +export interface ConvertStatusV5 { + accountType: string; + exchangeTxId: string; + userId: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; + extInfo: { paramType: string; paramValue: string }; + convertRate: string; + createdAt: string; +} ⋮---- -/** One configured task inside a parsed campaign JSON string. */ -export interface ReferralCampaignTaskItemV5 { - id: number; - awardType: ReferralAwardTypeV5; - /** English title of each valid rule. `null` when there are no valid rules. */ - ruleTitle: string[] | null; - /** English description of each valid rule. Same index as `ruleTitle`. */ - ruleDescription: string[] | null; - /** First parameter of each valid rule. Same index as `ruleTitle`. */ - ruleParam: string[] | null; - taskAwards: ReferralCampaignAwardV5[]; - /** M1 rewards with `UserRelateType=REFERRAL`. */ - m1Awards: ReferralCampaignAwardV5[]; +export interface ConvertHistoryRecordV5 { + accountType: string; + exchangeTxId: string; + userId: string; + fromCoin: string; + fromCoinType: string; + toCoin: string; + toCoinType: string; + fromAmount: string; + toAmount: string; + exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; + extInfo: { paramType: string; paramValue: string }; + convertRate: string; + createdAt: string; } ⋮---- -/** English title of each valid rule. `null` when there are no valid rules. */ +export interface SmallBalanceCoinV5 { + fromCoin: string; // Source currency + supportConvert: 1 | 2; // 1: support, 2: not supported + availableBalance: string; // Available balance + baseValue: string; // USDT equivalent value + toAmount: string; // Reserved field + exchangeRate: string; // Reserved field + feeInfo: null; // Reserved field + taxFeeInfo: null; // Reserved field +} ⋮---- -/** English description of each valid rule. Same index as `ruleTitle`. */ +fromCoin: string; // Source currency +supportConvert: 1 | 2; // 1: support, 2: not supported +availableBalance: string; // Available balance +baseValue: string; // USDT equivalent value +toAmount: string; // Reserved field +exchangeRate: string; // Reserved field +feeInfo: null; // Reserved field +taxFeeInfo: null; // Reserved field ⋮---- -/** First parameter of each valid rule. Same index as `ruleTitle`. */ +export interface SmallBalanceListV5 { + smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info + supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) +} ⋮---- -/** M1 rewards with `UserRelateType=REFERRAL`. */ +smallAssetCoins: SmallBalanceCoinV5[]; // Small balance info +supportToCoins: string[]; // Supported target coins (e.g., ["MNT","USDT","USDC"]) ⋮---- -/** - * Parsed shape of one `ReferralCampaignRewardsResultV5.tasks` string. - * `schemaVersion` is `2`. This is campaign configuration, not the user's - * task progress or a claimed reward. - */ -export interface ReferralCampaignTaskPayloadV5 { - schemaVersion: 2; - source: 'base' | 'fiat' | 'earn'; - /** Campaign configuration ID, not a user reward-record ID. */ - campaignId: string; - /** May be empty if task details cannot be assembled. */ - tasks: ReferralCampaignTaskItemV5[]; +export interface FiatCoinInfoV5 { + coin: string; // Fiat coin code + fullName: string; // Fiat full coin name + icon: string; // Coin icon url + iconNight: string; // Coin icon url (dark mode) + precision: number; // Fiat precision + disable: boolean; // true: the coin is disabled, false: the coin is allowed + singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction + singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction } ⋮---- -/** Campaign configuration ID, not a user reward-record ID. */ -⋮---- -/** May be empty if task details cannot be assembled. */ +coin: string; // Fiat coin code +fullName: string; // Fiat full coin name +icon: string; // Coin icon url +iconNight: string; // Coin icon url (dark mode) +precision: number; // Fiat precision +disable: boolean; // true: the coin is disabled, false: the coin is allowed +singleFromMinLimit: string; // For buy side, minimum amount of fiatCoin per transaction +singleFromMaxLimit: string; // For buy side, maximum amount of fiatCoin per transaction ⋮---- -export interface ReferralCampaignRewardsResultV5 { - /** - * Site referral rules. This does not indicate the tier matched by the - * current user. - */ - rebateRule: ReferralRebateRuleV5; - /** - * Campaign JSON strings, in base, fiat, then earn order when active. - * Parse each string as `ReferralCampaignTaskPayloadV5`. - */ - tasks: string[]; +export interface CryptoCoinInfoV5 { + coin: string; // Crypto coin code + fullName: string; // Crypto full coin name + icon: string; // Coin icon url + iconNight: string; // Coin icon url (dark mode) + precision: number; // Crypto precision + disable: boolean; // true: the coin is disabled, false: the coin is allowed + singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction + singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction } ⋮---- -/** - * Site referral rules. This does not indicate the tier matched by the - * current user. - */ -⋮---- -/** - * Campaign JSON strings, in base, fiat, then earn order when active. - * Parse each string as `ReferralCampaignTaskPayloadV5`. - */ +coin: string; // Crypto coin code +fullName: string; // Crypto full coin name +icon: string; // Coin icon url +iconNight: string; // Coin icon url (dark mode) +precision: number; // Crypto precision +disable: boolean; // true: the coin is disabled, false: the coin is allowed +singleFromMinLimit: string; // For sell side, minimum amount of cryptoCoin per transaction +singleFromMaxLimit: string; // For sell side, maximum amount of cryptoCoin per transaction ⋮---- -export interface ReferralCommissionInfoV5 { - totalCommission: string; - yesterdayCommission: string; - totalFriends: number; - /** Number of invitees eligible for commission. */ - qualifiedFriends: number; - walletBalance: string; - /** Current-quarter trading volume of qualified invitees. */ - qualifiedFriendsQuarterTotalTradeVolume: string; - /** - * Active invitees in the current quarter. May be `0` when the source - * value is `0`. - */ - curQuarterActiveFriendsCount: number; - /** Legacy referral-commission programme indicator. */ - hasOldReferral: number; - /** - * 0 unknown or not downgraded, 1 downgraded due to active invitee count, - * 2 downgraded due to invitee trading volume. - */ - degradeType: 0 | 1 | 2; - commissionRate: string; - /** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ - upgradeUnifiedAccount: 0 | 1 | 2 | 3; - /** - * 1 enabled, 2 disabled. May be `0` when the source value is `0`. - */ - withdrawalSwitch: 0 | 1 | 2; - /** - * Qualified invitees in the previous quarter. May be `0` when the source - * value is `0`. - */ - lastQuarterQualifiedFriendsCount: number; +export interface FiatTradingPairListV5 { + fiats: FiatCoinInfoV5[]; // Fiat coin list + cryptos: CryptoCoinInfoV5[]; // Crypto coin list } ⋮---- -/** Number of invitees eligible for commission. */ +fiats: FiatCoinInfoV5[]; // Fiat coin list +cryptos: CryptoCoinInfoV5[]; // Crypto coin list ⋮---- -/** Current-quarter trading volume of qualified invitees. */ +export interface FundingAccountTransactionRecordV5 { + memberId: string; + currency: string; + ioDirection: string; + txnAmt: string; + afterAmt: string; + createTime: string; + showBusiType: string; + showBusiTypeEn: string; + description: string; + descriptionEn: string; + currcCursor?: string; +} ⋮---- -/** - * Active invitees in the current quarter. May be `0` when the source - * value is `0`. - */ +/** When accountType=Alpha and category is farm, under `coinDetail` in sub-categories. */ +export interface AssetOverviewCoinExtMapV5 { + priceUpper?: string; + priceLower?: string; + equityUnit?: string; +} ⋮---- -/** Legacy referral-commission programme indicator. */ +export interface AssetOverviewCoinDetailV5 { + coin: string; + equity: string; + extMap?: AssetOverviewCoinExtMapV5; +} ⋮---- -/** - * 0 unknown or not downgraded, 1 downgraded due to active invitee count, - * 2 downgraded due to invitee trading volume. - */ +export interface AssetOverviewCategoryV5 { + category: string; + equity: string; + coinDetail: AssetOverviewCoinDetailV5[]; +} ⋮---- -/** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ +export interface AssetOverviewAccountItemV5 { + accountType: string; + totalEquity: string; + valuationCurrency: string; + snapshotTime: string; + coinDetail?: AssetOverviewCoinDetailV5[]; + categories?: AssetOverviewCategoryV5[]; +} ⋮---- -/** - * 1 enabled, 2 disabled. May be `0` when the source value is `0`. - */ +export interface AssetOverviewResultV5 { + totalEquity: string; + list: AssetOverviewAccountItemV5[]; +} ⋮---- -/** - * Qualified invitees in the previous quarter. May be `0` when the source - * value is `0`. - */ +// --- GET /v5/asset/portfolio-margin (portfolio margin P&L ranges) --- ⋮---- -export interface ReferralUserIdentityProfileV5 { - isAffiliate: boolean; - /** - * Whether the current user is an M1 inviter. Checked only when the user - * is not an affiliate. - */ - isM1: boolean; - /** - * Affiliate ID from the affiliate direct-customer relationship. `0` if - * none is found. - */ - inviterAffiliateId: number; - /** - * Relationship indicator: `1` when an affiliate direct-customer record - * exists, otherwise `0`. This is not the affiliate user's ID. - */ - inviterAffiliateUserId: number; - /** - * Relationship indicator: `1` when an invitation record exists for the - * current user as invitee, otherwise `0`. This is not the inviter's ID. - */ - inviterUserId: number; - /** - * Present only when an M1 inviter record matches the authenticated user - * and the commission query succeeds. - */ - commissionInfo?: ReferralCommissionInfoV5; +export interface PortfolioMarginWalletV5 { + equity: string; + cashBalance: string; + marginBalance: string; + availableBalance: string; + accountIM: string; + accountMM: string; + accountMMRate: string; + accountIMRate: string; } ⋮---- -/** - * Whether the current user is an M1 inviter. Checked only when the user - * is not an affiliate. - */ +export interface PortfolioMarginPnlRangePointV5 { + priceScale: string; + pnls: string[]; +} ⋮---- -/** - * Affiliate ID from the affiliate direct-customer relationship. `0` if - * none is found. - */ +export interface PortfolioMarginContractBucketPnlV5 { + pnlRanges: PortfolioMarginPnlRangePointV5[]; +} ⋮---- -/** - * Relationship indicator: `1` when an affiliate direct-customer record - * exists, otherwise `0`. This is not the affiliate user's ID. - */ +export interface PortfolioMarginTotalPnlRangesV5 { + ALL?: PortfolioMarginContractBucketPnlV5; + PERPETUAL?: PortfolioMarginContractBucketPnlV5; + OPTION?: PortfolioMarginContractBucketPnlV5; +} ⋮---- -/** - * Relationship indicator: `1` when an invitation record exists for the - * current user as invitee, otherwise `0`. This is not the inviter's ID. - */ +export interface PortfolioMarginPerpPositionPnlV5 { + symbolName: string; + position: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + sessionAvgPrice: string; + markPrice: string; + orderSize: string; + contractType: number; + settleCoin: string; + symbolAlias?: string; +} ⋮---- -/** - * Present only when an M1 inviter record matches the authenticated user - * and the commission query succeeds. - */ +export interface PortfolioMarginOptionPositionPnlV5 { + symbolName: string; + position: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + sessionAvgPrice: string; + markPrice: string; + orderSize: string; + contractType: number; + settleCoin: string; +} ⋮---- -export interface ReferralUserInvitationRecordV5 { - /** Masked invitee ID. */ - userIdMask: string; - /** Invitee registration timestamp. */ - signTime: number; - userStatus: ReferralFriendStatusV5; - /** Total commission, at most eight decimal places. */ - totalCommission: string; - /** - * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs - * say to confirm that exposing this value is intended. - */ - userId: string; - taskProgress: string; - /** - * `true` for some new EU-site invitees and non-Boost JPN-site invitees. - * The Boost path leaves the default `false`. - */ - notShowCommission: boolean; - /** - * Not populated by the current endpoint. May be omitted, or `""`. - */ - totalBaseRewards?: string; +export interface PortfolioMarginOptionExpiryPnlV5 { + expiryDateRepresentation: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; + optionPositionPnlRanges: PortfolioMarginOptionPositionPnlV5[]; } ⋮---- -/** Masked invitee ID. */ +export interface PortfolioMarginContingencyV5 { + optionContingency: string; + futureDeltaContingency: string; + optionVegaContingency: string; + contingencyComponents: string; + usdtUsdcContingency: string; + futureContingency: string; +} ⋮---- -/** Invitee registration timestamp. */ +export interface PortfolioMarginAssetBlockV5 { + coin: string; + assetIM: string; + assetMM: string; +} ⋮---- -/** Total commission, at most eight decimal places. */ +export interface PortfolioMarginSpotHedgeInfoV5 { + hedgeSpotSize: string; + walletBalance: string; + usdIndexPrice: string; + pnlRanges: PortfolioMarginPnlRangePointV5[]; +} ⋮---- -/** - * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs - * say to confirm that exposing this value is intended. - */ +export interface PortfolioMarginByBaseCoinV5 { + baseCoin: string; + totalPnlRanges: PortfolioMarginTotalPnlRangesV5; + perpPositionPnlRanges: PortfolioMarginPerpPositionPnlV5[]; + optionExpiryDatePnlRanges: PortfolioMarginOptionExpiryPnlV5[]; + contingency: PortfolioMarginContingencyV5; + asset: PortfolioMarginAssetBlockV5; + maxLossPriceMove: string; + maxLossIvShock: string; + totalClosePzFee: string; + spotHedgeInfo: PortfolioMarginSpotHedgeInfoV5; + maxLossIvShockList: string[]; +} ⋮---- -/** - * `true` for some new EU-site invitees and non-Boost JPN-site invitees. - * The Boost path leaves the default `false`. - */ +export interface PortfolioMarginInfoResultV5 { + wallet: PortfolioMarginWalletV5; + assetPnlRange: PortfolioMarginByBaseCoinV5[]; +} ⋮---- -/** - * Not populated by the current endpoint. May be omitted, or `""`. - */ +// --- GET /v5/asset/total-members-assets --- ⋮---- -export interface ReferralUserInvitationsResultV5 { - records: ReferralUserInvitationRecordV5[]; - total: number; +export interface TotalMembersAccountBreakdownItemV5 { + type: string; + origb: string; + quoteb: string; + stat: number; } - -================ -File: src/types/websockets/ws-events.ts -================ -import WebSocket from 'isomorphic-ws'; ⋮---- -import { - RFQItemV5, - RFQPublicTradeV5, - RFQQuoteItemV5, - RFQTradeV5, -} from '../response/v5-rfq'; -import { - CategoryV5, - ExecTypeV5, - OCOTriggerTypeV5, - OrderCancelTypeV5, - OrderCreateTypeV5, - OrderRejectReasonV5, - OrderSideV5, - OrderSMPTypeV5, - OrderStatusV5, - OrderTimeInForceV5, - OrderTriggerByV5, - OrderTypeV5, - PositionIdx, - PositionSideV5, - PositionStatusV5, - StopOrderTypeV5, - SystemStatusItemV5, - TPSLModeV5, - TradeModeV5, -} from '../shared-v5'; -import { WsKey } from './ws-general'; +export interface TotalMembersMemberEntryV5 { + uid: number; + isM?: boolean; + type?: number; + stat: number; + origb: string; + quoteb?: string; + items: TotalMembersAccountBreakdownItemV5[]; +} ⋮---- -export interface MessageEventLike { - target: WebSocket; - type: 'message'; - data: string; +export interface TotalMembersAssetsResultV5 { + total: string; + quoteTotal: string; + stat: number; + list: TotalMembersMemberEntryV5[]; } + +================ +File: src/types/response/v5-user.ts +================ +import { + ReferralFriendStatusV5, + ReferralProductLineV5, +} from '../request/v5-user'; +import { PermissionsV5 } from '../shared-v5'; ⋮---- -export function isMessageEvent(msg: unknown): msg is MessageEventLike +export interface CreateSubMemberResultV5 { + uid: string; + username: string; + memberType: number; + status: number; + remark: string; +} ⋮---- -export interface WSPublicTopicEventV5 { - id?: string; - topic: TTopic; - type: TType; - /** Cross sequence */ - cs?: number; - /** Event timestamp */ - ts: number; - data: TData; - /** - * matching engine timestamp (correlated with T from public trade channel) - */ - cts: number; - /** - * Internal reference, can be used to determine if this is spot/linear/inverse/etc - */ - wsKey: WsKey; +export interface CreateSubApiKeyResultV5 { + id: string; + note: string; + apiKey: string; + readOnly: number; + secret: string; + permissions: PermissionsV5; } ⋮---- -/** Cross sequence */ +export interface SubMemberV5 { + uid: string; + username: string; + memberType: number; + status: number; + accountMode: number; + remark: string; +} +export type ApiKeyType = 1 | 2; ⋮---- -/** Event timestamp */ +export interface ApiKeyPermissionsV5 { + ContractTrade: string[]; + Spot: string[]; + Wallet: string[]; + Options: string[]; + Derivatives: string[]; + CopyTrading: string[]; + BlockTrade: string[]; + Exchange: string[]; + NFT: string[]; + Affiliate: string[]; + Earn?: string[]; + FiatP2P?: string[]; + FiatBitPay?: string[]; + FiatConvertBroker?: string[]; + /** @deprecated */ + FiatGlobalPay?: string[]; + BitCard?: string[]; + ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ + Compliance?: string[]; +} ⋮---- -/** - * matching engine timestamp (correlated with T from public trade channel) - */ +/** @deprecated */ ⋮---- -/** - * Internal reference, can be used to determine if this is spot/linear/inverse/etc - */ +/** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ ⋮---- -export interface WSPrivateTopicEventV5 { - id?: string; - topic: TTopic; - creationTime: number; - data: TData; - wsKey: WsKey; +export interface ApiKeyInfoV5 { + id: string; + note: string; + apiKey: string; + readOnly: 0 | 1; + secret: string; + permissions: ApiKeyPermissionsV5; + ips: string[]; + type: 1 | 2; // 1: personal, 2: connected to third-party app + deadlineDay: number; + expiredAt: string; + createdAt: string; + /** @deprecated */ + unified: number; + uta: 0 | 1; // 0: regular account, 1: unified trade account + userID: number; + inviterID: number; + vipLevel: string; + mktMakerLevel: string; + affiliateID: number; + rsaPublicKey: string; + isMaster: boolean; + parentUid: string; + kycLevel: 'LEVEL_DEFAULT' | 'LEVEL_1' | 'LEVEL_2'; + kycRegion: string; + isFixApi?: boolean; } ⋮---- -export interface WSOrderbookV5 { - /** Symbol */ - s: string; - /** [price, qty][] */ - b: [string, string][]; - /** [price, qty][] */ - a: [string, string][]; - /** Update ID */ - u: number; - /** Cross sequence */ - seq: number; +type: 1 | 2; // 1: personal, 2: connected to third-party app +⋮---- +/** @deprecated */ +⋮---- +uta: 0 | 1; // 0: regular account, 1: unified trade account +⋮---- +export interface UpdateApiKeyResultV5 { + id: string; + note: string; + apiKey: string; + readOnly: 0 | 1; + secret: string; + permissions: PermissionsV5; + ips: string[]; } ⋮---- -/** Symbol */ +export interface SubAccountAllApiKeysResultV5 { + result: { + id: string; + ips?: string[]; + apiKey: string; + note: string; + status: number; + expiredAt?: string; + createdAt: string; + type: ApiKeyType; + permissions: PermissionsV5; + secret: string; + readOnly: 0 | 1; + deadlineDay?: number; + flag: string; + }[]; + nextPageCursor: string; +} ⋮---- -/** [price, qty][] */ +export interface AffiliateUserListItemV5 { + userId: string; + registerTime: string; + source: string; + remarks: string; + isKyc: boolean; + takerVol30Day: string; + makerVol30Day: string; + tradeVol30Day: string; + depositAmount30Day: string; + takerVol365Day: string; + makerVol365Day: string; + tradeVol365Day: string; + depositAmount365Day: string; + takerVol: string; + makerVol: string; + tradeVol: string; + startDate: string; + endDate: string; + /** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ + tradfiTradeVol?: string; + /** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ + tradfiTradeVol30Day?: string; + /** tradfi trade volume in past year. 0 when startDate/endDate in params */ + tradfiTradeVol365Day?: string; + /** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ + commissionsVol?: Record; + /** Commission in last 30 days. Coin -> amount */ + commissions30Day?: Record; + /** Commission in past year. Coin -> amount */ + commissions365Day?: Record; +} ⋮---- -/** [price, qty][] */ +/** tradfi trade volume in [startDate, endDate] when startDate/endDate in params */ ⋮---- -/** Update ID */ +/** tradfi trade volume in last 30 days. 0 when startDate/endDate in params */ ⋮---- -/** Cross sequence */ +/** tradfi trade volume in past year. 0 when startDate/endDate in params */ ⋮---- -export type WSOrderbookEventV5 = WSPublicTopicEventV5< - string, - 'delta' | 'snapshot', - WSOrderbookV5 ->; +/** Commission between startDate and endDate when startDate/endDate in params. Coin -> amount */ ⋮---- -export interface WSTradeV5 { - T: number; - s: string; - S: OrderSideV5; - v: string; - p: string; - L?: string; - i: string; - BT: boolean; - RPI?: boolean; - mP?: string; - iP?: string; - mIv?: string; - iv?: string; -} +/** Commission in last 30 days. Coin -> amount */ ⋮---- -export type WSTradeEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSTradeV5[] ->; +/** Commission in past year. Coin -> amount */ ⋮---- -export interface WSEventOrderbookV5 { - s: string; - r: [string, string][]; - u: number; - seq: number; +export interface AffiliateUserInfoV5 { + uid: string; + vipLevel: string; + takerVol30Day: string; + makerVol30Day: string; + tradeVol30Day: string; + depositAmount30Day: string; + takerVol365Day: string; + makerVol365Day: string; + tradeVol365Day: string; + depositAmount365Day: string; + totalWalletBalance: '1' | '2' | '3' | '4'; + depositUpdateTime: string; + volUpdateTime: string; + KycLevel: 0 | 1 | 2; + /** tradfi trade volume in last 30 days (USDT) */ + tradfiTradeVol30Day?: string; + /** tradfi trade volume in past year (USDT) */ + tradfiTradeVol365Day?: string; + /** tradfi commissions in last 30 days. Coin -> amount */ + commissions30Day?: Record; + /** tradfi commissions in past year. Coin -> amount */ + commissions365Day?: Record; + /** Payment amount in the last 30 days */ + paySendAmount30Day: string; + /** Pay first transaction amount */ + payFtt: string; + /** Card first-time transaction amount */ + cardFtt: string; } ⋮---- -export type WSEventOrderbookEventV5 = WSPublicTopicEventV5< - string, - 'delta' | 'snapshot', - WSEventOrderbookV5 ->; +/** tradfi trade volume in last 30 days (USDT) */ ⋮---- -export interface WSEventPublicTradeV5 { - T: number; - s: string; - r: string; - a: string; - i: string; - seq: number; -} +/** tradfi trade volume in past year (USDT) */ ⋮---- -export type WSEventPublicTradeEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSEventPublicTradeV5[] ->; +/** tradfi commissions in last 30 days. Coin -> amount */ ⋮---- -/** - * WSTickerV5 is the data structure for the "linear" ticker channel - * */ -export interface WSTickerV5 { - symbol: string; - tickDirection: string; - price24hPcnt: string; - lastPrice: string; - prevPrice24h: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice1h: string; - markPrice: string; - indexPrice: string; - openInterest: string; - openInterestValue: string; - singleOpenInterest?: string; - singleOpenInterestValue?: string; - turnover24h: string; - volume24h: string; - nextFundingTime: string; - fundingRate: string; - bid1Price: string; - bid1Size: string; - ask1Price: string; - ask1Size: string; - deliveryTime?: string; - basisRate?: string; - deliveryFeeRate?: string; - predictedDeliveryPrice?: string; - preOpenPrice?: string; - preQty?: string; - curPreListingPhase?: string; - fundingIntervalHour?: string; - fundingCap?: string; - basisRateYear?: string; -} +/** tradfi commissions in past year. Coin -> amount */ ⋮---- -export interface WSTickerOptionV5 { - symbol: string; - bidPrice: string; - bidSize: string; - bidIv: string; - askPrice: string; - askSize: string; - askIv: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - markPrice: string; - indexPrice: string; - markPriceIv: string; - underlyingPrice: string; - openInterest: string; - turnover24h: string; - volume24h: string; - totalVolume: string; - totalTurnover: string; - delta: string; - gamma: string; - vega: string; - theta: string; - predictedDeliveryPrice: string; - change24h: string; -} +/** Payment amount in the last 30 days */ ⋮---- -export interface WSTickerSpotV5 { - symbol: string; - lastPrice: string; - highPrice24h: string; - lowPrice24h: string; - prevPrice24h: string; - volume24h: string; - turnover24h: string; - price24hPcnt: string; - usdIndexPrice: string; -} +/** Pay first transaction amount */ ⋮---- -export type WSTickerEventV5 = WSPublicTopicEventV5< - string, - 'snapshot' | 'delta', - WSTickerV5 | WSTickerOptionV5 | WSTickerSpotV5 ->; +/** Card first-time transaction amount */ ⋮---- -export interface WSKlineV5 { - start: number; - end: number; - interval: string; - open: string; - close: string; - high: string; - low: string; - volume: string; - turnover: string; - confirm: boolean; - timestamp: number; +export interface AffiliateSubAffiliateListItemV5 { + subAffId: string; + userId: string; + name: string; + email: string; + /** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ + commissionsVol: Record; + commissionsForUsdt: string; + becameAffTime: string; + startDate: string; + endDate: string; } ⋮---- -export type WSKlineEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSKlineV5[] ->; +/** Commission per currency (BTC, ETH, MNT, USDC, USDT) for the queried date range */ ⋮---- -export interface WSLiquidationV5 { - T: number; - s: string; - S: OrderSideV5; - v: string; - p: string; +export interface AffiliateSubAffiliateListResultV5 { + list: AffiliateSubAffiliateListItemV5[]; + nextPageCursor: string; } ⋮---- -export type WSLiquidationEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSLiquidationV5[] ->; -⋮---- -export interface WSPositionV5 { - category: string; - symbol: string; - side: PositionSideV5; - size: string; - positionIdx: PositionIdx; - tradeMode: TradeModeV5; - positionValue: string; - riskId: number; - riskLimitValue: string; - entryPrice: string; - markPrice: string; - leverage: string; - breakEvenPrice?: string; // Break even price, only for linear & inverse - positionBalance: string; - autoAddMargin: number; - positionMM: string; - positionIM: string; - positionIMByMp: string; - positionMMByMp: string; - liqPrice: string; - bustPrice: string; - tpslMode: string; - takeProfit: string; - stopLoss: string; - trailingStop: string; - unrealisedPnl: string; - curRealisedPnl: string; - sessionAvgPrice: string; - delta: string; - gamma: string; - vega: string; - theta: string; - cumRealisedPnl: string; - positionStatus: PositionStatusV5; - adlRankIndicator: number; - isReduceOnly: boolean; - mmrSysUpdatedTime: string; - leverageSysUpdatedTime: string; - createdTime: string; - updatedTime: string; - /** Position open timestamp (ms). Default `0` when not set. */ - openTime: number; - seq: number; - netDeltaRatio?: string; +export interface FriendReferralRecordV5 { + id: string; + inviteeUid: string; + status: number; + createdAt: string; + updatedAt: string; } ⋮---- -breakEvenPrice?: string; // Break even price, only for linear & inverse +export interface ReferralCodeItemV5 { + referralCode: string; + referralLink: string; + scene: number; +} ⋮---- -/** Position open timestamp (ms). Default `0` when not set. */ +export interface ReferralCodesResultV5 { + referralCodes: ReferralCodeItemV5[]; +} ⋮---- -export type WSPositionEventV5 = WSPrivateTopicEventV5< - 'position', - WSPositionV5[] ->; +/** 0 unknown, 1 awaiting credit, 2 settled. Unrecognized values are returned as 0. */ +export type ReferralCommissionStatusV5 = 0 | 1 | 2; ⋮---- -export interface WSEventPositionV5 { - symbol: string; - baseCoin: string; - settleCoin: string; - side: string; - ecContractType: string; - ecDirection: string; - avgPayoutRatio: string; - positionValue: string; - ecSettleTime: string; - cumClosedPnl: string; - createdTime: string; - updatedTime: string; - seq: number; +export interface ReferralCommissionRecordV5 { + /** Masked invitee ID: first character + `***` + last character. */ + userId: string; + /** Commission payment time, Unix seconds. */ + paymentTime: number; + /** Commission rate. */ + rate: string; + businessUnit: ReferralProductLineV5; + commissionOriginCoin: string; + /** Commission amount in the original currency. */ + commissionOriginAmount: string; + /** Commission value in USDT. */ + commissionUsdtAmount: string; + commissionStatus: ReferralCommissionStatusV5; + /** + * Whether the invitee is a Boost user. May be omitted. + */ + isBoostM2?: boolean; } ⋮---- -export type WSEventPositionEventV5 = WSPrivateTopicEventV5< - 'position.event', - WSEventPositionV5[] ->; +/** Masked invitee ID: first character + `***` + last character. */ ⋮---- -export interface WSAccountOrderV5 { - category: CategoryV5; - orderId: string; - orderLinkId: string; - parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) - isLeverage: string; - blockTradeId: string; - symbol: string; - price: string; - qty: string; - side: OrderSideV5; - positionIdx: PositionIdx; - orderStatus: OrderStatusV5; - createType: OrderCreateTypeV5; - cancelType: OrderCancelTypeV5; - rejectReason?: OrderRejectReasonV5; - avgPrice?: string; - leavesQty?: string; - leavesValue?: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - closedPnl: string; - feeCurrency: string; - timeInForce: OrderTimeInForceV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - ocoTriggerType?: OCOTriggerTypeV5; - orderIv: string; - marketUnit?: 'baseCoin' | 'quoteCoin'; - triggerPrice: string; - takeProfit: string; - stopLoss: string; - tpslMode?: TPSLModeV5; - tpLimitPrice?: string; - slLimitPrice?: string; - tpTriggerBy: string; - slTriggerBy: string; - triggerDirection: number; - triggerBy: OrderTriggerByV5; - lastPriceOnCreated: string; - reduceOnly: boolean; - closeOnTrigger: boolean; - placeType: string; - smpType: OrderSMPTypeV5; - smpGroup: string; - smpOrderId: string; - createdTime: string; - updatedTime: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency - rpiTakerAccess?: boolean; - rpiMatchedQty?: string; -} +/** Commission payment time, Unix seconds. */ ⋮---- -parentOrderLinkId?: string; // Linked parent order for attached TP/SL orders (futures & options) +/** Commission rate. */ ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** Commission amount in the original currency. */ ⋮---- -export type WSAccountOrderEventV5 = WSPrivateTopicEventV5< - 'order', - WSAccountOrderV5[] ->; +/** Commission value in USDT. */ ⋮---- -export interface WSEventOrderV5 { - category: 'event' | string; - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: number; - side: string; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - orderStatus: string; - ecContractType: string; - ecDirection: string; - ecDurationWindow: number; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecOrderValue: string; - ecIndexPrice: string; - ecSettleTime: string; - payoutRatio: string; - orderAvgPayoutRatio: string; - cumExecValue: string; - cumExecFee: string; - leavesValue: string; - cumPayout: string; - createType: number; - cancelType: string; - rejectReason: string; - extraFees: unknown[]; - transTime: string; - createdTime: string; - updatedTime: string; +/** + * Whether the invitee is a Boost user. May be omitted. + */ +⋮---- +export interface ReferralCommissionRecordsResultV5 { + records: ReferralCommissionRecordV5[]; + total: number; } ⋮---- -export type WSEventOrderEventV5 = WSPrivateTopicEventV5< - 'order' | 'order.event', - WSEventOrderV5[] ->; +export interface ReferralRebateRatioRuleV5 { + /** Referral commission rate, from 0 to 100. */ + rebateRatio: number; + /** Required number of qualified invitees. */ + referralCount: number; + /** Whether the tier requires trading volume. */ + hasTradeCondition: boolean; + /** Trading-volume threshold for the tier. */ + tradeAmountCondition: number; +} ⋮---- -export interface WSExecutionV5 { - category: CategoryV5; - symbol: string; - isLeverage: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - createType: OrderCreateTypeV5; - orderType: OrderTypeV5; - stopOrderType: StopOrderTypeV5; - execFee: string; - feeCurrency: string; // Trading fee currency - execId: string; - execPrice: string; - execQty: string; - execPnl: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - tradeIv: string; - markIv: string; - markPrice: string; - indexPrice: string; - underlyingPrice: string; - blockTradeId: string; - closedSize: string; - extraFees: string; - seq: number; - marketUnit: string; +/** Referral commission rate, from 0 to 100. */ +⋮---- +/** Required number of qualified invitees. */ +⋮---- +/** Whether the tier requires trading volume. */ +⋮---- +/** Trading-volume threshold for the tier. */ +⋮---- +export interface ReferralRebateRuleV5 { + /** Deposit threshold. Currency and precision are not specified. */ + depositAmount: number; + /** Trading threshold. Currency and precision are not specified. */ + tradeAmount: number; + rebateRatioRules: ReferralRebateRatioRuleV5[]; + /** Number of days that the referral commission lasts. */ + rebateDurationDays: number; + /** + * Currently not populated. A default of `0` does not confirm a threshold. + */ + tradefiDepositAmount?: number; + /** + * Currently not populated. A default of `0` does not confirm a threshold. + */ + tradefiTradeAmount?: number; } ⋮---- -feeCurrency: string; // Trading fee currency +/** Deposit threshold. Currency and precision are not specified. */ ⋮---- -export type WSExecutionEventV5 = WSPrivateTopicEventV5< - 'execution', - WSExecutionV5[] ->; +/** Trading threshold. Currency and precision are not specified. */ ⋮---- -export interface WSEventExecutionV5 { - category: 'event' | string; - transId: string; - execId: string; - orderId: string; - orderLinkId: string; - symbol: string; - symbolId: number; - baseCoin: string; - quoteCoin: string; - settleCoin: string; - side: string; - feeCoin: string; - execType: string; - execPrice: string; - execValue: string; - execFee: string; - execFeeRate: string; - orderPrice: string; - ecContractType: number | string; - ecDirection: number | string; - ecDurationWindow: number; - ecTargetPrice: string; - ecLowerBound: string; - ecUpperBound: string; - ecOrderValue: string; - ecIndexPrice?: string; - ecPayout: string; - entryPrice: string; - settlePrice: string; - grossPayoutRatio: string; - sessionRpl: string; - transTime: string; - settleTimeMs: string; - crossSeq: string; - timeInForce: string; - extraFees: unknown[]; +/** Number of days that the referral commission lasts. */ +⋮---- +/** + * Currently not populated. A default of `0` does not confirm a threshold. + */ +⋮---- +/** + * Currently not populated. A default of `0` does not confirm a threshold. + */ +⋮---- +/** + * Task reward type. See Bybit enum `awardType`. + * `100` loads reward-packet details. Types `95` and `97` do not currently + * include assembled reward details. + */ +export type ReferralAwardTypeV5 = + | 0 + | 1 + | 2 + | 3 + | 4 + | 5 + | 6 + | 7 + | 8 + | 9 + | 10 + | 11 + | 12 + | 13 + | 14 + | 15 + | 16 + | 17 + | 18 + | 19 + | 95 + | 96 + | 97 + | 98 + | 99 + | 100; +⋮---- +export interface ReferralCampaignAwardV5 { + /** Regular reward ID or reward packet ID. */ + id: number; + /** + * English reward name. Reward packets use `UP TO ` or + * `EARN `. + */ + name: string; + /** English reward type. Always `Packet` for reward packets. */ + type: string; + /** English product type. Empty for reward packets. */ + productLine: string; + /** UTC RFC 3339. Empty when unavailable or for reward packets. */ + startTime: string; + /** UTC RFC 3339. Empty when unavailable. */ + endTime: string; } ⋮---- -export type WSEventExecutionEventV5 = WSPrivateTopicEventV5< - 'execution' | 'execution.event', - WSEventExecutionV5[] ->; +/** Regular reward ID or reward packet ID. */ ⋮---- -export interface WSExecutionFastV5 { - category: CategoryV5; - symbol: string; - execId: string; - execPrice: string; - execQty: string; - orderId: string; - isMaker: boolean; - orderLinkId: string; - side: OrderSideV5; - execTime: string; - seq: number; - liquidity?: string; -} +/** + * English reward name. Reward packets use `UP TO ` or + * `EARN `. + */ ⋮---- -export type WSExecutionFastEventV5 = WSPrivateTopicEventV5< - 'execution.fast', - WSExecutionFastV5[] ->; +/** English reward type. Always `Packet` for reward packets. */ ⋮---- -export interface WSCoinV5 { - coin: string; - equity: string; - usdValue: string; - walletBalance: string; - free?: string; - locked: string; - spotHedgingQty: string; - borrowAmount: string; - availableToBorrow: string; - availableToWithdraw: string; - accruedInterest: string; - totalOrderIM: string; - totalPositionIM: string; - totalPositionMM: string; - unrealisedPnl: string; - cumRealisedPnl: string; - bonus: string; - collateralSwitch: boolean; - marginCollateral: boolean; - spotBorrow: string; - colRes?: string; -} +/** English product type. Empty for reward packets. */ ⋮---- -export interface WSWalletV5 { - accountType: string; - accountLTV: string; - accountIMRate: string; - accountMMRate: string; - accountIMRateByMp: string; - accountMMRateByMp: string; - totalInitialMarginByMp: string; - totalMaintenanceMarginByMp: string; - totalEquity: string; - totalWalletBalance: string; - totalMarginBalance: string; - totalAvailableBalance: string; - totalPerpUPL: string; - totalInitialMargin: string; - totalMaintenanceMargin: string; - coin: WSCoinV5[]; +/** UTC RFC 3339. Empty when unavailable or for reward packets. */ +⋮---- +/** UTC RFC 3339. Empty when unavailable. */ +⋮---- +/** One configured task inside a parsed campaign JSON string. */ +export interface ReferralCampaignTaskItemV5 { + id: number; + awardType: ReferralAwardTypeV5; + /** English title of each valid rule. `null` when there are no valid rules. */ + ruleTitle: string[] | null; + /** English description of each valid rule. Same index as `ruleTitle`. */ + ruleDescription: string[] | null; + /** First parameter of each valid rule. Same index as `ruleTitle`. */ + ruleParam: string[] | null; + taskAwards: ReferralCampaignAwardV5[]; + /** M1 rewards with `UserRelateType=REFERRAL`. */ + m1Awards: ReferralCampaignAwardV5[]; } ⋮---- -export type WSWalletEventV5 = WSPrivateTopicEventV5<'wallet', WSWalletV5[]>; +/** English title of each valid rule. `null` when there are no valid rules. */ ⋮---- -export interface WSGreeksV5 { - baseCoin: string; - totalDelta: string; - totalGamma: string; - totalVega: string; - totalTheta: string; +/** English description of each valid rule. Same index as `ruleTitle`. */ +⋮---- +/** First parameter of each valid rule. Same index as `ruleTitle`. */ +⋮---- +/** M1 rewards with `UserRelateType=REFERRAL`. */ +⋮---- +/** + * Parsed shape of one `ReferralCampaignRewardsResultV5.tasks` string. + * `schemaVersion` is `2`. This is campaign configuration, not the user's + * task progress or a claimed reward. + */ +export interface ReferralCampaignTaskPayloadV5 { + schemaVersion: 2; + source: 'base' | 'fiat' | 'earn'; + /** Campaign configuration ID, not a user reward-record ID. */ + campaignId: string; + /** May be empty if task details cannot be assembled. */ + tasks: ReferralCampaignTaskItemV5[]; } ⋮---- -export type WSGreeksEventV5 = WSPrivateTopicEventV5<'greeks', WSGreeksV5[]>; +/** Campaign configuration ID, not a user reward-record ID. */ ⋮---- -export interface WSSpreadOrderV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - parentOrderId: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderStatus: OrderStatusV5; - cancelType: OrderCancelTypeV5; - rejectReason: OrderRejectReasonV5; - timeInForce: OrderTimeInForceV5; - price: string; - qty: string; - avgPrice: string; - leavesQty: string; - leavesValue: string; - cumExecQty: string; - cumExecValue: string; - cumExecFee: string; - orderType: OrderTypeV5; - isLeverage: string; - createdTime: string; - updatedTime: string; - feeCurrency: string; - createType: OrderCreateTypeV5; - closedPnl: string; - cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** May be empty if task details cannot be assembled. */ +⋮---- +export interface ReferralCampaignRewardsResultV5 { + /** + * Site referral rules. This does not indicate the tier matched by the + * current user. + */ + rebateRule: ReferralRebateRuleV5; + /** + * Campaign JSON strings, in base, fiat, then earn order when active. + * Parse each string as `ReferralCampaignTaskPayloadV5`. + */ + tasks: string[]; } ⋮---- -cumFeeDetail?: Record; // Cumulative trading fee details instead of cumExecFee and feeCurrency +/** + * Site referral rules. This does not indicate the tier matched by the + * current user. + */ ⋮---- -export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5< - 'spread.order', - WSSpreadOrderV5[] ->; +/** + * Campaign JSON strings, in base, fiat, then earn order when active. + * Parse each string as `ReferralCampaignTaskPayloadV5`. + */ ⋮---- -export interface WSSpreadExecutionV5 { - category: 'combination' | 'spot_leg' | 'future_leg'; - symbol: string; - isLeverage: string; - orderId: string; - orderLinkId: string; - side: OrderSideV5; - orderPrice: string; - orderQty: string; - leavesQty: string; - createType: OrderCreateTypeV5; - orderType: OrderTypeV5; - execFee: string; - execFeeV2: string; - feeCurrency: string; // Trading fee currency - parentExecId: string; - execId: string; - execPrice: string; - execQty: string; - execPnl: string; - execType: ExecTypeV5; - execValue: string; - execTime: string; - isMaker: boolean; - feeRate: string; - markPrice: string; - closedSize: string; - seq: number; +export interface ReferralCommissionInfoV5 { + totalCommission: string; + yesterdayCommission: string; + totalFriends: number; + /** Number of invitees eligible for commission. */ + qualifiedFriends: number; + walletBalance: string; + /** Current-quarter trading volume of qualified invitees. */ + qualifiedFriendsQuarterTotalTradeVolume: string; + /** + * Active invitees in the current quarter. May be `0` when the source + * value is `0`. + */ + curQuarterActiveFriendsCount: number; + /** Legacy referral-commission programme indicator. */ + hasOldReferral: number; + /** + * 0 unknown or not downgraded, 1 downgraded due to active invitee count, + * 2 downgraded due to invitee trading volume. + */ + degradeType: 0 | 1 | 2; + commissionRate: string; + /** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ + upgradeUnifiedAccount: 0 | 1 | 2 | 3; + /** + * 1 enabled, 2 disabled. May be `0` when the source value is `0`. + */ + withdrawalSwitch: 0 | 1 | 2; + /** + * Qualified invitees in the previous quarter. May be `0` when the source + * value is `0`. + */ + lastQuarterQualifiedFriendsCount: number; } ⋮---- -feeCurrency: string; // Trading fee currency +/** Number of invitees eligible for commission. */ ⋮---- -export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5< - 'spread.execution', - WSSpreadExecutionV5[] ->; +/** Current-quarter trading volume of qualified invitees. */ ⋮---- -export interface WSInsuranceV5 { - coin: string; - symbols: string; - balance: string; - updateTime: string; -} +/** + * Active invitees in the current quarter. May be `0` when the source + * value is `0`. + */ ⋮---- -export type WSInsuranceEventV5 = WSPublicTopicEventV5< - 'insurance.USDT' | 'insurance.USDC' | 'insurance.inverse', - 'snapshot' | 'delta', - WSInsuranceV5[] ->; +/** Legacy referral-commission programme indicator. */ ⋮---- -export interface WSPriceLimitV5 { - symbol: string; - buyLmt: string; - sellLmt: string; -} +/** + * 0 unknown or not downgraded, 1 downgraded due to active invitee count, + * 2 downgraded due to invitee trading volume. + */ ⋮---- -export type WSPriceLimitEventV5 = WSPublicTopicEventV5< - string, - 'snapshot', - WSPriceLimitV5 ->; +/** 0 unknown, 1 upgraded, 2 upgrading, 3 not upgraded. */ ⋮---- -export interface WSADLAlertV5 { - c: string; // Token of the insurance pool - s: string; // Trading pair name - b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) - mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours - i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL - pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped - adl_tt: string; // Trigger threshold for contract PnL drawdown ADL - adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +/** + * 1 enabled, 2 disabled. May be `0` when the source value is `0`. + */ +⋮---- +/** + * Qualified invitees in the previous quarter. May be `0` when the source + * value is `0`. + */ +⋮---- +export interface ReferralUserIdentityProfileV5 { + isAffiliate: boolean; + /** + * Whether the current user is an M1 inviter. Checked only when the user + * is not an affiliate. + */ + isM1: boolean; + /** + * Affiliate ID from the affiliate direct-customer relationship. `0` if + * none is found. + */ + inviterAffiliateId: number; + /** + * Relationship indicator: `1` when an affiliate direct-customer record + * exists, otherwise `0`. This is not the affiliate user's ID. + */ + inviterAffiliateUserId: number; + /** + * Relationship indicator: `1` when an invitation record exists for the + * current user as invitee, otherwise `0`. This is not the inviter's ID. + */ + inviterUserId: number; + /** + * Present only when an M1 inviter record matches the authenticated user + * and the commission query succeeds. + */ + commissionInfo?: ReferralCommissionInfoV5; } ⋮---- -c: string; // Token of the insurance pool -s: string; // Trading pair name -b: string; // Balance of the insurance fund. For shared insurance pool, follows T+1 refresh (updated daily at 00:00 UTC) -mb: string; // Deprecated: always returns empty string. Previously: Maximum balance of the insurance pool in the last 8 hours -i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL -pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped -adl_tt: string; // Trigger threshold for contract PnL drawdown ADL -adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL +/** + * Whether the current user is an M1 inviter. Checked only when the user + * is not an affiliate. + */ ⋮---- -export type WSADLAlertEventV5 = WSPublicTopicEventV5< - 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse', - 'snapshot', - WSADLAlertV5[] ->; +/** + * Affiliate ID from the affiliate direct-customer relationship. `0` if + * none is found. + */ ⋮---- -export type WSSystemStatusEventV5 = WSPublicTopicEventV5< - 'system.status', - 'snapshot', - SystemStatusItemV5[] ->; +/** + * Relationship indicator: `1` when an affiliate direct-customer record + * exists, otherwise `0`. This is not the affiliate user's ID. + */ ⋮---- /** - * RFQ WebSocket Events - */ + * Relationship indicator: `1` when an invitation record exists for the + * current user as invitee, otherwise `0`. This is not the inviter's ID. + */ ⋮---- /** - * RFQ Inquiry Channel - * Private push for RFQ inquiries sent or received by the user - * Topics: rfq.open.rfqs, rfq.site.rfqs - */ -export type WSRFQInquiryEventV5 = WSPrivateTopicEventV5< - 'rfq.open.rfqs' | 'rfq.site.rfqs', - RFQItemV5[] ->; + * Present only when an M1 inviter record matches the authenticated user + * and the commission query succeeds. + */ +⋮---- +export interface ReferralUserInvitationRecordV5 { + /** Masked invitee ID. */ + userIdMask: string; + /** Invitee registration timestamp. */ + signTime: number; + userStatus: ReferralFriendStatusV5; + /** Total commission, at most eight decimal places. */ + totalCommission: string; + /** + * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs + * say to confirm that exposing this value is intended. + */ + userId: string; + taskProgress: string; + /** + * `true` for some new EU-site invitees and non-Boost JPN-site invitees. + * The Boost path leaves the default `false`. + */ + notShowCommission: boolean; + /** + * Not populated by the current endpoint. May be omitted, or `""`. + */ + totalBaseRewards?: string; +} +⋮---- +/** Masked invitee ID. */ +⋮---- +/** Invitee registration timestamp. */ +⋮---- +/** Total commission, at most eight decimal places. */ ⋮---- /** - * RFQ Quote Channel - * Private push for quotes sent or received by the user - * Topics: rfq.open.quotes, rfq.site.quotes - */ -export type WSRFQQuoteEventV5 = WSPrivateTopicEventV5< - 'rfq.open.quotes' | 'rfq.site.quotes', - RFQQuoteItemV5[] ->; + * Unencrypted decimal invitee user ID. `userIdMask` is separate. The docs + * say to confirm that exposing this value is intended. + */ ⋮---- /** - * RFQ Trade Channel - * Private push for block trades executed by the user - * Topics: rfq.open.trades, rfq.site.trades - */ -export type WSRFQTradeEventV5 = WSPrivateTopicEventV5< - 'rfq.open.trades' | 'rfq.site.trades', - RFQTradeV5[] ->; + * `true` for some new EU-site invitees and non-Boost JPN-site invitees. + * The Boost path leaves the default `false`. + */ ⋮---- /** - * RFQ Public Trade Channel - * Public push for all block trades - * Topics: rfq.open.public.trades, rfq.site.public.trades - */ -export type WSRFQPublicTradeEventV5 = WSPublicTopicEventV5< - 'rfq.open.public.trades' | 'rfq.site.public.trades', - 'snapshot', - RFQPublicTradeV5[] ->; - -================ -File: src/types/request/index.ts -================ - + * Not populated by the current endpoint. May be omitted, or `""`. + */ +⋮---- +export interface ReferralUserInvitationsResultV5 { + records: ReferralUserInvitationRecordV5[]; + total: number; +} ================ File: src/types/request/v5-market.ts @@ -15282,11 +15337,14 @@ export interface GetOptionBaseCoinsParamsV5 { * Comma-separated underlying types. * 0 crypto, 1 commodity, 2 stock, 3 forex, 4 oil. Omit to return all types. */ - -================ -File: src/types/response/index.ts -================ - +⋮---- +export interface GetCorporateActionsParamsV5 { + category?: 'option'; + baseCoin?: string; + actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + limit?: number; + cursor?: string; +} ================ File: src/types/response/v5-market.ts @@ -15944,6 +16002,30 @@ export interface OptionBaseCoinV5 { export interface OptionBaseCoinsResultV5 { list: OptionBaseCoinV5[]; } +⋮---- +export interface CorporateActionV5 { + category?: 'option'; + symbol: string; + baseCoin: string; + actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + status: string; + effectiveTime: number; + details: { + splitFactor?: string; + splitType?: 'FORWARD' | 'REVERSE'; + dividendAmountPerShare?: string; + dividendCurrency?: string; + installmentCount?: number; + installmentAmountPerShare?: string; + installmentCoin?: string; + firstSettlementTimeUtc?: number; + installments?: { + installmentNo: number; + settlementTimeUtc: number; + status: string; + }[]; + }; +} ================ File: src/types/shared-v5.ts @@ -16473,12 +16555,16 @@ export interface PermissionsV5 { FiatConvertBroker?: string[]; BitCard?: string[]; ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ + Compliance?: string[]; } ⋮---- /** @deprecated , always returns []*/ ⋮---- /** Bybit Pay (FaitPayOrder) */ ⋮---- +/** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ +⋮---- export interface CategoryCursorListV5< T extends unknown[], TCategory extends CategoryV5 = CategoryV5, @@ -16634,10 +16720,13 @@ import { BrokerRateLimitCapItemV5, BrokerRateLimitSetResultItemV5, BrokerVoucherSpecV5, + CancelAllEventQuotesParamsV5, + CancelAllEventQuotesResultV5, CancelAllOrdersParamsV5, CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, CancelEventQuoteParamsV5, + CancelFixedRateBorrowOrderParamsV5, CancelOrderParamsV5, CancelRFQParamsV5, CancelRFQQuoteItemV5, @@ -16673,6 +16762,7 @@ import { ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, + CorporateActionV5, CreateBorrowOrderFixedParamsV5, CreateBorrowOrderFixedV5, CreateP2PAdParamsV5, @@ -16749,6 +16839,7 @@ import { FixedLoanAvailableInventoryV5, FixedRateAvailableInventoryV5, FixedRateBorrowContractInfoV5, + FixedRateBorrowInterestAccruedV5, FixedRateBorrowOrderInfoV5, FixedRateBorrowParamsV5, FixedRateBorrowQuoteV5, @@ -16826,6 +16917,7 @@ import { GetCollateralCoinsParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, + GetCorporateActionsParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, @@ -16856,6 +16948,7 @@ import { GetFixedLoanAvailableInventoryParamsV5, GetFixedRateAvailableInventoryParamsV5, GetFixedRateBorrowContractInfoParamsV5, + GetFixedRateBorrowInterestAccruedParamsV5, GetFixedRateBorrowOrderInfoParamsV5, GetFixedRateBorrowOrderQuoteParamsV5, GetFixedTermEarnOrderListParamsV5, @@ -17133,6 +17226,7 @@ import { SettlePwmFundProfitParamsV5, SettlePwmFundProfitResultV5, SetTPSLModeParamsV5, + SetTradeAutoRepayParamsV5, SetTradingStopParamsV5, SignAgreementParamsV5, SmallBalanceListV5, @@ -17177,6 +17271,7 @@ import { TokenSplashUserActivityResultV5, TotalMembersAssetsResultV5, TPSLModeV5, + TradeAutoRepayResultV5, TradeInfoForAnalysisResultV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, @@ -17236,8 +17331,7 @@ getSystemStatus(params?: GetSystemStatusParamsV5): Promise< APIResponseV3WithTime<{ list: SystemStatusItemV5[]; }> - > { - return this.getPrivate('/v5/system/status', params); + > ⋮---- getClientType() ⋮---- @@ -17245,8 +17339,7 @@ async fetchServerTime(): Promise ⋮---- getServerTime(): Promise< APIResponseV3WithTime<{ timeSecond: string; timeNano: string }> - > { - return this.get('/v5/market/time'); + > ⋮---- /** * @@ -17260,12 +17353,12 @@ requestDemoTradingFunds(params?: { coin: string; amountStr: string; }>; -}): Promise> ⋮---- /** * Create a demo trading account. */ -createDemoAccount(): Promise> ⋮---- /** * @@ -17281,8 +17374,7 @@ getSpreadInstrumentsInfo(params?: GetSpreadInstrumentsInfoParamsV5): Promise< list: SpreadInstrumentInfoV5[]; nextPageCursor: string; }> - > { - return this.get('/v5/spread/instrument', params); + > ⋮---- /** * Get Spread Orderbook @@ -17290,7 +17382,7 @@ getSpreadInstrumentsInfo(params?: GetSpreadInstrumentsInfoParamsV5): Promise< getSpreadOrderbook(params: { symbol: string; limit?: number; -}): Promise> + }): Promise> ⋮---- /** * Get Spread Tickers @@ -17299,8 +17391,7 @@ getSpreadTickers(params: { symbol: string }): Promise< APIResponseV3WithTime<{ list: SpreadTickerV5[]; }> - > { - return this.get('/v5/spread/tickers', params); + > ⋮---- /** * Get Spread Public Recent Trades @@ -17309,8 +17400,7 @@ getSpreadRecentTrades(params: { symbol: string; limit?: number }): Promise< APIResponseV3WithTime<{ list: SpreadRecentTradeV5[]; }> - > { - return this.get('/v5/spread/recent-trade', params); + > ⋮---- /** * Get Spread Max Qty @@ -17318,7 +17408,7 @@ getSpreadRecentTrades(params: { symbol: string; limit?: number }): Promise< */ getSpreadMaxQty( params: GetSpreadMaxQtyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create Spread Order @@ -17328,8 +17418,7 @@ submitSpreadOrder(params: SubmitSpreadOrderParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/create', params); + > ⋮---- /** * Amend Spread Order @@ -17340,8 +17429,7 @@ amendSpreadOrder(params: AmendSpreadOrderParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/amend', params); + > ⋮---- /** * Cancel Spread Order @@ -17354,8 +17442,7 @@ cancelSpreadOrder(params: { orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/spread/order/cancel', params); + > ⋮---- /** * Cancel All Spread Orders @@ -17374,8 +17461,7 @@ cancelAllSpreadOrders(params?: { }[]; success: string; }> - > { - return this.postPrivate('/v5/spread/order/cancel-all', params); + > ⋮---- /** * Get Spread Open Orders @@ -17386,8 +17472,7 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< list: SpreadOpenOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/order/realtime', params); + > ⋮---- /** * Get Spread Order History @@ -17396,14 +17481,18 @@ getSpreadOpenOrders(params?: GetSpreadOpenOrdersParamsV5): Promise< * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History + * - From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ list: SpreadOrderHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/order/history', params); + > ⋮---- /** * Get Spread Trade History @@ -17417,8 +17506,7 @@ getSpreadTradeHistory(params?: GetSpreadTradeHistoryParamsV5): Promise< list: SpreadTradeV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/spread/execution/list', params); + > ⋮---- /** * @@ -17437,8 +17525,7 @@ getKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/kline', params); + > ⋮---- /** * Query the mark price kline data. Charts are returned in groups based on the requested interval. @@ -17453,8 +17540,7 @@ getMarkPriceKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/mark-price-kline', params); + > ⋮---- /** * Query the index price kline data. Charts are returned in groups based on the requested interval. @@ -17467,8 +17553,7 @@ getIndexPriceKline( APIResponseV3WithTime< CategorySymbolListV5 > - > { - return this.get('/v5/market/index-price-kline', params); + > ⋮---- /** * Retrieve the premium index price kline data. Charts are returned in groups based on the requested interval. @@ -17479,8 +17564,7 @@ getPremiumIndexPriceKline( params: GetPremiumIndexPriceKlineParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/premium-index-price-kline', params); + > ⋮---- /** * Query a list of instruments of online trading pair. @@ -17492,7 +17576,7 @@ getPremiumIndexPriceKline( */ getInstrumentsInfo( params: GetInstrumentsInfoParamsV5 & { category: C }, -): Promise>> + ): Promise>> ⋮---- /** * Query summary information and trading increments for linear and option instruments. @@ -17504,7 +17588,7 @@ getInstrumentsInfo( */ getInstrumentSummary( params: GetInstrumentSummaryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query orderbook data @@ -17513,11 +17597,11 @@ getInstrumentSummary( */ getOrderbook( params: GetOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- getFullDepthOrderbook( params: GetFullDepthOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RPI Orderbook @@ -17529,7 +17613,7 @@ getFullDepthOrderbook( */ getRPIOrderbook( params: GetRPIOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- getTickers( ⋮---- @@ -17554,8 +17638,7 @@ getTickers( | CategoryListV5 | CategoryListV5 > - > { - return this.get('/v5/market/tickers', params); + > ⋮---- /** * Query historical funding rate. Each symbol has a different funding interval. @@ -17568,8 +17651,7 @@ getFundingRateHistory( APIResponseV3WithTime< CategoryListV5 > - > { - return this.get('/v5/market/funding/history', params); + > ⋮---- /** * Query recent public trading data in Bybit. @@ -17580,8 +17662,7 @@ getPublicTradingHistory( params: GetPublicTradingHistoryParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/recent-trade', params); + > ⋮---- /** * Get open interest of each symbol. @@ -17590,7 +17671,7 @@ getPublicTradingHistory( */ getOpenInterest( params: GetOpenInterestParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query option historical volatility @@ -17600,15 +17681,14 @@ getHistoricalVolatility( params: GetHistoricalVolatilityParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/historical-volatility', params); + > ⋮---- /** * Query Bybit insurance pool data (BTC/USDT/USDC etc). The data is updated every 24 hours. */ getInsurance( params?: GetInsuranceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query risk limit of futures @@ -17619,8 +17699,7 @@ getRiskLimit( params?: GetRiskLimitParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/risk-limit', params); + > ⋮---- /** * Get the delivery price for option @@ -17633,8 +17712,7 @@ getOptionDeliveryPrice( params: GetOptionDeliveryPriceParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.get('/v5/market/delivery-price', params); + > ⋮---- /** * Get the delivery price of Inverse futures, USDC futures and Options @@ -17643,7 +17721,7 @@ getOptionDeliveryPrice( */ getDeliveryPrice( params: GetDeliveryPriceParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get New Delivery Price @@ -17667,12 +17745,11 @@ getNewDeliveryPrice(params: { deliveryTime: string; }[]; }> - > { - return this.get('/v5/market/new-delivery-price', params); + > ⋮---- getLongShortRatio( params: GetLongShortRatioParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Index Price Components @@ -17680,12 +17757,12 @@ getLongShortRatio( */ getIndexPriceComponents( params: GetIndexPriceComponentsParamsV5, -): Promise> + ): Promise> ⋮---- getOrderPriceLimit(params: { symbol: string; category: 'spot' | 'linear' | 'inverse'; -}): Promise> + }): Promise> ⋮---- /** * Get ADL Alert @@ -17696,7 +17773,7 @@ getOrderPriceLimit(params: { */ getADLAlert( params?: GetADLAlertParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Fee Group Structure @@ -17707,14 +17784,21 @@ getADLAlert( */ getFeeGroupStructure( params: GetFeeGroupStructureParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query option base coins, display names, launch times, and tradable symbol availability. */ getOptionBaseCoins( params?: GetOptionBaseCoinsParamsV5, -): Promise> + ): Promise> +⋮---- +getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< + APIResponseV3WithTime<{ + list: CorporateActionV5[]; + nextPageCursor: string; + }> + > ⋮---- /** * @@ -17724,38 +17808,42 @@ getOptionBaseCoins( ⋮---- submitOrder( params: OrderParamsV5, -): Promise> + ): Promise> ⋮---- amendOrder( params: AmendOrderParamsV5, -): Promise> + ): Promise> ⋮---- cancelOrder( params: CancelOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query unfilled or partially filled orders in real-time. To query older order records, please use the order history interface. */ getActiveOrders( params: GetAccountOrdersParamsV5, -): Promise>> + ): Promise>> ⋮---- cancelAllOrders( params: CancelAllOrdersParamsV5, ): Promise< APIResponseV3WithTime<{ list: OrderResultV5[]; success: string }> - > { - return this.postPrivate('/v5/order/cancel-all', params); + > ⋮---- /** * Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). + * + * From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query users' execution records, sorted by execTime in descending order @@ -17765,7 +17853,7 @@ getHistoricOrders( */ getExecutionList( params: GetExecutionListParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * This endpoint allows you to place more than one order in a single request. @@ -17789,11 +17877,7 @@ batchSubmitOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/create-batch', { - category, - request: orders, - }); + > ⋮---- /** * This endpoint allows you to amend more than one open order in a single request. @@ -17813,11 +17897,7 @@ batchAmendOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/amend-batch', { - category, - request: orders, - }); + > ⋮---- /** * This endpoint allows you to cancel more than one open order in a single request. @@ -17837,11 +17917,7 @@ batchCancelOrders( }, BatchOrdersRetExtInfoV5 > - > { - return this.postPrivate('/v5/order/cancel-batch', { - category, - request: orders, - }); + > ⋮---- /** * Query the qty and amount of borrowable coins in spot account. @@ -17851,7 +17927,7 @@ batchCancelOrders( getSpotBorrowCheck( symbol: string, side: OrderSideV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the disconnection protect time window. Covers: option (unified account). @@ -17866,7 +17942,7 @@ getSpotBorrowCheck( setDisconnectCancelAllWindow( category: 'option', timeWindow: number, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the disconnection protect time window. Covers: option (unified account). @@ -17879,7 +17955,7 @@ setDisconnectCancelAllWindow( setDisconnectCancelAllWindowV2(params: { product?: 'OPTION' | 'SPOT' | 'DERIVATIVES'; timeWindow: number; -}): Promise> + }): Promise> ⋮---- /** * Pre-check order to calculate changes in IMR and MMR before placing an order @@ -17891,7 +17967,7 @@ setDisconnectCancelAllWindowV2(params: { */ preCheckOrder( params: OrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -17906,7 +17982,7 @@ preCheckOrder( */ createStrategyOrder( params: CreateStrategyOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Strategy List @@ -17915,7 +17991,7 @@ createStrategyOrder( */ getStrategyList( params?: GetStrategyListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Strategy Order List @@ -17924,7 +18000,7 @@ getStrategyList( */ getStrategyOrderList( params: GetStrategyOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Stop Strategy @@ -17933,7 +18009,7 @@ getStrategyOrderList( */ stopStrategy( params: StopStrategyParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -17956,7 +18032,7 @@ stopStrategy( */ getPositionInfo( params: PositionInfoParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Futures Leverage @@ -17966,7 +18042,7 @@ getPositionInfo( */ getFuturesLeverage( params: GetFuturesLeverageParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set the leverage @@ -17977,7 +18053,7 @@ getFuturesLeverage( * * Note: Under one-way mode, buyLeverage must be the same as sellLeverage */ -setLeverage(params: SetLeverageParamsV5): Promise> ⋮---- /** * Select cross margin mode or isolated margin mode. @@ -17990,7 +18066,7 @@ setLeverage(params: SetLeverageParamsV5): Promise> ⋮---- /** * @deprecated @@ -18002,7 +18078,7 @@ switchIsolatedMargin( */ setTPSLMode( params: SetTPSLModeParamsV5, -): Promise> ⋮---- /** * Switches the position mode for USDT perpetual and Inverse futures. @@ -18015,7 +18091,7 @@ setTPSLMode( */ switchPositionMode( params: SwitchPositionModeParamsV5, -): Promise> ⋮---- /** * @deprecated @@ -18027,7 +18103,7 @@ switchPositionMode( */ setRiskLimit( params: SetRiskLimitParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to set the take profit, stop loss or trailing stop for a position. @@ -18040,7 +18116,7 @@ setRiskLimit( */ setTradingStop( params: SetTradingStopParamsV5, -): Promise> ⋮---- /** * This endpoint allows you to turn on/off auto-add-margin for an isolated margin position. @@ -18049,7 +18125,7 @@ setTradingStop( */ setAutoAddMargin( params: SetAutoAddMarginParamsV5, -): Promise> ⋮---- /** * Manually add or reduce margin for isolated margin position @@ -18059,7 +18135,7 @@ setAutoAddMargin( */ addOrReduceMargin( params: AddOrReduceMarginParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query user's closed profit and loss records. The results are sorted by createdTime in descending order. @@ -18069,7 +18145,7 @@ addOrReduceMargin( */ getClosedPnL( params: GetClosedPnLParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Closed Options Positions @@ -18087,8 +18163,7 @@ getClosedOptionsPositions( category: string; list: ClosedOptionsPositionV5[]; }> - > { - return this.getPrivate('/v5/position/get-closed-positions', params); + > ⋮---- /** * Move positions between sub-master, master-sub, or sub-sub UIDs. @@ -18105,7 +18180,7 @@ getClosedOptionsPositions( */ movePosition( params: MovePositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query moved position data by master UID api key. @@ -18117,8 +18192,7 @@ getMovePositionHistory(params?: GetMovePositionHistoryParamsV5): Promise< list: MovePositionHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/position/move-history', params); + > ⋮---- /** * Confirm new risk limit. @@ -18132,7 +18206,7 @@ getMovePositionHistory(params?: GetMovePositionHistoryParamsV5): Promise< */ confirmNewRiskLimit( params: ConfirmNewRiskLimitParamsV5, -): Promise> ⋮---- /** * @@ -18150,7 +18224,7 @@ confirmNewRiskLimit( */ getPreUpgradeOrderHistory( params: GetPreUpgradeOrderHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get users' execution records which occurred before you upgrade the account to Unified account, sorted by execTime in descending order @@ -18163,7 +18237,7 @@ getPreUpgradeOrderHistory( */ getPreUpgradeTradeHistory( params: GetPreUpgradeTradeHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query user's closed profit and loss records. The results are sorted by createdTime in descending order. @@ -18172,7 +18246,7 @@ getPreUpgradeTradeHistory( */ getPreUpgradeClosedPnl( params: GetPreUpgradeClosedPnlParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query transaction logs which occurred in the USDC Derivatives wallet before the account was upgraded to a Unified account. @@ -18189,8 +18263,7 @@ getPreUpgradeTransactions( list: PreUpgradeTransaction[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/pre-upgrade/account/transaction-log', params); + > ⋮---- /** * Query delivery records of Option before you upgraded the account to a Unified account, sorted by deliveryTime in descending order. @@ -18202,8 +18275,7 @@ getPreUpgradeOptionDeliveryRecord( params: GetPreUpgradeOptionDeliveryRecordParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.getPrivate('/v5/pre-upgrade/asset/delivery-record', params); + > ⋮---- /** * Query session settlement records of USDC perpetual before you upgrade the account to Unified account. @@ -18217,8 +18289,7 @@ getPreUpgradeUSDCSessionSettlements( APIResponseV3WithTime< CategoryCursorListV5 > - > { - return this.getPrivate('/v5/pre-upgrade/asset/settlement-record', params); + > ⋮---- /** * @@ -18233,7 +18304,7 @@ getPreUpgradeUSDCSessionSettlements( */ getWalletBalance( params: GetWalletBalanceParamsV5, -): Promise> ⋮---- /** * Query the available amount to transfer of a specific coin in the Unified wallet. @@ -18244,8 +18315,7 @@ getTransferableAmount(params: { coinName: string }): Promise< APIResponseV3WithTime<{ availableWithdrawal: string; }> - > { - return this.getPrivate('/v5/account/withdrawal', params); + > ⋮---- /** * Get Account Instruments Info @@ -18258,7 +18328,7 @@ getTransferableAmount(params: { coinName: string }): Promise< */ getAccountInstrumentsInfo( params: GetAccountInstrumentsInfoParamsV5 & { category: C }, -): Promise>> + ): Promise>> ⋮---- /** * Upgrade to unified account. @@ -18267,8 +18337,7 @@ getAccountInstrumentsInfo( */ upgradeToUnifiedAccount(): Promise< APIResponseV3WithTime - > { - return this.postPrivate('/v5/account/upgrade-to-uta'); + > ⋮---- /** * Get interest records, sorted in reverse order of creation time. @@ -18277,7 +18346,7 @@ upgradeToUnifiedAccount(): Promise< */ getBorrowHistory( params?: GetBorrowHistoryParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * You can manually repay the liabilities of Unified account @@ -18296,7 +18365,7 @@ getBorrowHistory( */ repayLiability( params?: RepayLiabilityParamsV5, -): Promise> ⋮---- /** * Manual Repay @@ -18319,18 +18388,18 @@ repayLiability( */ manualRepay( params?: ManualRepayParamsV5, -): Promise> + ): Promise> ⋮---- /** * You can decide whether the assets in the Unified account needs to be collateral coins. */ setCollateralCoin( params: SetCollateralCoinParamsV5, -): Promise> ⋮---- batchSetCollateralCoin(params: { request: SetCollateralCoinParamsV5[]; -}): Promise> ⋮---- /** * Get the collateral information of the current unified margin account, including loan interest rate, @@ -18338,14 +18407,14 @@ batchSetCollateralCoin(params: { */ getCollateralInfo( currency?: string, -): Promise> ⋮---- /** * Get current account Greeks information */ getCoinGreeks( baseCoin?: string, -): Promise> ⋮---- /** * Get the trading fee rate. @@ -18353,7 +18422,7 @@ getCoinGreeks( */ getFeeRate( params: GetFeeRateParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query the margin mode and the upgraded status of account @@ -18369,14 +18438,14 @@ getAccountInfo(): Promise> * support linear contract (USDT, USDC Perp & USDC Futures) / Spot / Options only * Unified account only */ -getDCPInfo(): Promise> ⋮---- /** * Query transaction logs in Unified account. */ getTransactionLog( params?: GetTransactionLogParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query transaction logs in the derivatives wallet (classic account), and inverse derivatives wallet (upgraded to UTA). @@ -18387,8 +18456,7 @@ getClassicTransactionLogs( params?: GetClassicTransactionLogsParamsV5, ): Promise< APIResponseV3WithTime<{ list: TransactionLogV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/account/contract-transaction-log', params); + > ⋮---- /** * Query the SMP group ID of self match prevention. @@ -18397,8 +18465,7 @@ getSMPGroup(): Promise< APIResponseV3WithTime<{ smpGroup: string; }> - > { - return this.getPrivate('/v5/account/smp-group'); + > ⋮---- /** * Default is regular margin mode. @@ -18409,10 +18476,7 @@ setMarginMode( marginMode: AccountMarginModeV5, ): Promise< APIResponseV3<{ reasons: { reasonCode: string; reasonMsg: string }[] }> - > { - return this.postPrivate('/v5/account/set-margin-mode', { - setMarginMode: marginMode, - }); + > ⋮---- /** * Turn on/off Spot hedging feature in Portfolio margin for Unified account. @@ -18423,7 +18487,7 @@ setMarginMode( */ setSpotHedging(params: { setHedgingMode: 'ON' | 'OFF'; -}): Promise> ⋮---- /** * Set Limit Price Behaviour @@ -18434,7 +18498,7 @@ setSpotHedging(params: { */ setLimitPriceAction( params: SetLimitPriceActionParamsV5, -): Promise> ⋮---- /** * Get Trade Behaviour Config / Get Limit Price Behaviour @@ -18449,7 +18513,7 @@ getLimitPriceAction(): Promise> */ setDeltaNeutralMode( params: SetDeltaNeutralModeParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Configure Market Maker Protection (MMP) @@ -18466,7 +18530,7 @@ resetMMP(baseCoin: string): Promise> */ getMMPState( baseCoin: string, -): Promise> ⋮---- /** * Get Option Asset Info @@ -18474,8 +18538,7 @@ getMMPState( */ getOptionAssetInfo(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/account/option-asset-info'); + > ⋮---- /** * Get Pay Info @@ -18483,7 +18546,7 @@ getOptionAssetInfo(): Promise< */ getPayInfo( params?: GetPayInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Trade Info For Analysis @@ -18491,7 +18554,7 @@ getPayInfo( */ getTradeInfoForAnalysis( params: GetTradeInfoForAnalysisParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -18509,7 +18572,7 @@ getTradeInfoForAnalysis( */ getAssetOverview( params?: GetAssetOverviewParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Portfolio Margin Info @@ -18517,7 +18580,7 @@ getAssetOverview( */ getPortfolioMarginInfo( params?: GetPortfolioMarginInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Total Members Assets @@ -18525,7 +18588,7 @@ getPortfolioMarginInfo( */ getTotalMembersAssets( params?: GetTotalMembersAssetsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Funding Account Transaction History @@ -18540,8 +18603,7 @@ getFundingAccountTransactionHistory( nextPageCursor: string; list: FundingAccountTransactionRecordV5[]; }> - > { - return this.getPrivate('/v5/asset/fundinghistory', params); + > ⋮---- /** * Query option delivery records, sorted by deliveryTime in descending order. @@ -18550,7 +18612,7 @@ getFundingAccountTransactionHistory( */ getDeliveryRecord( params: GetDeliveryRecordParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query session settlement records of USDC perpetual @@ -18561,8 +18623,7 @@ getSettlementRecords( params: GetSettlementRecordParamsV5, ): Promise< APIResponseV3WithTime> - > { - return this.getPrivate('/v5/asset/settlement-record', params); + > ⋮---- /** * Query the coin exchange records. @@ -18574,8 +18635,7 @@ getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise< orderBody: CoinExchangeRecordV5[]; nextPageCursor?: string; }> - > { - return this.getPrivate('/v5/asset/exchange/order-record', params); + > ⋮---- /** * Query coin information, including chain information, withdraw and deposit status. @@ -18585,7 +18645,7 @@ getCoinExchangeRecords(params?: GetCoinExchangeRecordParamsV5): Promise< */ getCoinInfo( coin?: string, -): Promise> ⋮---- /** * Query the sub UIDs under a main UID @@ -18597,8 +18657,7 @@ getSubUID(): Promise< subMemberIds: string[]; transferableSubMemberIds: string[]; }> - > { - return this.getPrivate('/v5/asset/transfer/query-sub-member-list'); + > ⋮---- /** * Query asset information. @@ -18608,7 +18667,7 @@ getSubUID(): Promise< */ getAssetInfo( params: GetAssetInfoParamsV5, -): Promise> ⋮---- /** * Query all coin balances of all account types under the master account and sub accounts. @@ -18617,7 +18676,7 @@ getAssetInfo( */ getAllCoinsBalance( params: GetAllCoinsBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query the balance of a specific coin in a specific account type. Supports querying sub UID's balance. @@ -18626,7 +18685,7 @@ getAllCoinsBalance( */ getCoinBalance( params: GetAccountCoinBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query withdrawable amount (incl. risk-frozen `limitAmountUsd` and per-wallet slices). @@ -18635,7 +18694,7 @@ getCoinBalance( */ getWithdrawableAmount(params: { coin: string; -}): Promise> + }): Promise> ⋮---- /** * Query the transferable coin list between each account type. @@ -18643,7 +18702,7 @@ getWithdrawableAmount(params: { getTransferableCoinList( fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, -): Promise> ⋮---- /** * Create the internal transfer between different account types under the same UID. @@ -18657,14 +18716,14 @@ createInternalTransfer( amount: string, fromAccountType: AccountTypeV5, toAccountType: AccountTypeV5, -): Promise> ⋮---- /** * Query the internal transfer records between different account types under the same UID. */ getInternalTransferRecords( params?: GetInternalTransferParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Enable Universal Transfer for Sub UID @@ -18679,14 +18738,14 @@ getInternalTransferRecords( */ enableUniversalTransferForSubUIDs( subMemberIds: string[], -): Promise> ⋮---- /** * Transfer between sub-sub or main-sub. Please make sure you have enabled universal transfer on your sub UID in advance. */ createUniversalTransfer( params: UniversalTransferParamsV5, -): Promise> ⋮---- /** * Query universal transfer records @@ -18696,7 +18755,7 @@ createUniversalTransfer( */ getUniversalTransferRecords( params?: GetUniversalTransferRecordsParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Query allowed deposit coin information. @@ -18709,8 +18768,7 @@ getAllowedDepositCoinInfo( configList: AllowedDepositCoinInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/deposit/query-allowed-list', params); + > ⋮---- /** * Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI @@ -18720,8 +18778,7 @@ setDepositAccount(params: { accountType: AccountTypeV5 }): Promise< APIResponseV3WithTime<{ status: 0 | 1; }> - > { - return this.postPrivate('/v5/asset/deposit/deposit-to-account', params); + > ⋮---- /** * Query deposit records. @@ -18735,8 +18792,7 @@ getDepositRecords( params?: GetDepositRecordParamsV5, ): Promise< APIResponseV3WithTime<{ rows: DepositRecordV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/asset/deposit/query-record', params); + > ⋮---- /** * Query subaccount's deposit records by MAIN UID's API key. @@ -18749,8 +18805,7 @@ getSubAccountDepositRecords( params: GetSubAccountDepositRecordParamsV5, ): Promise< APIResponseV3WithTime<{ rows: DepositRecordV5[]; nextPageCursor: string }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-record', params); + > ⋮---- /** * Get Internal Deposit Records (across Bybit) @@ -18765,8 +18820,7 @@ getInternalDepositRecords(params?: GetInternalDepositRecordParamsV5): Promise< rows: InternalDepositRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/deposit/query-internal-record', params); + > ⋮---- /** * Query the deposit address information of MASTER account. @@ -18779,11 +18833,7 @@ getMasterDepositAddress( coin: string; chains: DepositAddressChainV5[]; }> - > { - return this.getPrivate('/v5/asset/deposit/query-address', { - coin, - chainType, - }); + > ⋮---- /** * Query the deposit address information of SUB account. @@ -18797,12 +18847,7 @@ getSubDepositAddress( coin: string; chains: DepositAddressChainV5; }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { - coin, - chainType, - subMemberId, - }); + > ⋮---- /** * @deprecated - duplicate function, use getSubDepositAddress() instead @@ -18821,19 +18866,14 @@ querySubMemberAddress( coin: string; chains: DepositAddressChainV5; }> - > { - return this.getPrivate('/v5/asset/deposit/query-sub-member-address', { - coin, - chainType, - subMemberId, - }); + > ⋮---- /** * Query withdrawal records. */ getWithdrawalRecords( params?: GetWithdrawalRecordsParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Withdrawal Address List @@ -18846,8 +18886,7 @@ getWithdrawalAddressList(params?: GetWithdrawalAddressListParamsV5): Promise< rows: WithdrawalAddressV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/asset/withdraw/query-address', params); + > ⋮---- /** * Get Exchange Entity List. @@ -18856,8 +18895,7 @@ getWithdrawalAddressList(params?: GetWithdrawalAddressListParamsV5): Promise< */ getExchangeEntities(): Promise< APIResponseV3WithTime<{ vasp: VaspEntityV5[] }> - > { - return this.getPrivate('/v5/asset/withdraw/vasp/list'); + > ⋮---- /** * Submit Deposit Originator Info @@ -18865,7 +18903,7 @@ getExchangeEntities(): Promise< */ submitDepositOriginatorInfo( params: SubmitDepositOriginatorInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Withdraw from Funding, Unified, and/or Earn (and combos such as FUND,UTA,EARN per API). @@ -18878,7 +18916,7 @@ submitDepositOriginatorInfo( */ submitWithdrawal( params: WithdrawParamsV5, -): Promise> ⋮---- /** * Cancel the withdrawal @@ -18887,7 +18925,7 @@ submitWithdrawal( */ cancelWithdrawal( id: string, -): Promise> ⋮---- /** * Query the coin list of convert from (to). @@ -18896,15 +18934,14 @@ getConvertCoins(params: ConvertCoinsParamsV5): Promise< APIResponseV3WithTime<{ coins: ConvertCoinSpecV5[]; }> - > { - return this.getPrivate('/v5/asset/exchange/query-coin-list', params); + > ⋮---- /** * Request a quote for converting coins. */ requestConvertQuote( params: RequestConvertQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Confirm a quote for converting coins. @@ -18914,8 +18951,7 @@ confirmConvertQuote(params: { quoteTxId: string }): Promise< quoteTxId: string; exchangeStatus: 'init' | 'processing' | 'success' | 'failure'; }> - > { - return this.postPrivate('/v5/asset/exchange/convert-execute', params); + > ⋮---- /** * Query the exchange result by sending quoteTxId. @@ -18932,8 +18968,7 @@ getConvertStatus(params: { APIResponseV3WithTime<{ result: ConvertStatusV5; }> - > { - return this.getPrivate('/v5/asset/exchange/convert-result-query', params); + > ⋮---- /** * Query the conversion history. @@ -18942,8 +18977,7 @@ getConvertHistory(params?: GetConvertHistoryParamsV5): Promise< APIResponseV3WithTime<{ list: ConvertHistoryRecordV5[]; }> - > { - return this.getPrivate('/v5/asset/exchange/query-convert-history', params); + > ⋮---- /** * Get Small Balance Coins @@ -18956,7 +18990,7 @@ getConvertHistory(params?: GetConvertHistoryParamsV5): Promise< */ getSmallBalanceList( params: GetSmallBalanceListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Fiat Trading Pair List @@ -18968,7 +19002,7 @@ getSmallBalanceList( */ getFiatTradingPairList( params?: GetFiatTradingPairListParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -18984,7 +19018,7 @@ getFiatTradingPairList( */ createSubMember( params: CreateSubMemberParamsV5, -): Promise> + ): Promise> ⋮---- /** * To create new API key for those newly created sub UID. Use master user's api key only. @@ -18994,15 +19028,14 @@ createSubMember( */ createSubUIDAPIKey( params: CreateSubApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint allows you to get a list of all sub UID of master account. At most 10k subaccounts. */ getSubUIDList(): Promise< APIResponseV3WithTime<{ subMembers: SubMemberV5[] }> - > { - return this.getPrivate('/v5/user/query-sub-members'); + > ⋮---- /** * This endpoint allows you to get a list of all sub UID of master account. No limit on the number of subaccounts. @@ -19015,8 +19048,7 @@ getSubUIDListUnlimited(params?: { subMembers: SubMemberV5[]; nextCursor: string; }> - > { - return this.getPrivate('/v5/user/submembers', params); + > ⋮---- /** * Froze sub uid. Use master user's api key only. @@ -19027,7 +19059,7 @@ getSubUIDListUnlimited(params?: { setSubUIDFrozenState( subuid: number, frozen: 0 | 1, -): Promise> ⋮---- /** * Get the information of the api key. Use the api key pending to be checked to call the endpoint. @@ -19047,8 +19079,7 @@ getSubAccountAllApiKeys(params: GetSubAccountAllApiKeysParamsV5): Promise< result: ApiKeyInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/user/sub-apikeys', params); + > ⋮---- getUIDWalletType(params: { memberIds: string }): Promise< APIResponseV3WithTime<{ @@ -19057,8 +19088,7 @@ getUIDWalletType(params: { memberIds: string }): Promise< accountType: string[]; }[]; }> - > { - return this.getPrivate('/v5/user/get-member-type', params); + > ⋮---- /** * Modify the settings of a master API key. Use the API key pending to be modified to call the endpoint. Use master user's API key only. @@ -19070,7 +19100,7 @@ getUIDWalletType(params: { memberIds: string }): Promise< */ updateMasterApiKey( params: UpdateApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * This endpoint modifies the settings of a sub API key. @@ -19082,7 +19112,7 @@ updateMasterApiKey( */ updateSubApiKey( params: UpdateApiKeyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Delete a sub UID. Before deleting the UID, please make sure there are no assets. @@ -19093,7 +19123,7 @@ updateSubApiKey( */ deleteSubMember( params: DeleteSubMemberParamsV5, -): Promise> ⋮---- /** * Delete the api key of master account. Use the api key pending to be delete to call the endpoint. Use master user's api key only. @@ -19104,7 +19134,7 @@ deleteSubMember( * * DANGER: BE CAREFUL! The API key used to call this interface will be invalid immediately. */ -deleteMasterApiKey(): Promise> ⋮---- /** * Delete the api key of sub account. Use the api key pending to be delete to call the endpoint. Use sub user's api key only. @@ -19118,7 +19148,7 @@ deleteMasterApiKey(): Promise> ⋮---- /** * @@ -19131,14 +19161,14 @@ deleteSubApiKey(params?: { */ createTaxBatchExport( params: CreateTaxBatchExportParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query tax batch export task status and download URLs by batchId. */ getTaxBatchExport( params: GetTaxBatchExportParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19159,8 +19189,7 @@ getAffiliateUserList(params?: GetAffiliateUserListParamsV5): Promise< list: AffiliateUserListItemV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/affiliate/aff-user-list', params); + > ⋮---- /** * Get Affiliate Sub-Affiliate List. @@ -19173,7 +19202,7 @@ getAffiliateUserList(params?: GetAffiliateUserListParamsV5): Promise< */ getAffiliateSubAffiliateList( params?: GetAffiliateSubAffiliateListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Affiliate User Info. @@ -19187,7 +19216,7 @@ getAffiliateSubAffiliateList( */ getAffiliateUserInfo( params: GetAffiliateUserInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Friend Referrals @@ -19200,8 +19229,7 @@ getFriendReferrals(params?: GetFriendReferralsParamsV5): Promise< nextCursor: string; records: FriendReferralRecordV5[]; }> - > { - return this.getPrivate('/v5/user/invitation/referrals', params); + > ⋮---- getReferralCode(): Promise> ⋮---- @@ -19215,7 +19243,7 @@ getReferralCode(): Promise> */ getReferralCommissionRecords( params?: GetReferralCommissionRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get referral rules and configured campaign tasks for the current site. @@ -19226,8 +19254,7 @@ getReferralCommissionRecords( */ getReferralCampaignRewards(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/referral/campaign/rewards', + > ⋮---- /** * Get the authenticated user's referral identity and available commission. @@ -19240,8 +19267,7 @@ return this.postPrivate('/v5/referral/campaign/rewards', */ getReferralUserIdentityProfile(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/referral/user/identity-profile', + > ⋮---- /** * Query invitation records for the authenticated referral user. @@ -19252,7 +19278,7 @@ return this.postPrivate('/v5/referral/user/identity-profile', */ getReferralUserInvitations( params?: GetReferralUserInvitationsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Sign Agreement @@ -19268,7 +19294,7 @@ getReferralUserInvitations( */ signAgreement( params: SignAgreementParamsV5, -): Promise> ⋮---- /** * @@ -19283,7 +19309,7 @@ signAgreement( */ getAlphaTradeQuote( params: GetAlphaTradeQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Purchase @@ -19292,7 +19318,7 @@ getAlphaTradeQuote( */ executeAlphaTradePurchase( params: ExecuteAlphaTradeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Redeem @@ -19301,7 +19327,7 @@ executeAlphaTradePurchase( */ executeAlphaTradeRedeem( params: ExecuteAlphaTradeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Payment Token List @@ -19309,7 +19335,7 @@ executeAlphaTradeRedeem( */ getAlphaPayTokenList( params: GetAlphaPayTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order List @@ -19317,7 +19343,7 @@ getAlphaPayTokenList( */ getAlphaTradeOrderList( params: GetAlphaTradeOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Biz Token List @@ -19325,7 +19351,7 @@ getAlphaTradeOrderList( */ getAlphaBizTokenList( params?: GetAlphaBizTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Price List @@ -19333,7 +19359,7 @@ getAlphaBizTokenList( */ getAlphaBizTokenPriceList( params: GetAlphaBizTokenPriceListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Details @@ -19341,7 +19367,7 @@ getAlphaBizTokenPriceList( */ getAlphaBizTokenDetails( params: GetAlphaBizTokenDetailsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Asset List @@ -19355,7 +19381,7 @@ getAlphaAssetList(): Promise> */ getAlphaAssetDetail( params: GetAlphaAssetDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19369,8 +19395,7 @@ getAlphaAssetDetail( */ getAlphaPredictionEngineStatus(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/alpha/prediction/engine-status'); + > ⋮---- /** * Get Payment Token List @@ -19378,8 +19403,7 @@ getAlphaPredictionEngineStatus(): Promise< */ getAlphaPredictionPayTokenList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/alpha/prediction/pay-token-list'); + > ⋮---- /** * Get Event Detail @@ -19387,7 +19411,7 @@ getAlphaPredictionPayTokenList(): Promise< */ getAlphaPredictionEventDetail( params: GetAlphaPredictionEventDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order Estimate @@ -19395,7 +19419,7 @@ getAlphaPredictionEventDetail( */ getAlphaPredictionOrderEstimate( params: GetAlphaPredictionOrderEstimateParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Buy @@ -19403,7 +19427,7 @@ getAlphaPredictionOrderEstimate( */ executeAlphaPredictionBuy( params: ExecuteAlphaPredictionBuyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Sell @@ -19411,7 +19435,7 @@ executeAlphaPredictionBuy( */ executeAlphaPredictionSell( params: ExecuteAlphaPredictionSellParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order List @@ -19419,7 +19443,7 @@ executeAlphaPredictionSell( */ getAlphaPredictionOrderList( params: GetAlphaPredictionOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Order Book @@ -19427,7 +19451,7 @@ getAlphaPredictionOrderList( */ getAlphaPredictionOrderBook( params: GetAlphaPredictionOrderBookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Token Price @@ -19435,7 +19459,7 @@ getAlphaPredictionOrderBook( */ getAlphaPredictionTokenPrice( params: GetAlphaPredictionTokenPriceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Price History @@ -19443,7 +19467,7 @@ getAlphaPredictionTokenPrice( */ getAlphaPredictionPriceHistory( params: GetAlphaPredictionPriceHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Position List @@ -19451,7 +19475,7 @@ getAlphaPredictionPriceHistory( */ getAlphaPredictionPositionList( params?: GetAlphaPredictionPositionListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Position History @@ -19459,7 +19483,7 @@ getAlphaPredictionPositionList( */ getAlphaPredictionPositionHistory( params?: GetAlphaPredictionPositionHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Portfolio Summary @@ -19467,7 +19491,7 @@ getAlphaPredictionPositionHistory( */ getAlphaPredictionPortfolioSummary( params?: GetAlphaPredictionPortfolioSummaryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Side Market List @@ -19475,7 +19499,7 @@ getAlphaPredictionPortfolioSummary( */ getAlphaPredictionSideMarketList( params: GetAlphaPredictionSideMarketListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Match List @@ -19483,7 +19507,7 @@ getAlphaPredictionSideMarketList( */ getAlphaPredictionSportsMatchList( params: GetAlphaPredictionSportsMatchListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Timeline Stages @@ -19491,7 +19515,7 @@ getAlphaPredictionSportsMatchList( */ getAlphaPredictionSportsTimelineStages( params: GetAlphaPredictionSportsTimelineStagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Sports Group Stage Detail @@ -19499,7 +19523,7 @@ getAlphaPredictionSportsTimelineStages( */ getAlphaPredictionSportsGroupStageDetail( params: GetAlphaPredictionSportsGroupStageDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19513,7 +19537,7 @@ getAlphaPredictionSportsGroupStageDetail( */ getAlphaLPPoolList( params?: GetAlphaLPPoolListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pool Info @@ -19521,7 +19545,7 @@ getAlphaLPPoolList( */ getAlphaLPPoolInfo( params: GetAlphaLPPoolInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute LP Stake @@ -19529,7 +19553,7 @@ getAlphaLPPoolInfo( */ executeAlphaLPStake( params: ExecuteAlphaLPStakeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute LP Redeem @@ -19537,7 +19561,7 @@ executeAlphaLPStake( */ executeAlphaLPRedeem( params: ExecuteAlphaLPRedeemParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Order List @@ -19545,7 +19569,7 @@ executeAlphaLPRedeem( */ getAlphaLPOrderList( params?: GetAlphaLPOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pay Token List @@ -19553,7 +19577,7 @@ getAlphaLPOrderList( */ getAlphaLPPayTokenList( params?: GetAlphaLPPayTokenListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Pay Token Price @@ -19561,7 +19585,7 @@ getAlphaLPPayTokenList( */ getAlphaLPPayTokenPrice( params: GetAlphaLPPayTokenPriceParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get LP Position List @@ -19569,8 +19593,7 @@ getAlphaLPPayTokenPrice( */ getAlphaLPPositionList(): Promise< APIResponseV3WithTime - > { -return this.postPrivate('/v5/alpha/lp/position-list', + > ⋮---- /** * @@ -19588,7 +19611,7 @@ return this.postPrivate('/v5/alpha/lp/position-list', */ getVIPMarginData( params?: GetVIPMarginDataParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Historical Interest Rate @@ -19609,11 +19632,7 @@ getHistoricalInterestRate(params: { vipLevel: string; }[]; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/interest-rate-history', - params, - ); + > ⋮---- /** * Get Currency Data @@ -19621,7 +19640,7 @@ getHistoricalInterestRate(params: { */ getSpotMarginCurrencyData( params?: GetSpotMarginCurrencyDataParamsV5, -): Promise> ⋮---- /** * Turn spot margin trade on / off in your UTA account. @@ -19631,12 +19650,12 @@ getSpotMarginCurrencyData( */ toggleSpotMarginTrade( spotMarginMode: '1' | '0', -): Promise> ⋮---- /** * @deprecated Use setSpotMarginLeverageV2 instead, which uses an object parameter instead. This method will be replaced by setSpotMarginLeverageV2 in a future release. */ -setSpotMarginLeverage(leverage: string): Promise> ⋮---- /** * Set the user's maximum leverage in spot cross margin. @@ -19644,7 +19663,7 @@ setSpotMarginLeverage(leverage: string): Promise> ⋮---- /** * Query the Spot margin status and leverage of Unified account. @@ -19658,7 +19677,7 @@ getSpotMarginState(): Promise> */ manualBorrow( params: ManualBorrowParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get max borrowable amount. @@ -19671,7 +19690,7 @@ manualBorrow( */ getMaxBorrowableAmount( params: GetMaxBorrowableAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get loan position risk information (position tiers) @@ -19680,8 +19699,7 @@ getPositionTiers(params?: GetPositionTiersParamsV5): Promise< APIResponseV3WithTime<{ list: CurrencyPositionTiersV5[]; }> - > { - return this.getPrivate('/v5/spot-margin-trade/position-tiers', params); + > ⋮---- /** * Get currency leverage information (coin state) @@ -19690,15 +19708,14 @@ getCoinState(params?: GetCoinStateParamsV5): Promise< APIResponseV3WithTime<{ list: CoinStateV5[]; }> - > { - return this.getPrivate('/v5/spot-margin-trade/coinstate', params); + > ⋮---- /** * Get available amount to repay */ getAvailableAmountToRepay( params: GetAvailableAmountToRepayParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manual repay without asset conversion @@ -19712,7 +19729,7 @@ getAvailableAmountToRepay( */ manualRepayWithoutConversion( params: ManualRepayWithoutConversionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Auto Repay Mode @@ -19723,35 +19740,56 @@ manualRepayWithoutConversion( */ getAutoRepayMode( params?: GetAutoRepayModeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set Auto Repay Mode * Set spot automatic repayment mode. * * INFO: - * - If currency is not passed, spot automatic repayment will be enabled for all currencies + * - If currency is not passed, autoRepayMode sets the global automatic repayment switch. + * When enabled, it also applies to currencies that become borrowable later. + * - If currency is passed, only that currency is updated; single-currency behavior is unchanged. * - If autoRepayMode of a currency is set to 1, the system will automatically make repayments * without asset conversion to that currency at 0 and 30 minutes every hour * - The amount of repayments is the minimum of available spot balance and liability */ setAutoRepayMode( params: SetAutoRepayModeParamsV5, -): Promise> + ): Promise> +⋮---- +/** + * Get the Unified account's trade auto repayment switch. + * + * Applies only in Cross and Portfolio margin modes; has no effect in Isolated mode. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ +getTradeAutoRepay(): Promise> +⋮---- +/** + * Set the Unified account's trade auto repayment switch. Disabled by default. + * Repays a credited coin's own flexible-rate liability after an eligible spot trade, without asset conversion. + * + * Runs only in Cross and Portfolio margin modes. Isolated mode can save the setting, but repayment does not run. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ +setTradeAutoRepay( + params: SetTradeAutoRepayParamsV5, + ): Promise> ⋮---- /** * Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split. */ getSpotMarginLiability( params: GetSpotMarginLiabilityInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-rate borrow (place order). */ submitFixedRateBorrow( params: FixedRateBorrowParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-rate borrow order history (descending by order time). @@ -19763,11 +19801,7 @@ getFixedRateBorrowOrderInfo( list: FixedRateBorrowOrderInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/fixedborrow-order-info', - params, - ); + > ⋮---- /** * Fixed-rate borrow contract list (descending by borrow time). @@ -19779,33 +19813,42 @@ getFixedRateBorrowContractInfo( list: FixedRateBorrowContractInfoV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/spot-margin-trade/fixedborrow-contract-info', - params, - ); + > ⋮---- /** * Fixed-rate borrow order book quotes (sort by apy, term, or quantity). */ getFixedRateBorrowOrderQuote( params: GetFixedRateBorrowOrderQuoteParamsV5, -): Promise> ⋮---- /** * Renew a fixed-rate loan contract (full remaining amount if `qty` omitted). */ renewFixedRateBorrow( params: RenewFixedRateBorrowParamsV5, -): Promise> + ): Promise> +⋮---- +getFixedRateBorrowInterestAccrued( + params?: GetFixedRateBorrowInterestAccruedParamsV5, + ): Promise< + APIResponseV3WithTime<{ + list: FixedRateBorrowInterestAccruedV5[]; + nextPageCursor: string; + }> + > +⋮---- +cancelFixedRateBorrowOrder( + params: CancelFixedRateBorrowOrderParamsV5, + ): Promise> ⋮---- getFlexibleAvailableInventory( params: GetFlexibleAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- getFixedRateAvailableInventory( params: GetFixedRateAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -19824,10 +19867,7 @@ getSpotMarginCoinInfo(coin?: string): Promise< liquidationOrder: number; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/pledge-token', { - coin, - }); + > ⋮---- /** * Get Borrowable Coin Info @@ -19840,10 +19880,7 @@ getSpotMarginBorrowableCoinInfo(coin?: string): Promise< repaymentPrecision: number; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/borrow-token', { - coin, - }); + > ⋮---- /** * Get Interest & Quota @@ -19857,10 +19894,7 @@ getSpotMarginInterestAndQuota(coin: string): Promise< maxLoanAmount: string; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/loan-info', { - coin, - }); + > ⋮---- /** * Get Loan Account Info @@ -19882,8 +19916,7 @@ getSpotMarginLoanAccountInfo(): Promise< status: number; switchStatus: number; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/account'); + > ⋮---- /** * Borrow @@ -19892,8 +19925,7 @@ spotMarginBorrow(params: { coin: string; qty: string }): Promise< APIResponseV3WithTime<{ transactId: string; }> - > { - return this.postPrivate('/v5/spot-cross-margin-trade/loan', params); + > ⋮---- /** * Repay @@ -19906,8 +19938,7 @@ spotMarginRepay(params: { APIResponseV3WithTime<{ repayId: string; }> - > { - return this.postPrivate('/v5/spot-cross-margin-trade/repay', params); + > ⋮---- /** * Get Borrow Order Detail @@ -19934,8 +19965,7 @@ getSpotMarginBorrowOrderDetail(params?: { type: string; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/orders', params); + > ⋮---- /** * Get Repayment Order Detail @@ -19962,15 +19992,14 @@ getSpotMarginRepaymentOrderDetail(params?: { }[]; }[]; }> - > { - return this.getPrivate('/v5/spot-cross-margin-trade/repay-history', params); + > ⋮---- /** * Turn spot margin trade on / off in your NORMAL account. */ toggleSpotCrossMarginTrade(params: { switch: 1 | 0; -}): Promise> ⋮---- /** * @@ -19993,8 +20022,7 @@ getCollateralCoins(params?: { APIResponseV3WithTime<{ vipCoinList: VipCollateralCoinsV5[]; }> - > { - return this.get('/v5/crypto-loan/collateral-data', params); + > ⋮---- /** * Get Borrowable Coins @@ -20009,8 +20037,7 @@ getBorrowableCoins(params?: { APIResponseV3WithTime<{ vipCoinList: VipBorrowableCoinsV5[]; }> - > { - return this.get('/v5/crypto-loan/loanable-data', params); + > ⋮---- /** * Get Account Borrow/Collateral Limit @@ -20022,7 +20049,7 @@ getBorrowableCoins(params?: { getAccountBorrowCollateralLimit(params: { loanCurrency: string; collateralCurrency: string; -}): Promise> + }): Promise> ⋮---- /** * Borrow Crypto Loan @@ -20038,8 +20065,7 @@ borrowCryptoLoan(params: BorrowCryptoLoanParamsV5): Promise< APIResponseV3WithTime<{ orderId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/borrow', params); + > ⋮---- /** * Repay Crypto Loan @@ -20058,8 +20084,7 @@ repayCryptoLoan(params: { orderId: string; amount: string }): Promise< APIResponseV3WithTime<{ repayId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/repay', params); + > ⋮---- /** * Get Unpaid Loan Orders @@ -20074,8 +20099,7 @@ getUnpaidLoanOrders(params?: GetUnpaidLoanOrdersParamsV5): Promise< list: UnpaidLoanOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/ongoing-orders', params); + > ⋮---- /** * Get Repayment Transaction History @@ -20094,8 +20118,7 @@ getRepaymentHistory(params?: GetRepaymentHistoryParamsV5): Promise< list: RepaymentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/repayment-history', params); + > ⋮---- /** * Get Completed Loan Order History @@ -20115,8 +20138,7 @@ getCompletedLoanOrderHistory( list: CompletedLoanOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/borrow-history', params); + > ⋮---- /** * Get Max. Allowed Reduction Collateral Amount @@ -20130,8 +20152,7 @@ getMaxAllowedReductionCollateralAmount(params: { orderId: string }): Promise< APIResponseV3WithTime<{ maxCollateralAmount: string; }> - > { - return this.getPrivate('/v5/crypto-loan/max-collateral-amount', params); + > ⋮---- /** * Adjust Collateral Amount @@ -20152,8 +20173,7 @@ adjustCollateralAmount(params: { APIResponseV3WithTime<{ adjustId: string; }> - > { - return this.postPrivate('/v5/crypto-loan/adjust-ltv', params); + > ⋮---- /** * Get Loan LTV Adjustment History @@ -20174,8 +20194,7 @@ getLoanLTVAdjustmentHistory( list: LoanLTVAdjustmentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan/adjustment-history', params); + > ⋮---- /** * @@ -20191,8 +20210,7 @@ getLoanBorrowableCoins(params?: GetBorrowableCoinsParamsV5): Promise< APIResponseV3WithTime<{ list: BorrowableCoinV5[]; }> - > { - return this.get('/v5/crypto-loan-common/loanable-data', params); + > ⋮---- /** * Get Collateral Coins New @@ -20200,7 +20218,7 @@ getLoanBorrowableCoins(params?: GetBorrowableCoinsParamsV5): Promise< */ getLoanCollateralCoins( params?: GetCollateralCoinsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Max. Allowed Collateral Reduction Amount New @@ -20210,11 +20228,7 @@ getMaxCollateralAmount(params: GetMaxCollateralAmountParamsV5): Promise< APIResponseV3WithTime<{ maxCollateralAmount: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-common/max-collateral-amount', - params, - ); + > ⋮---- /** * Obtain Max Loan Amount @@ -20226,7 +20240,7 @@ getMaxCollateralAmount(params: GetMaxCollateralAmountParamsV5): Promise< */ getMaxLoanAmount( params: GetMaxLoanAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Adjust Collateral Amount New @@ -20234,7 +20248,7 @@ getMaxLoanAmount( */ updateCollateralAmount( params: AdjustCollateralAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Collateral Adjustment History New @@ -20248,8 +20262,7 @@ getCollateralAdjustmentHistory( list: CollateralAdjustmentHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-common/adjustment-history', params); + > ⋮---- /** * Get Crypto Loan Position New @@ -20257,8 +20270,7 @@ getCollateralAdjustmentHistory( */ getCryptoLoanPosition(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/crypto-loan-common/position'); + > ⋮---- /** * @@ -20273,7 +20285,7 @@ getCryptoLoanPosition(): Promise< */ borrowFlexible( params: BorrowFlexibleParamsV5, -): Promise> + ): Promise> ⋮---- /** * Repay Flexible Loan @@ -20282,7 +20294,7 @@ borrowFlexible( */ repayFlexible( params: RepayFlexibleParamsV5, -): Promise> + ): Promise> ⋮---- /** * Collateral Repayment @@ -20290,7 +20302,7 @@ repayFlexible( */ repayCollateralFlexible( params: RepayCollateralFlexibleParamsV5, -): Promise> ⋮---- /** * Get Flexible Loans @@ -20301,8 +20313,7 @@ getOngoingFlexibleLoans(params?: GetOngoingFlexibleLoansParamsV5): Promise< APIResponseV3WithTime<{ list: OngoingFlexibleLoanV5[]; }> - > { - return this.getPrivate('/v5/crypto-loan-flexible/ongoing-coin', params); + > ⋮---- /** * Get Borrow Orders History @@ -20313,8 +20324,7 @@ getBorrowHistoryFlexible(params?: GetBorrowHistoryFlexibleParamsV5): Promise< list: BorrowHistoryFlexibleV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-flexible/borrow-history', params); + > ⋮---- /** * Get Repayment Orders History @@ -20327,15 +20337,11 @@ getRepaymentHistoryFlexible( list: RepaymentHistoryFlexibleV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-flexible/repayment-history', - params, - ); + > ⋮---- getFlexibleLoanAvailableInventory( params: GetFlexibleLoanAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20352,8 +20358,7 @@ getSupplyOrderQuoteFixed(params: GetSupplyOrderQuoteFixedParamsV5): Promise< APIResponseV3WithTime<{ list: SupplyOrderQuoteFixedV5[]; }> - > { - return this.get('/v5/crypto-loan-fixed/supply-order-quote', params); + > ⋮---- /** * Get Borrowing Market @@ -20364,8 +20369,7 @@ getBorrowOrderQuoteFixed(params: GetBorrowOrderQuoteFixedParamsV5): Promise< APIResponseV3WithTime<{ list: BorrowOrderQuoteFixedV5[]; }> - > { - return this.get('/v5/crypto-loan-fixed/borrow-order-quote', params); + > ⋮---- /** * Create Borrow Order @@ -20374,7 +20378,7 @@ getBorrowOrderQuoteFixed(params: GetBorrowOrderQuoteFixedParamsV5): Promise< */ createBorrowOrderFixed( params: CreateBorrowOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create Supply Order @@ -20385,7 +20389,7 @@ createBorrowOrderFixed( */ createSupplyOrderFixed( params: CreateSupplyOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel Borrow Order @@ -20393,7 +20397,7 @@ createSupplyOrderFixed( */ cancelBorrowOrderFixed( params: CancelBorrowOrderFixedParamsV5, -): Promise> ⋮---- /** * Cancel Supply Order @@ -20402,7 +20406,7 @@ cancelBorrowOrderFixed( */ cancelSupplyOrderFixed( params: CancelSupplyOrderFixedParamsV5, -): Promise> ⋮---- /** * Get Borrow Contract Info @@ -20415,11 +20419,7 @@ getBorrowContractInfoFixed( list: BorrowContractInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-fixed/borrow-contract-info', - params, - ); + > ⋮---- /** * Get Supply Contract Info @@ -20432,11 +20432,7 @@ getSupplyContractInfoFixed( list: SupplyContractInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/crypto-loan-fixed/supply-contract-info', - params, - ); + > ⋮---- /** * Get Borrow Order Info @@ -20447,8 +20443,7 @@ getBorrowOrderInfoFixed(params?: GetBorrowOrderInfoFixedParamsV5): Promise< list: BorrowOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/borrow-order-info', params); + > ⋮---- /** * Get Supply Order Info @@ -20459,8 +20454,7 @@ getSupplyOrderInfoFixed(params?: GetSupplyOrderInfoFixedParamsV5): Promise< list: SupplyOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/supply-order-info', params); + > ⋮---- /** * Repay Fixed Loan @@ -20469,7 +20463,7 @@ getSupplyOrderInfoFixed(params?: GetSupplyOrderInfoFixedParamsV5): Promise< */ repayFixed( params: RepayFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Collateral Repayment @@ -20478,7 +20472,7 @@ repayFixed( */ repayCollateralFixed( params: RepayCollateralFixedParamsV5, -): Promise> ⋮---- /** * Get Repayment History @@ -20489,8 +20483,7 @@ getRepaymentHistoryFixed(params?: GetRepaymentHistoryFixedParamsV5): Promise< list: RepaymentHistoryFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/repayment-history', params); + > ⋮---- /** * Renew Borrow Order @@ -20502,7 +20495,7 @@ getRepaymentHistoryFixed(params?: GetRepaymentHistoryFixedParamsV5): Promise< */ renewBorrowOrderFixed( params: RenewBorrowOrderFixedParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Renew Order Info @@ -20516,12 +20509,11 @@ getRenewOrderInfoFixed(params?: GetRenewOrderInfoFixedParamsV5): Promise< list: RenewOrderInfoFixedV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/crypto-loan-fixed/renew-info', params); + > ⋮---- getFixedLoanAvailableInventory( params: GetFixedLoanAvailableInventoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20536,8 +20528,7 @@ getInstitutionalLendingProductInfo(productId?: string): Promise< APIResponseV3WithTime<{ marginProductInfo: InstitutionalLendingProductInfoV5[]; }> - > { -return this.get('/v5/ins-loan/product-infos', + > ⋮---- /** * Get Coin Delta Amount @@ -20545,15 +20536,14 @@ return this.get('/v5/ins-loan/product-infos', */ getInstitutionalLendingCoinDeltaAmount( params?: GetCoinDeltaAmountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Current LTV, liquidation status, and delay-liquidation timing for an institutional loan account. */ getInstitutionalLendingDelayLiquidationStatus(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/delay-liq-status'); + > ⋮---- /** * Get Margin Coin Info @@ -20561,14 +20551,14 @@ getInstitutionalLendingDelayLiquidationStatus(): Promise< */ getInstitutionalLendingMarginCoinInfo( productId?: string, -): Promise> ⋮---- /** * Get Margin Coin Info With Conversion Rate */ getInstitutionalLendingMarginCoinInfoWithConversionRate( productId?: string, -): Promise> ⋮---- /** * Get Loan Orders @@ -20578,7 +20568,7 @@ getInstitutionalLendingLoanOrders(params?: { startTime?: number; endTime?: number; limit?: number; -}): Promise> ⋮---- /** * Get Repay Orders @@ -20587,7 +20577,7 @@ getInstitutionalLendingRepayOrders(params?: { startTime?: number; endTime?: number; limit?: number; -}): Promise> ⋮---- /** * Get LTV @@ -20595,16 +20585,14 @@ getInstitutionalLendingRepayOrders(params?: { */ getInstitutionalLendingLTV(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/ltv'); + > ⋮---- /** * Get LTV with Ladder Conversion Rate */ getInstitutionalLendingLTVWithLadderConversionRate(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/ins-loan/ltv-convert'); + > ⋮---- /** * Bind or unbind UID for the institutional loan product. @@ -20620,8 +20608,7 @@ bindOrUnbindUID(params: { uid: string; operate: '0' | '1' }): Promise< uid: string; operate: '0' | '1'; }> - > { - return this.postPrivate('/v5/ins-loan/association-uid', params); + > ⋮---- /** * Repay Institutional Loan @@ -20636,7 +20623,7 @@ bindOrUnbindUID(params: { uid: string; operate: '0' | '1' }): Promise< */ repayInstitutionalLoan( params: RepayInstitutionalLoanParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -20655,7 +20642,7 @@ repayInstitutionalLoan( */ getExchangeBrokerEarnings( params?: GetExchangeBrokerEarningsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Exchange Broker Account Info. @@ -20666,8 +20653,7 @@ getExchangeBrokerEarnings( */ getExchangeBrokerAccountInfo(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/broker/account-info'); + > ⋮---- /** * Get Sub Account Deposit Records. @@ -20684,18 +20670,14 @@ getBrokerSubAccountDeposits(params?: GetBrokerSubAccountDepositsV5): Promise< rows: ExchangeBrokerSubAccountDepositRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate( - '/v5/broker/asset/query-sub-member-deposit-record', - params, - ); + > ⋮---- /** * Query Voucher Spec */ getBrokerVoucherSpec(params: { id: string; -}): Promise> + }): Promise> ⋮---- /** * Issue a voucher to a user @@ -20705,7 +20687,7 @@ getBrokerVoucherSpec(params: { */ issueBrokerVoucher( params: IssueVoucherParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query an issued voucher @@ -20715,7 +20697,7 @@ issueBrokerVoucher( */ getBrokerIssuedVoucher( params: GetBrokerIssuedVoucherParamsV5, -): Promise> + ): Promise> ⋮---- /** * Set Rate Limit @@ -20732,8 +20714,7 @@ setBrokerRateLimit(params: SetBrokerRateLimitParamsV5): Promise< APIResponseV3WithTime<{ result: BrokerRateLimitSetResultItemV5[]; }> - > { - return this.postPrivate('/v5/broker/apilimit/set', params); + > ⋮---- /** * Get Rate Limit Cap @@ -20750,8 +20731,7 @@ getBrokerRateLimitCap(): Promise< APIResponseV3WithTime<{ list: BrokerRateLimitCapItemV5[]; }> - > { - return this.getPrivate('/v5/broker/apilimit/query-cap'); + > ⋮---- /** * Get All Rate Limits @@ -20768,8 +20748,7 @@ getAllBrokerRateLimits(params?: GetAllBrokerRateLimitsParamsV5): Promise< list: BrokerRateLimitAllItemV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/broker/apilimit/query-all', params); + > ⋮---- /** * @@ -20786,22 +20765,21 @@ getEarnProduct(params: { category: string; coin?: string }): Promise< APIResponseV3WithTime<{ list: EarnProductV5[]; }> - > { - return this.get('/v5/earn/product', params); + > ⋮---- /** * Query Flexible Saving auto savings settings. Omit coins to return every supported coin. */ getFlexibleSavingAutoSavings( params?: GetFlexibleSavingAutoSavingsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Enable or disable Flexible Saving auto savings for one coin, or globally when coin is omitted. */ setFlexibleSavingAutoSavings( params: SetFlexibleSavingAutoSavingsParamsV5, -): Promise> ⋮---- /** * Get Coupon List @@ -20809,7 +20787,7 @@ setFlexibleSavingAutoSavings( */ getEarnCouponList( params: GetEarnCouponListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA Product List @@ -20817,7 +20795,7 @@ getEarnCouponList( */ getRWAProductList( params?: GetRWAProductListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Place RWA Order @@ -20825,22 +20803,21 @@ getRWAProductList( */ placeRWAOrder( params: PlaceRWAOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA Position List */ getRWAPositionList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/earn/rwa/position'); + > ⋮---- /** * Get RWA Order List */ getRWAOrderList( params?: GetRWAOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RWA NAV Chart @@ -20848,7 +20825,7 @@ getRWAOrderList( */ getRWANavChart( params: GetRWANavChartParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Hold to Earn airdrop products (ByFi). @@ -20857,8 +20834,7 @@ getRWANavChart( */ getHoldToEarnAirdropProducts(): Promise< APIResponseV3WithTime - > { - return this.get('/v5/earn/hold-to-earn/product'); + > ⋮---- /** * Get Advanced Earn product info (Dual Asset, Double Win, Smart Leverage, etc. via `category`). @@ -20867,7 +20843,7 @@ getHoldToEarnAirdropProducts(): Promise< */ getAdvanceEarnProduct( params: GetAdvanceEarnProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Liquidity mining — product list (Advanced Earn). @@ -20876,7 +20852,7 @@ getAdvanceEarnProduct( */ getLiquidityMiningProduct( params?: GetLiquidityMiningProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Liquidity mining reinvest. Puts claimable yield of a position back into the pool. @@ -20887,7 +20863,7 @@ getLiquidityMiningProduct( */ reinvestLiquidityMining( params: ReinvestLiquidityMiningParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term / fixed saving — product list (Earn). @@ -20896,7 +20872,7 @@ reinvestLiquidityMining( */ getFixedTermEarnProduct( params?: GetFixedTermEarnProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — quote / extra info (Discount Buy, Dual Assets, …). Call before place order where required. @@ -20906,7 +20882,7 @@ getFixedTermEarnProduct( */ getAdvanceEarnProductExtraInfo( params: GetAdvanceEarnProductExtraInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — place order (Dual Assets, Discount Buy, …). Async; use getAdvanceEarnOrder to track. @@ -20915,7 +20891,7 @@ getAdvanceEarnProductExtraInfo( */ submitAdvanceEarnPlaceOrder( params: SubmitAdvanceEarnPlaceOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — active positions (Dual Assets, Discount Buy, …). @@ -20924,7 +20900,7 @@ submitAdvanceEarnPlaceOrder( */ getAdvanceEarnPosition( params: GetAdvanceEarnPositionListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Advanced Earn — order list (Dual Assets, Discount Buy, …). Distinct from getEarnOrderHistory (/v5/earn/order). @@ -20933,7 +20909,7 @@ getAdvanceEarnPosition( */ getAdvanceEarnOrder( params: GetAdvanceEarnOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — place order (stake). Async; use getFixedTermEarnOrder to track. @@ -20942,7 +20918,7 @@ getAdvanceEarnOrder( */ submitFixedTermEarnOrder( params: SubmitFixedTermEarnOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — early redeem (FundPool only, when product allows). @@ -20951,7 +20927,7 @@ submitFixedTermEarnOrder( */ redeemFixedTermEarn( params: RedeemFixedTermEarnParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — active positions. @@ -20960,7 +20936,7 @@ redeemFixedTermEarn( */ getFixedTermEarnPosition( params?: GetFixedTermEarnPositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — order list. @@ -20969,7 +20945,7 @@ getFixedTermEarnPosition( */ getFixedTermEarnOrder( params?: GetFixedTermEarnOrderListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Fixed-term earn — enable or disable auto-invest on a position. @@ -20978,7 +20954,7 @@ getFixedTermEarnOrder( */ setFixedTermEarnAutoInvest( params: SetFixedTermEarnAutoInvestParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Stake or Redeem Earn products @@ -20995,8 +20971,7 @@ submitStakeRedeem(params: SubmitStakeRedeemParamsV5): Promise< orderId: string; orderLinkId: string; }> - > { - return this.postPrivate('/v5/earn/place-order', params); + > ⋮---- /** * Get Stake/Redeem Order History @@ -21013,8 +20988,7 @@ getEarnOrderHistory(params: GetEarnOrderHistoryParamsV5): Promise< list: EarnOrderHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/order', params); + > ⋮---- /** * Get Staked Position @@ -21029,8 +21003,7 @@ getEarnPosition(params: GetEarnPositionParamsV5): Promise< APIResponseV3WithTime<{ list: EarnPositionV5[]; }> - > { - return this.getPrivate('/v5/earn/position', params); + > ⋮---- /** * Modify OnChain Earn position (e.g. auto-reinvest for fixed duration products). @@ -21039,7 +21012,7 @@ getEarnPosition(params: GetEarnPositionParamsV5): Promise< */ modifyEarnPosition( params: ModifyEarnPositionParamsV5, -): Promise>> + ): Promise>> ⋮---- /** * Get Yield History @@ -21053,8 +21026,7 @@ getEarnYieldHistory(params: GetEarnYieldHistoryParamsV5): Promise< yield: EarnYieldHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/yield', params); + > ⋮---- /** * Get Hold to Earn airdrop daily PnL records (ByFi). Up to 3 months of completed yield history. @@ -21063,7 +21035,7 @@ getEarnYieldHistory(params: GetEarnYieldHistoryParamsV5): Promise< */ getHoldToEarnAirdropYieldHistory( params: GetHoldToEarnAirdropYieldHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Hourly Yield History @@ -21075,8 +21047,7 @@ getEarnHourlyYieldHistory(params: GetEarnHourlyYieldHistoryParamsV5): Promise< list: EarnHourlyYieldHistoryV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/hourly-yield', params); + > ⋮---- /** * Get historical APR (FlexibleSaving / OnChain), up to ~6 months. @@ -21085,7 +21056,7 @@ getEarnHourlyYieldHistory(params: GetEarnHourlyYieldHistoryParamsV5): Promise< */ getEarnAprHistory( params: GetEarnAprHistoryParamsV5, -): Promise> ⋮---- /** * Earn token product (e.g. BYUSDT) — Get Product Info @@ -21093,14 +21064,14 @@ getEarnAprHistory( */ getEarnTokenProduct( params: GetEarnTokenProductParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Place Order (Mint / Redeem). Accepted response is not final settlement; use `getEarnTokenOrders`. */ submitEarnTokenOrder( params: PlaceEarnTokenOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Get Order List @@ -21110,15 +21081,14 @@ getEarnTokenOrders(params: GetEarnTokenOrderListParamsV5): Promise< list: EarnTokenOrderV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/order', params); + > ⋮---- /** * Earn token — Get Position Info */ getEarnTokenPosition( params: GetEarnTokenPositionParamsV5, -): Promise> + ): Promise> ⋮---- /** * Earn token — Get Daily Yield Records @@ -21128,8 +21098,7 @@ getEarnTokenDailyYield(params: GetEarnTokenDailyYieldParamsV5): Promise< list: EarnTokenDailyYieldRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/yield', params); + > ⋮---- /** * Earn token — Get Hourly Yield Records @@ -21139,15 +21108,14 @@ getEarnTokenHourlyYield(params: GetEarnTokenHourlyYieldParamsV5): Promise< list: EarnTokenHourlyYieldRecordV5[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/earn/token/hourly-yield', params); + > ⋮---- /** * Earn token — Get History APR (7/30/180 days). No authentication required. */ getEarnTokenHistoryApr( params: GetEarnTokenHistoryAprParamsV5, -): Promise> ⋮---- /** * @@ -21160,86 +21128,84 @@ getEarnTokenHistoryApr( */ getPwmInvestmentPlanList(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/earn/pwm/investment-plan/list'); + > ⋮---- /** * Get PWM investment plan detail (Active or Closed). */ getPwmInvestmentPlanDetail( params: GetPwmInvestmentPlanDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get pending PWM investment plan detail (PendingSubscription). */ getPwmPendingInvestmentPlanDetail( params: GetPwmPendingInvestmentPlanDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * Claim withdrawable funds from a PWM investment plan (Active). */ claimPwmWithdrawableFunds( params: ClaimPwmWithdrawableFundsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM investment plan asset trend (default last 7 days). */ getPwmInvestmentPlanAssetTrend( params: GetPwmInvestmentPlanAssetTrendParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM fund historical NAV (max 180 days between startTime and endTime). */ getPwmFundHistoricalNav( params: GetPwmFundHistoricalNavParamsV5, -): Promise> + ): Promise> ⋮---- /** * Subscribe to a PWM investment plan (PendingSubscription). */ subscribePwmInvestmentPlan( params: SubscribePwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Invest more into a PWM investment plan product (Active). */ investMorePwmInvestmentPlan( params: InvestMorePwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Redeem from a PWM investment plan product. */ redeemPwmInvestmentPlan( params: RedeemPwmInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM investment plan orders (subscribe / redeem / auto-reinvest). */ getPwmInvestmentPlanOrders( params?: GetPwmInvestmentPlanOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get PWM subscribable product info for customize plan. No authentication required. */ getPwmSubscribableProductInfo(): Promise< APIResponseV3WithTime - > { - return this.get('/v5/earn/pwm/customize-plan/product'); + > ⋮---- /** * Create a customized PWM investment plan (max 20 Active + Pending plans per user). */ createPwmCustomizeInvestmentPlan( params: CreatePwmCustomizeInvestmentPlanParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21252,21 +21218,21 @@ createPwmCustomizeInvestmentPlan( */ getPwmAllFunds( params?: GetPwmAllFundsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Settle fund profit sharing (Active funds only). */ settlePwmFundProfit( params: SettlePwmFundProfitParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM fund (PendingSubscribe). Max 10 funds per institution. */ createPwmFund( params: CreatePwmFundParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM investment plan for a user (PendingSubscription). Max 10 plans per institution. @@ -21275,18 +21241,14 @@ createPwmAssetManagerInvestmentPlan( params: CreatePwmAssetManagerInvestmentPlanParamsV5, ): Promise< APIResponseV3WithTime - > { - return this.postPrivate( - '/v5/earn/pwm/asset-manager/create-investment-plan', - params, - ); + > ⋮---- /** * Get PWM investment plans created by the institution (asset manager). */ getPwmAssetManagerInvestmentPlans( params?: GetPwmAssetManagerInvestmentPlansParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manage a PWM investment plan (status and/or fund allocation). @@ -21295,46 +21257,42 @@ managePwmAssetManagerInvestmentPlan( params: ManagePwmAssetManagerInvestmentPlanParamsV5, ): Promise< APIResponseV3WithTime - > { - return this.postPrivate( - '/v5/earn/pwm/asset-manager/manage-investment-plan', - params, - ); + > ⋮---- /** * Get all PWM fund orders (asset manager). Default time window: last 7 days. */ getPwmAllFundOrders( params?: GetPwmAllFundOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Manage a PWM fund order (approve / reject Pending Review orders). */ managePwmFundOrder( params: ManagePwmFundOrderParamsV5, -): Promise> + ): Promise> ⋮---- /** * Create a PWM fund sub-account (async; max 30 per fund, fund must be Active). */ createPwmFundSubAccount( params: CreatePwmFundSubAccountParamsV5, -): Promise> + ): Promise> ⋮---- /** * Transfer funds between custodian sub-accounts (fund custodian API key required). */ pwmFundTransfer( params: PwmFundTransferParamsV5, -): Promise> + ): Promise> ⋮---- /** * Query PWM fund transfer result (fund custodian API key required). */ getPwmFundTransferRecords( params?: GetPwmFundTransferRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21347,7 +21305,7 @@ getPwmFundTransferRecords( */ queryCardAssetRecords( params?: QueryCardAssetRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — point balance (available, pending, account status, …). @@ -21359,7 +21317,7 @@ queryCardPointsBalance(): Promise> */ queryCardPointsRecords( params?: QueryCardPointRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — reward tier, spending limit, auto cashback. @@ -21371,14 +21329,14 @@ queryCardPointsTier(): Promise> */ queryCardMallItemList( params?: QueryCardMallItemListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Bybit Card — cashback detail for a reward order. */ queryCardPointCashbackDetail( params: QueryCardPointCashbackDetailParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21392,7 +21350,7 @@ queryCardPointCashbackDetail( */ createRFQ( params: CreateRFQParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get RFQ Configuration @@ -21408,7 +21366,7 @@ getRFQConfig(): Promise> */ cancelRFQ( params: CancelRFQParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel All RFQ @@ -21423,7 +21381,7 @@ cancelAllRFQ(): Promise> */ createRFQQuote( params: CreateRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Execute Quote @@ -21432,7 +21390,7 @@ createRFQQuote( */ executeRFQQuote( params: ExecuteRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel Quote @@ -21441,7 +21399,7 @@ executeRFQQuote( */ cancelRFQQuote( params: CancelRFQQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel All Quotes @@ -21451,8 +21409,7 @@ cancelAllRFQQuotes(): Promise< APIResponseV3WithTime<{ data: CancelRFQQuoteItemV5[]; // Array of cancellation results }> - > { - return this.postPrivate('/v5/rfq/cancel-all-quotes'); + > ⋮---- data: CancelRFQQuoteItemV5[]; // Array of cancellation results ⋮---- @@ -21464,7 +21421,7 @@ data: CancelRFQQuoteItemV5[]; // Array of cancellation results */ getRFQRealtimeInfo( params?: GetRFQRealtimeParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Historical RFQ Information @@ -21474,7 +21431,7 @@ getRFQRealtimeInfo( */ getRFQHistory( params?: GetRFQListParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Real-time Quote Information @@ -21488,8 +21445,7 @@ getRFQRealtimeQuote(params?: GetRFQQuoteRealtimeParamsV5): Promise< APIResponseV3WithTime<{ list: RFQQuoteItemV5[]; }> - > { - return this.getPrivate('/v5/rfq/quote-realtime', params); + > ⋮---- /** * Get Historical Quote Information @@ -21503,8 +21459,7 @@ getRFQHistoryQuote(params?: GetRFQHistoryParamsV5): Promise< cursor: string; // Page turning mark list: RFQQuoteItemV5[]; // Array of quote items }> - > { - return this.getPrivate('/v5/rfq/quote-list', params); + > ⋮---- cursor: string; // Page turning mark list: RFQQuoteItemV5[]; // Array of quote items @@ -21518,8 +21473,7 @@ getRFQTrades(params?: GetRFQTradeListParamsV5): Promise< cursor: string; // Page turning mark list: RFQTradeV5[]; // Array of trade items }> - > { - return this.getPrivate('/v5/rfq/trade-list', params); + > ⋮---- cursor: string; // Page turning mark list: RFQTradeV5[]; // Array of trade items @@ -21533,8 +21487,7 @@ getRFQPublicTrades(params?: GetRFQPublicTradesParamsV5): Promise< cursor: string; // Page turning mark list: RFQPublicTradeV5[]; // Array of public trade items }> - > { - return this.getPrivate('/v5/rfq/public-trades', params); + > ⋮---- cursor: string; // Page turning mark list: RFQPublicTradeV5[]; // Array of public trade items @@ -21548,15 +21501,14 @@ list: RFQPublicTradeV5[]; // Array of public trade items */ acceptNonLPQuote( params: AcceptNonLPQuoteParamsV5, -): Promise> + ): Promise> ⋮---- getRFQDetails(params?: GetRFQDetailsParamsV5): Promise< APIResponseV3WithTime<{ cursor: string; list: RFQDetailItemV5[]; }> - > { - return this.getPrivate('/v5/rfq/rfq-detail-list', params); + > ⋮---- /** * @@ -21576,7 +21528,7 @@ getRFQDetails(params?: GetRFQDetailsParamsV5): Promise< */ getP2PAccountCoinsBalance( params: GetP2PAccountCoinsBalanceParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21588,14 +21540,14 @@ getP2PAccountCoinsBalance( */ getP2POnlineAds( params: GetP2POnlineAdsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Post new P2P advertisement */ createP2PAd( params: CreateP2PAdParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel P2P advertisement @@ -21607,15 +21559,14 @@ cancelP2PAd(params: { itemId: string }): Promise< riskVersion: string; needSecurityRisk: boolean; }> - > { - return this.postPrivate('/v5/p2p/item/cancel', params); + > ⋮---- /** * Update or relist P2P advertisement */ updateP2PAd( params: UpdateP2PAdParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get personal P2P ads list @@ -21623,14 +21574,14 @@ updateP2PAd( */ getP2PPersonalAds( params: GetP2PPersonalAdsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get P2P ad details */ getP2PAdDetail(params: { itemId: string; -}): Promise> + }): Promise> ⋮---- /** * @@ -21643,7 +21594,7 @@ getP2PAdDetail(params: { */ getP2POrders( params: GetP2POrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get P2P order details @@ -21651,28 +21602,28 @@ getP2POrders( */ getP2POrderDetail(params: { orderId: string; -}): Promise> + }): Promise> ⋮---- /** * Get pending P2P orders */ getP2PPendingOrders( params: GetP2PPendingOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Mark P2P order as paid */ markP2POrderAsPaid( params: MarkP2POrderAsPaidParamsV5, -): Promise> + ): Promise> ⋮---- /** * Release digital assets in a P2P order */ releaseP2POrder(params: { orderId: string; -}): Promise> + }): Promise> ⋮---- /** * Buyer review of a pending seller cancel request. @@ -21682,14 +21633,14 @@ releaseP2POrder(params: { */ reviewP2PSellerCancelOrderApply( params: ReviewP2PSellerCancelOrderApplyParamsV5, -): Promise> + ): Promise> ⋮---- /** * Send chat message in a P2P order */ sendP2POrderMessage( params: SendP2POrderMessageParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21702,7 +21653,7 @@ sendP2POrderMessage( */ getP2PChatSessions( params: GetP2PChatSessionsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get the AES encrypted P2P chat session ID for a counterparty. @@ -21710,7 +21661,7 @@ getP2PChatSessions( */ getP2PChatSessionId( params: GetP2PChatSessionIdParamsV5, -): Promise> ⋮---- /** * Upload chat file for P2P order (Node.js only) @@ -21733,8 +21684,7 @@ uploadP2PChatFile(params: { type: string; uploadId: string | null; }> - > { - return this.postPrivateFile('/v5/p2p/oss/upload_file', params); + > ⋮---- fileName: string; // Required: the filename (used for MIME type detection) ⋮---- @@ -21743,7 +21693,11 @@ fileName: string; // Required: the filename (used for MIME type detection) * For files, first call uploadP2PChatFile and use its URL as the message. * @see https://bybit-exchange.github.io/docs/p2p/chat/send-chat-msg */ -sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise< +sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise<{ + ret_code: number; + ret_msg: string; + rateLimitApi?: APIRateLimit; + }> ⋮---- /** * Get P2P chat messages, ordered by creation time descending. @@ -21751,14 +21705,14 @@ sendP2PChatMessage(params: SendP2PChatMessageParamsV5): Promise< */ getP2PChatMessages( params: GetP2PChatMessagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get chat messages in a P2P order */ getP2POrderMessages( params: GetP2POrderMessagesParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21775,7 +21729,7 @@ getP2PUserInfo(): Promise> */ getP2PCounterpartyUserInfo( params: GetP2PCounterpartyUserInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get user payment information @@ -21814,8 +21768,7 @@ setApiRateLimit(params: { msg: string; }[]; }> - > { - return this.postPrivate('/v5/apilimit/set', params); + > ⋮---- /** * Query API rate limit @@ -21834,8 +21787,7 @@ queryApiRateLimit(params: { uids: string }): Promise< rate: number; }[]; }> - > { - return this.getPrivate('/v5/apilimit/query', params); + > ⋮---- /** * Get Rate Limit Cap @@ -21853,8 +21805,7 @@ getRateLimitCap(): Promise< uidCap: number; }[]; }> - > { - return this.getPrivate('/v5/apilimit/query-cap'); + > ⋮---- /** * Get All Rate Limits @@ -21875,8 +21826,7 @@ getAllRateLimits(params?: { }[]; nextPageCursor: string; }> - > { - return this.getPrivate('/v5/apilimit/query-all', params); + > ⋮---- /** * @@ -21886,32 +21836,31 @@ getAllRateLimits(params?: { ⋮---- getLaunchpoolProjectList( params: GetLaunchpoolProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getLaunchpoolUserActivityLog( params?: GetLaunchpoolUserActivityLogParamsV5, -): Promise> + ): Promise> ⋮---- getLaunchpoolCurrentStaking(): Promise< APIResponseV3WithTime - > { - return this.getPrivate('/v5/spot-x/launchpool/user/current-staking'); + > ⋮---- getLaunchpoolUserHistory( params?: GetLaunchpoolUserHistoryParamsV5, -): Promise> + ): Promise> ⋮---- getPuzzleProjectList( params: GetPuzzleProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getTokenSplashProjectList( params: GetTokenSplashProjectListParamsV5, -): Promise> + ): Promise> ⋮---- getTokenSplashUserActivityParams( params?: GetTokenSplashUserActivityParamsV5, -): Promise> + ): Promise> ⋮---- /** * @@ -21929,7 +21878,7 @@ getTokenSplashUserActivityParams( */ getEventInstrumentsInfo( params?: GetEventInstrumentsInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract 25-level orderbook. Each level is [payoutRatio, orderValue]. @@ -21938,7 +21887,7 @@ getEventInstrumentsInfo( */ getEventOrderbook( params: GetEventOrderbookParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract order history (up to 2 years). Default query window is 7 days if start/end omitted. @@ -21947,7 +21896,7 @@ getEventOrderbook( */ getEventOrderHistory( params?: GetEventOrderHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract active (unfilled / partially filled) orders. @@ -21956,7 +21905,7 @@ getEventOrderHistory( */ getEventActiveOrders( params?: GetEventActiveOrdersParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract position info (UpDown, Target, Range). @@ -21965,7 +21914,7 @@ getEventActiveOrders( */ getEventPositionInfo( params?: GetEventPositionInfoParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract trade (execution) history (up to 2 years). Default query window is 7 days if start/end omitted. @@ -21974,7 +21923,7 @@ getEventPositionInfo( */ getEventTradeHistory( params: GetEventTradeHistoryParamsV5, -): Promise> + ): Promise> ⋮---- /** * Get Event Contract settlement records (up to 2 years). Default query window is 7 days if start/end omitted. @@ -21983,7 +21932,7 @@ getEventTradeHistory( */ getEventSettlementRecords( params: GetEventSettlementRecordsParamsV5, -): Promise> + ): Promise> ⋮---- /** * Submit an Event Contract payout-ratio quote. @@ -21992,7 +21941,7 @@ getEventSettlementRecords( */ submitEventQuote( params: SubmitEventQuoteParamsV5, -): Promise> + ): Promise> ⋮---- /** * Cancel an Event Contract quote. Pass orderLinkId and/or orderId. @@ -22001,7 +21950,16 @@ submitEventQuote( */ cancelEventQuote( params?: CancelEventQuoteParamsV5, -): Promise> + ): Promise> +⋮---- +/** + * Cancel all active Event Contract quotes for a symbol. + * + * INFO: Event Contract maker accounts only. + */ +cancelAllEventQuotes( + params: CancelAllEventQuotesParamsV5, + ): Promise> ================ File: docs/BYBIT_SDK_QUICKSTART_GUIDE.md @@ -24636,7 +24594,7 @@ File: package.json ================ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/package-lock.json b/package-lock.json index a9e76876..7a19c170 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "license": "MIT", "dependencies": { "@types/ws": "8.18.1", diff --git a/package.json b/package.json index 0874b489..71b6283c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "4.8.4", + "version": "4.8.5", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/rest-client-v5.ts b/src/rest-client-v5.ts index 09177550..b2ff5b1b 100644 --- a/src/rest-client-v5.ts +++ b/src/rest-client-v5.ts @@ -87,10 +87,13 @@ import { BrokerRateLimitCapItemV5, BrokerRateLimitSetResultItemV5, BrokerVoucherSpecV5, + CancelAllEventQuotesParamsV5, + CancelAllEventQuotesResultV5, CancelAllOrdersParamsV5, CancelAllRFQResultV5, CancelBorrowOrderFixedParamsV5, CancelEventQuoteParamsV5, + CancelFixedRateBorrowOrderParamsV5, CancelOrderParamsV5, CancelRFQParamsV5, CancelRFQQuoteItemV5, @@ -126,6 +129,7 @@ import { ConvertHistoryRecordV5, ConvertQuoteV5, ConvertStatusV5, + CorporateActionV5, CreateBorrowOrderFixedParamsV5, CreateBorrowOrderFixedV5, CreateP2PAdParamsV5, @@ -202,6 +206,7 @@ import { FixedLoanAvailableInventoryV5, FixedRateAvailableInventoryV5, FixedRateBorrowContractInfoV5, + FixedRateBorrowInterestAccruedV5, FixedRateBorrowOrderInfoV5, FixedRateBorrowParamsV5, FixedRateBorrowQuoteV5, @@ -279,6 +284,7 @@ import { GetCollateralCoinsParamsV5, GetCompletedLoanOrderHistoryParamsV5, GetConvertHistoryParamsV5, + GetCorporateActionsParamsV5, GetDeliveryPriceParamsV5, GetDeliveryRecordParamsV5, GetDepositRecordParamsV5, @@ -309,6 +315,7 @@ import { GetFixedLoanAvailableInventoryParamsV5, GetFixedRateAvailableInventoryParamsV5, GetFixedRateBorrowContractInfoParamsV5, + GetFixedRateBorrowInterestAccruedParamsV5, GetFixedRateBorrowOrderInfoParamsV5, GetFixedRateBorrowOrderQuoteParamsV5, GetFixedTermEarnOrderListParamsV5, @@ -586,6 +593,7 @@ import { SettlePwmFundProfitParamsV5, SettlePwmFundProfitResultV5, SetTPSLModeParamsV5, + SetTradeAutoRepayParamsV5, SetTradingStopParamsV5, SignAgreementParamsV5, SmallBalanceListV5, @@ -630,6 +638,7 @@ import { TokenSplashUserActivityResultV5, TotalMembersAssetsResultV5, TPSLModeV5, + TradeAutoRepayResultV5, TradeInfoForAnalysisResultV5, TransactionLogV5, UnifiedAccountUpgradeResultV5, @@ -914,6 +923,11 @@ export class RestClientV5 extends BaseRestClient { * - orderId & orderLinkId has a higher priority than startTime & endTime * - Fully canceled orders are stored for up to 24 hours * - Single leg orders can also be found with "createType"=CreateByFutureSpread via Get Order History + * - From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getSpreadOrderHistory(params?: GetSpreadOrderHistoryParamsV5): Promise< APIResponseV3WithTime<{ @@ -1281,6 +1295,15 @@ export class RestClientV5 extends BaseRestClient { return this.get('/v5/market/option-base-coins', params); } + getCorporateActions(params?: GetCorporateActionsParamsV5): Promise< + APIResponseV3WithTime<{ + list: CorporateActionV5[]; + nextPageCursor: string; + }> + > { + return this.get('/v5/market/corporate-action', params); + } + /** * ****** Trade APIs @@ -1326,6 +1349,11 @@ export class RestClientV5 extends BaseRestClient { * Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. * * If you want to get real-time order information, you could query this endpoint or rely on the websocket stream (recommended). + * + * From 2026-12-03 (postponed from 2026-11-12), omitting orderStatus excludes Cancelled, Rejected and Deactivated orders from the last 24 hours. + * Pass orderStatus explicitly to retrieve matching orders from that period. + * @see https://t.me/Bybit_API_Announcements/464 + * @see https://t.me/Bybit_API_Announcements/468 */ getHistoricOrders( params: GetAccountHistoricOrdersParamsV5, @@ -3663,7 +3691,9 @@ export class RestClientV5 extends BaseRestClient { * Set spot automatic repayment mode. * * INFO: - * - If currency is not passed, spot automatic repayment will be enabled for all currencies + * - If currency is not passed, autoRepayMode sets the global automatic repayment switch. + * When enabled, it also applies to currencies that become borrowable later. + * - If currency is passed, only that currency is updated; single-currency behavior is unchanged. * - If autoRepayMode of a currency is set to 1, the system will automatically make repayments * without asset conversion to that currency at 0 and 30 minutes every hour * - The amount of repayments is the minimum of available spot balance and liability @@ -3677,6 +3707,32 @@ export class RestClientV5 extends BaseRestClient { ); } + /** + * Get the Unified account's trade auto repayment switch. + * + * Applies only in Cross and Portfolio margin modes; has no effect in Isolated mode. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ + getTradeAutoRepay(): Promise> { + return this.getPrivate('/v5/spot-margin-trade/get-trade-auto-repay'); + } + + /** + * Set the Unified account's trade auto repayment switch. Disabled by default. + * Repays a credited coin's own flexible-rate liability after an eligible spot trade, without asset conversion. + * + * Runs only in Cross and Portfolio margin modes. Isolated mode can save the setting, but repayment does not run. + * Separate from scheduled automatic repayment configured through setAutoRepayMode. + */ + setTradeAutoRepay( + params: SetTradeAutoRepayParamsV5, + ): Promise> { + return this.postPrivate( + '/v5/spot-margin-trade/set-trade-auto-repay', + params, + ); + } + /** * Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split. */ @@ -3750,6 +3806,29 @@ export class RestClientV5 extends BaseRestClient { return this.postPrivate('/v5/spot-margin-trade/fixedborrow-renew', params); } + getFixedRateBorrowInterestAccrued( + params?: GetFixedRateBorrowInterestAccruedParamsV5, + ): Promise< + APIResponseV3WithTime<{ + list: FixedRateBorrowInterestAccruedV5[]; + nextPageCursor: string; + }> + > { + return this.getPrivate( + '/v5/spot-margin-trade/fixedborrow-interest-accrued', + params, + ); + } + + cancelFixedRateBorrowOrder( + params: CancelFixedRateBorrowOrderParamsV5, + ): Promise> { + return this.postPrivate( + '/v5/spot-margin-trade/fixedborrow-order-cancel', + params, + ); + } + getFlexibleAvailableInventory( params: GetFlexibleAvailableInventoryParamsV5, ): Promise> { @@ -6310,4 +6389,15 @@ export class RestClientV5 extends BaseRestClient { ): Promise> { return this.postPrivate('/v5/event/cancel', params); } + + /** + * Cancel all active Event Contract quotes for a symbol. + * + * INFO: Event Contract maker accounts only. + */ + cancelAllEventQuotes( + params: CancelAllEventQuotesParamsV5, + ): Promise> { + return this.postPrivate('/v5/event/cancel-all', params); + } } diff --git a/src/types/request/v5-event.ts b/src/types/request/v5-event.ts index b0490a64..91efe8f5 100644 --- a/src/types/request/v5-event.ts +++ b/src/types/request/v5-event.ts @@ -59,9 +59,15 @@ export interface SubmitEventQuoteParamsV5 { orderLinkId: string; grossPayoutRatio: string; amount: string; + /** Automatically cancel after this many milliseconds. 0 uses quoteMaxValidMs; non-zero values must not exceed quoteMaxValidMs */ + cancelAfterMs?: number; } export interface CancelEventQuoteParamsV5 { orderLinkId?: string; orderId?: string; } + +export interface CancelAllEventQuotesParamsV5 { + symbol: string; +} diff --git a/src/types/request/v5-market.ts b/src/types/request/v5-market.ts index 0f032069..749636f2 100644 --- a/src/types/request/v5-market.ts +++ b/src/types/request/v5-market.ts @@ -204,3 +204,11 @@ export interface GetOptionBaseCoinsParamsV5 { */ underlyingType?: string; } + +export interface GetCorporateActionsParamsV5 { + category?: 'option'; + baseCoin?: string; + actionType?: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + limit?: number; + cursor?: string; +} diff --git a/src/types/request/v5-spot-leverage-token.ts b/src/types/request/v5-spot-leverage-token.ts index f9de1dca..266aa662 100644 --- a/src/types/request/v5-spot-leverage-token.ts +++ b/src/types/request/v5-spot-leverage-token.ts @@ -72,10 +72,16 @@ export interface GetAutoRepayModeParamsV5 { } export interface SetAutoRepayModeParamsV5 { - currency?: string; // Coin name, uppercase only. If not passed, enables for all currencies + /** Coin name, uppercase only. If omitted, sets the global switch; when enabled, includes currencies that become borrowable later */ + currency?: string; autoRepayMode: '0' | '1'; // 0: Off, 1: On } +export interface SetTradeAutoRepayParamsV5 { + /** 1: enable trade auto repayment; 0: disable */ + autoRepay: '0' | '1'; +} + export interface GetSpotMarginLiabilityInfoParamsV5 { currency: string; } @@ -121,6 +127,17 @@ export interface RenewFixedRateBorrowParamsV5 { qty?: string; } +export interface GetFixedRateBorrowInterestAccruedParamsV5 { + orderId?: string; + orderCurrency?: string; + limit?: string; + cursor?: string; +} + +export interface CancelFixedRateBorrowOrderParamsV5 { + orderId: string; +} + export interface GetFlexibleAvailableInventoryParamsV5 { currency: string; } diff --git a/src/types/request/v5-spreadtrading.ts b/src/types/request/v5-spreadtrading.ts index 68c01105..eaff944d 100644 --- a/src/types/request/v5-spreadtrading.ts +++ b/src/types/request/v5-spreadtrading.ts @@ -44,6 +44,11 @@ export interface GetSpreadOrderHistoryParamsV5 { baseCoin?: string; orderId?: string; orderLinkId?: string; + /** + * Filter by order status. Undocumented in the endpoint parameter table; confirmed by Bybit's API announcement. + * @see https://t.me/Bybit_API_Announcements/464 + */ + orderStatus?: 'Rejected' | 'Cancelled' | 'Filled'; startTime?: number; endTime?: number; limit?: number; diff --git a/src/types/request/v5-strategy.ts b/src/types/request/v5-strategy.ts index 01c32b63..f01d57d8 100644 --- a/src/types/request/v5-strategy.ts +++ b/src/types/request/v5-strategy.ts @@ -58,7 +58,10 @@ export interface CreateStrategyOrderParamsV5 { depthReference?: string; } -/** GET /v5/strategy/list */ +/** + * GET /v5/strategy/list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ export interface GetStrategyListParamsV5 { strategyId?: string; symbol?: string; @@ -72,7 +75,10 @@ export interface GetStrategyListParamsV5 { cursor?: string; } -/** GET /v5/strategy/order-list */ +/** + * GET /v5/strategy/order-list + * The range between beginTimeE0 and endTimeE0 (Unix timestamps in seconds) cannot exceed one year. + */ export interface GetStrategyOrderListParamsV5 { strategyId: string; /** 2: created, 3: create failed, 4: partially filled, 5: fully filled, 6: rejected, 7: canceled */ diff --git a/src/types/response/v5-asset.ts b/src/types/response/v5-asset.ts index ed8c90f5..a0852921 100644 --- a/src/types/response/v5-asset.ts +++ b/src/types/response/v5-asset.ts @@ -107,6 +107,7 @@ export interface AllowedDepositCoinInfoV5 { export interface DepositRecordV5 { id: string; + requestId?: string; coin: string; chain: string; amount: string; diff --git a/src/types/response/v5-event.ts b/src/types/response/v5-event.ts index a4186061..4d75eb90 100644 --- a/src/types/response/v5-event.ts +++ b/src/types/response/v5-event.ts @@ -230,3 +230,9 @@ export interface EventQuoteResultV5 { orderLinkId: string; orderId: string; } + +export interface CancelAllEventQuotesResultV5 { + list: EventQuoteResultV5[]; + /** 1: success; 0: failed */ + success: '1' | '0'; +} diff --git a/src/types/response/v5-market.ts b/src/types/response/v5-market.ts index 774c638c..4d51790e 100644 --- a/src/types/response/v5-market.ts +++ b/src/types/response/v5-market.ts @@ -538,3 +538,27 @@ export interface OptionBaseCoinV5 { export interface OptionBaseCoinsResultV5 { list: OptionBaseCoinV5[]; } + +export interface CorporateActionV5 { + category?: 'option'; + symbol: string; + baseCoin: string; + actionType: 'ForwardSplit' | 'ReverseSplit' | 'Dividend'; + status: string; + effectiveTime: number; + details: { + splitFactor?: string; + splitType?: 'FORWARD' | 'REVERSE'; + dividendAmountPerShare?: string; + dividendCurrency?: string; + installmentCount?: number; + installmentAmountPerShare?: string; + installmentCoin?: string; + firstSettlementTimeUtc?: number; + installments?: { + installmentNo: number; + settlementTimeUtc: number; + status: string; + }[]; + }; +} diff --git a/src/types/response/v5-spot-leverage-token.ts b/src/types/response/v5-spot-leverage-token.ts index 9012db64..1027ab0e 100644 --- a/src/types/response/v5-spot-leverage-token.ts +++ b/src/types/response/v5-spot-leverage-token.ts @@ -164,6 +164,11 @@ export interface AutoRepayModeResultV5 { data: AutoRepayModeItemV5[]; } +export interface TradeAutoRepayResultV5 { + /** Saved switch state. 1: enabled; 0: disabled */ + autoRepay: '0' | '1'; +} + export interface SpotMarginLiabilityInfoV5 { currency: string; totalBorrowAmount: string; @@ -213,6 +218,16 @@ export interface FixedRateBorrowQuoteV5 { qty: string; } +export interface FixedRateBorrowInterestAccruedV5 { + refId: string; + currency: string; + orderId: string; + loanAmt: string; + interest: string; + interestRate: string; + ts: string; +} + export interface FlexibleAvailableInventoryV5 { currency: string; availableInventory: string; diff --git a/src/types/response/v5-user.ts b/src/types/response/v5-user.ts index ec0655fb..71f5c4e9 100644 --- a/src/types/response/v5-user.ts +++ b/src/types/response/v5-user.ts @@ -50,6 +50,8 @@ export interface ApiKeyPermissionsV5 { FiatGlobalPay?: string[]; BitCard?: string[]; ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] when not granted */ + Compliance?: string[]; } export interface ApiKeyInfoV5 { diff --git a/src/types/shared-v5.ts b/src/types/shared-v5.ts index db2e15df..04f5d772 100644 --- a/src/types/shared-v5.ts +++ b/src/types/shared-v5.ts @@ -434,6 +434,8 @@ export interface PermissionsV5 { FiatConvertBroker?: string[]; BitCard?: string[]; ByXPost?: string[]; + /** ComplianceAppeal: TM Onchain appeals. Bybit global master read-write API keys only; [] revokes permission */ + Compliance?: string[]; } export interface CategoryCursorListV5<