Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
543 changes: 272 additions & 271 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/apidoc/RestClient/getLowCapExchangeList.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
const { RestClient } = require('gateio-api');

// 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
// This Gate.io API SDK is available on npm via "npm install gateio-api"
// ENDPOINT: /wallet/getLowCapExchangeList
// METHOD: GET
// PUBLIC: NO

const client = new RestClient({
apiKey: 'insert_api_key_here',
apiSecret: 'insert_api_secret_here',
});

client.getLowCapExchangeList(params)
.then((response) => {
console.log(response);
})
.catch((error) => {
console.error(error);
});
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "gateio-api",
"version": "1.3.2",
"version": "1.3.3",
"description": "Complete & Robust Node.js SDK for Gate.com's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.",
"scripts": {
"clean": "rm -rf dist/*",
Expand Down
53 changes: 51 additions & 2 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,15 @@ export class RestClient extends BaseRestClient {
return this.getPrivate('/wallet/push', params);
}

/**
* Retrieve the list of low-liquidity or low-cap tokens
*
* @returns Promise<string[]>
*/
getLowCapExchangeList(): Promise<string[]> {
return this.getPrivate('/wallet/getLowCapExchangeList');
}

/**==========================================================================================================================
* SUBACCOUNT
* ==========================================================================================================================
Expand Down Expand Up @@ -820,6 +829,8 @@ export class RestClient extends BaseRestClient {
/**
* Update API key of the sub-account
*
* Note: This interface cannot modify the mode account type attribute
*
* @param params Parameters for updating API key of the sub-account
* @returns Promise<any>
*/
Expand Down Expand Up @@ -901,6 +912,9 @@ export class RestClient extends BaseRestClient {
* Get unified account information
*
* 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.
*
* For specific formulas, please refer to Margin Formula
*
* @param params Parameters for retrieving unified account information
* @returns Promise<UnifiedAccountInfo>
*/
Expand Down Expand Up @@ -1543,9 +1557,16 @@ export class RestClient extends BaseRestClient {
/**
* List personal trading history
*
* Spot, portfolio and margin trades are queried by default. If cross margin trades are needed, account must be set to cross_margin.
* By default query of transaction records for spot, unified account and warehouse-by-site leverage accounts.
*
* 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.
* The history within a specified time range can be queried by specifying from or (and) to.
*
* If no time parameters are specified, only data for the last 7 days can be obtained.
* 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.
* The range not allowed to exceed 30 days.
* The parameters of the time range filter are processed according to the order end time.
*
* The maximum number of pages when searching data using limit&page paging function is 100,0, that is, limit * (page - 1) <= 100,0.
*
* @param params Parameters for listing personal trading history
* @returns Promise<GetSpotTradingHistoryResp[]>
Expand Down Expand Up @@ -2425,6 +2446,8 @@ export class RestClient extends BaseRestClient {
/**
* Query futures account
*
* Query account information for classic future account and unified account
*
* @param params Parameters for querying futures account
* @returns Promise<GetFuturesAccountResp>
*/
Expand Down Expand Up @@ -2465,6 +2488,8 @@ export class RestClient extends BaseRestClient {
/**
* Get single position
*
* Clarifies dual-position query method when holding both long and short positions in the same contract market
*
* @param params Parameters for retrieving a single position
* @returns Promise<Position>
*/
Expand All @@ -2480,6 +2505,8 @@ export class RestClient extends BaseRestClient {
/**
* Update position margin
*
* 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.
*
* @param params Parameters for updating position margin
* @returns Promise<Position>
*/
Expand All @@ -2497,6 +2524,17 @@ export class RestClient extends BaseRestClient {
/**
* Update position leverage
*
* Position Mode Switching Rules:
* - leverage ≠ 0: Isolated Margin Mode (Regardless of whether cross_leverage_limit is filled, this parameter will be ignored)
* - leverage = 0: Cross Margin Mode (Use cross_leverage_limit to set the leverage multiple)
*
* Examples:
* - Set isolated margin with 10x leverage: leverage=10
* - Set cross margin with 10x leverage: leverage=0&cross_leverage_limit=10
* - leverage=5&cross_leverage_limit=10 → Result: Isolated margin with 5x leverage (cross_leverage_limit is ignored)
*
* Warning: Incorrect settings may cause unexpected position mode switching, affecting risk management.
*
* @param params Parameters for updating position leverage
* @returns Promise<Position>
*/
Expand All @@ -2505,6 +2543,7 @@ export class RestClient extends BaseRestClient {
contract: string;
leverage: string;
cross_leverage_limit?: string;
pid?: number; // Product ID
}): Promise<FuturesPosition> {
const { settle, contract, ...query } = params;
return this.postPrivate(
Expand Down Expand Up @@ -2619,6 +2658,14 @@ export class RestClient extends BaseRestClient {
* @param params Parameters for updating position risk limit in dual mode
* @returns Promise<Position[]>
*/
/**
* Update position risk limit in dual mode
*
* See risk limit rules for more information
*
* @param params Parameters for updating position risk limit in dual mode
* @returns Promise<FuturesPosition[]>
*/
updateDualModePositionRiskLimit(params: {
settle: 'btc' | 'usdt' | 'usd';
contract: string;
Expand Down Expand Up @@ -3650,6 +3697,8 @@ export class RestClient extends BaseRestClient {
/**
* List options account
*
* Indicates support for querying both classic options accounts and unified accounts
*
* @returns Promise<GetOptionsAccountResp>
*/
getOptionsAccount(): Promise<OptionsAccount> {
Expand Down
15 changes: 9 additions & 6 deletions src/types/response/delivery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface DeliveryTrade {
contract: string;
size: number;
price: string;
is_internal?: boolean;
is_internal?: boolean; // Deprecated
}

export interface DeliveryCandle {
Expand Down Expand Up @@ -47,33 +47,36 @@ export interface DeliveryTicker {
funding_rate: string;
funding_rate_indicative: string;
index_price: string;
quanto_base_rate?: string;
quanto_base_rate?: string; // Deprecated
basis_rate: string;
basis_value: string;
lowest_ask: string;
highest_bid: string;
}

export interface DeliveryAccount {
total: string;
total: string; // Balance, only applicable to classic contract account
unrealised_pnl: string;
position_margin: string;
order_margin: string;
position_margin?: string; // Deprecated
order_margin: string; // Initial margin for all pending orders
available: string;
point: string;
currency: string;
in_dual_mode: boolean;
position_mode?: string; // Position mode: single - one-way, dual - dual-side, split - sub-positions (in_dual_mode is deprecated)
enable_credit: boolean;
position_initial_margin: string;
maintenance_margin: string;
bonus: string;
enable_evolved_classic: boolean;
enable_evolved_classic?: boolean; // Deprecated
cross_order_margin: string;
cross_initial_margin: string;
cross_maintenance_margin: string;
cross_unrealised_pnl: string;
cross_available: string;
isolated_position_margin: string;
enable_new_dual_mode?: boolean; // Deprecated
margin_mode?: number; // 0: classic delivery account; 1: Multi-Currency Margin Mode; 2: Portfolio Margin Mode; 3: Single-Currency Margin Mode
history: {
dnw: string;
pnl: string;
Expand Down
Loading
Loading