bybit-api 4.3.1 → 4.3.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/llms.txt CHANGED
@@ -78,6 +78,11 @@ examples/
78
78
  Affiliate/
79
79
  get-affiliate-user-info.js
80
80
  get-affiliate-user-list.js
81
+ API-Limit/
82
+ get-all-rate-limits.js
83
+ get-rate-limit-cap.js
84
+ get-rate-limit.js
85
+ set-rate-limit.js
81
86
  Asset/
82
87
  cancel-withdrawal.js
83
88
  confirm-convert-quote.js
@@ -171,10 +176,13 @@ examples/
171
176
  get-product-info.js
172
177
  get-repayment-orders.js
173
178
  Market/
179
+ get-adl-alert.js
174
180
  get-Bybit-server-time.js
175
181
  get-delivery-price.js
182
+ get-fee-group-structure.js
176
183
  get-funding-rate-history.js
177
184
  get-historical-volatility.js
185
+ get-index-price-components.js
178
186
  get-instruments-info.js
179
187
  get-insurance.js
180
188
  get-kline-index-price.js
@@ -188,6 +196,7 @@ examples/
188
196
  get-orderbook.js
189
197
  get-public-trading-history.js
190
198
  get-risk-limit.js
199
+ get-rpi-orderbook.js
191
200
  get-tickers.js
192
201
  README.md
193
202
  P2P/
@@ -696,6 +705,66 @@ console.log(response);
696
705
  .catch((error) => {
697
706
  console.error(error);
698
707
 
708
+ ================
709
+ File: examples/apidoc/V5/API-Limit/get-all-rate-limits.js
710
+ ================
711
+ const client = new RestClientV5({
712
+ ⋮----
713
+ // Get all rate limits without filters
714
+ ⋮----
715
+ .getAllRateLimits()
716
+ .then((response) => {
717
+ console.log(response);
718
+ ⋮----
719
+ .catch((error) => {
720
+ console.error(error);
721
+ ⋮----
722
+ // Get all rate limits with filters
723
+ ⋮----
724
+ .getAllRateLimits({
725
+
726
+ ================
727
+ File: examples/apidoc/V5/API-Limit/get-rate-limit-cap.js
728
+ ================
729
+ const client = new RestClientV5({
730
+ ⋮----
731
+ .getRateLimitCap()
732
+ .then((response) => {
733
+ console.log(response);
734
+ ⋮----
735
+ .catch((error) => {
736
+ console.error(error);
737
+
738
+ ================
739
+ File: examples/apidoc/V5/API-Limit/get-rate-limit.js
740
+ ================
741
+ const client = new RestClientV5({
742
+ ⋮----
743
+ .queryApiRateLimit({
744
+ ⋮----
745
+ .then((response) => {
746
+ console.log(response);
747
+ // Response now contains 'rate' field instead of 'limit'
748
+ console.log('Rate limits:', response.result.list);
749
+ ⋮----
750
+ .catch((error) => {
751
+ console.error(error);
752
+
753
+ ================
754
+ File: examples/apidoc/V5/API-Limit/set-rate-limit.js
755
+ ================
756
+ const client = new RestClientV5({
757
+ ⋮----
758
+ .setApiRateLimit({
759
+ ⋮----
760
+ rate: 100, // Changed from 'limit' to 'rate'
761
+ ⋮----
762
+ .then((response) => {
763
+ console.log(response);
764
+ ⋮----
765
+ .catch((error) => {
766
+ console.error(error);
767
+
699
768
  ================
700
769
  File: examples/apidoc/V5/Asset/cancel-withdrawal.js
701
770
  ================
@@ -1176,38 +1245,6 @@ console.log(response);
1176
1245
  .catch((error) => {
1177
1246
  console.error(error);
1178
1247
 
1179
- ================
1180
- File: examples/apidoc/V5/Crypto-Loan-New/Fixed-Loan/collateral-repayment.js
1181
- ================
1182
- // or:
1183
- // const { RestClientV5 } = require('bybit-api');
1184
- ⋮----
1185
- const client = new RestClientV5({
1186
- ⋮----
1187
- client.repayCollateralFixed({
1188
- ⋮----
1189
- .then(response => {
1190
- console.log(response);
1191
- ⋮----
1192
- .catch(error => {
1193
- console.error('Error:', error);
1194
-
1195
- ================
1196
- File: examples/apidoc/V5/Crypto-Loan-New/Flexible-Loan/collateral-repayment.js
1197
- ================
1198
- // or:
1199
- // const { RestClientV5 } = require('bybit-api');
1200
- ⋮----
1201
- const client = new RestClientV5({
1202
- ⋮----
1203
- client.repayCollateralFlexible({
1204
- ⋮----
1205
- .then(response => {
1206
- console.log(response);
1207
- ⋮----
1208
- .catch(error => {
1209
- console.error('Error:', error);
1210
-
1211
1248
  ================
1212
1249
  File: examples/apidoc/V5/Earn/get-product-info.js
1213
1250
  ================
@@ -1351,6 +1388,24 @@ console.log(response);
1351
1388
  .catch((error) => {
1352
1389
  console.error(error);
1353
1390
 
1391
+ ================
1392
+ File: examples/apidoc/V5/Market/get-adl-alert.js
1393
+ ================
1394
+ const client = new RestClientV5({
1395
+ ⋮----
1396
+ // Get ADL alerts for all symbols
1397
+ ⋮----
1398
+ .getADLAlert()
1399
+ .then((response) => {
1400
+ console.log(response);
1401
+ ⋮----
1402
+ .catch((error) => {
1403
+ console.error(error);
1404
+ ⋮----
1405
+ // Get ADL alerts for a specific symbol
1406
+ ⋮----
1407
+ .getADLAlert({
1408
+
1354
1409
  ================
1355
1410
  File: examples/apidoc/V5/Market/get-Bybit-server-time.js
1356
1411
  ================
@@ -1375,6 +1430,23 @@ console.log(response);
1375
1430
  .catch((error) => {
1376
1431
  console.error(error);
1377
1432
 
1433
+ ================
1434
+ File: examples/apidoc/V5/Market/get-fee-group-structure.js
1435
+ ================
1436
+ const client = new RestClientV5({
1437
+ ⋮----
1438
+ // Get fee group structure for all groups
1439
+ ⋮----
1440
+ .getFeeGroupStructure({
1441
+ ⋮----
1442
+ .then((response) => {
1443
+ console.log(response);
1444
+ ⋮----
1445
+ .catch((error) => {
1446
+ console.error(error);
1447
+ ⋮----
1448
+ // Get fee group structure for a specific group
1449
+
1378
1450
  ================
1379
1451
  File: examples/apidoc/V5/Market/get-funding-rate-history.js
1380
1452
  ================
@@ -1401,6 +1473,19 @@ console.log(response);
1401
1473
  .catch((error) => {
1402
1474
  console.error(error);
1403
1475
 
1476
+ ================
1477
+ File: examples/apidoc/V5/Market/get-index-price-components.js
1478
+ ================
1479
+ const client = new RestClientV5({
1480
+ ⋮----
1481
+ .getIndexPriceComponents({
1482
+ ⋮----
1483
+ .then((response) => {
1484
+ console.log(response);
1485
+ ⋮----
1486
+ .catch((error) => {
1487
+ console.error(error);
1488
+
1404
1489
  ================
1405
1490
  File: examples/apidoc/V5/Market/get-instruments-info.js
1406
1491
  ================
@@ -1550,6 +1635,19 @@ console.log(response);
1550
1635
  .catch((error) => {
1551
1636
  console.error(error);
1552
1637
 
1638
+ ================
1639
+ File: examples/apidoc/V5/Market/get-rpi-orderbook.js
1640
+ ================
1641
+ const client = new RestClientV5({
1642
+ ⋮----
1643
+ .getRPIOrderbook({
1644
+ ⋮----
1645
+ .then((response) => {
1646
+ console.log(response);
1647
+ ⋮----
1648
+ .catch((error) => {
1649
+ console.error(error);
1650
+
1553
1651
  ================
1554
1652
  File: examples/apidoc/V5/Market/get-tickers.js
1555
1653
  ================
@@ -7220,6 +7318,38 @@ console.log(response);
7220
7318
  .catch((error) => {
7221
7319
  console.error(error);
7222
7320
 
7321
+ ================
7322
+ File: examples/apidoc/V5/Crypto-Loan-New/Fixed-Loan/collateral-repayment.js
7323
+ ================
7324
+ // or:
7325
+ // const { RestClientV5 } = require('bybit-api');
7326
+ ⋮----
7327
+ const client = new RestClientV5({
7328
+ ⋮----
7329
+ client.repayCollateralFixed({
7330
+ ⋮----
7331
+ .then(response => {
7332
+ console.log(response);
7333
+ ⋮----
7334
+ .catch(error => {
7335
+ console.error('Error:', error);
7336
+
7337
+ ================
7338
+ File: examples/apidoc/V5/Crypto-Loan-New/Flexible-Loan/collateral-repayment.js
7339
+ ================
7340
+ // or:
7341
+ // const { RestClientV5 } = require('bybit-api');
7342
+ ⋮----
7343
+ const client = new RestClientV5({
7344
+ ⋮----
7345
+ client.repayCollateralFlexible({
7346
+ ⋮----
7347
+ .then(response => {
7348
+ console.log(response);
7349
+ ⋮----
7350
+ .catch(error => {
7351
+ console.error('Error:', error);
7352
+
7223
7353
  ================
7224
7354
  File: examples/apidoc/V5/Market/get-new-delivery-price.js
7225
7355
  ================
@@ -7707,6 +7837,34 @@ export interface GetOrderbookParamsV5 {
7707
7837
  limit?: number;
7708
7838
  }
7709
7839
  ⋮----
7840
+ export interface GetRPIOrderbookParamsV5 {
7841
+ category?: 'spot' | 'linear' | 'inverse';
7842
+ symbol: string;
7843
+ limit: number; // Required for RPI orderbook, [1, 50]
7844
+ }
7845
+ ⋮----
7846
+ limit: number; // Required for RPI orderbook, [1, 50]
7847
+ ⋮----
7848
+ export interface GetIndexPriceComponentsParamsV5 {
7849
+ indexName: string; // Index name, like BTCUSDT
7850
+ }
7851
+ ⋮----
7852
+ indexName: string; // Index name, like BTCUSDT
7853
+ ⋮----
7854
+ export interface GetADLAlertParamsV5 {
7855
+ symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only
7856
+ }
7857
+ ⋮----
7858
+ symbol?: string; // Contract name, e.g. BTCUSDT. Uppercase only
7859
+ ⋮----
7860
+ export interface GetFeeGroupStructureParamsV5 {
7861
+ productType: string; // Product type. contract only for now
7862
+ groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7
7863
+ }
7864
+ ⋮----
7865
+ productType: string; // Product type. contract only for now
7866
+ groupId?: string; // Group ID. 1, 2, 3, 4, 5, 6, 7
7867
+ ⋮----
7710
7868
  export interface GetTickersParamsV5<TCategory = CategoryV5> {
7711
7869
  category: TCategory;
7712
7870
  symbol?: string;
@@ -7794,197 +7952,49 @@ export interface GetLongShortRatioParamsV5 {
7794
7952
  }
7795
7953
 
7796
7954
  ================
7797
- File: src/types/request/v5-position.ts
7955
+ File: src/types/request/v5-rfq.ts
7798
7956
  ================
7799
- import {
7800
- CategoryV5,
7801
- ExecTypeV5,
7802
- OrderTriggerByV5,
7803
- OrderTypeV5,
7804
- PositionIdx,
7805
- TPSLModeV5,
7806
- } from '../shared-v5';
7807
- ⋮----
7808
- export interface PositionInfoParamsV5 {
7809
- category: CategoryV5;
7810
- symbol?: string;
7811
- baseCoin?: string;
7812
- settleCoin?: string;
7813
- limit?: number;
7814
- cursor?: string;
7957
+ export interface RFQTransactionV5 {
7958
+ category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type
7959
+ symbol: string; // Name of the trading contract
7960
+ side: 'buy' | 'sell'; // Inquiry transaction direction
7961
+ qty: string; // Transaction quantity
7962
+ isLeverage?: boolean; // For spot lending, default false
7815
7963
  }
7816
7964
  ⋮----
7817
- export interface SetLeverageParamsV5 {
7818
- category: 'linear' | 'inverse';
7819
- symbol: string;
7820
- buyLeverage: string;
7821
- sellLeverage: string;
7822
- }
7965
+ category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type
7966
+ symbol: string; // Name of the trading contract
7967
+ side: 'buy' | 'sell'; // Inquiry transaction direction
7968
+ qty: string; // Transaction quantity
7969
+ isLeverage?: boolean; // For spot lending, default false
7823
7970
  ⋮----
7824
- export interface SwitchIsolatedMarginParamsV5 {
7825
- category: 'linear' | 'inverse';
7826
- symbol: string;
7827
- tradeMode: 0 | 1;
7828
- buyLeverage: string;
7829
- sellLeverage: string;
7971
+ export interface CreateRFQParamsV5 {
7972
+ counterparties: string[]; // Array of deskCode
7973
+ rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters
7974
+ anonymous?: boolean; // Whether it is anonymous inquiry, default false
7975
+ strategyType?: string; // Inquiry label, max 36 characters
7976
+ list: RFQTransactionV5[]; // Transaction list, up to 10 sets
7830
7977
  }
7831
7978
  ⋮----
7832
- export interface SetTPSLModeParamsV5 {
7833
- category: 'linear' | 'inverse';
7834
- symbol: string;
7835
- tpSlMode: TPSLModeV5;
7836
- }
7979
+ counterparties: string[]; // Array of deskCode
7980
+ rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters
7981
+ anonymous?: boolean; // Whether it is anonymous inquiry, default false
7982
+ strategyType?: string; // Inquiry label, max 36 characters
7983
+ list: RFQTransactionV5[]; // Transaction list, up to 10 sets
7837
7984
  ⋮----
7838
- export interface SwitchPositionModeParamsV5 {
7839
- category: 'linear' | 'inverse';
7840
- symbol?: string;
7841
- coin?: string;
7842
- mode: 0 | 3;
7985
+ export interface CancelRFQParamsV5 {
7986
+ rfqId?: string; // Inquiry ID
7987
+ rfqLinkId?: string; // Inquiry Custom ID
7843
7988
  }
7844
7989
  ⋮----
7845
- export interface SetRiskLimitParamsV5 {
7846
- category: 'linear' | 'inverse';
7847
- symbol: string;
7848
- riskId: number;
7849
- positionIdx?: PositionIdx;
7850
- }
7851
- ⋮----
7852
- export interface SetTradingStopParamsV5 {
7853
- category: CategoryV5;
7854
- symbol: string;
7855
- takeProfit?: string;
7856
- stopLoss?: string;
7857
- trailingStop?: string;
7858
- tpTriggerBy?: OrderTriggerByV5;
7859
- slTriggerBy?: OrderTriggerByV5;
7860
- activePrice?: string;
7861
- tpslMode?: TPSLModeV5;
7862
- tpSize?: string;
7863
- slSize?: string;
7864
- tpLimitPrice?: string;
7865
- slLimitPrice?: string;
7866
- tpOrderType?: OrderTypeV5;
7867
- slOrderType?: OrderTypeV5;
7868
- positionIdx: PositionIdx;
7869
- }
7870
- ⋮----
7871
- export interface SetAutoAddMarginParamsV5 {
7872
- category: 'linear';
7873
- symbol: string;
7874
- autoAddMargin: 0 | 1;
7875
- positionIdx?: PositionIdx;
7876
- }
7877
- ⋮----
7878
- export interface AddOrReduceMarginParamsV5 {
7879
- category: 'linear' | 'inverse';
7880
- symbol: string;
7881
- margin: string;
7882
- positionIDex?: PositionIdx;
7883
- }
7884
- ⋮----
7885
- export interface GetExecutionListParamsV5 {
7886
- category: CategoryV5;
7887
- symbol?: string;
7888
- orderId?: string;
7889
- orderLinkId?: string;
7890
- baseCoin?: string;
7891
- startTime?: number;
7892
- endTime?: number;
7893
- execType?: ExecTypeV5;
7894
- limit?: number;
7895
- cursor?: string;
7896
- }
7897
- ⋮----
7898
- export interface GetClosedPnLParamsV5 {
7899
- category: CategoryV5;
7900
- symbol?: string;
7901
- startTime?: number;
7902
- endTime?: number;
7903
- limit?: number;
7904
- cursor?: string;
7905
- }
7906
- ⋮----
7907
- export interface MovePositionParamsV5 {
7908
- fromUid: string;
7909
- toUid: string;
7910
- list: {
7911
- category: 'linear' | 'spot' | 'option' | 'inverse';
7912
- symbol: string;
7913
- price: string;
7914
- side: 'Buy' | 'Sell';
7915
- qty: string;
7916
- }[];
7917
- }
7918
- ⋮----
7919
- export interface GetMovePositionHistoryParamsV5 {
7920
- category?: 'linear' | 'spot' | 'option';
7921
- symbol?: string;
7922
- startTime?: number;
7923
- endTime?: number;
7924
- status?: 'Processing' | 'Filled' | 'Rejected';
7925
- blockTradeId?: string;
7926
- limit?: string;
7927
- cursor?: string;
7928
- }
7929
- ⋮----
7930
- export interface ConfirmNewRiskLimitParamsV5 {
7931
- category: 'linear' | 'inverse';
7932
- symbol: string;
7933
- }
7934
- ⋮----
7935
- export interface GetClosedOptionsPositionsParamsV5 {
7936
- category: 'option';
7937
- symbol?: string;
7938
- startTime?: number;
7939
- endTime?: number;
7940
- limit?: number;
7941
- cursor?: string;
7942
- }
7943
-
7944
- ================
7945
- File: src/types/request/v5-rfq.ts
7946
- ================
7947
- export interface RFQTransactionV5 {
7948
- category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type
7949
- symbol: string; // Name of the trading contract
7950
- side: 'buy' | 'sell'; // Inquiry transaction direction
7951
- qty: string; // Transaction quantity
7952
- isLeverage?: boolean; // For spot lending, default false
7953
- }
7954
- ⋮----
7955
- category: 'spot' | 'linear' | 'inverse' | 'option'; // Product type
7956
- symbol: string; // Name of the trading contract
7957
- side: 'buy' | 'sell'; // Inquiry transaction direction
7958
- qty: string; // Transaction quantity
7959
- isLeverage?: boolean; // For spot lending, default false
7960
- ⋮----
7961
- export interface CreateRFQParamsV5 {
7962
- counterparties: string[]; // Array of deskCode
7963
- rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters
7964
- anonymous?: boolean; // Whether it is anonymous inquiry, default false
7965
- strategyType?: string; // Inquiry label, max 36 characters
7966
- list: RFQTransactionV5[]; // Transaction list, up to 10 sets
7967
- }
7968
- ⋮----
7969
- counterparties: string[]; // Array of deskCode
7970
- rfqLinkId?: string; // Custom ID for inquiry form, 1-32 characters
7971
- anonymous?: boolean; // Whether it is anonymous inquiry, default false
7972
- strategyType?: string; // Inquiry label, max 36 characters
7973
- list: RFQTransactionV5[]; // Transaction list, up to 10 sets
7974
- ⋮----
7975
- export interface CancelRFQParamsV5 {
7976
- rfqId?: string; // Inquiry ID
7977
- rfqLinkId?: string; // Inquiry Custom ID
7978
- }
7979
- ⋮----
7980
- rfqId?: string; // Inquiry ID
7981
- rfqLinkId?: string; // Inquiry Custom ID
7982
- ⋮----
7983
- export interface RFQQuoteV5 {
7984
- category: 'spot' | 'linear' | 'option'; // Product type
7985
- symbol: string; // Name of the trading contract
7986
- price: string; // Quote price
7987
- isLeverage?: boolean; // For spot lending, default false
7990
+ rfqId?: string; // Inquiry ID
7991
+ rfqLinkId?: string; // Inquiry Custom ID
7992
+ ⋮----
7993
+ export interface RFQQuoteV5 {
7994
+ category: 'spot' | 'linear' | 'option'; // Product type
7995
+ symbol: string; // Name of the trading contract
7996
+ price: string; // Quote price
7997
+ isLeverage?: boolean; // For spot lending, default false
7988
7998
  }
7989
7999
  ⋮----
7990
8000
  category: 'spot' | 'linear' | 'option'; // Product type
@@ -9042,7 +9052,9 @@ export type TransactionTypeV5 =
9042
9052
  | 'INSTITUTION_LOAN_TRANSFER_OUT'
9043
9053
  | 'INSTITUTION_LOAN_WITHOUT_WITHDRAW'
9044
9054
  | 'INSTITUTION_LOAN_RESERVE_IN'
9045
- | 'INSTITUTION_LOAN_RESERVE_OUT';
9055
+ | 'INSTITUTION_LOAN_RESERVE_OUT'
9056
+ | 'PLATFORM_TOKEN_MNT_LIQRECALLEDMMNT'
9057
+ | 'PLATFORM_TOKEN_MNT_LIQRETURNEDMNT';
9046
9058
  ⋮----
9047
9059
  export type PermissionTypeV5 =
9048
9060
  | 'ContractTrade'
@@ -9529,110 +9541,259 @@ export interface GetConvertHistoryParamsV5 {
9529
9541
  }
9530
9542
 
9531
9543
  ================
9532
- File: src/types/response/index.ts
9533
- ================
9534
-
9535
-
9536
- ================
9537
- File: src/types/response/v5-account.ts
9544
+ File: src/types/request/v5-position.ts
9538
9545
  ================
9539
9546
  import {
9540
- AccountMarginModeV5,
9541
- AccountTypeV5,
9542
9547
  CategoryV5,
9543
- TransactionTypeV5,
9544
- UnifiedUpdateStatusV5,
9548
+ ExecTypeV5,
9549
+ OrderTriggerByV5,
9550
+ OrderTypeV5,
9551
+ PositionIdx,
9552
+ TPSLModeV5,
9545
9553
  } from '../shared-v5';
9546
9554
  ⋮----
9547
- export interface WalletBalanceV5Coin {
9548
- coin: string;
9549
- equity: string;
9550
- usdValue: string;
9551
- walletBalance: string;
9552
- free: string; // spot only
9553
- locked: string; // spot only
9554
- borrowAmount: string;
9555
- availableToBorrow: string; // deprecated field
9556
- availableToWithdraw: string;
9557
- accruedInterest: string;
9558
- totalOrderIM: string;
9559
- totalPositionIM: string;
9560
- totalPositionMM: string;
9561
- unrealisedPnl: string;
9562
- cumRealisedPnl: string;
9563
- bonus: string;
9564
- marginCollateral: boolean;
9565
- collateralSwitch: boolean;
9555
+ export interface PositionInfoParamsV5 {
9556
+ category: CategoryV5;
9557
+ symbol?: string;
9558
+ baseCoin?: string;
9559
+ settleCoin?: string;
9560
+ limit?: number;
9561
+ cursor?: string;
9566
9562
  }
9567
9563
  ⋮----
9568
- free: string; // spot only
9569
- locked: string; // spot only
9570
- ⋮----
9571
- availableToBorrow: string; // deprecated field
9572
- ⋮----
9573
- export interface WalletBalanceV5 {
9574
- accountType: AccountTypeV5;
9575
- accountLTV: string;
9576
- accountIMRate: string;
9577
- accountMMRate: string;
9578
- accountIMRateByMp: string;
9579
- accountMMRateByMp: string;
9580
- totalInitialMarginByMp: string;
9581
- totalMaintenanceMarginByMp: string;
9582
- totalEquity: string;
9583
- totalWalletBalance: string;
9584
- totalMarginBalance: string;
9585
- totalAvailableBalance: string;
9586
- totalPerpUPL: string;
9587
- totalInitialMargin: string;
9588
- totalMaintenanceMargin: string;
9589
- coin: WalletBalanceV5Coin[];
9564
+ export interface SetLeverageParamsV5 {
9565
+ category: 'linear' | 'inverse';
9566
+ symbol: string;
9567
+ buyLeverage: string;
9568
+ sellLeverage: string;
9590
9569
  }
9591
9570
  ⋮----
9592
- export interface UnifiedAccountUpgradeResultV5 {
9593
- unifiedUpdateStatus: UnifiedUpdateStatusV5;
9594
- unifiedUpdateMsg: {
9595
- msg: string[] | null;
9596
- };
9571
+ export interface SwitchIsolatedMarginParamsV5 {
9572
+ category: 'linear' | 'inverse';
9573
+ symbol: string;
9574
+ tradeMode: 0 | 1;
9575
+ buyLeverage: string;
9576
+ sellLeverage: string;
9597
9577
  }
9598
9578
  ⋮----
9599
- export interface BorrowHistoryRecordV5 {
9600
- currency: string;
9601
- createdTime: number;
9602
- borrowCost: string;
9603
- hourlyBorrowRate: string;
9604
- InterestBearingBorrowSize: string;
9605
- costExemption: string;
9606
- borrowAmount: string;
9607
- unrealisedLoss: string;
9608
- freeBorrowedAmount: string;
9579
+ export interface SetTPSLModeParamsV5 {
9580
+ category: 'linear' | 'inverse';
9581
+ symbol: string;
9582
+ tpSlMode: TPSLModeV5;
9609
9583
  }
9610
9584
  ⋮----
9611
- export interface CollateralInfoV5 {
9612
- currency: string;
9613
- hourlyBorrowRate: string;
9614
- maxBorrowingAmount: string;
9615
- freeBorrowAmount: string;
9616
- freeBorrowingLimit: string;
9617
- borrowAmount: string;
9618
- availableToBorrow: string;
9619
- borrowable: boolean;
9620
- borrowUsageRate: string;
9621
- marginCollateral: boolean;
9622
- collateralSwitch: boolean;
9623
- collateralRatio: string;
9585
+ export interface SwitchPositionModeParamsV5 {
9586
+ category: 'linear' | 'inverse';
9587
+ symbol?: string;
9588
+ coin?: string;
9589
+ mode: 0 | 3;
9624
9590
  }
9625
9591
  ⋮----
9626
- export interface CoinGreeksV5 {
9627
- baseCoin: string;
9628
- totalDelta: string;
9629
- totalGamma: string;
9630
- totalVega: string;
9631
- totalTheta: string;
9592
+ export interface SetRiskLimitParamsV5 {
9593
+ category: 'linear' | 'inverse';
9594
+ symbol: string;
9595
+ riskId: number;
9596
+ positionIdx?: PositionIdx;
9632
9597
  }
9633
9598
  ⋮----
9634
- export interface FeeRateV5 {
9635
- symbol: string;
9599
+ export interface SetTradingStopParamsV5 {
9600
+ category: CategoryV5;
9601
+ symbol: string;
9602
+ takeProfit?: string;
9603
+ stopLoss?: string;
9604
+ trailingStop?: string;
9605
+ tpTriggerBy?: OrderTriggerByV5;
9606
+ slTriggerBy?: OrderTriggerByV5;
9607
+ activePrice?: string;
9608
+ tpslMode?: TPSLModeV5;
9609
+ tpSize?: string;
9610
+ slSize?: string;
9611
+ tpLimitPrice?: string;
9612
+ slLimitPrice?: string;
9613
+ tpOrderType?: OrderTypeV5;
9614
+ slOrderType?: OrderTypeV5;
9615
+ positionIdx: PositionIdx;
9616
+ }
9617
+ ⋮----
9618
+ export interface SetAutoAddMarginParamsV5 {
9619
+ category: 'linear';
9620
+ symbol: string;
9621
+ autoAddMargin: 0 | 1;
9622
+ positionIdx?: PositionIdx;
9623
+ }
9624
+ ⋮----
9625
+ export interface AddOrReduceMarginParamsV5 {
9626
+ category: 'linear' | 'inverse';
9627
+ symbol: string;
9628
+ margin: string;
9629
+ positionIDex?: PositionIdx;
9630
+ }
9631
+ ⋮----
9632
+ export interface GetExecutionListParamsV5 {
9633
+ category: CategoryV5;
9634
+ symbol?: string;
9635
+ orderId?: string;
9636
+ orderLinkId?: string;
9637
+ baseCoin?: string;
9638
+ startTime?: number;
9639
+ endTime?: number;
9640
+ execType?: ExecTypeV5;
9641
+ limit?: number;
9642
+ cursor?: string;
9643
+ }
9644
+ ⋮----
9645
+ export interface GetClosedPnLParamsV5 {
9646
+ category: CategoryV5;
9647
+ symbol?: string;
9648
+ startTime?: number;
9649
+ endTime?: number;
9650
+ limit?: number;
9651
+ cursor?: string;
9652
+ }
9653
+ ⋮----
9654
+ export interface MovePositionParamsV5 {
9655
+ fromUid: string;
9656
+ toUid: string;
9657
+ list: {
9658
+ category: 'linear' | 'spot' | 'option' | 'inverse';
9659
+ symbol: string;
9660
+ price: string;
9661
+ side: 'Buy' | 'Sell';
9662
+ qty: string;
9663
+ }[];
9664
+ }
9665
+ ⋮----
9666
+ export interface GetMovePositionHistoryParamsV5 {
9667
+ category?: 'linear' | 'spot' | 'option';
9668
+ symbol?: string;
9669
+ startTime?: number;
9670
+ endTime?: number;
9671
+ status?: 'Processing' | 'Filled' | 'Rejected';
9672
+ blockTradeId?: string;
9673
+ limit?: string;
9674
+ cursor?: string;
9675
+ }
9676
+ ⋮----
9677
+ export interface ConfirmNewRiskLimitParamsV5 {
9678
+ category: 'linear' | 'inverse';
9679
+ symbol: string;
9680
+ }
9681
+ ⋮----
9682
+ export interface GetClosedOptionsPositionsParamsV5 {
9683
+ category: 'option';
9684
+ symbol?: string;
9685
+ startTime?: number;
9686
+ endTime?: number;
9687
+ limit?: number;
9688
+ cursor?: string;
9689
+ }
9690
+
9691
+ ================
9692
+ File: src/types/response/index.ts
9693
+ ================
9694
+
9695
+
9696
+ ================
9697
+ File: src/types/response/v5-account.ts
9698
+ ================
9699
+ import {
9700
+ AccountMarginModeV5,
9701
+ AccountTypeV5,
9702
+ CategoryV5,
9703
+ TransactionTypeV5,
9704
+ UnifiedUpdateStatusV5,
9705
+ } from '../shared-v5';
9706
+ ⋮----
9707
+ export interface WalletBalanceV5Coin {
9708
+ coin: string;
9709
+ equity: string;
9710
+ usdValue: string;
9711
+ walletBalance: string;
9712
+ free: string; // spot only
9713
+ locked: string; // spot only
9714
+ borrowAmount: string;
9715
+ availableToBorrow: string; // deprecated field
9716
+ availableToWithdraw: string;
9717
+ accruedInterest: string;
9718
+ totalOrderIM: string;
9719
+ totalPositionIM: string;
9720
+ totalPositionMM: string;
9721
+ unrealisedPnl: string;
9722
+ cumRealisedPnl: string;
9723
+ bonus: string;
9724
+ marginCollateral: boolean;
9725
+ collateralSwitch: boolean;
9726
+ spotBorrow: string;
9727
+ }
9728
+ ⋮----
9729
+ free: string; // spot only
9730
+ locked: string; // spot only
9731
+ ⋮----
9732
+ availableToBorrow: string; // deprecated field
9733
+ ⋮----
9734
+ export interface WalletBalanceV5 {
9735
+ accountType: AccountTypeV5;
9736
+ accountLTV: string;
9737
+ accountIMRate: string;
9738
+ accountMMRate: string;
9739
+ accountIMRateByMp: string;
9740
+ accountMMRateByMp: string;
9741
+ totalInitialMarginByMp: string;
9742
+ totalMaintenanceMarginByMp: string;
9743
+ totalEquity: string;
9744
+ totalWalletBalance: string;
9745
+ totalMarginBalance: string;
9746
+ totalAvailableBalance: string;
9747
+ totalPerpUPL: string;
9748
+ totalInitialMargin: string;
9749
+ totalMaintenanceMargin: string;
9750
+ coin: WalletBalanceV5Coin[];
9751
+ }
9752
+ ⋮----
9753
+ export interface UnifiedAccountUpgradeResultV5 {
9754
+ unifiedUpdateStatus: UnifiedUpdateStatusV5;
9755
+ unifiedUpdateMsg: {
9756
+ msg: string[] | null;
9757
+ };
9758
+ }
9759
+ ⋮----
9760
+ export interface BorrowHistoryRecordV5 {
9761
+ currency: string;
9762
+ createdTime: number;
9763
+ borrowCost: string;
9764
+ hourlyBorrowRate: string;
9765
+ InterestBearingBorrowSize: string;
9766
+ costExemption: string;
9767
+ borrowAmount: string;
9768
+ unrealisedLoss: string;
9769
+ freeBorrowedAmount: string;
9770
+ }
9771
+ ⋮----
9772
+ export interface CollateralInfoV5 {
9773
+ currency: string;
9774
+ hourlyBorrowRate: string;
9775
+ maxBorrowingAmount: string;
9776
+ freeBorrowAmount: string;
9777
+ freeBorrowingLimit: string;
9778
+ borrowAmount: string;
9779
+ availableToBorrow: string;
9780
+ borrowable: boolean;
9781
+ borrowUsageRate: string;
9782
+ marginCollateral: boolean;
9783
+ collateralSwitch: boolean;
9784
+ collateralRatio: string;
9785
+ }
9786
+ ⋮----
9787
+ export interface CoinGreeksV5 {
9788
+ baseCoin: string;
9789
+ totalDelta: string;
9790
+ totalGamma: string;
9791
+ totalVega: string;
9792
+ totalTheta: string;
9793
+ }
9794
+ ⋮----
9795
+ export interface FeeRateV5 {
9796
+ symbol: string;
9636
9797
  baseCoin: string;
9637
9798
  takerFeeRate: string;
9638
9799
  makerFeeRate: string;
@@ -10020,6 +10181,7 @@ export interface LinearInverseInstrumentInfoV5 {
10020
10181
  status: InstrumentStatusV5;
10021
10182
  baseCoin: string;
10022
10183
  quoteCoin: string;
10184
+ symbolType: string; // The region to which the trading pair belongs
10023
10185
  launchTime: string;
10024
10186
  deliveryTime?: string;
10025
10187
  deliveryFeeRate?: string;
@@ -10069,6 +10231,8 @@ export interface LinearInverseInstrumentInfoV5 {
10069
10231
  displayName: string;
10070
10232
  }
10071
10233
  ⋮----
10234
+ symbolType: string; // The region to which the trading pair belongs
10235
+ ⋮----
10072
10236
  export interface OptionInstrumentInfoV5 {
10073
10237
  symbol: string;
10074
10238
  optionsType: OptionTypeV5;
@@ -10076,6 +10240,7 @@ export interface OptionInstrumentInfoV5 {
10076
10240
  baseCoin: string;
10077
10241
  quoteCoin: string;
10078
10242
  settleCoin: string;
10243
+ symbolType: string; // The region to which the trading pair belongs
10079
10244
  launchTime: string;
10080
10245
  deliveryTime: string;
10081
10246
  deliveryFeeRate: string;
@@ -10092,11 +10257,14 @@ export interface OptionInstrumentInfoV5 {
10092
10257
  displayName: string;
10093
10258
  }
10094
10259
  ⋮----
10260
+ symbolType: string; // The region to which the trading pair belongs
10261
+ ⋮----
10095
10262
  export interface SpotInstrumentInfoV5 {
10096
10263
  symbol: string;
10097
10264
  baseCoin: string;
10098
10265
  quoteCoin: string;
10099
- innovation: '0' | '1';
10266
+ symbolType: string; // The region to which the trading pair belongs
10267
+ innovation: '0' | '1'; // Deprecated, always 0
10100
10268
  status: InstrumentStatusV5;
10101
10269
  marginTrading: MarginTradingV5;
10102
10270
  stTag: '0' | '1';
@@ -10117,6 +10285,9 @@ export interface SpotInstrumentInfoV5 {
10117
10285
  };
10118
10286
  }
10119
10287
  ⋮----
10288
+ symbolType: string; // The region to which the trading pair belongs
10289
+ innovation: '0' | '1'; // Deprecated, always 0
10290
+ ⋮----
10120
10291
  type InstrumentInfoV5Mapping = {
10121
10292
  linear: LinearInverseInstrumentInfoV5[];
10122
10293
  inverse: LinearInverseInstrumentInfoV5[];
@@ -10142,6 +10313,29 @@ export interface OrderbookResponseV5 {
10142
10313
  cts: number;
10143
10314
  }
10144
10315
  ⋮----
10316
+ /**
10317
+ * RPI Orderbook level: [price, nonRpiSize, rpiSize]
10318
+ */
10319
+ export type RPIOrderbookLevelV5 = [string, string, string];
10320
+ ⋮----
10321
+ export interface RPIOrderbookResponseV5 {
10322
+ s: string; // Symbol name
10323
+ b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order
10324
+ a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order
10325
+ ts: number; // The timestamp (ms) that the system generates the data
10326
+ u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream
10327
+ seq: number; // Cross sequence
10328
+ cts: number; // The timestamp from the matching engine when this orderbook data is produced
10329
+ }
10330
+ ⋮----
10331
+ s: string; // Symbol name
10332
+ b: RPIOrderbookLevelV5[]; // Bids. Sorted by price in descending order
10333
+ a: RPIOrderbookLevelV5[]; // Asks. Sorted by price in ascending order
10334
+ ts: number; // The timestamp (ms) that the system generates the data
10335
+ u: number; // Update ID, is always in sequence corresponds to u in the 50-level WebSocket RPI orderbook stream
10336
+ seq: number; // Cross sequence
10337
+ cts: number; // The timestamp from the matching engine when this orderbook data is produced
10338
+ ⋮----
10145
10339
  export interface TickerLinearInverseV5 {
10146
10340
  symbol: string;
10147
10341
  lastPrice: string;
@@ -10315,6 +10509,104 @@ export interface OrderPriceLimitV5 {
10315
10509
  sellLmt: string;
10316
10510
  ts: string;
10317
10511
  }
10512
+ ⋮----
10513
+ export interface IndexPriceComponentV5 {
10514
+ exchange: string; // Name of the exchange
10515
+ spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT)
10516
+ equivalentPrice: string; // Equivalent price
10517
+ multiplier: string; // Multiplier used for the component price
10518
+ price: string; // Actual price
10519
+ weight: string; // Weight in the index calculation
10520
+ }
10521
+ ⋮----
10522
+ exchange: string; // Name of the exchange
10523
+ spotPair: string; // Spot trading pair on the exchange (e.g., BTCUSDT)
10524
+ equivalentPrice: string; // Equivalent price
10525
+ multiplier: string; // Multiplier used for the component price
10526
+ price: string; // Actual price
10527
+ weight: string; // Weight in the index calculation
10528
+ ⋮----
10529
+ export interface IndexPriceComponentsResponseV5 {
10530
+ indexName: string; // Name of the index (e.g., BTCUSDT)
10531
+ lastPrice: string; // Last price of the index
10532
+ updateTime: string; // Timestamp of the last update in milliseconds
10533
+ components: IndexPriceComponentV5[]; // List of components contributing to the index price
10534
+ }
10535
+ ⋮----
10536
+ indexName: string; // Name of the index (e.g., BTCUSDT)
10537
+ lastPrice: string; // Last price of the index
10538
+ updateTime: string; // Timestamp of the last update in milliseconds
10539
+ components: IndexPriceComponentV5[]; // List of components contributing to the index price
10540
+ ⋮----
10541
+ export interface ADLAlertItemV5 {
10542
+ coin: string; // Token of the insurance pool
10543
+ symbol: string; // Trading pair name
10544
+ balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered
10545
+ maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours
10546
+ insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL
10547
+ pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped
10548
+ adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL
10549
+ adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL
10550
+ }
10551
+ ⋮----
10552
+ coin: string; // Token of the insurance pool
10553
+ symbol: string; // Trading pair name
10554
+ balance: string; // Balance of the insurance fund. Used to determine if ADL is triggered
10555
+ maxBalance: string; // Maximum balance of the insurance pool in the last 8 hours
10556
+ insurancePnlRatio: string; // PnL ratio threshold for triggering contract PnL drawdown ADL
10557
+ pnlRatio: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped
10558
+ adlTriggerThreshold: string; // Trigger threshold for contract PnL drawdown ADL
10559
+ adlStopRatio: string; // Stop ratio threshold for contract PnL drawdown ADL
10560
+ ⋮----
10561
+ export interface ADLAlertResponseV5 {
10562
+ updateTime: string; // Latest data update timestamp (ms)
10563
+ list: ADLAlertItemV5[]; // List of ADL alert items
10564
+ }
10565
+ ⋮----
10566
+ updateTime: string; // Latest data update timestamp (ms)
10567
+ list: ADLAlertItemV5[]; // List of ADL alert items
10568
+ ⋮----
10569
+ export interface FeeGroupLevelV5 {
10570
+ level: string; // Pro level name or Market Maker level name
10571
+ takerFeeRate: string; // Taker fee rate
10572
+ makerFeeRate: string; // Maker fee rate
10573
+ makerRebate: string; // Maker rebate fee rate
10574
+ }
10575
+ ⋮----
10576
+ level: string; // Pro level name or Market Maker level name
10577
+ takerFeeRate: string; // Taker fee rate
10578
+ makerFeeRate: string; // Maker fee rate
10579
+ makerRebate: string; // Maker rebate fee rate
10580
+ ⋮----
10581
+ export interface FeeGroupRatesV5 {
10582
+ pro: FeeGroupLevelV5[]; // Pro-level fee structures
10583
+ marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures
10584
+ }
10585
+ ⋮----
10586
+ pro: FeeGroupLevelV5[]; // Pro-level fee structures
10587
+ marketMaker: FeeGroupLevelV5[]; // Market Maker-level fee structures
10588
+ ⋮----
10589
+ export interface FeeGroupItemV5 {
10590
+ groupName: string; // Fee group name
10591
+ weightingFactor: number; // Group weighting factor
10592
+ symbolsNumbers: number; // Symbols number
10593
+ symbols: string[]; // Symbol names
10594
+ feeRates: FeeGroupRatesV5; // Fee rate details for different categories
10595
+ updateTime: string; // Latest data update timestamp (ms)
10596
+ }
10597
+ ⋮----
10598
+ groupName: string; // Fee group name
10599
+ weightingFactor: number; // Group weighting factor
10600
+ symbolsNumbers: number; // Symbols number
10601
+ symbols: string[]; // Symbol names
10602
+ feeRates: FeeGroupRatesV5; // Fee rate details for different categories
10603
+ updateTime: string; // Latest data update timestamp (ms)
10604
+ ⋮----
10605
+ export interface FeeGroupStructureResponseV5 {
10606
+ list: FeeGroupItemV5[]; // List of fee group objects
10607
+ }
10608
+ ⋮----
10609
+ list: FeeGroupItemV5[]; // List of fee group objects
10318
10610
 
10319
10611
  ================
10320
10612
  File: src/types/response/v5-rfq.ts
@@ -10770,8 +11062,11 @@ export interface SpreadOrderHistoryV5 {
10770
11062
  leg2Symbol: string;
10771
11063
  leg2Side: string;
10772
11064
  cxlRejReason: string;
11065
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee
10773
11066
  }
10774
11067
  ⋮----
11068
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee
11069
+ ⋮----
10775
11070
  export interface SpreadTradeLegV5 {
10776
11071
  symbol: string;
10777
11072
  side: 'Buy' | 'Sell';
@@ -10782,9 +11077,12 @@ export interface SpreadTradeLegV5 {
10782
11077
  category: 'linear' | 'spot';
10783
11078
  execQty: string;
10784
11079
  execFee: string;
11080
+ feeCurrency: string; // Trading fee currency
10785
11081
  execId: string;
10786
11082
  }
10787
11083
  ⋮----
11084
+ feeCurrency: string; // Trading fee currency
11085
+ ⋮----
10788
11086
  export interface SpreadTradeV5 {
10789
11087
  symbol: string;
10790
11088
  orderLinkId: string;
@@ -10873,8 +11171,11 @@ export interface AccountOrderV5 {
10873
11171
  createdTime: string;
10874
11172
  updatedTime: string;
10875
11173
  extraFees: string;
11174
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee
10876
11175
  }
10877
11176
  ⋮----
11177
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee
11178
+ ⋮----
10878
11179
  export interface BatchCreateOrderResultV5 {
10879
11180
  category: CategoryV5;
10880
11181
  symbol: string;
@@ -11336,6 +11637,7 @@ export interface ExecutionV5 {
11336
11637
  stopOrderType?: StopOrderTypeV5;
11337
11638
  execFee: string;
11338
11639
  execFeeV2: string;
11640
+ feeCurrency: string; // Trading fee currency
11339
11641
  execId: string;
11340
11642
  execPrice: string;
11341
11643
  execQty: string;
@@ -11355,6 +11657,8 @@ export interface ExecutionV5 {
11355
11657
  extraFees: string;
11356
11658
  }
11357
11659
  ⋮----
11660
+ feeCurrency: string; // Trading fee currency
11661
+ ⋮----
11358
11662
  export interface ClosedPnLV5 {
11359
11663
  symbol: string;
11360
11664
  orderId: string;
@@ -11792,231 +12096,19 @@ logger, // Optional: inject a custom logger
11792
12096
  // await wsClient.getWSClient().connectWSAPI();
11793
12097
 
11794
12098
  ================
11795
- File: src/types/request/v5-crypto-loan.ts
12099
+ File: src/types/response/v5-crypto-loan.ts
11796
12100
  ================
11797
- export interface BorrowCryptoLoanParamsV5 {
11798
- loanCurrency: string;
11799
- loanAmount?: string;
11800
- loanTerm?: string;
11801
- collateralCurrency: string;
11802
- collateralAmount?: string;
12101
+ export interface CollateralCoinV5 {
12102
+ collateralAccuracy: number;
12103
+ initialLTV: string;
12104
+ liquidationLTV: string;
12105
+ marginCallLTV: string;
12106
+ maxLimit: string;
11803
12107
  }
11804
12108
  ⋮----
11805
- export interface GetUnpaidLoanOrdersParamsV5 {
11806
- orderId?: string;
11807
- loanCurrency?: string;
11808
- collateralCurrency?: string;
11809
- loanTermType?: string;
11810
- loanTerm?: string;
11811
- limit?: string;
11812
- cursor?: string;
11813
- }
11814
- ⋮----
11815
- export interface GetRepaymentHistoryParamsV5 {
11816
- orderId?: string;
11817
- repayId?: string;
11818
- loanCurrency?: string;
11819
- limit?: string;
11820
- cursor?: string;
11821
- }
11822
- ⋮----
11823
- export interface GetCompletedLoanOrderHistoryParamsV5 {
11824
- orderId?: string;
11825
- loanCurrency?: string;
11826
- collateralCurrency?: string;
11827
- limit?: string;
11828
- cursor?: string;
11829
- }
11830
- ⋮----
11831
- export interface GetLoanLTVAdjustmentHistoryParamsV5 {
11832
- orderId?: string;
11833
- adjustId?: string;
11834
- collateralCurrency?: string;
11835
- limit?: string;
11836
- cursor?: string;
11837
- }
11838
- ⋮----
11839
- // New Crypto Loan Request Types
11840
- ⋮----
11841
- export interface GetBorrowableCoinsParamsV5 {
11842
- vipLevel?: string;
11843
- currency?: string;
11844
- }
11845
- ⋮----
11846
- export interface GetCollateralCoinsParamsV5 {
11847
- currency?: string;
11848
- }
11849
- ⋮----
11850
- export interface GetMaxCollateralAmountParamsV5 {
11851
- currency: string;
11852
- }
11853
- ⋮----
11854
- export interface AdjustCollateralAmountParamsV5 {
11855
- currency: string;
11856
- amount: string;
11857
- direction: '0' | '1';
11858
- }
11859
- ⋮----
11860
- export interface GetCollateralAdjustmentHistoryParamsV5 {
11861
- adjustId?: string;
11862
- collateralCurrency?: string;
11863
- limit?: string;
11864
- cursor?: string;
11865
- }
11866
- ⋮----
11867
- // Flexible Loan Request Types
11868
- ⋮----
11869
- export interface BorrowFlexibleParamsV5 {
11870
- loanCurrency: string;
11871
- loanAmount: string;
11872
- collateralList?: {
11873
- currency: string;
11874
- amount: string;
11875
- }[];
11876
- }
11877
- ⋮----
11878
- export interface RepayFlexibleParamsV5 {
11879
- loanCurrency: string;
11880
- amount: string;
11881
- }
11882
- ⋮----
11883
- export interface RepayCollateralFlexibleParamsV5 {
11884
- loanCurrency: string;
11885
- collateralCoin: string;
11886
- amount: string;
11887
- }
11888
- ⋮----
11889
- export interface GetOngoingFlexibleLoansParamsV5 {
11890
- loanCurrency?: string;
11891
- }
11892
- ⋮----
11893
- export interface GetBorrowHistoryFlexibleParamsV5 {
11894
- orderId?: string;
11895
- loanCurrency?: string;
11896
- limit?: string;
11897
- cursor?: string;
11898
- }
11899
- ⋮----
11900
- export interface GetRepaymentHistoryFlexibleParamsV5 {
11901
- repayId?: string;
11902
- loanCurrency?: string;
11903
- limit?: string;
11904
- cursor?: string;
11905
- }
11906
- ⋮----
11907
- // Fixed Loan Request Types
11908
- ⋮----
11909
- export interface GetSupplyOrderQuoteFixedParamsV5 {
11910
- orderCurrency: string;
11911
- term?: string;
11912
- orderBy: 'apy' | 'term' | 'quantity';
11913
- sort?: number;
11914
- limit?: number;
11915
- }
11916
- ⋮----
11917
- export interface GetBorrowOrderQuoteFixedParamsV5 {
11918
- orderCurrency: string;
11919
- term?: string;
11920
- orderBy: 'apy' | 'term' | 'quantity';
11921
- sort?: number;
11922
- limit?: number;
11923
- }
11924
- ⋮----
11925
- export interface CreateBorrowOrderFixedParamsV5 {
11926
- orderCurrency: string;
11927
- orderAmount: string;
11928
- annualRate: string;
11929
- term: string;
11930
- autoRepay?: string;
11931
- collateralList?: {
11932
- currency: string;
11933
- amount: string;
11934
- }[];
11935
- }
11936
- ⋮----
11937
- export interface CreateSupplyOrderFixedParamsV5 {
11938
- orderCurrency: string;
11939
- orderAmount: string;
11940
- annualRate: string;
11941
- term: string;
11942
- }
11943
- ⋮----
11944
- export interface CancelBorrowOrderFixedParamsV5 {
11945
- orderId: string;
11946
- }
11947
- ⋮----
11948
- export interface CancelSupplyOrderFixedParamsV5 {
11949
- orderId: string;
11950
- }
11951
- ⋮----
11952
- export interface GetBorrowContractInfoFixedParamsV5 {
11953
- orderId?: string;
11954
- loanId?: string;
11955
- orderCurrency?: string;
11956
- term?: string;
11957
- limit?: string;
11958
- cursor?: string;
11959
- }
11960
- ⋮----
11961
- export interface GetSupplyContractInfoFixedParamsV5 {
11962
- orderId?: string;
11963
- supplyId?: string;
11964
- supplyCurrency?: string;
11965
- term?: string;
11966
- limit?: string;
11967
- cursor?: string;
11968
- }
11969
- ⋮----
11970
- export interface GetBorrowOrderInfoFixedParamsV5 {
11971
- orderId?: string;
11972
- orderCurrency?: string;
11973
- state?: string;
11974
- term?: string;
11975
- limit?: string;
11976
- cursor?: string;
11977
- }
11978
- ⋮----
11979
- export interface GetSupplyOrderInfoFixedParamsV5 {
11980
- orderId?: string;
11981
- orderCurrency?: string;
11982
- state?: string;
11983
- term?: string;
11984
- limit?: string;
11985
- cursor?: string;
11986
- }
11987
- ⋮----
11988
- export interface RepayFixedParamsV5 {
11989
- loanId?: string;
11990
- loanCurrency?: string;
11991
- }
11992
- ⋮----
11993
- export interface RepayCollateralFixedParamsV5 {
11994
- loanCurrency: string;
11995
- collateralCoin: string;
11996
- amount: string;
11997
- }
11998
- ⋮----
11999
- export interface GetRepaymentHistoryFixedParamsV5 {
12000
- repayId?: string;
12001
- loanCurrency?: string;
12002
- limit?: string;
12003
- cursor?: string;
12004
- }
12005
-
12006
- ================
12007
- File: src/types/response/v5-crypto-loan.ts
12008
- ================
12009
- export interface CollateralCoinV5 {
12010
- collateralAccuracy: number;
12011
- initialLTV: string;
12012
- liquidationLTV: string;
12013
- marginCallLTV: string;
12014
- maxLimit: string;
12015
- }
12016
- ⋮----
12017
- export interface VipCollateralCoinsV5 {
12018
- list: CollateralCoinV5[];
12019
- vipLevel: string;
12109
+ export interface VipCollateralCoinsV5 {
12110
+ list: CollateralCoinV5[];
12111
+ vipLevel: string;
12020
12112
  }
12021
12113
  ⋮----
12022
12114
  export interface BorrowableCoinV5 {
@@ -12166,153 +12258,377 @@ export interface BorrowListV5 {
12166
12258
  loanCurrency: string;
12167
12259
  }
12168
12260
  ⋮----
12169
- export interface CollateralListV5 {
12170
- amount: string;
12171
- amountUSD: string;
12261
+ export interface CollateralListV5 {
12262
+ amount: string;
12263
+ amountUSD: string;
12264
+ currency: string;
12265
+ ltv: string;
12266
+ }
12267
+ ⋮----
12268
+ export interface SupplyListV5 {
12269
+ amount: string;
12270
+ amountUSD: string;
12271
+ currency: string;
12272
+ }
12273
+ ⋮----
12274
+ export interface CryptoLoanPositionV5 {
12275
+ borrowList: BorrowListV5[];
12276
+ collateralList: CollateralListV5[];
12277
+ supplyList: SupplyListV5[];
12278
+ totalCollateral: string;
12279
+ totalDebt: string;
12280
+ totalSupply: string;
12281
+ }
12282
+ ⋮----
12283
+ // Flexible Loan Types
12284
+ ⋮----
12285
+ export interface BorrowFlexibleV5 {
12286
+ orderId: string;
12287
+ }
12288
+ ⋮----
12289
+ export interface RepayFlexibleV5 {
12290
+ repayId: string;
12291
+ }
12292
+ ⋮----
12293
+ export interface OngoingFlexibleLoanV5 {
12294
+ hourlyInterestRate: string;
12295
+ loanCurrency: string;
12296
+ totalDebt: string;
12297
+ }
12298
+ ⋮----
12299
+ export interface BorrowHistoryFlexibleV5 {
12300
+ borrowTime: number;
12301
+ initialLoanAmount: string;
12302
+ loanCurrency: string;
12303
+ orderId: string;
12304
+ status: number;
12305
+ }
12306
+ ⋮----
12307
+ export interface RepaymentHistoryFlexibleV5 {
12308
+ loanCurrency: string;
12309
+ repayAmount: string;
12310
+ repayId: string;
12311
+ repayStatus: number;
12312
+ repayTime: number;
12313
+ repayType: number;
12314
+ }
12315
+ ⋮----
12316
+ // Fixed Loan Types
12317
+ ⋮----
12318
+ export interface SupplyOrderQuoteFixedV5 {
12319
+ orderCurrency: string;
12320
+ term: number;
12321
+ annualRate: string;
12322
+ qty: string;
12323
+ }
12324
+ ⋮----
12325
+ export interface BorrowOrderQuoteFixedV5 {
12326
+ orderCurrency: string;
12327
+ term: number;
12328
+ annualRate: string;
12329
+ qty: string;
12330
+ }
12331
+ ⋮----
12332
+ export interface CreateBorrowOrderFixedV5 {
12333
+ orderId: string;
12334
+ }
12335
+ ⋮----
12336
+ export interface CreateSupplyOrderFixedV5 {
12337
+ orderId: string;
12338
+ }
12339
+ ⋮----
12340
+ export interface BorrowContractInfoFixedV5 {
12341
+ annualRate: string;
12342
+ autoRepay: string; // Deprecated
12343
+ borrowCurrency: string;
12344
+ borrowTime: string;
12345
+ interestPaid: string;
12346
+ loanId: string;
12347
+ orderId: string;
12348
+ repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment
12349
+ repaymentTime: string;
12350
+ residualPenaltyInterest: string;
12351
+ residualPrincipal: string;
12352
+ status: number;
12353
+ term: string;
12354
+ }
12355
+ ⋮----
12356
+ autoRepay: string; // Deprecated
12357
+ ⋮----
12358
+ repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment
12359
+ ⋮----
12360
+ export interface SupplyContractInfoFixedV5 {
12361
+ annualRate: string;
12362
+ supplyCurrency: string;
12363
+ supplyTime: string;
12364
+ supplyAmount: string;
12365
+ interestPaid: string;
12366
+ supplyId: string;
12367
+ orderId: string;
12368
+ redemptionTime: string;
12369
+ penaltyInterest: string;
12370
+ actualRedemptionTime: string;
12371
+ status: number;
12372
+ term: string;
12373
+ }
12374
+ ⋮----
12375
+ export interface BorrowOrderInfoFixedV5 {
12376
+ annualRate: string;
12377
+ orderId: number;
12378
+ orderTime: string;
12379
+ filledQty: string;
12380
+ orderQty: string;
12381
+ orderCurrency: string;
12382
+ state: number;
12383
+ term: number;
12384
+ repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment
12385
+ }
12386
+ ⋮----
12387
+ repayType: string; // 1: Auto Repayment; 2: Transfer to flexible loan; 0: No Automatic Repayment
12388
+ ⋮----
12389
+ export interface SupplyOrderInfoFixedV5 {
12390
+ annualRate: string;
12391
+ orderId: number;
12392
+ orderTime: string;
12393
+ filledQty: string;
12394
+ orderQty: string;
12395
+ orderCurrency: string;
12396
+ state: number;
12397
+ term: number;
12398
+ }
12399
+ ⋮----
12400
+ export interface RepayFixedV5 {
12401
+ repayId: string;
12402
+ }
12403
+ ⋮----
12404
+ export interface RepaymentHistoryFixedV5 {
12405
+ details: {
12406
+ loanCurrency: string;
12407
+ loanId: string;
12408
+ repayAmount: string;
12409
+ }[];
12410
+ loanCurrency: string;
12411
+ repayAmount: string;
12412
+ repayId: string;
12413
+ repayStatus: number;
12414
+ repayTime: number;
12415
+ repayType: number;
12416
+ }
12417
+
12418
+ ================
12419
+ File: src/types/request/v5-crypto-loan.ts
12420
+ ================
12421
+ export interface BorrowCryptoLoanParamsV5 {
12422
+ loanCurrency: string;
12423
+ loanAmount?: string;
12424
+ loanTerm?: string;
12425
+ collateralCurrency: string;
12426
+ collateralAmount?: string;
12427
+ }
12428
+ ⋮----
12429
+ export interface GetUnpaidLoanOrdersParamsV5 {
12430
+ orderId?: string;
12431
+ loanCurrency?: string;
12432
+ collateralCurrency?: string;
12433
+ loanTermType?: string;
12434
+ loanTerm?: string;
12435
+ limit?: string;
12436
+ cursor?: string;
12437
+ }
12438
+ ⋮----
12439
+ export interface GetRepaymentHistoryParamsV5 {
12440
+ orderId?: string;
12441
+ repayId?: string;
12442
+ loanCurrency?: string;
12443
+ limit?: string;
12444
+ cursor?: string;
12445
+ }
12446
+ ⋮----
12447
+ export interface GetCompletedLoanOrderHistoryParamsV5 {
12448
+ orderId?: string;
12449
+ loanCurrency?: string;
12450
+ collateralCurrency?: string;
12451
+ limit?: string;
12452
+ cursor?: string;
12453
+ }
12454
+ ⋮----
12455
+ export interface GetLoanLTVAdjustmentHistoryParamsV5 {
12456
+ orderId?: string;
12457
+ adjustId?: string;
12458
+ collateralCurrency?: string;
12459
+ limit?: string;
12460
+ cursor?: string;
12461
+ }
12462
+ ⋮----
12463
+ // New Crypto Loan Request Types
12464
+ ⋮----
12465
+ export interface GetBorrowableCoinsParamsV5 {
12466
+ vipLevel?: string;
12467
+ currency?: string;
12468
+ }
12469
+ ⋮----
12470
+ export interface GetCollateralCoinsParamsV5 {
12471
+ currency?: string;
12472
+ }
12473
+ ⋮----
12474
+ export interface GetMaxCollateralAmountParamsV5 {
12172
12475
  currency: string;
12173
- ltv: string;
12174
12476
  }
12175
12477
  ⋮----
12176
- export interface SupplyListV5 {
12177
- amount: string;
12178
- amountUSD: string;
12478
+ export interface AdjustCollateralAmountParamsV5 {
12179
12479
  currency: string;
12480
+ amount: string;
12481
+ direction: '0' | '1';
12180
12482
  }
12181
12483
  ⋮----
12182
- export interface CryptoLoanPositionV5 {
12183
- borrowList: BorrowListV5[];
12184
- collateralList: CollateralListV5[];
12185
- supplyList: SupplyListV5[];
12186
- totalCollateral: string;
12187
- totalDebt: string;
12188
- totalSupply: string;
12484
+ export interface GetCollateralAdjustmentHistoryParamsV5 {
12485
+ adjustId?: string;
12486
+ collateralCurrency?: string;
12487
+ limit?: string;
12488
+ cursor?: string;
12189
12489
  }
12190
12490
  ⋮----
12191
- // Flexible Loan Types
12491
+ // Flexible Loan Request Types
12192
12492
  ⋮----
12193
- export interface BorrowFlexibleV5 {
12194
- orderId: string;
12493
+ export interface BorrowFlexibleParamsV5 {
12494
+ loanCurrency: string;
12495
+ loanAmount: string;
12496
+ collateralList?: {
12497
+ currency: string;
12498
+ amount: string;
12499
+ }[];
12195
12500
  }
12196
12501
  ⋮----
12197
- export interface RepayFlexibleV5 {
12198
- repayId: string;
12502
+ export interface RepayFlexibleParamsV5 {
12503
+ loanCurrency: string;
12504
+ amount: string;
12199
12505
  }
12200
12506
  ⋮----
12201
- export interface OngoingFlexibleLoanV5 {
12202
- hourlyInterestRate: string;
12507
+ export interface RepayCollateralFlexibleParamsV5 {
12203
12508
  loanCurrency: string;
12204
- totalDebt: string;
12509
+ collateralCoin: string;
12510
+ amount: string;
12205
12511
  }
12206
12512
  ⋮----
12207
- export interface BorrowHistoryFlexibleV5 {
12208
- borrowTime: number;
12209
- initialLoanAmount: string;
12210
- loanCurrency: string;
12211
- orderId: string;
12212
- status: number;
12513
+ export interface GetOngoingFlexibleLoansParamsV5 {
12514
+ loanCurrency?: string;
12213
12515
  }
12214
12516
  ⋮----
12215
- export interface RepaymentHistoryFlexibleV5 {
12216
- loanCurrency: string;
12217
- repayAmount: string;
12218
- repayId: string;
12219
- repayStatus: number;
12220
- repayTime: number;
12221
- repayType: number;
12517
+ export interface GetBorrowHistoryFlexibleParamsV5 {
12518
+ orderId?: string;
12519
+ loanCurrency?: string;
12520
+ limit?: string;
12521
+ cursor?: string;
12222
12522
  }
12223
12523
  ⋮----
12224
- // Fixed Loan Types
12524
+ export interface GetRepaymentHistoryFlexibleParamsV5 {
12525
+ repayId?: string;
12526
+ loanCurrency?: string;
12527
+ limit?: string;
12528
+ cursor?: string;
12529
+ }
12225
12530
  ⋮----
12226
- export interface SupplyOrderQuoteFixedV5 {
12531
+ // Fixed Loan Request Types
12532
+ ⋮----
12533
+ export interface GetSupplyOrderQuoteFixedParamsV5 {
12227
12534
  orderCurrency: string;
12228
- term: number;
12535
+ term?: string;
12536
+ orderBy: 'apy' | 'term' | 'quantity';
12537
+ sort?: number;
12538
+ limit?: number;
12539
+ }
12540
+ ⋮----
12541
+ export interface GetBorrowOrderQuoteFixedParamsV5 {
12542
+ orderCurrency: string;
12543
+ term?: string;
12544
+ orderBy: 'apy' | 'term' | 'quantity';
12545
+ sort?: number;
12546
+ limit?: number;
12547
+ }
12548
+ ⋮----
12549
+ export interface CreateBorrowOrderFixedParamsV5 {
12550
+ orderCurrency: string;
12551
+ orderAmount: string;
12229
12552
  annualRate: string;
12230
- qty: string;
12553
+ term: string;
12554
+ autoRepay?: string; // Deprecated
12555
+ repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan
12556
+ collateralList?: {
12557
+ currency: string;
12558
+ amount: string;
12559
+ }[];
12231
12560
  }
12232
12561
  ⋮----
12233
- export interface BorrowOrderQuoteFixedV5 {
12562
+ autoRepay?: string; // Deprecated
12563
+ repayType?: string; // 1: Auto Repayment (default); 2: Transfer to flexible loan
12564
+ ⋮----
12565
+ export interface CreateSupplyOrderFixedParamsV5 {
12234
12566
  orderCurrency: string;
12235
- term: number;
12567
+ orderAmount: string;
12236
12568
  annualRate: string;
12237
- qty: string;
12569
+ term: string;
12238
12570
  }
12239
12571
  ⋮----
12240
- export interface CreateBorrowOrderFixedV5 {
12572
+ export interface CancelBorrowOrderFixedParamsV5 {
12241
12573
  orderId: string;
12242
12574
  }
12243
12575
  ⋮----
12244
- export interface CreateSupplyOrderFixedV5 {
12576
+ export interface CancelSupplyOrderFixedParamsV5 {
12245
12577
  orderId: string;
12246
12578
  }
12247
12579
  ⋮----
12248
- export interface BorrowContractInfoFixedV5 {
12249
- annualRate: string;
12250
- autoRepay: string;
12251
- borrowCurrency: string;
12252
- borrowTime: string;
12253
- interestPaid: string;
12254
- loanId: string;
12255
- orderId: string;
12256
- repaymentTime: string;
12257
- residualPenaltyInterest: string;
12258
- residualPrincipal: string;
12259
- status: number;
12260
- term: string;
12580
+ export interface GetBorrowContractInfoFixedParamsV5 {
12581
+ orderId?: string;
12582
+ loanId?: string;
12583
+ orderCurrency?: string;
12584
+ term?: string;
12585
+ limit?: string;
12586
+ cursor?: string;
12261
12587
  }
12262
12588
  ⋮----
12263
- export interface SupplyContractInfoFixedV5 {
12264
- annualRate: string;
12265
- supplyCurrency: string;
12266
- supplyTime: string;
12267
- supplyAmount: string;
12268
- interestPaid: string;
12269
- supplyId: string;
12270
- orderId: string;
12271
- redemptionTime: string;
12272
- penaltyInterest: string;
12273
- actualRedemptionTime: string;
12274
- status: number;
12275
- term: string;
12589
+ export interface GetSupplyContractInfoFixedParamsV5 {
12590
+ orderId?: string;
12591
+ supplyId?: string;
12592
+ supplyCurrency?: string;
12593
+ term?: string;
12594
+ limit?: string;
12595
+ cursor?: string;
12276
12596
  }
12277
12597
  ⋮----
12278
- export interface BorrowOrderInfoFixedV5 {
12279
- annualRate: string;
12280
- orderId: number;
12281
- orderTime: string;
12282
- filledQty: string;
12283
- orderQty: string;
12284
- orderCurrency: string;
12285
- state: number;
12286
- term: number;
12598
+ export interface GetBorrowOrderInfoFixedParamsV5 {
12599
+ orderId?: string;
12600
+ orderCurrency?: string;
12601
+ state?: string;
12602
+ term?: string;
12603
+ limit?: string;
12604
+ cursor?: string;
12287
12605
  }
12288
12606
  ⋮----
12289
- export interface SupplyOrderInfoFixedV5 {
12290
- annualRate: string;
12291
- orderId: number;
12292
- orderTime: string;
12293
- filledQty: string;
12294
- orderQty: string;
12295
- orderCurrency: string;
12296
- state: number;
12297
- term: number;
12607
+ export interface GetSupplyOrderInfoFixedParamsV5 {
12608
+ orderId?: string;
12609
+ orderCurrency?: string;
12610
+ state?: string;
12611
+ term?: string;
12612
+ limit?: string;
12613
+ cursor?: string;
12298
12614
  }
12299
12615
  ⋮----
12300
- export interface RepayFixedV5 {
12301
- repayId: string;
12616
+ export interface RepayFixedParamsV5 {
12617
+ loanId?: string;
12618
+ loanCurrency?: string;
12302
12619
  }
12303
12620
  ⋮----
12304
- export interface RepaymentHistoryFixedV5 {
12305
- details: {
12306
- loanCurrency: string;
12307
- loanId: string;
12308
- repayAmount: string;
12309
- }[];
12621
+ export interface RepayCollateralFixedParamsV5 {
12310
12622
  loanCurrency: string;
12311
- repayAmount: string;
12312
- repayId: string;
12313
- repayStatus: number;
12314
- repayTime: number;
12315
- repayType: number;
12623
+ collateralCoin: string;
12624
+ amount: string;
12625
+ }
12626
+ ⋮----
12627
+ export interface GetRepaymentHistoryFixedParamsV5 {
12628
+ repayId?: string;
12629
+ loanCurrency?: string;
12630
+ limit?: string;
12631
+ cursor?: string;
12316
12632
  }
12317
12633
 
12318
12634
  ================
@@ -13021,8 +13337,11 @@ export interface WSAccountOrderV5 {
13021
13337
  smpOrderId: string;
13022
13338
  createdTime: string;
13023
13339
  updatedTime: string;
13340
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee and feeCurrency
13024
13341
  }
13025
13342
  ⋮----
13343
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee and feeCurrency
13344
+ ⋮----
13026
13345
  export type WSAccountOrderEventV5 = WSPrivateTopicEventV5<
13027
13346
  'order',
13028
13347
  WSAccountOrderV5[]
@@ -13042,6 +13361,7 @@ export interface WSExecutionV5 {
13042
13361
  orderType: OrderTypeV5;
13043
13362
  stopOrderType: StopOrderTypeV5;
13044
13363
  execFee: string;
13364
+ feeCurrency: string; // Trading fee currency
13045
13365
  execId: string;
13046
13366
  execPrice: string;
13047
13367
  execQty: string;
@@ -13063,6 +13383,8 @@ export interface WSExecutionV5 {
13063
13383
  marketUnit: string;
13064
13384
  }
13065
13385
  ⋮----
13386
+ feeCurrency: string; // Trading fee currency
13387
+ ⋮----
13066
13388
  export type WSExecutionEventV5 = WSPrivateTopicEventV5<
13067
13389
  'execution',
13068
13390
  WSExecutionV5[]
@@ -13107,6 +13429,7 @@ export interface WSCoinV5 {
13107
13429
  bonus: string;
13108
13430
  collateralSwitch: boolean;
13109
13431
  marginCollateral: boolean;
13432
+ spotBorrow: string;
13110
13433
  }
13111
13434
  ⋮----
13112
13435
  export interface WSWalletV5 {
@@ -13166,8 +13489,11 @@ export interface WSSpreadOrderV5 {
13166
13489
  feeCurrency: string;
13167
13490
  createType: OrderCreateTypeV5;
13168
13491
  closedPnl: string;
13492
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee and feeCurrency
13169
13493
  }
13170
13494
  ⋮----
13495
+ cumFeeDetail?: Record<string, string>; // Cumulative trading fee details instead of cumExecFee and feeCurrency
13496
+ ⋮----
13171
13497
  export type WSSpreadOrderEventV5 = WSPrivateTopicEventV5<
13172
13498
  'spread.order',
13173
13499
  WSSpreadOrderV5[]
@@ -13187,7 +13513,7 @@ export interface WSSpreadExecutionV5 {
13187
13513
  orderType: OrderTypeV5;
13188
13514
  execFee: string;
13189
13515
  execFeeV2: string;
13190
- feeCurrency: string;
13516
+ feeCurrency: string; // Trading fee currency
13191
13517
  parentExecId: string;
13192
13518
  execId: string;
13193
13519
  execPrice: string;
@@ -13203,6 +13529,8 @@ export interface WSSpreadExecutionV5 {
13203
13529
  seq: number;
13204
13530
  }
13205
13531
  ⋮----
13532
+ feeCurrency: string; // Trading fee currency
13533
+ ⋮----
13206
13534
  export type WSSpreadExecutionEventV5 = WSPrivateTopicEventV5<
13207
13535
  'spread.execution',
13208
13536
  WSSpreadExecutionV5[]
@@ -13233,6 +13561,32 @@ export type WSPriceLimitEventV5 = WSPublicTopicEventV5<
13233
13561
  WSPriceLimitV5
13234
13562
  >;
13235
13563
  ⋮----
13564
+ export interface WSADLAlertV5 {
13565
+ c: string; // Token of the insurance pool
13566
+ s: string; // Trading pair name
13567
+ b: string; // Balance of the insurance fund. Used to determine if ADL is triggered
13568
+ mb: string; // Maximum balance of the insurance pool in the last 8 hours
13569
+ i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL
13570
+ pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped
13571
+ adl_tt: string; // Trigger threshold for contract PnL drawdown ADL
13572
+ adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL
13573
+ }
13574
+ ⋮----
13575
+ c: string; // Token of the insurance pool
13576
+ s: string; // Trading pair name
13577
+ b: string; // Balance of the insurance fund. Used to determine if ADL is triggered
13578
+ mb: string; // Maximum balance of the insurance pool in the last 8 hours
13579
+ i_pr: string; // PnL ratio threshold for triggering contract PnL drawdown ADL
13580
+ pr: string; // Symbol's PnL drawdown ratio in the last 8 hours. Used to determine whether ADL is triggered or stopped
13581
+ adl_tt: string; // Trigger threshold for contract PnL drawdown ADL
13582
+ adl_sr: string; // Stop ratio threshold for contract PnL drawdown ADL
13583
+ ⋮----
13584
+ export type WSADLAlertEventV5 = WSPublicTopicEventV5<
13585
+ 'adlAlert.USDT' | 'adlAlert.USDC' | 'adlAlert.inverse',
13586
+ 'snapshot',
13587
+ WSADLAlertV5[]
13588
+ >;
13589
+ ⋮----
13236
13590
  export type WSSystemStatusEventV5 = WSPublicTopicEventV5<
13237
13591
  'system.status',
13238
13592
  'snapshot',
@@ -13958,6 +14312,7 @@ import {
13958
14312
  AddOrReduceMarginResultV5,
13959
14313
  AdjustCollateralAmountParamsV5,
13960
14314
  AdjustCollateralAmountV5,
14315
+ ADLAlertResponseV5,
13961
14316
  AffiliateUserInfoV5,
13962
14317
  AffiliateUserListItemV5,
13963
14318
  AllCoinsBalanceV5,
@@ -14046,11 +14401,13 @@ import {
14046
14401
  ExecuteRFQQuoteParamsV5,
14047
14402
  ExecuteRFQQuoteResultV5,
14048
14403
  ExecutionV5,
14404
+ FeeGroupStructureResponseV5,
14049
14405
  FeeRateV5,
14050
14406
  FundingRateHistoryResponseV5,
14051
14407
  GetAccountCoinBalanceParamsV5,
14052
14408
  GetAccountHistoricOrdersParamsV5,
14053
14409
  GetAccountOrdersParamsV5,
14410
+ GetADLAlertParamsV5,
14054
14411
  GetAllCoinsBalanceParamsV5,
14055
14412
  GetAllowedDepositCoinInfoParamsV5,
14056
14413
  GetAssetInfoParamsV5,
@@ -14077,9 +14434,11 @@ import {
14077
14434
  GetEarnPositionParamsV5,
14078
14435
  GetExchangeBrokerEarningsParamsV5,
14079
14436
  GetExecutionListParamsV5,
14437
+ GetFeeGroupStructureParamsV5,
14080
14438
  GetFeeRateParamsV5,
14081
14439
  GetFundingRateHistoryParamsV5,
14082
14440
  GetHistoricalVolatilityParamsV5,
14441
+ GetIndexPriceComponentsParamsV5,
14083
14442
  GetIndexPriceKlineParamsV5,
14084
14443
  GetInstrumentsInfoParamsV5,
14085
14444
  GetInsuranceParamsV5,
@@ -14121,6 +14480,7 @@ import {
14121
14480
  GetRFQRealtimeResultV5,
14122
14481
  GetRFQTradeListParamsV5,
14123
14482
  GetRiskLimitParamsV5,
14483
+ GetRPIOrderbookParamsV5,
14124
14484
  GetSettlementRecordParamsV5,
14125
14485
  GetSpreadInstrumentsInfoParamsV5,
14126
14486
  GetSpreadOpenOrdersParamsV5,
@@ -14140,6 +14500,7 @@ import {
14140
14500
  GetWalletBalanceParamsV5,
14141
14501
  GetWithdrawalRecordsParamsV5,
14142
14502
  HistoricalVolatilityV5,
14503
+ IndexPriceComponentsResponseV5,
14143
14504
  InstrumentInfoResponseV5,
14144
14505
  InsuranceResponseV5,
14145
14506
  InternalDepositRecordV5,
@@ -14199,6 +14560,7 @@ import {
14199
14560
  RFQQuoteItemV5,
14200
14561
  RFQTradeV5,
14201
14562
  RiskLimitV5,
14563
+ RPIOrderbookResponseV5,
14202
14564
  SendP2POrderMessageParamsV5,
14203
14565
  SetAutoAddMarginParamsV5,
14204
14566
  SetCollateralCoinParamsV5,
@@ -14543,6 +14905,18 @@ getOrderbook(
14543
14905
  params: GetOrderbookParamsV5,
14544
14906
  ): Promise<APIResponseV3WithTime<OrderbookResponseV5>>
14545
14907
  ⋮----
14908
+ /**
14909
+ * Get RPI Orderbook
14910
+ * Query for orderbook depth data with RPI (Retail Price Improvement) information.
14911
+ *
14912
+ * Covers: Spot / USDT contract / USDC contract / Inverse contract
14913
+ * Contract: 50-level of RPI orderbook data
14914
+ * Spot: 50-level of RPI orderbook data
14915
+ */
14916
+ getRPIOrderbook(
14917
+ params: GetRPIOrderbookParamsV5,
14918
+ ): Promise<APIResponseV3WithTime<RPIOrderbookResponseV5>>
14919
+ ⋮----
14546
14920
  getTickers(
14547
14921
  ⋮----
14548
14922
  getTickers(
@@ -14686,11 +15060,41 @@ getLongShortRatio(
14686
15060
  params: GetLongShortRatioParamsV5,
14687
15061
  ): Promise<APIResponseV3WithTime<CursorListV5<LongShortRatioV5[]>>>
14688
15062
  ⋮----
15063
+ /**
15064
+ * Get Index Price Components
15065
+ * Query for index price components that contribute to the calculation of an index price.
15066
+ */
15067
+ getIndexPriceComponents(
15068
+ params: GetIndexPriceComponentsParamsV5,
15069
+ ): Promise<APIResponseV3WithTime<IndexPriceComponentsResponseV5>>
15070
+ ⋮----
14689
15071
  getOrderPriceLimit(params: {
14690
15072
  symbol: string;
14691
15073
  category: 'spot' | 'linear' | 'inverse';
14692
15074
  }): Promise<APIResponseV3WithTime<OrderPriceLimitV5>>
14693
15075
  ⋮----
15076
+ /**
15077
+ * Get ADL Alert
15078
+ * Query for ADL (auto-deleveraging mechanism) alerts and insurance pool information.
15079
+ *
15080
+ * Covers: USDT Perpetual / USDT Delivery / USDC Perpetual / USDC Delivery / Inverse Contracts
15081
+ * Data update frequency: every 1 minute
15082
+ */
15083
+ getADLAlert(
15084
+ params?: GetADLAlertParamsV5,
15085
+ ): Promise<APIResponseV3WithTime<ADLAlertResponseV5>>
15086
+ ⋮----
15087
+ /**
15088
+ * Get Fee Group Structure
15089
+ * Query for the group fee structure and fee rates.
15090
+ *
15091
+ * The new grouped fee structure only applies to Pro-level and Market Maker clients.
15092
+ * Covers: USDT Perpetual / USDT Delivery / USDC Perpetual / USDC Delivery / Inverse Contracts
15093
+ */
15094
+ getFeeGroupStructure(
15095
+ params: GetFeeGroupStructureParamsV5,
15096
+ ): Promise<APIResponseV3WithTime<FeeGroupStructureResponseV5>>
15097
+ ⋮----
14694
15098
  /**
14695
15099
  *
14696
15100
  ****** Trade APIs
@@ -17199,14 +17603,14 @@ setApiRateLimit(params: {
17199
17603
  list: {
17200
17604
  uids: string;
17201
17605
  bizType: string;
17202
- limit: number;
17606
+ rate: number;
17203
17607
  }[];
17204
17608
  }): Promise<
17205
17609
  APIResponseV3WithTime<{
17206
17610
  result: {
17207
17611
  uids: string;
17208
17612
  bizType: string;
17209
- limit: number;
17613
+ rate: number;
17210
17614
  success: boolean;
17211
17615
  msg: string;
17212
17616
  }[];
@@ -17228,18 +17632,59 @@ queryApiRateLimit(params: { uids: string }): Promise<
17228
17632
  list: {
17229
17633
  uids: string;
17230
17634
  bizType: string;
17231
- limit: number;
17635
+ rate: number;
17232
17636
  }[];
17233
17637
  }>
17234
17638
  > {
17235
17639
  return this.getPrivate('/v5/apilimit/query', params);
17640
+ ⋮----
17641
+ /**
17642
+ * Get Rate Limit Cap
17643
+ * Get your institution's total rate limit usage and cap, across the board.
17644
+ *
17645
+ * API rate limit: 50 req per second
17646
+ * Main UIDs or sub UIDs can query this endpoint, but a main UID can only see the rate limits of subs below it.
17647
+ */
17648
+ getRateLimitCap(): Promise<
17649
+ APIResponseV3WithTime<{
17650
+ list: {
17651
+ bizType: string;
17652
+ totalRate: number;
17653
+ insCap: number;
17654
+ uidCap: number;
17655
+ }[];
17656
+ }>
17657
+ > {
17658
+ return this.getPrivate('/v5/apilimit/query-cap');
17659
+ ⋮----
17660
+ /**
17661
+ * Get All Rate Limits
17662
+ * Query for all your UID-level rate limits, including all master accounts and subaccounts.
17663
+ *
17664
+ * API rate limit: 50 req per second
17665
+ */
17666
+ getAllRateLimits(params?: {
17667
+ limit?: string;
17668
+ cursor?: string;
17669
+ uids?: string;
17670
+ }): Promise<
17671
+ APIResponseV3WithTime<{
17672
+ list: {
17673
+ uids: string;
17674
+ bizType: string;
17675
+ rate: number;
17676
+ }[];
17677
+ nextPageCursor: string;
17678
+ }>
17679
+ > {
17680
+ return this.getPrivate('/v5/apilimit/query-all', params);
17236
17681
 
17237
17682
  ================
17238
17683
  File: package.json
17239
17684
  ================
17240
17685
  {
17241
17686
  "name": "bybit-api",
17242
- "version": "4.3.1",
17687
+ "version": "4.3.2",
17243
17688
  "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.",
17244
17689
  "main": "lib/index.js",
17245
17690
  "types": "lib/index.d.ts",