Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(v1.1.4): deprecated functions, added new response/request fields #45

Merged
merged 2 commits into from
Feb 10, 2025
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
23 changes: 11 additions & 12 deletions .github/workflows/e2etest.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
name: 'Build & Test'
name: E2ETests

on: [push]

# on:
# # pull_request:
# # branches:
# # - "master"
# push:
# branches:
on:
push:
pull_request:
workflow_dispatch:

jobs:
build:
E2ETests:
name: 'Build & Test'
runs-on: ubuntu-latest

Expand All @@ -33,8 +29,11 @@ jobs:
- name: Check Build
run: npm run build

- name: Test
run: npm run test
- name: Test Public API Calls
run: npm run test -- public.test.ts

- name: Test Private API Calls
run: npm run test -- private.test.ts
env:
API_KEY: ${{ secrets.API_KEY }}
API_SECRET: ${{ secrets.API_SECRET }}
Expand Down
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.1.3",
"version": "1.1.4",
"description": "Complete & robust Node.js SDK for Gate.io's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.",
"scripts": {
"clean": "rm -rf dist/*",
Expand Down
33 changes: 33 additions & 0 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1741,6 +1741,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Currencies supported by cross margin
*
* @returns Promise<GetCrossMarginCurrenciesResp[]>
Expand All @@ -1750,6 +1751,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Retrieve detail of one single currency supported by cross margin
*
* @param params Parameters containing the currency name
Expand All @@ -1762,6 +1764,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Retrieve cross margin account
*
* @returns Promise<GetCrossMarginAccountResp>
Expand All @@ -1771,6 +1774,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Retrieve cross margin account change history
*
* Record time range cannot exceed 30 days.
Expand All @@ -1785,12 +1789,15 @@ export class RestClient extends BaseRestClient {
}

/**
*
* @deprecated as of 2025-02-10
* Create a cross margin borrow loan
*
* Borrow amount cannot be less than currency minimum borrow amount.
*
* @param params Parameters for creating a cross margin borrow loan
* @returns Promise<SubmitCrossMarginBorrowLoanResp>
*
*/
submitCrossMarginBorrowLoan(
params: SubmitCrossMarginBorrowLoanReq,
Expand All @@ -1799,6 +1806,7 @@ export class RestClient extends BaseRestClient {
}

/**
*
* List cross margin borrow history
*
* Sort by creation time in descending order by default. Set reverse=false to return ascending results.
Expand All @@ -1813,6 +1821,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Retrieve single borrow loan detail
*
* @param params Parameters containing the borrow loan ID
Expand All @@ -1824,6 +1833,7 @@ export class RestClient extends BaseRestClient {
return this.getPrivate(`/margin/cross/loans/${params.loan_id}`);
}
/**
* @deprecated as of 2025-02-10
* Cross margin repayments
*
* When the liquidity of the currency is insufficient and the transaction risk is high, the currency will be disabled, and funds cannot be transferred. When the available balance of cross-margin is insufficient, the balance of the spot account can be used for repayment. Please ensure that the balance of the spot account is sufficient, and system uses cross-margin account for repayment first.
Expand All @@ -1839,6 +1849,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Retrieve cross margin repayments
*
* Sort by creation time in descending order by default. Set reverse=false to return ascending results.
Expand All @@ -1853,6 +1864,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Interest records for the cross margin account
*
* @param params Parameters for retrieving interest records
Expand All @@ -1865,6 +1877,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Get the max transferable amount for a specific cross margin currency
*
* @param params Parameters for retrieving the max transferable amount
Expand All @@ -1881,6 +1894,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Estimated interest rates
*
* Please note that the interest rates are subject to change based on the borrowing and lending demand, and therefore, the provided rates may not be entirely accurate.
Expand All @@ -1893,6 +1907,7 @@ export class RestClient extends BaseRestClient {
}

/**
* @deprecated as of 2025-02-10
* Get the max borrowable amount for a specific cross margin currency
*
* @param params Parameters for retrieving the max borrowable amount
Expand Down Expand Up @@ -4343,4 +4358,22 @@ export class RestClient extends BaseRestClient {
getUserRebateInfo(): Promise<{ invite_uid: number }> {
return this.getPrivate('/rebate/user/info');
}

/**
* Query user-subordinate relationship
*
* Checks whether specified users are in the system and their relationship status
*/
getUserSubordinateRelationships(params: {
user_id_list: string; // Comma-separated list of user IDs (max 100)
}): Promise<{
list: {
uid: number;
belong: string;
type: number;
ref_uid: number;
}[];
}> {
return this.getPrivate('/rebate/user/sub_relation', params);
}
}
1 change: 1 addition & 0 deletions src/types/request/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export interface ListPushOrdersReq {
to?: number;
limit?: number;
offset?: number;
transaction_type?: string;
}

export interface SubmitSubToSubTransferReq {
Expand Down
1 change: 1 addition & 0 deletions src/types/response/futures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ export interface LiquidationHistoryRecord {
time: number;
contract: string;
size: number;
order_size: number;
order_price: string;
fill_price: string;
left: number;
Expand Down
Loading