gateio-api 1.3.1 → 1.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ import { GetDeliveryAutoOrdersReq, GetDeliveryBookReq, GetDeliveryCandlesReq, Ge
7
7
  import { GetStructuredProductListReq, GetStructuredProductOrdersReq } from './types/request/earn.js';
8
8
  import { GetLendingInterestRecordsReq, GetLendingOrdersReq, GetLendingRecordsReq, SubmitLendOrRedeemReq } from './types/request/earnuni.js';
9
9
  import { GetFlashSwapOrdersReq, SubmitFlashSwapOrderPreviewReq, SubmitFlashSwapOrderReq } from './types/request/flashswap.js';
10
- import { BatchAmendOrderReq, DeleteAllFuturesOrdersReq, GetFundingRatesReq, GetFuturesAccountBookReq, GetFuturesAutoOrdersReq, GetFuturesCandlesReq, GetFuturesInsuranceReq, GetFuturesLiquidationHistoryReq, GetFuturesOrderBookReq, GetFuturesOrdersByTimeRangeReq, GetFuturesOrdersReq, GetFuturesPositionCloseHistoryReq, GetFuturesPositionHistoryReq, GetFuturesPositionsReq, GetFuturesStatsReq, GetFuturesTradesReq, GetFuturesTradingHistoryByTimeRangeReq, GetFuturesTradingHistoryReq, GetLiquidationHistoryReq, GetRiskLimitTableReq, GetRiskLimitTiersReq, SubmitFuturesOrderReq, SubmitFuturesTriggeredOrderReq, UpdateDualModePositionLeverageReq, UpdateDualModePositionMarginReq, UpdateFuturesOrderReq } from './types/request/futures.js';
10
+ import { BatchAmendOrderReq, DeleteAllFuturesOrdersReq, GetFundingRatesReq, GetFuturesAccountBookReq, GetFuturesAutoOrdersReq, GetFuturesCandlesReq, GetFuturesInsuranceReq, GetFuturesLiquidationHistoryReq, GetFuturesOrderBookReq, GetFuturesOrdersByTimeRangeReq, GetFuturesOrdersReq, GetFuturesPositionCloseHistoryReq, GetFuturesPositionHistoryReq, GetFuturesPositionsReq, GetFuturesStatsReq, GetFuturesTradesReq, GetFuturesTradingHistoryByTimeRangeReq, GetFuturesTradingHistoryReq, GetLiquidationHistoryReq, GetRiskLimitTableReq, GetRiskLimitTiersReq, SubmitFuturesOrderReq, SubmitFuturesTriggeredOrderReq, UpdateDualModePositionLeverageReq, UpdateDualModePositionMarginReq, UpdateFuturesOrderReq, UpdateFuturesPriceTriggeredOrderReq } from './types/request/futures.js';
11
11
  import { GetCrossMarginAccountHistoryReq, GetCrossMarginBorrowHistoryReq, GetCrossMarginInterestRecordsReq, GetCrossMarginRepaymentsReq, GetMarginBalanceHistoryReq, SubmitCrossMarginBorrowLoanReq } from './types/request/margin.js';
12
12
  import { GetMarginUNIInterestRecordsReq, GetMarginUNILoanRecordsReq, GetMarginUNILoansReq, GetMarginUNIMaxBorrowReq } from './types/request/marginuni.js';
13
13
  import { GetMultiLoanAdjustmentRecordsReq, GetMultiLoanOrdersReq, GetMultiLoanRepayRecordsReq, RepayMultiLoanReq, SubmitMultiLoanOrderReq, UpdateMultiLoanReq } from './types/request/multicollateralLoan.js';
@@ -18,7 +18,7 @@ import { CreateSubAccountApiKeyReq, CreateSubAccountReq, UpdateSubAccountApiKeyR
18
18
  import { GetUnifiedHistoryLendingRateReq, GetUnifiedInterestRecordsReq, GetUnifiedLoanRecordsReq, GetUnifiedLoansReq, PortfolioMarginCalculatorReq, SetUnifiedAccountModeReq, SubmitUnifiedBorrowOrRepayReq, SubmitUnifiedLoanRepayReq } from './types/request/unified.js';
19
19
  import { GetMainSubTransfersReq, GetSavedAddressReq, GetSmallBalanceHistoryReq, GetWithdrawalDepositRecordsReq, ListPushOrdersReq, SubmitMainSubTransferReq, SubmitSubToSubTransferReq, SubmitTransferReq } from './types/request/wallet.js';
20
20
  import { SubmitWithdrawalReq } from './types/request/withdrawal.js';
21
- import { AccountDetail, AccountRateLimit, StpGroup, StpGroupUser } from './types/response/account.js';
21
+ import { AccountDetail, AccountMainKey, AccountRateLimit, StpGroup, StpGroupUser } from './types/response/account.js';
22
22
  import { LoanCollateralRatio, LoanCollateralRecord, LoanOrder, LoanRepaymentHistoryRecord } from './types/response/collateralloan.js';
23
23
  import { DeliveryAccount, DeliveryBook, DeliveryCandle, DeliveryClosedPosition, DeliveryLiquidationHistoryRecord, DeliveryOrderBook, DeliverySettlementHistoryRecord, DeliveryTicker, DeliveryTrade, DeliveryTradingHistoryRecord } from './types/response/delivery.js';
24
24
  import { DualInvestmentOrder, DualInvestmentProduct, StructuredProduct, StructuredProductOrder } from './types/response/earn.js';
@@ -33,7 +33,7 @@ import { AgencyCommissionHistoryRecord, AgencyTransactionHistoryRecord, BrokerCo
33
33
  import { DeleteSpotBatchOrdersResp, GetSpotOpenOrdersResp, SpotAccount, SpotAccountBook, SpotCandle, SpotCurrency, SpotFeeRates, SpotHistoricTradeRecord, SpotInsuranceHistory, SpotOrder, SpotOrderBook, SpotPriceTriggeredOrder, SpotTicker, SpotTrade, SubmitSpotBatchOrdersResp } from './types/response/spot.js';
34
34
  import { CreatedSubAccountAPIKey, SubAccount, SubAccountAPIKey, SubAccountMode } from './types/response/subaccount.js';
35
35
  import { MarginTier, PortfolioMarginCalculation, UnifiedAccountInfo, UnifiedCurrencyDiscountTiers, UnifiedHistoryLendingRate, UnifiedInterestRecord, UnifiedLoan, UnifiedLoanCurrency, UnifiedLoanRecord, UnifiedRiskUnitDetails, UserCurrencyLeverageConfig } from './types/response/unified.js';
36
- import { CreateDepositAddressResp, CurrencyChain, GetBalancesResp, PushOrder, SavedAddress, SmallBalanceHistoryRecord, SmallBalanceRecord, SubAccountCrossMarginBalancesResp, SubAccountFuturesBalancesResp, SubAccountMarginBalance, SubAccountTransferRecord, TradingFees, WithdrawalStatus } from './types/response/wallet.js';
36
+ import { CreateDepositAddressResp, CurrencyChain, DepositRecord, GetBalancesResp, PushOrder, SavedAddress, SmallBalanceHistoryRecord, SmallBalanceRecord, SubAccountCrossMarginBalancesResp, SubAccountFuturesBalancesResp, SubAccountMarginBalance, SubAccountTransferRecord, TradingFees, WithdrawalStatus } from './types/response/wallet.js';
37
37
  import { WithdrawalRecord } from './types/response/withdrawal.js';
38
38
  import { CurrencyPair, FromToPageLimit } from './types/shared.js';
39
39
  /**
@@ -95,7 +95,7 @@ export declare class RestClient extends BaseRestClient {
95
95
  * Cancel withdrawal with specified ID
96
96
  *
97
97
  * @param params Parameters containing the withdrawal ID
98
- * @returns Promise<Withdraw>
98
+ * @returns Promise<WithdrawalRecord>
99
99
  */
100
100
  cancelWithdrawal(params: {
101
101
  withdrawal_id: string;
@@ -108,7 +108,7 @@ export declare class RestClient extends BaseRestClient {
108
108
  * List chains supported for specified currency
109
109
  *
110
110
  * @param params Parameters containing the currency name
111
- * @returns Promise< GetCurrencyChainsResp[][]>
111
+ * @returns Promise<CurrencyChain[]>
112
112
  */
113
113
  getCurrencyChains(params: {
114
114
  currency: string;
@@ -137,9 +137,9 @@ export declare class RestClient extends BaseRestClient {
137
137
  * Record time range cannot exceed 30 days
138
138
  *
139
139
  * @param params Parameters for filtering deposit records
140
- * @returns Promise<Withdraw[]>
140
+ * @returns Promise<DepositRecord[]>
141
141
  */
142
- getDepositRecords(params?: GetWithdrawalDepositRecordsReq): Promise<WithdrawalRecord[]>;
142
+ getDepositRecords(params?: GetWithdrawalDepositRecordsReq): Promise<DepositRecord[]>;
143
143
  /**
144
144
  * Transfer between trading accounts
145
145
  *
@@ -205,7 +205,7 @@ export declare class RestClient extends BaseRestClient {
205
205
  * Retrieve withdrawal status
206
206
  *
207
207
  * @param params Parameters for retrieving withdrawal status
208
- * @returns Promise<GetWithdrawalStatusResp[]>
208
+ * @returns Promise<WithdrawalStatus[]>
209
209
  */
210
210
  getWithdrawalStatus(params?: {
211
211
  currency?: string;
@@ -322,6 +322,12 @@ export declare class RestClient extends BaseRestClient {
322
322
  * @returns Promise<PushOrder[]>
323
323
  */
324
324
  getPushOrders(params?: ListPushOrdersReq): Promise<PushOrder[]>;
325
+ /**
326
+ * Retrieve the list of low-liquidity or low-cap tokens
327
+ *
328
+ * @returns Promise<string[]>
329
+ */
330
+ getLowCapExchangeList(): Promise<string[]>;
325
331
  /**==========================================================================================================================
326
332
  * SUBACCOUNT
327
333
  * ==========================================================================================================================
@@ -370,6 +376,8 @@ export declare class RestClient extends BaseRestClient {
370
376
  /**
371
377
  * Update API key of the sub-account
372
378
  *
379
+ * Note: This interface cannot modify the mode account type attribute
380
+ *
373
381
  * @param params Parameters for updating API key of the sub-account
374
382
  * @returns Promise<any>
375
383
  */
@@ -432,8 +440,10 @@ export declare class RestClient extends BaseRestClient {
432
440
  *
433
441
  * The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account.
434
442
  *
443
+ * For specific formulas, please refer to Margin Formula
444
+ *
435
445
  * @param params Parameters for retrieving unified account information
436
- * @returns Promise<GetUnifiedAccountInfoResp>
446
+ * @returns Promise<UnifiedAccountInfo>
437
447
  */
438
448
  getUnifiedAccountInfo(params?: {
439
449
  currency?: string;
@@ -877,9 +887,16 @@ export declare class RestClient extends BaseRestClient {
877
887
  /**
878
888
  * List personal trading history
879
889
  *
880
- * Spot, portfolio and margin trades are queried by default. If cross margin trades are needed, account must be set to cross_margin.
890
+ * By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts.
891
+ *
892
+ * The history within a specified time range can be queried by specifying from or (and) to.
881
893
  *
882
- * You can also set from and/or to to query by time range. If you don't specify from and/or to parameters, only the last 7 days of data will be returned. The range of from and to is not allowed to exceed 30 days. Time range parameters are handled as order finish time.
894
+ * If no time parameters are specified, only data for the last 7 days can be obtained.
895
+ * If only any parameter of from or to is specified, only 7-day data from the start (or end) of the specified time is returned.
896
+ * The range not allowed to exceed 30 days.
897
+ * The parameters of the time range filter are processed according to the order end time.
898
+ *
899
+ * The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
883
900
  *
884
901
  * @param params Parameters for listing personal trading history
885
902
  * @returns Promise<GetSpotTradingHistoryResp[]>
@@ -1527,6 +1544,8 @@ export declare class RestClient extends BaseRestClient {
1527
1544
  /**
1528
1545
  * Query futures account
1529
1546
  *
1547
+ * Query account information for classic future account and unified account
1548
+ *
1530
1549
  * @param params Parameters for querying futures account
1531
1550
  * @returns Promise<GetFuturesAccountResp>
1532
1551
  */
@@ -1552,6 +1571,8 @@ export declare class RestClient extends BaseRestClient {
1552
1571
  /**
1553
1572
  * Get single position
1554
1573
  *
1574
+ * Clarifies dual-position query method when holding both long and short positions in the same contract market
1575
+ *
1555
1576
  * @param params Parameters for retrieving a single position
1556
1577
  * @returns Promise<Position>
1557
1578
  */
@@ -1562,6 +1583,8 @@ export declare class RestClient extends BaseRestClient {
1562
1583
  /**
1563
1584
  * Update position margin
1564
1585
  *
1586
+ * Under the new risk limit rules, the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit.
1587
+ *
1565
1588
  * @param params Parameters for updating position margin
1566
1589
  * @returns Promise<Position>
1567
1590
  */
@@ -1573,6 +1596,17 @@ export declare class RestClient extends BaseRestClient {
1573
1596
  /**
1574
1597
  * Update position leverage
1575
1598
  *
1599
+ * Position Mode Switching Rules:
1600
+ * - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored)
1601
+ * - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple)
1602
+ *
1603
+ * Examples:
1604
+ * - Set isolated margin with 10x leverage: leverage=10
1605
+ * - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10
1606
+ * - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored)
1607
+ *
1608
+ * Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management.
1609
+ *
1576
1610
  * @param params Parameters for updating position leverage
1577
1611
  * @returns Promise<Position>
1578
1612
  */
@@ -1581,6 +1615,7 @@ export declare class RestClient extends BaseRestClient {
1581
1615
  contract: string;
1582
1616
  leverage: string;
1583
1617
  cross_leverage_limit?: string;
1618
+ pid?: number;
1584
1619
  }): Promise<FuturesPosition>;
1585
1620
  /**
1586
1621
  * Update position by store mode
@@ -1646,6 +1681,14 @@ export declare class RestClient extends BaseRestClient {
1646
1681
  * @param params Parameters for updating position risk limit in dual mode
1647
1682
  * @returns Promise<Position[]>
1648
1683
  */
1684
+ /**
1685
+ * Update position risk limit in dual mode
1686
+ *
1687
+ * See risk limit rules for more information
1688
+ *
1689
+ * @param params Parameters for updating position risk limit in dual mode
1690
+ * @returns Promise<FuturesPosition[]>
1691
+ */
1649
1692
  updateDualModePositionRiskLimit(params: {
1650
1693
  settle: 'btc' | 'usdt' | 'usd';
1651
1694
  contract: string;
@@ -1901,6 +1944,15 @@ export declare class RestClient extends BaseRestClient {
1901
1944
  settle: 'btc' | 'usdt' | 'usd';
1902
1945
  order_id: string;
1903
1946
  }): Promise<FuturesPriceTriggeredOrder>;
1947
+ /**
1948
+ * Update a single price-triggered order
1949
+ *
1950
+ * @param params Parameters for updating a price-triggered order
1951
+ * @returns Promise<{ id: number }>
1952
+ */
1953
+ updateFuturesPriceTriggeredOrder(params: UpdateFuturesPriceTriggeredOrderReq): Promise<{
1954
+ id: number;
1955
+ }>;
1904
1956
  getFuturesPositionCloseHistory(params: GetFuturesPositionCloseHistoryReq): Promise<FuturesPositionHistoryRecord[]>;
1905
1957
  getFuturesInsuranceHistory(params: GetFuturesInsuranceReq): Promise<FuturesInsuranceHistory[]>;
1906
1958
  /**==========================================================================================================================
@@ -2298,6 +2350,8 @@ export declare class RestClient extends BaseRestClient {
2298
2350
  /**
2299
2351
  * List options account
2300
2352
  *
2353
+ * Indicates support for querying both classic options accounts and unified accounts
2354
+ *
2301
2355
  * @returns Promise<GetOptionsAccountResp>
2302
2356
  */
2303
2357
  getOptionsAccount(): Promise<OptionsAccount>;
@@ -2761,9 +2815,8 @@ export declare class RestClient extends BaseRestClient {
2761
2815
  * ==========================================================================================================================
2762
2816
  */
2763
2817
  /**
2764
- * ETH2 swap
2765
- *
2766
- * @param params Parameters for ETH2 swap
2818
+ * ETH swap (formerly ETH2 swap)
2819
+ * @param params Parameters for ETH swap (1 - ETH to GTETH, 2 - GTETH to ETH)
2767
2820
  * @returns Promise<any>
2768
2821
  */
2769
2822
  submitEth2Swap(params: {
@@ -2771,9 +2824,7 @@ export declare class RestClient extends BaseRestClient {
2771
2824
  amount: string;
2772
2825
  }): Promise<any>;
2773
2826
  /**
2774
- * Get ETH2 historical rate of return data
2775
- *
2776
- * Returns the ETH earnings rate record for the last 31 days
2827
+ * Get GTETH historical rate of return data (formerly ETH2)
2777
2828
  *
2778
2829
  * @returns Promise<Array<{date_time: number, date: string, rate: string}>>
2779
2830
  */
@@ -2936,6 +2987,12 @@ export declare class RestClient extends BaseRestClient {
2936
2987
  getGTDeduction(): Promise<{
2937
2988
  enabled: boolean;
2938
2989
  }>;
2990
+ /**
2991
+ * Query all main account API key information
2992
+ *
2993
+ * @returns Promise<AccountMainKey[]>
2994
+ */
2995
+ getAccountMainKeys(): Promise<AccountMainKey[]>;
2939
2996
  /**==========================================================================================================================
2940
2997
  * REBATES
2941
2998
  * ==========================================================================================================================
@@ -98,7 +98,7 @@ export class RestClient extends BaseRestClient {
98
98
  * Cancel withdrawal with specified ID
99
99
  *
100
100
  * @param params Parameters containing the withdrawal ID
101
- * @returns Promise<Withdraw>
101
+ * @returns Promise<WithdrawalRecord>
102
102
  */
103
103
  cancelWithdrawal(params) {
104
104
  return this.deletePrivate(`/withdrawals/${params.withdrawal_id}`);
@@ -111,7 +111,7 @@ export class RestClient extends BaseRestClient {
111
111
  * List chains supported for specified currency
112
112
  *
113
113
  * @param params Parameters containing the currency name
114
- * @returns Promise< GetCurrencyChainsResp[][]>
114
+ * @returns Promise<CurrencyChain[]>
115
115
  */
116
116
  getCurrencyChains(params) {
117
117
  return this.get('/wallet/currency_chains', params);
@@ -142,7 +142,7 @@ export class RestClient extends BaseRestClient {
142
142
  * Record time range cannot exceed 30 days
143
143
  *
144
144
  * @param params Parameters for filtering deposit records
145
- * @returns Promise<Withdraw[]>
145
+ * @returns Promise<DepositRecord[]>
146
146
  */
147
147
  getDepositRecords(params) {
148
148
  return this.getPrivate('/wallet/deposits', params);
@@ -216,7 +216,7 @@ export class RestClient extends BaseRestClient {
216
216
  * Retrieve withdrawal status
217
217
  *
218
218
  * @param params Parameters for retrieving withdrawal status
219
- * @returns Promise<GetWithdrawalStatusResp[]>
219
+ * @returns Promise<WithdrawalStatus[]>
220
220
  */
221
221
  getWithdrawalStatus(params) {
222
222
  return this.getPrivate('/wallet/withdraw_status', params);
@@ -330,6 +330,14 @@ export class RestClient extends BaseRestClient {
330
330
  getPushOrders(params) {
331
331
  return this.getPrivate('/wallet/push', params);
332
332
  }
333
+ /**
334
+ * Retrieve the list of low-liquidity or low-cap tokens
335
+ *
336
+ * @returns Promise<string[]>
337
+ */
338
+ getLowCapExchangeList() {
339
+ return this.getPrivate('/wallet/getLowCapExchangeList');
340
+ }
333
341
  /**==========================================================================================================================
334
342
  * SUBACCOUNT
335
343
  * ==========================================================================================================================
@@ -383,6 +391,8 @@ export class RestClient extends BaseRestClient {
383
391
  /**
384
392
  * Update API key of the sub-account
385
393
  *
394
+ * Note: This interface cannot modify the mode account type attribute
395
+ *
386
396
  * @param params Parameters for updating API key of the sub-account
387
397
  * @returns Promise<any>
388
398
  */
@@ -448,8 +458,10 @@ export class RestClient extends BaseRestClient {
448
458
  *
449
459
  * The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account.
450
460
  *
461
+ * For specific formulas, please refer to Margin Formula
462
+ *
451
463
  * @param params Parameters for retrieving unified account information
452
- * @returns Promise<GetUnifiedAccountInfoResp>
464
+ * @returns Promise<UnifiedAccountInfo>
453
465
  */
454
466
  getUnifiedAccountInfo(params) {
455
467
  return this.getPrivate('/unified/accounts', params);
@@ -964,9 +976,16 @@ export class RestClient extends BaseRestClient {
964
976
  /**
965
977
  * List personal trading history
966
978
  *
967
- * Spot, portfolio and margin trades are queried by default. If cross margin trades are needed, account must be set to cross_margin.
979
+ * By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts.
980
+ *
981
+ * The history within a specified time range can be queried by specifying from or (and) to.
968
982
  *
969
- * You can also set from and/or to to query by time range. If you don't specify from and/or to parameters, only the last 7 days of data will be returned. The range of from and to is not allowed to exceed 30 days. Time range parameters are handled as order finish time.
983
+ * If no time parameters are specified, only data for the last 7 days can be obtained.
984
+ * If only any parameter of from or to is specified, only 7-day data from the start (or end) of the specified time is returned.
985
+ * The range not allowed to exceed 30 days.
986
+ * The parameters of the time range filter are processed according to the order end time.
987
+ *
988
+ * The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
970
989
  *
971
990
  * @param params Parameters for listing personal trading history
972
991
  * @returns Promise<GetSpotTradingHistoryResp[]>
@@ -1633,6 +1652,8 @@ export class RestClient extends BaseRestClient {
1633
1652
  /**
1634
1653
  * Query futures account
1635
1654
  *
1655
+ * Query account information for classic future account and unified account
1656
+ *
1636
1657
  * @param params Parameters for querying futures account
1637
1658
  * @returns Promise<GetFuturesAccountResp>
1638
1659
  */
@@ -1664,6 +1685,8 @@ export class RestClient extends BaseRestClient {
1664
1685
  /**
1665
1686
  * Get single position
1666
1687
  *
1688
+ * Clarifies dual-position query method when holding both long and short positions in the same contract market
1689
+ *
1667
1690
  * @param params Parameters for retrieving a single position
1668
1691
  * @returns Promise<Position>
1669
1692
  */
@@ -1673,6 +1696,8 @@ export class RestClient extends BaseRestClient {
1673
1696
  /**
1674
1697
  * Update position margin
1675
1698
  *
1699
+ * Under the new risk limit rules, the position limit is related to the leverage you set; a lower leverage will result in a higher position limit. Please use the leverage adjustment api to adjust the position limit.
1700
+ *
1676
1701
  * @param params Parameters for updating position margin
1677
1702
  * @returns Promise<Position>
1678
1703
  */
@@ -1685,6 +1710,17 @@ export class RestClient extends BaseRestClient {
1685
1710
  /**
1686
1711
  * Update position leverage
1687
1712
  *
1713
+ * Position Mode Switching Rules:
1714
+ * - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored)
1715
+ * - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple)
1716
+ *
1717
+ * Examples:
1718
+ * - Set isolated margin with 10x leverage: leverage=10
1719
+ * - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10
1720
+ * - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored)
1721
+ *
1722
+ * Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management.
1723
+ *
1688
1724
  * @param params Parameters for updating position leverage
1689
1725
  * @returns Promise<Position>
1690
1726
  */
@@ -1763,6 +1799,14 @@ export class RestClient extends BaseRestClient {
1763
1799
  * @param params Parameters for updating position risk limit in dual mode
1764
1800
  * @returns Promise<Position[]>
1765
1801
  */
1802
+ /**
1803
+ * Update position risk limit in dual mode
1804
+ *
1805
+ * See risk limit rules for more information
1806
+ *
1807
+ * @param params Parameters for updating position risk limit in dual mode
1808
+ * @returns Promise<FuturesPosition[]>
1809
+ */
1766
1810
  updateDualModePositionRiskLimit(params) {
1767
1811
  const { settle, contract, ...query } = params;
1768
1812
  return this.postPrivate(`/futures/${settle}/dual_comp/positions/${contract}/risk_limit`, { query: query });
@@ -2089,6 +2133,18 @@ export class RestClient extends BaseRestClient {
2089
2133
  cancelFuturesPriceTriggeredOrder(params) {
2090
2134
  return this.deletePrivate(`/futures/${params.settle}/price_orders/${params.order_id}`);
2091
2135
  }
2136
+ /**
2137
+ * Update a single price-triggered order
2138
+ *
2139
+ * @param params Parameters for updating a price-triggered order
2140
+ * @returns Promise<{ id: number }>
2141
+ */
2142
+ updateFuturesPriceTriggeredOrder(params) {
2143
+ const { settle, order_id, ...body } = params;
2144
+ return this.putPrivate(`/futures/${settle}/price_orders/${order_id}`, {
2145
+ body: body,
2146
+ });
2147
+ }
2092
2148
  getFuturesPositionCloseHistory(params) {
2093
2149
  return this.getPrivate(`/futures/${params.settle}/position_close_history`, params);
2094
2150
  }
@@ -2523,6 +2579,8 @@ export class RestClient extends BaseRestClient {
2523
2579
  /**
2524
2580
  * List options account
2525
2581
  *
2582
+ * Indicates support for querying both classic options accounts and unified accounts
2583
+ *
2526
2584
  * @returns Promise<GetOptionsAccountResp>
2527
2585
  */
2528
2586
  getOptionsAccount() {
@@ -2998,18 +3056,15 @@ export class RestClient extends BaseRestClient {
2998
3056
  * ==========================================================================================================================
2999
3057
  */
3000
3058
  /**
3001
- * ETH2 swap
3002
- *
3003
- * @param params Parameters for ETH2 swap
3059
+ * ETH swap (formerly ETH2 swap)
3060
+ * @param params Parameters for ETH swap (1 - ETH to GTETH, 2 - GTETH to ETH)
3004
3061
  * @returns Promise<any>
3005
3062
  */
3006
3063
  submitEth2Swap(params) {
3007
3064
  return this.postPrivate('/earn/staking/eth2/swap', { body: params });
3008
3065
  }
3009
3066
  /**
3010
- * Get ETH2 historical rate of return data
3011
- *
3012
- * Returns the ETH earnings rate record for the last 31 days
3067
+ * Get GTETH historical rate of return data (formerly ETH2)
3013
3068
  *
3014
3069
  * @returns Promise<Array<{date_time: number, date: string, rate: string}>>
3015
3070
  */
@@ -3178,6 +3233,14 @@ export class RestClient extends BaseRestClient {
3178
3233
  getGTDeduction() {
3179
3234
  return this.getPrivate('/account/debit_fee');
3180
3235
  }
3236
+ /**
3237
+ * Query all main account API key information
3238
+ *
3239
+ * @returns Promise<AccountMainKey[]>
3240
+ */
3241
+ getAccountMainKeys() {
3242
+ return this.getPrivate('/account/main_keys');
3243
+ }
3181
3244
  /**==========================================================================================================================
3182
3245
  * REBATES
3183
3246
  * ==========================================================================================================================