bybit-api 4.6.1 → 4.6.2
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.
- package/lib/constants/enum.d.ts +1 -0
- package/lib/constants/enum.js +1 -0
- package/lib/constants/enum.js.map +1 -1
- package/lib/rest-client-v5.d.ts +339 -15
- package/lib/rest-client-v5.js +411 -5
- package/lib/rest-client-v5.js.map +1 -1
- package/lib/types/request/index.d.ts +6 -0
- package/lib/types/request/index.js +6 -0
- package/lib/types/request/index.js.map +1 -1
- package/lib/types/request/v5-account.d.ts +26 -0
- package/lib/types/request/v5-alpha-trade.d.ts +52 -0
- package/lib/types/request/v5-alpha-trade.js +6 -0
- package/lib/types/request/v5-alpha-trade.js.map +1 -0
- package/lib/types/request/v5-asset.d.ts +26 -2
- package/lib/types/request/v5-card.d.ts +51 -0
- package/lib/types/request/v5-card.js +7 -0
- package/lib/types/request/v5-card.js.map +1 -0
- package/lib/types/request/v5-earn-advance-discount.d.ts +75 -0
- package/lib/types/request/v5-earn-advance-discount.js +3 -0
- package/lib/types/request/v5-earn-advance-discount.js.map +1 -0
- package/lib/types/request/v5-earn-fixed-term.d.ts +42 -0
- package/lib/types/request/v5-earn-fixed-term.js +3 -0
- package/lib/types/request/v5-earn-fixed-term.js.map +1 -0
- package/lib/types/request/v5-earn-liquidity-mining.d.ts +7 -0
- package/lib/types/request/v5-earn-liquidity-mining.js +3 -0
- package/lib/types/request/v5-earn-liquidity-mining.js.map +1 -0
- package/lib/types/request/v5-earn-token.d.ts +49 -0
- package/lib/types/request/v5-earn-token.js +6 -0
- package/lib/types/request/v5-earn-token.js.map +1 -0
- package/lib/types/request/v5-earn.d.ts +24 -0
- package/lib/types/request/v5-market.d.ts +10 -1
- package/lib/types/request/v5-spot-leverage-token.d.ts +46 -0
- package/lib/types/request/v5-spreadtrading.d.ts +7 -0
- package/lib/types/request/v5-user.d.ts +7 -3
- package/lib/types/response/index.d.ts +6 -0
- package/lib/types/response/index.js +6 -0
- package/lib/types/response/index.js.map +1 -1
- package/lib/types/response/v5-account.d.ts +76 -0
- package/lib/types/response/v5-alpha-trade.d.ts +170 -0
- package/lib/types/response/v5-alpha-trade.js +6 -0
- package/lib/types/response/v5-alpha-trade.js.map +1 -0
- package/lib/types/response/v5-asset.d.ts +125 -10
- package/lib/types/response/v5-card.d.ts +118 -0
- package/lib/types/response/v5-card.js +3 -0
- package/lib/types/response/v5-card.js.map +1 -0
- package/lib/types/response/v5-earn-advance-discount.d.ts +143 -0
- package/lib/types/response/v5-earn-advance-discount.js +3 -0
- package/lib/types/response/v5-earn-advance-discount.js.map +1 -0
- package/lib/types/response/v5-earn-fixed-term.d.ts +102 -0
- package/lib/types/response/v5-earn-fixed-term.js +3 -0
- package/lib/types/response/v5-earn-fixed-term.js.map +1 -0
- package/lib/types/response/v5-earn-liquidity-mining.d.ts +31 -0
- package/lib/types/response/v5-earn-liquidity-mining.js +3 -0
- package/lib/types/response/v5-earn-liquidity-mining.js.map +1 -0
- package/lib/types/response/v5-earn-token.d.ts +62 -0
- package/lib/types/response/v5-earn-token.js +6 -0
- package/lib/types/response/v5-earn-token.js.map +1 -0
- package/lib/types/response/v5-earn.d.ts +103 -0
- package/lib/types/response/v5-market.d.ts +14 -0
- package/lib/types/response/v5-position.d.ts +4 -0
- package/lib/types/response/v5-spot-leverage-token.d.ts +56 -0
- package/lib/types/response/v5-spreadtrading.d.ts +5 -0
- package/lib/types/response/v5-user.d.ts +16 -0
- package/lib/types/shared-v5.d.ts +11 -1
- package/lib/types/websockets/ws-events.d.ts +4 -0
- package/lib/util/webCryptoAPI.d.ts +1 -1
- package/lib/util/webCryptoAPI.js +1 -1
- package/lib/util/webCryptoAPI.js.map +1 -1
- package/lib/util/websockets/websocket-util.js +1 -0
- package/lib/util/websockets/websocket-util.js.map +1 -1
- package/llms.txt +8037 -5345
- package/package.json +1 -1
package/lib/rest-client-v5.js
CHANGED
|
@@ -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:
|
|
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);
|
|
@@ -764,6 +774,7 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
764
774
|
* Covers: SPOT / USDT contract / USDC contract / Inverse contract
|
|
765
775
|
*
|
|
766
776
|
* Includes RPI permission information (isPublicRpi, myRpiPermission)
|
|
777
|
+
* Note: e.g. `symbolType: 'commodity'`, and for linear also `stock`, `forex`.
|
|
767
778
|
*/
|
|
768
779
|
getAccountInstrumentsInfo(params) {
|
|
769
780
|
return this.getPrivate('/v5/account/instruments-info', params);
|
|
@@ -791,6 +802,13 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
791
802
|
*
|
|
792
803
|
* - Input the specific coin: repay the liability of this coin in particular
|
|
793
804
|
* - No coin specified: repay the liability of all coins
|
|
805
|
+
*
|
|
806
|
+
* Does not repay manual-borrow (spot margin manual borrow) liabilities — use `manualRepay` or
|
|
807
|
+
* `manualRepayWithoutConversion` instead (API error 182120 otherwise).
|
|
808
|
+
* From 2026-03-17 (full 2026-03-24), BYUSDT can be used for repayment. MNT is temporarily not used for
|
|
809
|
+
* this flow; MNT convert-repay is not supported (use `manualRepayWithoutConversion` with existing balance).
|
|
810
|
+
* From 2026-02-10 08:00 UTC, coin-conversion fees use the higher of collateral or debt fee rate, with a
|
|
811
|
+
* per-transaction coin-conversion cap of 300,000 USD equivalent.
|
|
794
812
|
*/
|
|
795
813
|
repayLiability(params) {
|
|
796
814
|
return this.postPrivate('/v5/account/quick-repayment', params);
|
|
@@ -805,6 +823,14 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
805
823
|
* If that's not enough, the remaining amount will be repaid by converting other assets.
|
|
806
824
|
*
|
|
807
825
|
* Repayment is prohibited between 04:00 and 05:30 per hour.
|
|
826
|
+
*
|
|
827
|
+
* When `coin` and `amount` are both set, validation depends on `repaymentType` (e.g. amount must not
|
|
828
|
+
* exceed the matching liability pool). If neither `coin` nor `amount` is set, `repaymentType` must be
|
|
829
|
+
* ALL. Response timing: ALL and FIXED are asynchronous; FLEXIBLE is synchronous.
|
|
830
|
+
* For repay-without-convert (spot balance only), use `manualRepayWithoutConversion`.
|
|
831
|
+
* From 2026-03-17 (full 2026-03-24), BYUSDT can be used for repayment. MNT: not via convert-repay;
|
|
832
|
+
* use `manualRepayWithoutConversion` for MNT with existing balance. From 2026-02-10 08:00 UTC,
|
|
833
|
+
* coin-conversion cap 300,000 USD equivalent per transaction applies.
|
|
808
834
|
*/
|
|
809
835
|
manualRepay(params) {
|
|
810
836
|
return this.postPrivate('/v5/account/repay', params);
|
|
@@ -907,12 +933,20 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
907
933
|
return this.postPrivate('/v5/account/set-limit-px-action', params);
|
|
908
934
|
}
|
|
909
935
|
/**
|
|
910
|
-
* Get Limit Price Behaviour
|
|
936
|
+
* Get Trade Behaviour Config / Get Limit Price Behaviour
|
|
911
937
|
* You can get configuration how the system behaves when your limit order price exceeds the highest bid or lowest ask price.
|
|
938
|
+
* Response includes `deltaEnable` for Delta Neutral mode, and `smsef` / `fmsef` for Spot and Futures MNT fee deduction.
|
|
912
939
|
*/
|
|
913
940
|
getLimitPriceAction() {
|
|
914
941
|
return this.getPrivate('/v5/account/user-setting-config');
|
|
915
942
|
}
|
|
943
|
+
/**
|
|
944
|
+
* Set Delta Neutral Mode
|
|
945
|
+
* 1: enable, 0: disable. Query current status via `getLimitPriceAction()`.
|
|
946
|
+
*/
|
|
947
|
+
setDeltaNeutralMode(params) {
|
|
948
|
+
return this.postPrivate('/v5/account/set-delta-mode', params);
|
|
949
|
+
}
|
|
916
950
|
/**
|
|
917
951
|
* Configure Market Maker Protection (MMP)
|
|
918
952
|
*/
|
|
@@ -931,6 +965,27 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
931
965
|
getMMPState(baseCoin) {
|
|
932
966
|
return this.getPrivate('/v5/account/mmp-state', { baseCoin });
|
|
933
967
|
}
|
|
968
|
+
/**
|
|
969
|
+
* Get Option Asset Info
|
|
970
|
+
* P&L per coin for options: delta, RPL, UPL, margin. Result uses a nested `result` list.
|
|
971
|
+
*/
|
|
972
|
+
getOptionAssetInfo() {
|
|
973
|
+
return this.getPrivate('/v5/account/option-asset-info');
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Get Pay Info
|
|
977
|
+
* Repayment collateral snapshot before `manualRepay` or `repayLiability`. Optional `coin` for one liability; omit for total.
|
|
978
|
+
*/
|
|
979
|
+
getPayInfo(params) {
|
|
980
|
+
return this.getPrivate('/v5/account/pay-info', params);
|
|
981
|
+
}
|
|
982
|
+
/**
|
|
983
|
+
* Get Trade Info For Analysis
|
|
984
|
+
* Aggregated spot trade stats for a symbol, including daily breakdown when returned.
|
|
985
|
+
*/
|
|
986
|
+
getTradeInfoForAnalysis(params) {
|
|
987
|
+
return this.getPrivate('/v5/account/trade-info-for-analysis', params);
|
|
988
|
+
}
|
|
934
989
|
/**
|
|
935
990
|
*
|
|
936
991
|
****** Asset APIs
|
|
@@ -941,10 +996,26 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
941
996
|
* Query master account or subaccount's total assets and detailed asset holdings across different accounts and product categories.
|
|
942
997
|
*
|
|
943
998
|
* INFO: For accountType=Alpha, on-chain assets are not included in the returned data in current version.
|
|
999
|
+
* `valuationCurrency` sets fiat for totals; `accountType` filters which account to return. For Alpha + farm, `extMap` may
|
|
1000
|
+
* appear on `coinDetail` (price range and equity unit).
|
|
944
1001
|
*/
|
|
945
1002
|
getAssetOverview(params) {
|
|
946
1003
|
return this.getPrivate('/v5/asset/asset-overview', params);
|
|
947
1004
|
}
|
|
1005
|
+
/**
|
|
1006
|
+
* Get Portfolio Margin Info
|
|
1007
|
+
* Wallet and per-base-coin P&L range (aligned with the portfolio margin page).
|
|
1008
|
+
*/
|
|
1009
|
+
getPortfolioMarginInfo(params) {
|
|
1010
|
+
return this.getPrivate('/v5/asset/portfolio-margin', params);
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Get Total Members Assets
|
|
1014
|
+
* Master + sub-accounts; optional `coin` for valuation (default BTC).
|
|
1015
|
+
*/
|
|
1016
|
+
getTotalMembersAssets(params) {
|
|
1017
|
+
return this.getPrivate('/v5/asset/total-members-assets', params);
|
|
1018
|
+
}
|
|
948
1019
|
/**
|
|
949
1020
|
* Funding Account Transaction History
|
|
950
1021
|
* Transaction log in Funding Account. Supports filtering by transaction type and time range.
|
|
@@ -1018,7 +1089,9 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1018
1089
|
return this.getPrivate('/v5/asset/transfer/query-account-coin-balance', params);
|
|
1019
1090
|
}
|
|
1020
1091
|
/**
|
|
1021
|
-
* Query withdrawable amount.
|
|
1092
|
+
* Query withdrawable amount (incl. risk-frozen `limitAmountUsd` and per-wallet slices).
|
|
1093
|
+
* May include FUND, UTA, EARN, SPOT keys depending on the coin. EARN is present when the coin
|
|
1094
|
+
* supports withdrawal from the Earn account.
|
|
1022
1095
|
*/
|
|
1023
1096
|
getWithdrawableAmount(params) {
|
|
1024
1097
|
return this.getPrivate('/v5/asset/withdraw/withdrawable-amount', params);
|
|
@@ -1093,6 +1166,7 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1093
1166
|
}
|
|
1094
1167
|
/**
|
|
1095
1168
|
* Set auto transfer account after deposit. The same function as the setting for Deposit on web GUI
|
|
1169
|
+
* (UNIFIED, FUND, or EARN; if a coin is not in flexible saving, EARN may route to funding as per Bybit).
|
|
1096
1170
|
*/
|
|
1097
1171
|
setDepositAccount(params) {
|
|
1098
1172
|
return this.postPrivate('/v5/asset/deposit/deposit-to-account', params);
|
|
@@ -1187,11 +1261,13 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1187
1261
|
return this.getPrivate('/v5/asset/withdraw/vasp/list');
|
|
1188
1262
|
}
|
|
1189
1263
|
/**
|
|
1190
|
-
* Withdraw
|
|
1264
|
+
* Withdraw from Funding, Unified, and/or Earn (and combos such as FUND,UTA,EARN per API).
|
|
1191
1265
|
*
|
|
1192
1266
|
* CAUTION: Make sure you have whitelisted your wallet address before calling this endpoint.
|
|
1193
1267
|
*
|
|
1194
1268
|
* You can make an off-chain transfer if the target wallet address is from Bybit. This means that no blockchain fee will be charged.
|
|
1269
|
+
*
|
|
1270
|
+
* Bybit Turkey (TR) site: `transactionPurpose` is required on the request (see `WithdrawParamsV5`).
|
|
1195
1271
|
*/
|
|
1196
1272
|
submitWithdrawal(params) {
|
|
1197
1273
|
return this.postPrivate('/v5/asset/withdraw/create', params);
|
|
@@ -1306,6 +1382,8 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1306
1382
|
* Both master and sub user's api key are applicable.
|
|
1307
1383
|
*
|
|
1308
1384
|
* TIP: Any permission can access this endpoint.
|
|
1385
|
+
*
|
|
1386
|
+
* Response `permissions` may include `FiatBitPay`; `FiatBybitPay` is deprecated for the same scope.
|
|
1309
1387
|
*/
|
|
1310
1388
|
getQueryApiKey() {
|
|
1311
1389
|
return this.getPrivate('/v5/user/query-api');
|
|
@@ -1324,6 +1402,8 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1324
1402
|
*
|
|
1325
1403
|
* TIP: The API key must have one of the permissions to be allowed to call the following API endpoint.
|
|
1326
1404
|
* - master API key: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
1405
|
+
*
|
|
1406
|
+
* `permissions` may include `FiatBitPay`; `FiatBybitPay` remains during transition for the same scope.
|
|
1327
1407
|
*/
|
|
1328
1408
|
updateMasterApiKey(params) {
|
|
1329
1409
|
return this.postPrivate('/v5/user/update-api', params);
|
|
@@ -1414,8 +1494,9 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1414
1494
|
}
|
|
1415
1495
|
/**
|
|
1416
1496
|
* Sign Agreement
|
|
1417
|
-
* To trade
|
|
1497
|
+
* To trade commodity contracts (e.g. metals XAU/XAG perps, crude oil perps), complete the agreement signing first.
|
|
1418
1498
|
* Recommended to sign in advance via API so you can trade immediately when contracts go live.
|
|
1499
|
+
* Send either `category` (legacy) or `categoryV2` (preferred; new agreement types are added to `categoryV2` only).
|
|
1419
1500
|
*
|
|
1420
1501
|
* INFO
|
|
1421
1502
|
* - Only the master account can sign. Subaccounts are not supported.
|
|
@@ -1426,6 +1507,84 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1426
1507
|
signAgreement(params) {
|
|
1427
1508
|
return this.postPrivate('/v5/user/agreement', params);
|
|
1428
1509
|
}
|
|
1510
|
+
/**
|
|
1511
|
+
*
|
|
1512
|
+
****** Alpha / Web3 (on-chain) trade APIs
|
|
1513
|
+
*
|
|
1514
|
+
*/
|
|
1515
|
+
/**
|
|
1516
|
+
* Get Trade Quote
|
|
1517
|
+
* Get a price quote before a purchase or redeem. Required before `executeAlphaTradePurchase` or `executeAlphaTradeRedeem`.
|
|
1518
|
+
* Pass `quoteData` and `correctingCode` from the response unchanged to the execute endpoints.
|
|
1519
|
+
*/
|
|
1520
|
+
getAlphaTradeQuote(params) {
|
|
1521
|
+
return this.postPrivate('/v5/alpha/trade/quote', params);
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Execute Purchase
|
|
1525
|
+
* Buy on-chain tokens with a payment token (e.g. USDT). Requires a valid quote; obtain user confirmation first.
|
|
1526
|
+
* HTTP 200 is only an acknowledgment — poll `getAlphaTradeOrderList` for final status. Idempotent by `quoteDataId` in the quote.
|
|
1527
|
+
*/
|
|
1528
|
+
executeAlphaTradePurchase(params) {
|
|
1529
|
+
return this.postPrivate('/v5/alpha/trade/purchase', params);
|
|
1530
|
+
}
|
|
1531
|
+
/**
|
|
1532
|
+
* Execute Redeem
|
|
1533
|
+
* Sell on-chain tokens for a payment token. Requires a valid quote; obtain user confirmation first.
|
|
1534
|
+
* HTTP 200 is only an acknowledgment — poll `getAlphaTradeOrderList` for final status. Idempotent by `quoteDataId` in the quote.
|
|
1535
|
+
*/
|
|
1536
|
+
executeAlphaTradeRedeem(params) {
|
|
1537
|
+
return this.postPrivate('/v5/alpha/trade/redeem', params);
|
|
1538
|
+
}
|
|
1539
|
+
/**
|
|
1540
|
+
* Get Payment Token List
|
|
1541
|
+
* List payment tokens (e.g. USDT) and CEX token codes (e.g. CEX_1) for quote and execution. Each entry includes `supportChains`.
|
|
1542
|
+
*/
|
|
1543
|
+
getAlphaPayTokenList(params) {
|
|
1544
|
+
return this.postPrivate('/v5/alpha/trade/pay-token-list', params);
|
|
1545
|
+
}
|
|
1546
|
+
/**
|
|
1547
|
+
* Get Order List
|
|
1548
|
+
* On-chain trade order history; filters for trade type, status, token, and time. Max 90 days.
|
|
1549
|
+
*/
|
|
1550
|
+
getAlphaTradeOrderList(params) {
|
|
1551
|
+
return this.postPrivate('/v5/alpha/trade/order-list', params);
|
|
1552
|
+
}
|
|
1553
|
+
/**
|
|
1554
|
+
* Get Biz Token List
|
|
1555
|
+
* Tradable on-chain tokens (DEX_ prefix ids), risk flags, limits, and supported payment token codes.
|
|
1556
|
+
*/
|
|
1557
|
+
getAlphaBizTokenList(params) {
|
|
1558
|
+
return this.postPrivate('/v5/alpha/trade/biz-token-list', params || {});
|
|
1559
|
+
}
|
|
1560
|
+
/**
|
|
1561
|
+
* Get Token Price List
|
|
1562
|
+
* Batch market data (up to 20 `chainCode` + `tokenAddress` pairs). Prices, 24h change, volume, market cap, etc.
|
|
1563
|
+
*/
|
|
1564
|
+
getAlphaBizTokenPriceList(params) {
|
|
1565
|
+
return this.postPrivate('/v5/alpha/trade/biz-token-price-list', params);
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Get Token Details
|
|
1569
|
+
* One token: description, links, `riskFlag`, and listing status. Use `chainCode` + `tokenAddress` from biz list or assets.
|
|
1570
|
+
*/
|
|
1571
|
+
getAlphaBizTokenDetails(params) {
|
|
1572
|
+
return this.postPrivate('/v5/alpha/trade/biz-token-details', params);
|
|
1573
|
+
}
|
|
1574
|
+
/**
|
|
1575
|
+
* Get Asset List
|
|
1576
|
+
* Portfolio of on-chain token holdings (non-zero only), sorted by USD value.
|
|
1577
|
+
*/
|
|
1578
|
+
getAlphaAssetList() {
|
|
1579
|
+
return this.postPrivate('/v5/alpha/trade/asset-list', {});
|
|
1580
|
+
}
|
|
1581
|
+
/**
|
|
1582
|
+
* Get Asset Detail
|
|
1583
|
+
* Single-asset view; `result.assetList` has 0 or 1 item.
|
|
1584
|
+
*/
|
|
1585
|
+
getAlphaAssetDetail(params) {
|
|
1586
|
+
return this.postPrivate('/v5/alpha/trade/asset-detail', params);
|
|
1587
|
+
}
|
|
1429
1588
|
/**
|
|
1430
1589
|
*
|
|
1431
1590
|
****** Spot Margin Trade APIs (UTA)
|
|
@@ -1450,6 +1609,13 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1450
1609
|
getHistoricalInterestRate(params) {
|
|
1451
1610
|
return this.getPrivate('/v5/spot-margin-trade/interest-rate-history', params);
|
|
1452
1611
|
}
|
|
1612
|
+
/**
|
|
1613
|
+
* Get Currency Data
|
|
1614
|
+
* Borrowing currency data: flexible/fixed manual borrow, min qty, precision, interest rate range.
|
|
1615
|
+
*/
|
|
1616
|
+
getSpotMarginCurrencyData(params) {
|
|
1617
|
+
return this.getPrivate('/v5/spot-margin-trade/currency-data', params);
|
|
1618
|
+
}
|
|
1453
1619
|
/**
|
|
1454
1620
|
* Turn spot margin trade on / off in your UTA account.
|
|
1455
1621
|
*
|
|
@@ -1517,6 +1683,10 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1517
1683
|
*
|
|
1518
1684
|
* IMPORTANT: Repayment is prohibited between 04:00 and 05:30 per hour.
|
|
1519
1685
|
* When repaying, system will only use the spot available balance of the debt currency.
|
|
1686
|
+
*
|
|
1687
|
+
* Use `getAvailableAmountToRepay` to check spot available amount. Response timing: ALL and FIXED
|
|
1688
|
+
* asynchronous; FLEXIBLE synchronous. From 2026-03-17 (full 2026-03-24), BYUSDT can be used for
|
|
1689
|
+
* repayment, including MNT using existing spot balance.
|
|
1520
1690
|
*/
|
|
1521
1691
|
manualRepayWithoutConversion(params) {
|
|
1522
1692
|
return this.postPrivate('/v5/account/no-convert-repay', params);
|
|
@@ -1544,6 +1714,42 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
1544
1714
|
setAutoRepayMode(params) {
|
|
1545
1715
|
return this.postPrivate('/v5/spot-margin-trade/set-auto-repay-mode', params);
|
|
1546
1716
|
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Get Liability Info (spot margin UTA): fixed vs floating, spot vs derivatives borrow split.
|
|
1719
|
+
*/
|
|
1720
|
+
getSpotMarginLiability(params) {
|
|
1721
|
+
return this.getPrivate('/v5/spot-margin-trade/liability', params);
|
|
1722
|
+
}
|
|
1723
|
+
/**
|
|
1724
|
+
* Fixed-rate borrow (place order).
|
|
1725
|
+
*/
|
|
1726
|
+
submitFixedRateBorrow(params) {
|
|
1727
|
+
return this.postPrivate('/v5/spot-margin-trade/fixedborrow', params);
|
|
1728
|
+
}
|
|
1729
|
+
/**
|
|
1730
|
+
* Fixed-rate borrow order history (descending by order time).
|
|
1731
|
+
*/
|
|
1732
|
+
getFixedRateBorrowOrderInfo(params) {
|
|
1733
|
+
return this.getPrivate('/v5/spot-margin-trade/fixedborrow-order-info', params);
|
|
1734
|
+
}
|
|
1735
|
+
/**
|
|
1736
|
+
* Fixed-rate borrow contract list (descending by borrow time).
|
|
1737
|
+
*/
|
|
1738
|
+
getFixedRateBorrowContractInfo(params) {
|
|
1739
|
+
return this.getPrivate('/v5/spot-margin-trade/fixedborrow-contract-info', params);
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Fixed-rate borrow order book quotes (sort by apy, term, or quantity).
|
|
1743
|
+
*/
|
|
1744
|
+
getFixedRateBorrowOrderQuote(params) {
|
|
1745
|
+
return this.getPrivate('/v5/spot-margin-trade/fixedborrow-order-quote', params);
|
|
1746
|
+
}
|
|
1747
|
+
/**
|
|
1748
|
+
* Renew a fixed-rate loan contract (full remaining amount if `qty` omitted).
|
|
1749
|
+
*/
|
|
1750
|
+
renewFixedRateBorrow(params) {
|
|
1751
|
+
return this.postPrivate('/v5/spot-margin-trade/fixedborrow-renew', params);
|
|
1752
|
+
}
|
|
1547
1753
|
/**
|
|
1548
1754
|
*
|
|
1549
1755
|
****** Spot Margin Trade APIs (Normal)
|
|
@@ -2177,6 +2383,103 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
2177
2383
|
getEarnProduct(params) {
|
|
2178
2384
|
return this.get('/v5/earn/product', params);
|
|
2179
2385
|
}
|
|
2386
|
+
/**
|
|
2387
|
+
* Get Advanced Earn product info (Dual Asset, Double Win, Smart Leverage, etc. via `category`).
|
|
2388
|
+
*
|
|
2389
|
+
* INFO: No authentication. Up to 50 requests/second per IP.
|
|
2390
|
+
*/
|
|
2391
|
+
getAdvanceEarnProduct(params) {
|
|
2392
|
+
return this.get('/v5/earn/advance/product', params);
|
|
2393
|
+
}
|
|
2394
|
+
/**
|
|
2395
|
+
* Liquidity mining — product list (Advanced Earn).
|
|
2396
|
+
*
|
|
2397
|
+
* INFO: No authentication. Up to 50 requests/second per IP.
|
|
2398
|
+
*/
|
|
2399
|
+
getLiquidityMiningProduct(params) {
|
|
2400
|
+
return this.get('/v5/earn/liquidity-mining/product', params);
|
|
2401
|
+
}
|
|
2402
|
+
/**
|
|
2403
|
+
* Fixed-term / fixed saving — product list (Earn).
|
|
2404
|
+
*
|
|
2405
|
+
* INFO: No authentication. Up to 50 requests/second per IP.
|
|
2406
|
+
*/
|
|
2407
|
+
getFixedTermEarnProduct(params) {
|
|
2408
|
+
return this.get('/v5/earn/fixed-term/product', params);
|
|
2409
|
+
}
|
|
2410
|
+
/**
|
|
2411
|
+
* Advanced Earn — quote / extra info (Discount Buy, Dual Assets, …). Call before place order where required.
|
|
2412
|
+
*
|
|
2413
|
+
* INFO: No authentication. Up to 50 requests/second per IP.
|
|
2414
|
+
* Dual Assets: `productId` is required. Response uses `list` with `buyLowPrice` / `sellHighPrice`.
|
|
2415
|
+
*/
|
|
2416
|
+
getAdvanceEarnProductExtraInfo(params) {
|
|
2417
|
+
return this.get('/v5/earn/advance/product-extra-info', params);
|
|
2418
|
+
}
|
|
2419
|
+
/**
|
|
2420
|
+
* Advanced Earn — place order (Dual Assets, Discount Buy, …). Async; use getAdvanceEarnOrder to track.
|
|
2421
|
+
*
|
|
2422
|
+
* INFO: API key needs "Earn" permission. Rate limit e.g. 5 req/s (Dual Assets per docs).
|
|
2423
|
+
*/
|
|
2424
|
+
submitAdvanceEarnPlaceOrder(params) {
|
|
2425
|
+
return this.postPrivate('/v5/earn/advance/place-order', params);
|
|
2426
|
+
}
|
|
2427
|
+
/**
|
|
2428
|
+
* Advanced Earn — active positions (Dual Assets, Discount Buy, …).
|
|
2429
|
+
*
|
|
2430
|
+
* INFO: API key needs "Earn" permission. E.g. 10 req/s (Dual Assets per docs).
|
|
2431
|
+
*/
|
|
2432
|
+
getAdvanceEarnPosition(params) {
|
|
2433
|
+
return this.getPrivate('/v5/earn/advance/position', params);
|
|
2434
|
+
}
|
|
2435
|
+
/**
|
|
2436
|
+
* Advanced Earn — order list (Dual Assets, Discount Buy, …). Distinct from getEarnOrderHistory (/v5/earn/order).
|
|
2437
|
+
*
|
|
2438
|
+
* INFO: API key needs "Earn" permission. E.g. 10 req/s (Dual Assets per docs).
|
|
2439
|
+
*/
|
|
2440
|
+
getAdvanceEarnOrder(params) {
|
|
2441
|
+
return this.getPrivate('/v5/earn/advance/order', params);
|
|
2442
|
+
}
|
|
2443
|
+
/**
|
|
2444
|
+
* Fixed-term earn — place order (stake). Async; use getFixedTermEarnOrder to track.
|
|
2445
|
+
*
|
|
2446
|
+
* INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
|
|
2447
|
+
*/
|
|
2448
|
+
submitFixedTermEarnOrder(params) {
|
|
2449
|
+
return this.postPrivate('/v5/earn/fixed-term/place-order', params);
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* Fixed-term earn — early redeem (FundPool only, when product allows).
|
|
2453
|
+
*
|
|
2454
|
+
* INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
|
|
2455
|
+
*/
|
|
2456
|
+
redeemFixedTermEarn(params) {
|
|
2457
|
+
return this.postPrivate('/v5/earn/fixed-term/redeem', params);
|
|
2458
|
+
}
|
|
2459
|
+
/**
|
|
2460
|
+
* Fixed-term earn — active positions.
|
|
2461
|
+
*
|
|
2462
|
+
* INFO: API key needs "Earn" permission. Rate limit: 10 req/s.
|
|
2463
|
+
*/
|
|
2464
|
+
getFixedTermEarnPosition(params) {
|
|
2465
|
+
return this.getPrivate('/v5/earn/fixed-term/position', params);
|
|
2466
|
+
}
|
|
2467
|
+
/**
|
|
2468
|
+
* Fixed-term earn — order list.
|
|
2469
|
+
*
|
|
2470
|
+
* INFO: API key needs "Earn" permission. Rate limit: 10 req/s.
|
|
2471
|
+
*/
|
|
2472
|
+
getFixedTermEarnOrder(params) {
|
|
2473
|
+
return this.getPrivate('/v5/earn/fixed-term/order', params);
|
|
2474
|
+
}
|
|
2475
|
+
/**
|
|
2476
|
+
* Fixed-term earn — enable or disable auto-invest on a position.
|
|
2477
|
+
*
|
|
2478
|
+
* INFO: API key needs "Earn" permission. Rate limit: 5 req/s.
|
|
2479
|
+
*/
|
|
2480
|
+
setFixedTermEarnAutoInvest(params) {
|
|
2481
|
+
return this.postPrivate('/v5/earn/fixed-term/position/auto-invest', params);
|
|
2482
|
+
}
|
|
2180
2483
|
/**
|
|
2181
2484
|
* Stake or Redeem Earn products
|
|
2182
2485
|
*
|
|
@@ -2209,14 +2512,25 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
2209
2512
|
* INFO: API key needs "Earn" permission
|
|
2210
2513
|
*
|
|
2211
2514
|
* Note: Fully redeemed position is also returned in the response
|
|
2515
|
+
* Note: Response includes `autoReinvest` where applicable; use `modifyEarnPosition` to change it (OnChain fixed).
|
|
2212
2516
|
*/
|
|
2213
2517
|
getEarnPosition(params) {
|
|
2214
2518
|
return this.getPrivate('/v5/earn/position', params);
|
|
2215
2519
|
}
|
|
2520
|
+
/**
|
|
2521
|
+
* Modify OnChain Earn position (e.g. auto-reinvest for fixed duration products).
|
|
2522
|
+
*
|
|
2523
|
+
* INFO: API key needs "Earn" permission. Only `category=OnChain` and fixed positions (see product).
|
|
2524
|
+
*/
|
|
2525
|
+
modifyEarnPosition(params) {
|
|
2526
|
+
return this.postPrivate('/v5/earn/position/modify', params);
|
|
2527
|
+
}
|
|
2216
2528
|
/**
|
|
2217
2529
|
* Get Yield History
|
|
2218
2530
|
*
|
|
2219
2531
|
* INFO: API key needs "Earn" permission
|
|
2532
|
+
*
|
|
2533
|
+
* Note: `category` includes `OnChain`. For `OnChain`, do not pass `productId` (error).
|
|
2220
2534
|
*/
|
|
2221
2535
|
getEarnYieldHistory(params) {
|
|
2222
2536
|
return this.getPrivate('/v5/earn/yield', params);
|
|
@@ -2229,6 +2543,98 @@ class RestClientV5 extends BaseRestClient_1.default {
|
|
|
2229
2543
|
getEarnHourlyYieldHistory(params) {
|
|
2230
2544
|
return this.getPrivate('/v5/earn/hourly-yield', params);
|
|
2231
2545
|
}
|
|
2546
|
+
/**
|
|
2547
|
+
* Get historical APR (FlexibleSaving / OnChain), up to ~6 months.
|
|
2548
|
+
*
|
|
2549
|
+
* INFO: Does not need authentication
|
|
2550
|
+
*/
|
|
2551
|
+
getEarnAprHistory(params) {
|
|
2552
|
+
return this.get('/v5/earn/apr-history', params);
|
|
2553
|
+
}
|
|
2554
|
+
/**
|
|
2555
|
+
* Earn token product (e.g. BYUSDT) — Get Product Info
|
|
2556
|
+
* Without auth, user-specific fields are empty or defaulted.
|
|
2557
|
+
*/
|
|
2558
|
+
getEarnTokenProduct(params) {
|
|
2559
|
+
return this.get('/v5/earn/token/product', params);
|
|
2560
|
+
}
|
|
2561
|
+
/**
|
|
2562
|
+
* Earn token — Place Order (Mint / Redeem). Accepted response is not final settlement; use `getEarnTokenOrders`.
|
|
2563
|
+
*/
|
|
2564
|
+
submitEarnTokenOrder(params) {
|
|
2565
|
+
return this.postPrivate('/v5/earn/token/place-order', params);
|
|
2566
|
+
}
|
|
2567
|
+
/**
|
|
2568
|
+
* Earn token — Get Order List
|
|
2569
|
+
*/
|
|
2570
|
+
getEarnTokenOrders(params) {
|
|
2571
|
+
return this.getPrivate('/v5/earn/token/order', params);
|
|
2572
|
+
}
|
|
2573
|
+
/**
|
|
2574
|
+
* Earn token — Get Position Info
|
|
2575
|
+
*/
|
|
2576
|
+
getEarnTokenPosition(params) {
|
|
2577
|
+
return this.getPrivate('/v5/earn/token/position', params);
|
|
2578
|
+
}
|
|
2579
|
+
/**
|
|
2580
|
+
* Earn token — Get Daily Yield Records
|
|
2581
|
+
*/
|
|
2582
|
+
getEarnTokenDailyYield(params) {
|
|
2583
|
+
return this.getPrivate('/v5/earn/token/yield', params);
|
|
2584
|
+
}
|
|
2585
|
+
/**
|
|
2586
|
+
* Earn token — Get Hourly Yield Records
|
|
2587
|
+
*/
|
|
2588
|
+
getEarnTokenHourlyYield(params) {
|
|
2589
|
+
return this.getPrivate('/v5/earn/token/hourly-yield', params);
|
|
2590
|
+
}
|
|
2591
|
+
/**
|
|
2592
|
+
* Earn token — Get History APR (7/30/180 days). No authentication required.
|
|
2593
|
+
*/
|
|
2594
|
+
getEarnTokenHistoryApr(params) {
|
|
2595
|
+
return this.get('/v5/earn/token/history-apr', params);
|
|
2596
|
+
}
|
|
2597
|
+
/**
|
|
2598
|
+
*
|
|
2599
|
+
****** Bybit Card APIs
|
|
2600
|
+
*
|
|
2601
|
+
*/
|
|
2602
|
+
/**
|
|
2603
|
+
* Bybit Card — query card transaction / asset history (filter by status, card digits, merchant, time, type, …).
|
|
2604
|
+
*/
|
|
2605
|
+
queryCardAssetRecords(params) {
|
|
2606
|
+
return this.postPrivate('/v5/card/transaction/query-asset-records', params);
|
|
2607
|
+
}
|
|
2608
|
+
/**
|
|
2609
|
+
* Bybit Card — point balance (available, pending, account status, …).
|
|
2610
|
+
*/
|
|
2611
|
+
queryCardPointsBalance() {
|
|
2612
|
+
return this.postPrivate('/v5/card/reward/points/balance');
|
|
2613
|
+
}
|
|
2614
|
+
/**
|
|
2615
|
+
* Bybit Card — point transaction records.
|
|
2616
|
+
*/
|
|
2617
|
+
queryCardPointsRecords(params) {
|
|
2618
|
+
return this.postPrivate('/v5/card/reward/points/records', params);
|
|
2619
|
+
}
|
|
2620
|
+
/**
|
|
2621
|
+
* Bybit Card — reward tier, spending limit, auto cashback.
|
|
2622
|
+
*/
|
|
2623
|
+
queryCardPointsTier() {
|
|
2624
|
+
return this.postPrivate('/v5/card/reward/points/tier');
|
|
2625
|
+
}
|
|
2626
|
+
/**
|
|
2627
|
+
* Bybit Card — reward mall item list.
|
|
2628
|
+
*/
|
|
2629
|
+
queryCardMallItemList(params) {
|
|
2630
|
+
return this.postPrivate('/v5/card/reward/mall/item/list', params);
|
|
2631
|
+
}
|
|
2632
|
+
/**
|
|
2633
|
+
* Bybit Card — cashback detail for a reward order.
|
|
2634
|
+
*/
|
|
2635
|
+
queryCardPointCashbackDetail(params) {
|
|
2636
|
+
return this.postPrivate('/v5/card/reward/point/cashback/detail', params);
|
|
2637
|
+
}
|
|
2232
2638
|
/**
|
|
2233
2639
|
*
|
|
2234
2640
|
****** RFQ APIs
|