You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This example shows how to call this Gate.io API endpoint with either node.js, javascript (js) or typescript (ts) with the npm module "gateio-api" for Gate.io exchange
4
+
// This Gate.io API SDK is available on npm via "npm install gateio-api"
@@ -820,6 +829,8 @@ export class RestClient extends BaseRestClient {
820
829
/**
821
830
* Update API key of the sub-account
822
831
*
832
+
* Note: This interface cannot modify the mode account type attribute
833
+
*
823
834
* @param params Parameters for updating API key of the sub-account
824
835
* @returns Promise<any>
825
836
*/
@@ -901,6 +912,9 @@ export class RestClient extends BaseRestClient {
901
912
* Get unified account information
902
913
*
903
914
* 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.
915
+
*
916
+
* For specific formulas, please refer to Margin Formula
917
+
*
904
918
* @param params Parameters for retrieving unified account information
905
919
* @returns Promise<UnifiedAccountInfo>
906
920
*/
@@ -1543,9 +1557,16 @@ export class RestClient extends BaseRestClient {
1543
1557
/**
1544
1558
* List personal trading history
1545
1559
*
1546
-
* Spot, portfolio and margin trades are queried by default. If cross margin trades are needed, account must be set to cross_margin.
1560
+
* By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts.
1547
1561
*
1548
-
* 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.
1562
+
* The history within a specified time range can be queried by specifying from or (and) to.
1563
+
*
1564
+
* If no time parameters are specified, only data for the last 7 days can be obtained.
1565
+
* 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.
1566
+
* The range not allowed to exceed 30 days.
1567
+
* The parameters of the time range filter are processed according to the order end time.
1568
+
*
1569
+
* The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
1549
1570
*
1550
1571
* @param params Parameters for listing personal trading history
1551
1572
* @returns Promise<GetSpotTradingHistoryResp[]>
@@ -2425,6 +2446,8 @@ export class RestClient extends BaseRestClient {
2425
2446
/**
2426
2447
* Query futures account
2427
2448
*
2449
+
* Query account information for classic future account and unified account
2450
+
*
2428
2451
* @param params Parameters for querying futures account
2429
2452
* @returns Promise<GetFuturesAccountResp>
2430
2453
*/
@@ -2465,6 +2488,8 @@ export class RestClient extends BaseRestClient {
2465
2488
/**
2466
2489
* Get single position
2467
2490
*
2491
+
* Clarifies dual-position query method when holding both long and short positions in the same contract market
2492
+
*
2468
2493
* @param params Parameters for retrieving a single position
2469
2494
* @returns Promise<Position>
2470
2495
*/
@@ -2480,6 +2505,8 @@ export class RestClient extends BaseRestClient {
2480
2505
/**
2481
2506
* Update position margin
2482
2507
*
2508
+
* 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.
2509
+
*
2483
2510
* @param params Parameters for updating position margin
2484
2511
* @returns Promise<Position>
2485
2512
*/
@@ -2497,6 +2524,17 @@ export class RestClient extends BaseRestClient {
2497
2524
/**
2498
2525
* Update position leverage
2499
2526
*
2527
+
* Position Mode Switching Rules:
2528
+
* - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored)
2529
+
* - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple)
2530
+
*
2531
+
* Examples:
2532
+
* - Set isolated margin with 10x leverage: leverage=10
2533
+
* - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10
2534
+
* - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored)
2535
+
*
2536
+
* Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management.
2537
+
*
2500
2538
* @param params Parameters for updating position leverage
2501
2539
* @returns Promise<Position>
2502
2540
*/
@@ -2505,6 +2543,7 @@ export class RestClient extends BaseRestClient {
2505
2543
contract: string;
2506
2544
leverage: string;
2507
2545
cross_leverage_limit?: string;
2546
+
pid?: number;// Product ID
2508
2547
}): Promise<FuturesPosition>{
2509
2548
const{ settle, contract, ...query}=params;
2510
2549
returnthis.postPrivate(
@@ -2619,6 +2658,14 @@ export class RestClient extends BaseRestClient {
2619
2658
* @param params Parameters for updating position risk limit in dual mode
2620
2659
* @returns Promise<Position[]>
2621
2660
*/
2661
+
/**
2662
+
* Update position risk limit in dual mode
2663
+
*
2664
+
* See risk limit rules for more information
2665
+
*
2666
+
* @param params Parameters for updating position risk limit in dual mode
2667
+
* @returns Promise<FuturesPosition[]>
2668
+
*/
2622
2669
updateDualModePositionRiskLimit(params: {
2623
2670
settle: 'btc'|'usdt'|'usd';
2624
2671
contract: string;
@@ -3650,6 +3697,8 @@ export class RestClient extends BaseRestClient {
3650
3697
/**
3651
3698
* List options account
3652
3699
*
3700
+
* Indicates support for querying both classic options accounts and unified accounts
0 commit comments