bybit-api 4.6.1 → 4.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. package/README.md +1 -0
  2. package/lib/constants/enum.d.ts +1 -0
  3. package/lib/constants/enum.js +1 -0
  4. package/lib/constants/enum.js.map +1 -1
  5. package/lib/rest-client-v5.d.ts +503 -18
  6. package/lib/rest-client-v5.js +634 -5
  7. package/lib/rest-client-v5.js.map +1 -1
  8. package/lib/types/request/index.d.ts +8 -0
  9. package/lib/types/request/index.js +8 -0
  10. package/lib/types/request/index.js.map +1 -1
  11. package/lib/types/request/v5-account.d.ts +25 -1
  12. package/lib/types/request/v5-alpha-trade.d.ts +52 -0
  13. package/lib/types/request/v5-alpha-trade.js +6 -0
  14. package/lib/types/request/v5-alpha-trade.js.map +1 -0
  15. package/lib/types/request/v5-asset.d.ts +26 -2
  16. package/lib/types/request/v5-card.d.ts +51 -0
  17. package/lib/types/request/v5-card.js +7 -0
  18. package/lib/types/request/v5-card.js.map +1 -0
  19. package/lib/types/request/v5-crypto-loan.d.ts +8 -0
  20. package/lib/types/request/v5-earn-advance-discount.d.ts +75 -0
  21. package/lib/types/request/v5-earn-advance-discount.js +3 -0
  22. package/lib/types/request/v5-earn-advance-discount.js.map +1 -0
  23. package/lib/types/request/v5-earn-fixed-term.d.ts +42 -0
  24. package/lib/types/request/v5-earn-fixed-term.js +3 -0
  25. package/lib/types/request/v5-earn-fixed-term.js.map +1 -0
  26. package/lib/types/request/v5-earn-liquidity-mining.d.ts +7 -0
  27. package/lib/types/request/v5-earn-liquidity-mining.js +3 -0
  28. package/lib/types/request/v5-earn-liquidity-mining.js.map +1 -0
  29. package/lib/types/request/v5-earn-pwm.d.ts +167 -0
  30. package/lib/types/request/v5-earn-pwm.js +3 -0
  31. package/lib/types/request/v5-earn-pwm.js.map +1 -0
  32. package/lib/types/request/v5-earn-token.d.ts +49 -0
  33. package/lib/types/request/v5-earn-token.js +6 -0
  34. package/lib/types/request/v5-earn-token.js.map +1 -0
  35. package/lib/types/request/v5-earn.d.ts +35 -0
  36. package/lib/types/request/v5-market.d.ts +10 -3
  37. package/lib/types/request/v5-spot-leverage-token.d.ts +46 -0
  38. package/lib/types/request/v5-spreadtrading.d.ts +7 -0
  39. package/lib/types/request/v5-strategy.d.ts +80 -0
  40. package/lib/types/request/v5-strategy.js +3 -0
  41. package/lib/types/request/v5-strategy.js.map +1 -0
  42. package/lib/types/request/v5-user.d.ts +29 -3
  43. package/lib/types/response/index.d.ts +8 -0
  44. package/lib/types/response/index.js +8 -0
  45. package/lib/types/response/index.js.map +1 -1
  46. package/lib/types/response/v5-account.d.ts +76 -0
  47. package/lib/types/response/v5-alpha-trade.d.ts +170 -0
  48. package/lib/types/response/v5-alpha-trade.js +6 -0
  49. package/lib/types/response/v5-alpha-trade.js.map +1 -0
  50. package/lib/types/response/v5-asset.d.ts +128 -10
  51. package/lib/types/response/v5-card.d.ts +118 -0
  52. package/lib/types/response/v5-card.js +3 -0
  53. package/lib/types/response/v5-card.js.map +1 -0
  54. package/lib/types/response/v5-earn-advance-discount.d.ts +143 -0
  55. package/lib/types/response/v5-earn-advance-discount.js +3 -0
  56. package/lib/types/response/v5-earn-advance-discount.js.map +1 -0
  57. package/lib/types/response/v5-earn-fixed-term.d.ts +102 -0
  58. package/lib/types/response/v5-earn-fixed-term.js +3 -0
  59. package/lib/types/response/v5-earn-fixed-term.js.map +1 -0
  60. package/lib/types/response/v5-earn-liquidity-mining.d.ts +31 -0
  61. package/lib/types/response/v5-earn-liquidity-mining.js +3 -0
  62. package/lib/types/response/v5-earn-liquidity-mining.js.map +1 -0
  63. package/lib/types/response/v5-earn-pwm.d.ts +425 -0
  64. package/lib/types/response/v5-earn-pwm.js +3 -0
  65. package/lib/types/response/v5-earn-pwm.js.map +1 -0
  66. package/lib/types/response/v5-earn-token.d.ts +62 -0
  67. package/lib/types/response/v5-earn-token.js +6 -0
  68. package/lib/types/response/v5-earn-token.js.map +1 -0
  69. package/lib/types/response/v5-earn.d.ts +141 -0
  70. package/lib/types/response/v5-market.d.ts +16 -4
  71. package/lib/types/response/v5-position.d.ts +2 -0
  72. package/lib/types/response/v5-spot-leverage-token.d.ts +56 -0
  73. package/lib/types/response/v5-spreadtrading.d.ts +5 -0
  74. package/lib/types/response/v5-strategy.d.ts +96 -0
  75. package/lib/types/response/v5-strategy.js +3 -0
  76. package/lib/types/response/v5-strategy.js.map +1 -0
  77. package/lib/types/response/v5-user.d.ts +30 -0
  78. package/lib/types/shared-v5.d.ts +20 -1
  79. package/lib/types/websockets/ws-events.d.ts +2 -0
  80. package/lib/util/webCryptoAPI.d.ts +1 -1
  81. package/lib/util/webCryptoAPI.js +1 -1
  82. package/lib/util/webCryptoAPI.js.map +1 -1
  83. package/lib/util/websockets/websocket-util.js +1 -0
  84. package/lib/util/websockets/websocket-util.js.map +1 -1
  85. package/llms.txt +12585 -7241
  86. package/package.json +1 -1
@@ -133,6 +133,13 @@ class RestClientV5 extends BaseRestClient_1.default {
133
133
  getSpreadRecentTrades(params) {
134
134
  return this.get('/v5/spread/recent-trade', params);
135
135
  }
136
+ /**
137
+ * Get Spread Max Qty
138
+ * Max order quantity (available balance) for a spread order at a given side and price.
139
+ */
140
+ getSpreadMaxQty(params) {
141
+ return this.getPrivate('/v5/spread/max-qty', params);
142
+ }
136
143
  /**
137
144
  * Create Spread Order
138
145
  */
@@ -205,7 +212,9 @@ class RestClientV5 extends BaseRestClient_1.default {
205
212
  /**
206
213
  * Query the mark price kline data. Charts are returned in groups based on the requested interval.
207
214
  *
208
- * Covers: Linear contract / Inverse contract
215
+ * Covers: USDT contract / USDC contract / Inverse contract / Options
216
+ *
217
+ * `category` defaults to linear if omitted. For options, `limit` max is 500; futures max is 1000.
209
218
  */
210
219
  getMarkPriceKline(params) {
211
220
  return this.get('/v5/market/mark-price-kline', params);
@@ -232,6 +241,7 @@ class RestClientV5 extends BaseRestClient_1.default {
232
241
  * Covers: Spot / Linear contract / Inverse contract / Option
233
242
  *
234
243
  * Note: Spot does not support pagination, so limit & cursor are invalid.
244
+ * Note: e.g. `symbolType: 'commodity'`, and for linear also `stock`, `forex` (see Bybit Get Instruments Info).
235
245
  */
236
246
  getInstrumentsInfo(params) {
237
247
  return this.get('/v5/market/instruments-info', params);
@@ -508,6 +518,43 @@ class RestClientV5 extends BaseRestClient_1.default {
508
518
  preCheckOrder(params) {
509
519
  return this.postPrivate('/v5/order/pre-check', params);
510
520
  }
521
+ /**
522
+ *
523
+ ****** Strategy APIs
524
+ *
525
+ */
526
+ /**
527
+ * Create Strategy Order
528
+ *
529
+ * Supported strategy types: `twap`, `chaseOrder`, `iceberg`, `pov`.
530
+ */
531
+ createStrategyOrder(params) {
532
+ return this.postPrivate('/v5/strategy/create', params);
533
+ }
534
+ /**
535
+ * Get Strategy List
536
+ *
537
+ * Query the strategy list. Supports filtering by strategy ID, symbol, status, category, and strategy type.
538
+ */
539
+ getStrategyList(params) {
540
+ return this.getPrivate('/v5/strategy/list', params);
541
+ }
542
+ /**
543
+ * Get Strategy Order List
544
+ *
545
+ * Query the individual orders generated by a specific strategy.
546
+ */
547
+ getStrategyOrderList(params) {
548
+ return this.getPrivate('/v5/strategy/order-list', params);
549
+ }
550
+ /**
551
+ * Stop Strategy
552
+ *
553
+ * Stop a running strategy. Once stopped, the strategy cannot be resumed.
554
+ */
555
+ stopStrategy(params) {
556
+ return this.postPrivate('/v5/strategy/stop', params);
557
+ }
511
558
  /**
512
559
  *
513
560
  ****** Position APIs
@@ -523,6 +570,8 @@ class RestClientV5 extends BaseRestClient_1.default {
523
570
  * Normal account covers: USDT perpetual / Inverse perpetual / Inverse futures
524
571
  *
525
572
  * Note: this will give a 404 error if you query the `option` category if your account is not unified
573
+ *
574
+ * Response list items include `openTime` (position open timestamp in ms, default `0`).
526
575
  */
527
576
  getPositionInfo(params) {
528
577
  return this.getPrivate('/v5/position/list', params);
@@ -764,6 +813,7 @@ class RestClientV5 extends BaseRestClient_1.default {
764
813
  * Covers: SPOT / USDT contract / USDC contract / Inverse contract
765
814
  *
766
815
  * Includes RPI permission information (isPublicRpi, myRpiPermission)
816
+ * Note: e.g. `symbolType: 'commodity'`, and for linear also `stock`, `forex`.
767
817
  */
768
818
  getAccountInstrumentsInfo(params) {
769
819
  return this.getPrivate('/v5/account/instruments-info', params);
@@ -791,6 +841,13 @@ class RestClientV5 extends BaseRestClient_1.default {
791
841
  *
792
842
  * - Input the specific coin: repay the liability of this coin in particular
793
843
  * - No coin specified: repay the liability of all coins
844
+ *
845
+ * Does not repay manual-borrow (spot margin manual borrow) liabilities — use `manualRepay` or
846
+ * `manualRepayWithoutConversion` instead (API error 182120 otherwise).
847
+ * From 2026-03-17 (full 2026-03-24), BYUSDT can be used for repayment. MNT is temporarily not used for
848
+ * this flow; MNT convert-repay is not supported (use `manualRepayWithoutConversion` with existing balance).
849
+ * From 2026-02-10 08:00 UTC, coin-conversion fees use the higher of collateral or debt fee rate, with a
850
+ * per-transaction coin-conversion cap of 300,000 USD equivalent.
794
851
  */
795
852
  repayLiability(params) {
796
853
  return this.postPrivate('/v5/account/quick-repayment', params);
@@ -805,6 +862,14 @@ class RestClientV5 extends BaseRestClient_1.default {
805
862
  * If that's not enough, the remaining amount will be repaid by converting other assets.
806
863
  *
807
864
  * Repayment is prohibited between 04:00 and 05:30 per hour.
865
+ *
866
+ * When `coin` and `amount` are both set, validation depends on `repaymentType` (e.g. amount must not
867
+ * exceed the matching liability pool). If neither `coin` nor `amount` is set, `repaymentType` must be
868
+ * ALL. Response timing: ALL and FIXED are asynchronous; FLEXIBLE is synchronous.
869
+ * For repay-without-convert (spot balance only), use `manualRepayWithoutConversion`.
870
+ * From 2026-03-17 (full 2026-03-24), BYUSDT can be used for repayment. MNT: not via convert-repay;
871
+ * use `manualRepayWithoutConversion` for MNT with existing balance. From 2026-02-10 08:00 UTC,
872
+ * coin-conversion cap 300,000 USD equivalent per transaction applies.
808
873
  */
809
874
  manualRepay(params) {
810
875
  return this.postPrivate('/v5/account/repay', params);
@@ -907,12 +972,20 @@ class RestClientV5 extends BaseRestClient_1.default {
907
972
  return this.postPrivate('/v5/account/set-limit-px-action', params);
908
973
  }
909
974
  /**
910
- * Get Limit Price Behaviour
975
+ * Get Trade Behaviour Config / Get Limit Price Behaviour
911
976
  * You can get configuration how the system behaves when your limit order price exceeds the highest bid or lowest ask price.
977
+ * Response includes `deltaEnable` for Delta Neutral mode, and `smsef` / `fmsef` for Spot and Futures MNT fee deduction.
912
978
  */
913
979
  getLimitPriceAction() {
914
980
  return this.getPrivate('/v5/account/user-setting-config');
915
981
  }
982
+ /**
983
+ * Set Delta Neutral Mode
984
+ * 1: enable, 0: disable. Query current status via `getLimitPriceAction()`.
985
+ */
986
+ setDeltaNeutralMode(params) {
987
+ return this.postPrivate('/v5/account/set-delta-mode', params);
988
+ }
916
989
  /**
917
990
  * Configure Market Maker Protection (MMP)
918
991
  */
@@ -931,6 +1004,27 @@ class RestClientV5 extends BaseRestClient_1.default {
931
1004
  getMMPState(baseCoin) {
932
1005
  return this.getPrivate('/v5/account/mmp-state', { baseCoin });
933
1006
  }
1007
+ /**
1008
+ * Get Option Asset Info
1009
+ * P&L per coin for options: delta, RPL, UPL, margin. Result uses a nested `result` list.
1010
+ */
1011
+ getOptionAssetInfo() {
1012
+ return this.getPrivate('/v5/account/option-asset-info');
1013
+ }
1014
+ /**
1015
+ * Get Pay Info
1016
+ * Repayment collateral snapshot before `manualRepay` or `repayLiability`. Optional `coin` for one liability; omit for total.
1017
+ */
1018
+ getPayInfo(params) {
1019
+ return this.getPrivate('/v5/account/pay-info', params);
1020
+ }
1021
+ /**
1022
+ * Get Trade Info For Analysis
1023
+ * Aggregated spot trade stats for a symbol, including daily breakdown when returned.
1024
+ */
1025
+ getTradeInfoForAnalysis(params) {
1026
+ return this.getPrivate('/v5/account/trade-info-for-analysis', params);
1027
+ }
934
1028
  /**
935
1029
  *
936
1030
  ****** Asset APIs
@@ -941,10 +1035,26 @@ class RestClientV5 extends BaseRestClient_1.default {
941
1035
  * Query master account or subaccount's total assets and detailed asset holdings across different accounts and product categories.
942
1036
  *
943
1037
  * INFO: For accountType=Alpha, on-chain assets are not included in the returned data in current version.
1038
+ * `valuationCurrency` sets fiat for totals; `accountType` filters which account to return. For Alpha + farm, `extMap` may
1039
+ * appear on `coinDetail` (price range and equity unit).
944
1040
  */
945
1041
  getAssetOverview(params) {
946
1042
  return this.getPrivate('/v5/asset/asset-overview', params);
947
1043
  }
1044
+ /**
1045
+ * Get Portfolio Margin Info
1046
+ * Wallet and per-base-coin P&L range (aligned with the portfolio margin page).
1047
+ */
1048
+ getPortfolioMarginInfo(params) {
1049
+ return this.getPrivate('/v5/asset/portfolio-margin', params);
1050
+ }
1051
+ /**
1052
+ * Get Total Members Assets
1053
+ * Master + sub-accounts; optional `coin` for valuation (default BTC).
1054
+ */
1055
+ getTotalMembersAssets(params) {
1056
+ return this.getPrivate('/v5/asset/total-members-assets', params);
1057
+ }
948
1058
  /**
949
1059
  * Funding Account Transaction History
950
1060
  * Transaction log in Funding Account. Supports filtering by transaction type and time range.
@@ -980,6 +1090,9 @@ class RestClientV5 extends BaseRestClient_1.default {
980
1090
  }
981
1091
  /**
982
1092
  * Query coin information, including chain information, withdraw and deposit status.
1093
+ *
1094
+ * Per-chain `withdrawMax` is the max amount per withdrawal on that chain (`-1` = no limit).
1095
+ * `remainAmount` is deprecated.
983
1096
  */
984
1097
  getCoinInfo(coin) {
985
1098
  return this.getPrivate('/v5/asset/coin/query-info', coin ? { coin } : undefined);
@@ -1018,7 +1131,9 @@ class RestClientV5 extends BaseRestClient_1.default {
1018
1131
  return this.getPrivate('/v5/asset/transfer/query-account-coin-balance', params);
1019
1132
  }
1020
1133
  /**
1021
- * Query withdrawable amount.
1134
+ * Query withdrawable amount (incl. risk-frozen `limitAmountUsd` and per-wallet slices).
1135
+ * May include FUND, UTA, EARN, SPOT keys depending on the coin. EARN is present when the coin
1136
+ * supports withdrawal from the Earn account.
1022
1137
  */
1023
1138
  getWithdrawableAmount(params) {
1024
1139
  return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
@@ -1093,6 +1208,7 @@ class RestClientV5 extends BaseRestClient_1.default {
1093
1208
  }
1094
1209
  /**
1095
1210
  * Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI
1211
+ * (UNIFIED, FUND, or EARN; if a coin is not in flexible saving, EARN may route to funding as per Bybit).
1096
1212
  */
1097
1213
  setDepositAccount(params) {
1098
1214
  return this.postPrivate('/v5/asset/deposit/deposit-to-account', params);
@@ -1187,11 +1303,13 @@ class RestClientV5 extends BaseRestClient_1.default {
1187
1303
  return this.getPrivate('/v5/asset/withdraw/vasp/list');
1188
1304
  }
1189
1305
  /**
1190
- * Withdraw assets from the SPOT account.
1306
+ * Withdraw from Funding, Unified, and/or Earn (and combos such as FUND,UTA,EARN per API).
1191
1307
  *
1192
1308
  * CAUTION: Make sure you have whitelisted your wallet address before calling this endpoint.
1193
1309
  *
1194
1310
  * You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
1311
+ *
1312
+ * Bybit Turkey (TR) site: `transactionPurpose` is required on the request (see `WithdrawParamsV5`).
1195
1313
  */
1196
1314
  submitWithdrawal(params) {
1197
1315
  return this.postPrivate('/v5/asset/withdraw/create', params);
@@ -1306,6 +1424,8 @@ class RestClientV5 extends BaseRestClient_1.default {
1306
1424
  * Both master and sub user's api key are applicable.
1307
1425
  *
1308
1426
  * TIP: Any permission can access this endpoint.
1427
+ *
1428
+ * Response `permissions` may include `FiatBitPay` (not `FiatBybitPay`).
1309
1429
  */
1310
1430
  getQueryApiKey() {
1311
1431
  return this.getPrivate('/v5/user/query-api');
@@ -1324,6 +1444,8 @@ class RestClientV5 extends BaseRestClient_1.default {
1324
1444
  *
1325
1445
  * TIP: The API key must have one of the permissions to be allowed to call the following API endpoint.
1326
1446
  * - master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"
1447
+ *
1448
+ * `permissions` may include `FiatBitPay` (not `FiatBybitPay`).
1327
1449
  */
1328
1450
  updateMasterApiKey(params) {
1329
1451
  return this.postPrivate('/v5/user/update-api', params);
@@ -1390,6 +1512,18 @@ class RestClientV5 extends BaseRestClient_1.default {
1390
1512
  getAffiliateUserList(params) {
1391
1513
  return this.getPrivate('/v5/affiliate/aff-user-list', params);
1392
1514
  }
1515
+ /**
1516
+ * Get Affiliate Sub-Affiliate List.
1517
+ *
1518
+ * To use this endpoint, you should have an affiliate account and only tick "affiliate" permission while creating the API key.
1519
+ *
1520
+ * TIP:
1521
+ * - Use master UID only
1522
+ * - The api key can only have "Affiliate" permission
1523
+ */
1524
+ getAffiliateSubAffiliateList(params) {
1525
+ return this.getPrivate('/v5/affiliate/affiliate-sub-list', params);
1526
+ }
1393
1527
  /**
1394
1528
  * Get Affiliate User Info.
1395
1529
  *
@@ -1414,8 +1548,9 @@ class RestClientV5 extends BaseRestClient_1.default {
1414
1548
  }
1415
1549
  /**
1416
1550
  * Sign Agreement
1417
- * To trade metals commodity contracts (e.g. XAUUSDT, XAGUSDT Perpetuals), complete the agreement signing first.
1551
+ * To trade commodity contracts (e.g. metals XAU/XAG perps, crude oil perps), complete the agreement signing first.
1418
1552
  * Recommended to sign in advance via API so you can trade immediately when contracts go live.
1553
+ * Send either `category` (legacy) or `categoryV2` (preferred; new agreement types are added to `categoryV2` only).
1419
1554
  *
1420
1555
  * INFO
1421
1556
  * - Only the master account can sign. Subaccounts are not supported.
@@ -1426,6 +1561,84 @@ class RestClientV5 extends BaseRestClient_1.default {
1426
1561
  signAgreement(params) {
1427
1562
  return this.postPrivate('/v5/user/agreement', params);
1428
1563
  }
1564
+ /**
1565
+ *
1566
+ ****** Alpha / Web3 (on-chain) trade APIs
1567
+ *
1568
+ */
1569
+ /**
1570
+ * Get Trade Quote
1571
+ * Get a price quote before a purchase or redeem. Required before `executeAlphaTradePurchase` or `executeAlphaTradeRedeem`.
1572
+ * Pass `quoteData` and `correctingCode` from the response unchanged to the execute endpoints.
1573
+ */
1574
+ getAlphaTradeQuote(params) {
1575
+ return this.postPrivate('/v5/alpha/trade/quote', params);
1576
+ }
1577
+ /**
1578
+ * Execute Purchase
1579
+ * Buy on-chain tokens with a payment token (e.g. USDT). Requires a valid quote; obtain user confirmation first.
1580
+ * HTTP 200 is only an acknowledgment — poll `getAlphaTradeOrderList` for final status. Idempotent by `quoteDataId` in the quote.
1581
+ */
1582
+ executeAlphaTradePurchase(params) {
1583
+ return this.postPrivate('/v5/alpha/trade/purchase', params);
1584
+ }
1585
+ /**
1586
+ * Execute Redeem
1587
+ * Sell on-chain tokens for a payment token. Requires a valid quote; obtain user confirmation first.
1588
+ * HTTP 200 is only an acknowledgment — poll `getAlphaTradeOrderList` for final status. Idempotent by `quoteDataId` in the quote.
1589
+ */
1590
+ executeAlphaTradeRedeem(params) {
1591
+ return this.postPrivate('/v5/alpha/trade/redeem', params);
1592
+ }
1593
+ /**
1594
+ * Get Payment Token List
1595
+ * List payment tokens (e.g. USDT) and CEX token codes (e.g. CEX_1) for quote and execution. Each entry includes `supportChains`.
1596
+ */
1597
+ getAlphaPayTokenList(params) {
1598
+ return this.postPrivate('/v5/alpha/trade/pay-token-list', params);
1599
+ }
1600
+ /**
1601
+ * Get Order List
1602
+ * On-chain trade order history; filters for trade type, status, token, and time. Max 90 days.
1603
+ */
1604
+ getAlphaTradeOrderList(params) {
1605
+ return this.postPrivate('/v5/alpha/trade/order-list', params);
1606
+ }
1607
+ /**
1608
+ * Get Biz Token List
1609
+ * Tradable on-chain tokens (DEX_ prefix ids), risk flags, limits, and supported payment token codes.
1610
+ */
1611
+ getAlphaBizTokenList(params) {
1612
+ return this.postPrivate('/v5/alpha/trade/biz-token-list', params || {});
1613
+ }
1614
+ /**
1615
+ * Get Token Price List
1616
+ * Batch market data (up to 20 `chainCode` + `tokenAddress` pairs). Prices, 24h change, volume, market cap, etc.
1617
+ */
1618
+ getAlphaBizTokenPriceList(params) {
1619
+ return this.postPrivate('/v5/alpha/trade/biz-token-price-list', params);
1620
+ }
1621
+ /**
1622
+ * Get Token Details
1623
+ * One token: description, links, `riskFlag`, and listing status. Use `chainCode` + `tokenAddress` from biz list or assets.
1624
+ */
1625
+ getAlphaBizTokenDetails(params) {
1626
+ return this.postPrivate('/v5/alpha/trade/biz-token-details', params);
1627
+ }
1628
+ /**
1629
+ * Get Asset List
1630
+ * Portfolio of on-chain token holdings (non-zero only), sorted by USD value.
1631
+ */
1632
+ getAlphaAssetList() {
1633
+ return this.postPrivate('/v5/alpha/trade/asset-list', {});
1634
+ }
1635
+ /**
1636
+ * Get Asset Detail
1637
+ * Single-asset view; `result.assetList` has 0 or 1 item.
1638
+ */
1639
+ getAlphaAssetDetail(params) {
1640
+ return this.postPrivate('/v5/alpha/trade/asset-detail', params);
1641
+ }
1429
1642
  /**
1430
1643
  *
1431
1644
  ****** Spot Margin Trade APIs (UTA)
@@ -1450,6 +1663,13 @@ class RestClientV5 extends BaseRestClient_1.default {
1450
1663
  getHistoricalInterestRate(params) {
1451
1664
  return this.getPrivate('/v5/spot-margin-trade/interest-rate-history', params);
1452
1665
  }
1666
+ /**
1667
+ * Get Currency Data
1668
+ * Borrowing currency data: flexible/fixed manual borrow, min qty, precision, interest rate range.
1669
+ */
1670
+ getSpotMarginCurrencyData(params) {
1671
+ return this.getPrivate('/v5/spot-margin-trade/currency-data', params);
1672
+ }
1453
1673
  /**
1454
1674
  * Turn spot margin trade on / off in your UTA account.
1455
1675
  *
@@ -1517,6 +1737,10 @@ class RestClientV5 extends BaseRestClient_1.default {
1517
1737
  *
1518
1738
  * IMPORTANT: Repayment is prohibited between 04:00 and 05:30 per hour.
1519
1739
  * When repaying, system will only use the spot available balance of the debt currency.
1740
+ *
1741
+ * Use `getAvailableAmountToRepay` to check spot available amount. Response timing: ALL and FIXED
1742
+ * asynchronous; FLEXIBLE synchronous. From 2026-03-17 (full 2026-03-24), BYUSDT can be used for
1743
+ * repayment, including MNT using existing spot balance.
1520
1744
  */
1521
1745
  manualRepayWithoutConversion(params) {
1522
1746
  return this.postPrivate('/v5/account/no-convert-repay', params);
@@ -1544,6 +1768,42 @@ class RestClientV5 extends BaseRestClient_1.default {
1544
1768
  setAutoRepayMode(params) {
1545
1769
  return this.postPrivate('/v5/spot-margin-trade/set-auto-repay-mode', params);
1546
1770
  }
1771
+ /**
1772
+ * Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split.
1773
+ */
1774
+ getSpotMarginLiability(params) {
1775
+ return this.getPrivate('/v5/spot-margin-trade/liability', params);
1776
+ }
1777
+ /**
1778
+ * Fixed-rate borrow (place order).
1779
+ */
1780
+ submitFixedRateBorrow(params) {
1781
+ return this.postPrivate('/v5/spot-margin-trade/fixedborrow', params);
1782
+ }
1783
+ /**
1784
+ * Fixed-rate borrow order history (descending by order time).
1785
+ */
1786
+ getFixedRateBorrowOrderInfo(params) {
1787
+ return this.getPrivate('/v5/spot-margin-trade/fixedborrow-order-info', params);
1788
+ }
1789
+ /**
1790
+ * Fixed-rate borrow contract list (descending by borrow time).
1791
+ */
1792
+ getFixedRateBorrowContractInfo(params) {
1793
+ return this.getPrivate('/v5/spot-margin-trade/fixedborrow-contract-info', params);
1794
+ }
1795
+ /**
1796
+ * Fixed-rate borrow order book quotes (sort by apy, term, or quantity).
1797
+ */
1798
+ getFixedRateBorrowOrderQuote(params) {
1799
+ return this.getPrivate('/v5/spot-margin-trade/fixedborrow-order-quote', params);
1800
+ }
1801
+ /**
1802
+ * Renew a fixed-rate loan contract (full remaining amount if `qty` omitted).
1803
+ */
1804
+ renewFixedRateBorrow(params) {
1805
+ return this.postPrivate('/v5/spot-margin-trade/fixedborrow-renew', params);
1806
+ }
1547
1807
  /**
1548
1808
  *
1549
1809
  ****** Spot Margin Trade APIs (Normal)
@@ -1895,6 +2155,8 @@ class RestClientV5 extends BaseRestClient_1.default {
1895
2155
  * Create Supply Order
1896
2156
  *
1897
2157
  * Permission: "Spot trade"
2158
+ *
2159
+ * Optional `availableSource`: 0 Funding, 1 Earn Flexible, 2 ALL (default 0).
1898
2160
  */
1899
2161
  createSupplyOrderFixed(params) {
1900
2162
  return this.postPrivate('/v5/crypto-loan-fixed/supply', params);
@@ -1908,6 +2170,8 @@ class RestClientV5 extends BaseRestClient_1.default {
1908
2170
  }
1909
2171
  /**
1910
2172
  * Cancel Supply Order
2173
+ *
2174
+ * Optional `refundedAccount`: 0 Funding, 1 EasyEarn (default 0).
1911
2175
  */
1912
2176
  cancelSupplyOrderFixed(params) {
1913
2177
  return this.postPrivate('/v5/crypto-loan-fixed/supply-order-cancel', params);
@@ -2177,6 +2441,111 @@ class RestClientV5 extends BaseRestClient_1.default {
2177
2441
  getEarnProduct(params) {
2178
2442
  return this.get('/v5/earn/product', params);
2179
2443
  }
2444
+ /**
2445
+ * Get Hold to Earn airdrop products (ByFi).
2446
+ *
2447
+ * No authentication required; guest access supported. Authenticated users get eligibility-filtered products.
2448
+ */
2449
+ getHoldToEarnAirdropProducts() {
2450
+ return this.get('/v5/earn/hold-to-earn/product');
2451
+ }
2452
+ /**
2453
+ * Get Advanced Earn product info (Dual Asset, Double Win, Smart Leverage, etc. via `category`).
2454
+ *
2455
+ * INFO: No authentication. Up to 50 requests/second per IP.
2456
+ */
2457
+ getAdvanceEarnProduct(params) {
2458
+ return this.get('/v5/earn/advance/product', params);
2459
+ }
2460
+ /**
2461
+ * Liquidity mining — product list (Advanced Earn).
2462
+ *
2463
+ * INFO: No authentication. Up to 50 requests/second per IP.
2464
+ */
2465
+ getLiquidityMiningProduct(params) {
2466
+ return this.get('/v5/earn/liquidity-mining/product', params);
2467
+ }
2468
+ /**
2469
+ * Fixed-term / fixed saving — product list (Earn).
2470
+ *
2471
+ * INFO: No authentication. Up to 50 requests/second per IP.
2472
+ */
2473
+ getFixedTermEarnProduct(params) {
2474
+ return this.get('/v5/earn/fixed-term/product', params);
2475
+ }
2476
+ /**
2477
+ * Advanced Earn — quote / extra info (Discount Buy, Dual Assets, …). Call before place order where required.
2478
+ *
2479
+ * INFO: No authentication. Up to 50 requests/second per IP.
2480
+ * Dual Assets: `productId` is required. Response uses `list` with `buyLowPrice` / `sellHighPrice`.
2481
+ */
2482
+ getAdvanceEarnProductExtraInfo(params) {
2483
+ return this.get('/v5/earn/advance/product-extra-info', params);
2484
+ }
2485
+ /**
2486
+ * Advanced Earn — place order (Dual Assets, Discount Buy, …). Async; use getAdvanceEarnOrder to track.
2487
+ *
2488
+ * INFO: API key needs "Earn" permission. Rate limit e.g. 5 req/s (Dual Assets per docs).
2489
+ */
2490
+ submitAdvanceEarnPlaceOrder(params) {
2491
+ return this.postPrivate('/v5/earn/advance/place-order', params);
2492
+ }
2493
+ /**
2494
+ * Advanced Earn — active positions (Dual Assets, Discount Buy, …).
2495
+ *
2496
+ * INFO: API key needs "Earn" permission. E.g. 10 req/s (Dual Assets per docs).
2497
+ */
2498
+ getAdvanceEarnPosition(params) {
2499
+ return this.getPrivate('/v5/earn/advance/position', params);
2500
+ }
2501
+ /**
2502
+ * Advanced Earn — order list (Dual Assets, Discount Buy, …). Distinct from getEarnOrderHistory (/v5/earn/order).
2503
+ *
2504
+ * INFO: API key needs "Earn" permission. E.g. 10 req/s (Dual Assets per docs).
2505
+ */
2506
+ getAdvanceEarnOrder(params) {
2507
+ return this.getPrivate('/v5/earn/advance/order', params);
2508
+ }
2509
+ /**
2510
+ * Fixed-term earn — place order (stake). Async; use getFixedTermEarnOrder to track.
2511
+ *
2512
+ * INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
2513
+ */
2514
+ submitFixedTermEarnOrder(params) {
2515
+ return this.postPrivate('/v5/earn/fixed-term/place-order', params);
2516
+ }
2517
+ /**
2518
+ * Fixed-term earn — early redeem (FundPool only, when product allows).
2519
+ *
2520
+ * INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
2521
+ */
2522
+ redeemFixedTermEarn(params) {
2523
+ return this.postPrivate('/v5/earn/fixed-term/redeem', params);
2524
+ }
2525
+ /**
2526
+ * Fixed-term earn — active positions.
2527
+ *
2528
+ * INFO: API key needs "Earn" permission. Rate limit: 10 req/s.
2529
+ */
2530
+ getFixedTermEarnPosition(params) {
2531
+ return this.getPrivate('/v5/earn/fixed-term/position', params);
2532
+ }
2533
+ /**
2534
+ * Fixed-term earn — order list.
2535
+ *
2536
+ * INFO: API key needs "Earn" permission. Rate limit: 10 req/s.
2537
+ */
2538
+ getFixedTermEarnOrder(params) {
2539
+ return this.getPrivate('/v5/earn/fixed-term/order', params);
2540
+ }
2541
+ /**
2542
+ * Fixed-term earn — enable or disable auto-invest on a position.
2543
+ *
2544
+ * INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
2545
+ */
2546
+ setFixedTermEarnAutoInvest(params) {
2547
+ return this.postPrivate('/v5/earn/fixed-term/position/auto-invest', params);
2548
+ }
2180
2549
  /**
2181
2550
  * Stake or Redeem Earn products
2182
2551
  *
@@ -2209,18 +2578,38 @@ class RestClientV5 extends BaseRestClient_1.default {
2209
2578
  * INFO: API key needs "Earn" permission
2210
2579
  *
2211
2580
  * Note: Fully redeemed position is also returned in the response
2581
+ * Note: Response includes `autoReinvest` where applicable; use `modifyEarnPosition` to change it (OnChain fixed).
2582
+ * List items include `availableAmount` (redeemable) and `freezeDetails` (frozen amount + reason).
2212
2583
  */
2213
2584
  getEarnPosition(params) {
2214
2585
  return this.getPrivate('/v5/earn/position', params);
2215
2586
  }
2587
+ /**
2588
+ * Modify OnChain Earn position (e.g. auto-reinvest for fixed duration products).
2589
+ *
2590
+ * INFO: API key needs "Earn" permission. Only `category=OnChain` and fixed positions (see product).
2591
+ */
2592
+ modifyEarnPosition(params) {
2593
+ return this.postPrivate('/v5/earn/position/modify', params);
2594
+ }
2216
2595
  /**
2217
2596
  * Get Yield History
2218
2597
  *
2219
2598
  * INFO: API key needs "Earn" permission
2599
+ *
2600
+ * Note: `category` includes `OnChain`. For `OnChain`, do not pass `productId` (error).
2220
2601
  */
2221
2602
  getEarnYieldHistory(params) {
2222
2603
  return this.getPrivate('/v5/earn/yield', params);
2223
2604
  }
2605
+ /**
2606
+ * Get Hold to Earn airdrop daily PnL records (ByFi). Up to 3 months of completed yield history.
2607
+ *
2608
+ * INFO: API key needs "Earn" permission
2609
+ */
2610
+ getHoldToEarnAirdropYieldHistory(params) {
2611
+ return this.getPrivate('/v5/earn/hold-to-earn/yield-history', params);
2612
+ }
2224
2613
  /**
2225
2614
  * Get Hourly Yield History
2226
2615
  *
@@ -2229,6 +2618,246 @@ class RestClientV5 extends BaseRestClient_1.default {
2229
2618
  getEarnHourlyYieldHistory(params) {
2230
2619
  return this.getPrivate('/v5/earn/hourly-yield', params);
2231
2620
  }
2621
+ /**
2622
+ * Get historical APR (FlexibleSaving / OnChain), up to ~6 months.
2623
+ *
2624
+ * INFO: Does not need authentication
2625
+ */
2626
+ getEarnAprHistory(params) {
2627
+ return this.get('/v5/earn/apr-history', params);
2628
+ }
2629
+ /**
2630
+ * Earn token product (e.g. BYUSDT) — Get Product Info
2631
+ * Without auth, user-specific fields are empty or defaulted.
2632
+ */
2633
+ getEarnTokenProduct(params) {
2634
+ return this.get('/v5/earn/token/product', params);
2635
+ }
2636
+ /**
2637
+ * Earn token — Place Order (Mint / Redeem). Accepted response is not final settlement; use `getEarnTokenOrders`.
2638
+ */
2639
+ submitEarnTokenOrder(params) {
2640
+ return this.postPrivate('/v5/earn/token/place-order', params);
2641
+ }
2642
+ /**
2643
+ * Earn token — Get Order List
2644
+ */
2645
+ getEarnTokenOrders(params) {
2646
+ return this.getPrivate('/v5/earn/token/order', params);
2647
+ }
2648
+ /**
2649
+ * Earn token — Get Position Info
2650
+ */
2651
+ getEarnTokenPosition(params) {
2652
+ return this.getPrivate('/v5/earn/token/position', params);
2653
+ }
2654
+ /**
2655
+ * Earn token — Get Daily Yield Records
2656
+ */
2657
+ getEarnTokenDailyYield(params) {
2658
+ return this.getPrivate('/v5/earn/token/yield', params);
2659
+ }
2660
+ /**
2661
+ * Earn token — Get Hourly Yield Records
2662
+ */
2663
+ getEarnTokenHourlyYield(params) {
2664
+ return this.getPrivate('/v5/earn/token/hourly-yield', params);
2665
+ }
2666
+ /**
2667
+ * Earn token — Get History APR (7/30/180 days). No authentication required.
2668
+ */
2669
+ getEarnTokenHistoryApr(params) {
2670
+ return this.get('/v5/earn/token/history-apr', params);
2671
+ }
2672
+ /**
2673
+ *
2674
+ ****** PWM (Private Wealth Management) — Investment Plan
2675
+ *
2676
+ */
2677
+ /**
2678
+ * Get all PWM investment plans.
2679
+ */
2680
+ getPwmInvestmentPlanList() {
2681
+ return this.getPrivate('/v5/earn/pwm/investment-plan/list');
2682
+ }
2683
+ /**
2684
+ * Get PWM investment plan detail (Active or Closed).
2685
+ */
2686
+ getPwmInvestmentPlanDetail(params) {
2687
+ return this.getPrivate('/v5/earn/pwm/investment-plan/detail', params);
2688
+ }
2689
+ /**
2690
+ * Get pending PWM investment plan detail (PendingSubscription).
2691
+ */
2692
+ getPwmPendingInvestmentPlanDetail(params) {
2693
+ return this.getPrivate('/v5/earn/pwm/investment-plan/new-plan', params);
2694
+ }
2695
+ /**
2696
+ * Claim withdrawable funds from a PWM investment plan (Active).
2697
+ */
2698
+ claimPwmWithdrawableFunds(params) {
2699
+ return this.postPrivate('/v5/earn/pwm/investment-plan/claim', params);
2700
+ }
2701
+ /**
2702
+ * Get PWM investment plan asset trend (default last 7 days).
2703
+ */
2704
+ getPwmInvestmentPlanAssetTrend(params) {
2705
+ return this.getPrivate('/v5/earn/pwm/investment-plan/asset-trend', params);
2706
+ }
2707
+ /**
2708
+ * Get PWM fund historical NAV (max 180 days between startTime and endTime).
2709
+ */
2710
+ getPwmFundHistoricalNav(params) {
2711
+ return this.getPrivate('/v5/earn/pwm/investment-plan/fund-nav', params);
2712
+ }
2713
+ /**
2714
+ * Subscribe to a PWM investment plan (PendingSubscription).
2715
+ */
2716
+ subscribePwmInvestmentPlan(params) {
2717
+ return this.postPrivate('/v5/earn/pwm/investment-plan/subscribe', params);
2718
+ }
2719
+ /**
2720
+ * Invest more into a PWM investment plan product (Active).
2721
+ */
2722
+ investMorePwmInvestmentPlan(params) {
2723
+ return this.postPrivate('/v5/earn/pwm/investment-plan/invest-more', params);
2724
+ }
2725
+ /**
2726
+ * Redeem from a PWM investment plan product.
2727
+ */
2728
+ redeemPwmInvestmentPlan(params) {
2729
+ return this.postPrivate('/v5/earn/pwm/investment-plan/redeem', params);
2730
+ }
2731
+ /**
2732
+ * Get PWM investment plan orders (subscribe / redeem / auto-reinvest).
2733
+ */
2734
+ getPwmInvestmentPlanOrders(params) {
2735
+ return this.getPrivate('/v5/earn/pwm/investment-plan/order', params);
2736
+ }
2737
+ /**
2738
+ * Get PWM subscribable product info for customize plan. No authentication required.
2739
+ */
2740
+ getPwmSubscribableProductInfo() {
2741
+ return this.get('/v5/earn/pwm/customize-plan/product');
2742
+ }
2743
+ /**
2744
+ * Create a customized PWM investment plan (max 20 Active + Pending plans per user).
2745
+ */
2746
+ createPwmCustomizeInvestmentPlan(params) {
2747
+ return this.postPrivate('/v5/earn/pwm/customize-plan/create', params);
2748
+ }
2749
+ /**
2750
+ *
2751
+ ****** PWM — Asset Manager
2752
+ *
2753
+ */
2754
+ /**
2755
+ * Get all PWM funds managed by the institution (newest first).
2756
+ */
2757
+ getPwmAllFunds(params) {
2758
+ return this.getPrivate('/v5/earn/pwm/asset-manager/all-funds', params);
2759
+ }
2760
+ /**
2761
+ * Settle fund profit sharing (Active funds only).
2762
+ */
2763
+ settlePwmFundProfit(params) {
2764
+ return this.postPrivate('/v5/earn/pwm/asset-manager/settle-profit', params);
2765
+ }
2766
+ /**
2767
+ * Create a PWM fund (PendingSubscribe). Max 10 funds per institution.
2768
+ */
2769
+ createPwmFund(params) {
2770
+ return this.postPrivate('/v5/earn/pwm/asset-manager/create-fund', params);
2771
+ }
2772
+ /**
2773
+ * Create a PWM investment plan for a user (PendingSubscription). Max 10 plans per institution.
2774
+ */
2775
+ createPwmAssetManagerInvestmentPlan(params) {
2776
+ return this.postPrivate('/v5/earn/pwm/asset-manager/create-investment-plan', params);
2777
+ }
2778
+ /**
2779
+ * Get PWM investment plans created by the institution (asset manager).
2780
+ */
2781
+ getPwmAssetManagerInvestmentPlans(params) {
2782
+ return this.getPrivate('/v5/earn/pwm/asset-manager/get-investment-plan', params);
2783
+ }
2784
+ /**
2785
+ * Manage a PWM investment plan (status and/or fund allocation).
2786
+ */
2787
+ managePwmAssetManagerInvestmentPlan(params) {
2788
+ return this.postPrivate('/v5/earn/pwm/asset-manager/manage-investment-plan', params);
2789
+ }
2790
+ /**
2791
+ * Get all PWM fund orders (asset manager). Default time window: last 7 days.
2792
+ */
2793
+ getPwmAllFundOrders(params) {
2794
+ return this.getPrivate('/v5/earn/pwm/asset-manager/all-order', params);
2795
+ }
2796
+ /**
2797
+ * Manage a PWM fund order (approve / reject Pending Review orders).
2798
+ */
2799
+ managePwmFundOrder(params) {
2800
+ return this.postPrivate('/v5/earn/pwm/asset-manager/manage-order', params);
2801
+ }
2802
+ /**
2803
+ * Create a PWM fund sub-account (async; max 30 per fund, fund must be Active).
2804
+ */
2805
+ createPwmFundSubAccount(params) {
2806
+ return this.postPrivate('/v5/earn/pwm/asset-manager/create-sub-account', params);
2807
+ }
2808
+ /**
2809
+ * Transfer funds between custodian sub-accounts (fund custodian API key required).
2810
+ */
2811
+ pwmFundTransfer(params) {
2812
+ return this.postPrivate('/v5/earn/pwm/fund-transfer', params);
2813
+ }
2814
+ /**
2815
+ * Query PWM fund transfer result (fund custodian API key required).
2816
+ */
2817
+ getPwmFundTransferRecords(params) {
2818
+ return this.getPrivate('/v5/earn/pwm/query-fund-transfer-result', params);
2819
+ }
2820
+ /**
2821
+ *
2822
+ ****** Bybit Card APIs
2823
+ *
2824
+ */
2825
+ /**
2826
+ * Bybit Card — query card transaction / asset history (filter by status, card digits, merchant, time, type, …).
2827
+ */
2828
+ queryCardAssetRecords(params) {
2829
+ return this.postPrivate('/v5/card/transaction/query-asset-records', params);
2830
+ }
2831
+ /**
2832
+ * Bybit Card — point balance (available, pending, account status, …).
2833
+ */
2834
+ queryCardPointsBalance() {
2835
+ return this.postPrivate('/v5/card/reward/points/balance');
2836
+ }
2837
+ /**
2838
+ * Bybit Card — point transaction records.
2839
+ */
2840
+ queryCardPointsRecords(params) {
2841
+ return this.postPrivate('/v5/card/reward/points/records', params);
2842
+ }
2843
+ /**
2844
+ * Bybit Card — reward tier, spending limit, auto cashback.
2845
+ */
2846
+ queryCardPointsTier() {
2847
+ return this.postPrivate('/v5/card/reward/points/tier');
2848
+ }
2849
+ /**
2850
+ * Bybit Card — reward mall item list.
2851
+ */
2852
+ queryCardMallItemList(params) {
2853
+ return this.postPrivate('/v5/card/reward/mall/item/list', params);
2854
+ }
2855
+ /**
2856
+ * Bybit Card — cashback detail for a reward order.
2857
+ */
2858
+ queryCardPointCashbackDetail(params) {
2859
+ return this.postPrivate('/v5/card/reward/point/cashback/detail', params);
2860
+ }
2232
2861
  /**
2233
2862
  *
2234
2863
  ****** RFQ APIs