Skip to content

Commit 591357d

Browse files
authored
Merge pull request #89 from JJ-Cro/update15122025
chore(v1.3.3): update version to 1.3.3, add getLowCapExchangeList endpoint, and deprecate certain fields in response types
2 parents 1668050 + 2681e2d commit 591357d

File tree

13 files changed

+421
-338
lines changed

13 files changed

+421
-338
lines changed

docs/endpointFunctionList.md

Lines changed: 272 additions & 271 deletions
Large diffs are not rendered by default.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
const { RestClient } = require('gateio-api');
2+
3+
// 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"
5+
// ENDPOINT: /wallet/getLowCapExchangeList
6+
// METHOD: GET
7+
// PUBLIC: NO
8+
9+
const client = new RestClient({
10+
apiKey: 'insert_api_key_here',
11+
apiSecret: 'insert_api_secret_here',
12+
});
13+
14+
client.getLowCapExchangeList(params)
15+
.then((response) => {
16+
console.log(response);
17+
})
18+
.catch((error) => {
19+
console.error(error);
20+
});

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "gateio-api",
3-
"version": "1.3.2",
3+
"version": "1.3.3",
44
"description": "Complete & Robust Node.js SDK for Gate.com's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.",
55
"scripts": {
66
"clean": "rm -rf dist/*",

src/RestClient.ts

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -756,6 +756,15 @@ export class RestClient extends BaseRestClient {
756756
return this.getPrivate('/wallet/push', params);
757757
}
758758

759+
/**
760+
* Retrieve the list of low-liquidity or low-cap tokens
761+
*
762+
* @returns Promise<string[]>
763+
*/
764+
getLowCapExchangeList(): Promise<string[]> {
765+
return this.getPrivate('/wallet/getLowCapExchangeList');
766+
}
767+
759768
/**==========================================================================================================================
760769
* SUBACCOUNT
761770
* ==========================================================================================================================
@@ -820,6 +829,8 @@ export class RestClient extends BaseRestClient {
820829
/**
821830
* Update API key of the sub-account
822831
*
832+
* Note: This interface cannot modify the mode account type attribute
833+
*
823834
* @param params Parameters for updating API key of the sub-account
824835
* @returns Promise<any>
825836
*/
@@ -901,6 +912,9 @@ export class RestClient extends BaseRestClient {
901912
* Get unified account information
902913
*
903914
* 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+
*
904918
* @param params Parameters for retrieving unified account information
905919
* @returns Promise<UnifiedAccountInfo>
906920
*/
@@ -1543,9 +1557,16 @@ export class RestClient extends BaseRestClient {
15431557
/**
15441558
* List personal trading history
15451559
*
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.
15471561
*
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.
15491570
*
15501571
* @param params Parameters for listing personal trading history
15511572
* @returns Promise<GetSpotTradingHistoryResp[]>
@@ -2425,6 +2446,8 @@ export class RestClient extends BaseRestClient {
24252446
/**
24262447
* Query futures account
24272448
*
2449+
* Query account information for classic future account and unified account
2450+
*
24282451
* @param params Parameters for querying futures account
24292452
* @returns Promise<GetFuturesAccountResp>
24302453
*/
@@ -2465,6 +2488,8 @@ export class RestClient extends BaseRestClient {
24652488
/**
24662489
* Get single position
24672490
*
2491+
* Clarifies dual-position query method when holding both long and short positions in the same contract market
2492+
*
24682493
* @param params Parameters for retrieving a single position
24692494
* @returns Promise<Position>
24702495
*/
@@ -2480,6 +2505,8 @@ export class RestClient extends BaseRestClient {
24802505
/**
24812506
* Update position margin
24822507
*
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+
*
24832510
* @param params Parameters for updating position margin
24842511
* @returns Promise<Position>
24852512
*/
@@ -2497,6 +2524,17 @@ export class RestClient extends BaseRestClient {
24972524
/**
24982525
* Update position leverage
24992526
*
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+
*
25002538
* @param params Parameters for updating position leverage
25012539
* @returns Promise<Position>
25022540
*/
@@ -2505,6 +2543,7 @@ export class RestClient extends BaseRestClient {
25052543
contract: string;
25062544
leverage: string;
25072545
cross_leverage_limit?: string;
2546+
pid?: number; // Product ID
25082547
}): Promise<FuturesPosition> {
25092548
const { settle, contract, ...query } = params;
25102549
return this.postPrivate(
@@ -2619,6 +2658,14 @@ export class RestClient extends BaseRestClient {
26192658
* @param params Parameters for updating position risk limit in dual mode
26202659
* @returns Promise<Position[]>
26212660
*/
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+
*/
26222669
updateDualModePositionRiskLimit(params: {
26232670
settle: 'btc' | 'usdt' | 'usd';
26242671
contract: string;
@@ -3650,6 +3697,8 @@ export class RestClient extends BaseRestClient {
36503697
/**
36513698
* List options account
36523699
*
3700+
* Indicates support for querying both classic options accounts and unified accounts
3701+
*
36533702
* @returns Promise<GetOptionsAccountResp>
36543703
*/
36553704
getOptionsAccount(): Promise<OptionsAccount> {

src/types/response/delivery.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface DeliveryTrade {
1818
contract: string;
1919
size: number;
2020
price: string;
21-
is_internal?: boolean;
21+
is_internal?: boolean; // Deprecated
2222
}
2323

2424
export interface DeliveryCandle {
@@ -47,33 +47,36 @@ export interface DeliveryTicker {
4747
funding_rate: string;
4848
funding_rate_indicative: string;
4949
index_price: string;
50-
quanto_base_rate?: string;
50+
quanto_base_rate?: string; // Deprecated
5151
basis_rate: string;
5252
basis_value: string;
5353
lowest_ask: string;
5454
highest_bid: string;
5555
}
5656

5757
export interface DeliveryAccount {
58-
total: string;
58+
total: string; // Balance, only applicable to classic contract account
5959
unrealised_pnl: string;
60-
position_margin: string;
61-
order_margin: string;
60+
position_margin?: string; // Deprecated
61+
order_margin: string; // Initial margin for all pending orders
6262
available: string;
6363
point: string;
6464
currency: string;
6565
in_dual_mode: boolean;
66+
position_mode?: string; // Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated)
6667
enable_credit: boolean;
6768
position_initial_margin: string;
6869
maintenance_margin: string;
6970
bonus: string;
70-
enable_evolved_classic: boolean;
71+
enable_evolved_classic?: boolean; // Deprecated
7172
cross_order_margin: string;
7273
cross_initial_margin: string;
7374
cross_maintenance_margin: string;
7475
cross_unrealised_pnl: string;
7576
cross_available: string;
7677
isolated_position_margin: string;
78+
enable_new_dual_mode?: boolean; // Deprecated
79+
margin_mode?: number; // 0: classic delivery account; 1: Multi-Currency Margin Mode; 2: Portfolio Margin Mode; 3: Single-Currency Margin Mode
7780
history: {
7881
dnw: string;
7982
pnl: string;

0 commit comments

Comments
 (0)