Skip to content

Commit aa013f2

Browse files
authored
Merge pull request #45 from JJ-Cro/update100225
feat(v1.1.4): deprecated functions, added new response/request fields
2 parents a8c9e03 + 029e214 commit aa013f2

File tree

6 files changed

+49
-15
lines changed

6 files changed

+49
-15
lines changed

.github/workflows/e2etest.yml

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,12 @@
1-
name: 'Build & Test'
1+
name: E2ETests
22

3-
on: [push]
4-
5-
# on:
6-
# # pull_request:
7-
# # branches:
8-
# # - "master"
9-
# push:
10-
# branches:
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
117

128
jobs:
13-
build:
9+
E2ETests:
1410
name: 'Build & Test'
1511
runs-on: ubuntu-latest
1612

@@ -33,8 +29,11 @@ jobs:
3329
- name: Check Build
3430
run: npm run build
3531

36-
- name: Test
37-
run: npm run test
32+
- name: Test Public API Calls
33+
run: npm run test -- public.test.ts
34+
35+
- name: Test Private API Calls
36+
run: npm run test -- private.test.ts
3837
env:
3938
API_KEY: ${{ secrets.API_KEY }}
4039
API_SECRET: ${{ secrets.API_SECRET }}

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.1.3",
3+
"version": "1.1.4",
44
"description": "Complete & robust Node.js SDK for Gate.io's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.",
55
"scripts": {
66
"clean": "rm -rf dist/*",

src/RestClient.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1741,6 +1741,7 @@ export class RestClient extends BaseRestClient {
17411741
}
17421742

17431743
/**
1744+
* @deprecated as of 2025-02-10
17441745
* Currencies supported by cross margin
17451746
*
17461747
* @returns Promise<GetCrossMarginCurrenciesResp[]>
@@ -1750,6 +1751,7 @@ export class RestClient extends BaseRestClient {
17501751
}
17511752

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

17641766
/**
1767+
* @deprecated as of 2025-02-10
17651768
* Retrieve cross margin account
17661769
*
17671770
* @returns Promise<GetCrossMarginAccountResp>
@@ -1771,6 +1774,7 @@ export class RestClient extends BaseRestClient {
17711774
}
17721775

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

17871791
/**
1792+
*
1793+
* @deprecated as of 2025-02-10
17881794
* Create a cross margin borrow loan
17891795
*
17901796
* Borrow amount cannot be less than currency minimum borrow amount.
17911797
*
17921798
* @param params Parameters for creating a cross margin borrow loan
17931799
* @returns Promise<SubmitCrossMarginBorrowLoanResp>
1800+
*
17941801
*/
17951802
submitCrossMarginBorrowLoan(
17961803
params: SubmitCrossMarginBorrowLoanReq,
@@ -1799,6 +1806,7 @@ export class RestClient extends BaseRestClient {
17991806
}
18001807

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

18151823
/**
1824+
* @deprecated as of 2025-02-10
18161825
* Retrieve single borrow loan detail
18171826
*
18181827
* @param params Parameters containing the borrow loan ID
@@ -1824,6 +1833,7 @@ export class RestClient extends BaseRestClient {
18241833
return this.getPrivate(`/margin/cross/loans/${params.loan_id}`);
18251834
}
18261835
/**
1836+
* @deprecated as of 2025-02-10
18271837
* Cross margin repayments
18281838
*
18291839
* 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.
@@ -1839,6 +1849,7 @@ export class RestClient extends BaseRestClient {
18391849
}
18401850

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

18551866
/**
1867+
* @deprecated as of 2025-02-10
18561868
* Interest records for the cross margin account
18571869
*
18581870
* @param params Parameters for retrieving interest records
@@ -1865,6 +1877,7 @@ export class RestClient extends BaseRestClient {
18651877
}
18661878

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

18831896
/**
1897+
* @deprecated as of 2025-02-10
18841898
* Estimated interest rates
18851899
*
18861900
* 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.
@@ -1893,6 +1907,7 @@ export class RestClient extends BaseRestClient {
18931907
}
18941908

18951909
/**
1910+
* @deprecated as of 2025-02-10
18961911
* Get the max borrowable amount for a specific cross margin currency
18971912
*
18981913
* @param params Parameters for retrieving the max borrowable amount
@@ -4343,4 +4358,22 @@ export class RestClient extends BaseRestClient {
43434358
getUserRebateInfo(): Promise<{ invite_uid: number }> {
43444359
return this.getPrivate('/rebate/user/info');
43454360
}
4361+
4362+
/**
4363+
* Query user-subordinate relationship
4364+
*
4365+
* Checks whether specified users are in the system and their relationship status
4366+
*/
4367+
getUserSubordinateRelationships(params: {
4368+
user_id_list: string; // Comma-separated list of user IDs (max 100)
4369+
}): Promise<{
4370+
list: {
4371+
uid: number;
4372+
belong: string;
4373+
type: number;
4374+
ref_uid: number;
4375+
}[];
4376+
}> {
4377+
return this.getPrivate('/rebate/user/sub_relation', params);
4378+
}
43464379
}

src/types/request/wallet.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export interface ListPushOrdersReq {
4242
to?: number;
4343
limit?: number;
4444
offset?: number;
45+
transaction_type?: string;
4546
}
4647

4748
export interface SubmitSubToSubTransferReq {

src/types/response/futures.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ export interface LiquidationHistoryRecord {
9393
time: number;
9494
contract: string;
9595
size: number;
96+
order_size: number;
9697
order_price: string;
9798
fill_price: string;
9899
left: number;

0 commit comments

Comments
 (0)