Skip to content

Commit 077f353

Browse files
authored
Merge pull request #41 from JJ-Cro/update10122024
v1.1.2 feat(): added new transfer endpoint, updated response types
2 parents db2df5a + 8c37a79 commit 077f353

File tree

6 files changed

+305
-264
lines changed

6 files changed

+305
-264
lines changed

docs/endpointFunctionList.md

Lines changed: 262 additions & 261 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/order_status
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.getTransferStatus(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.1.1",
3+
"version": "1.1.2",
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: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,25 @@ export class RestClient extends BaseRestClient {
570570
});
571571
}
572572

573+
/**
574+
* Query transfer status based on client_order_id or tx_id
575+
*
576+
* @param params Parameters for querying transfer status
577+
* @returns Promise<{
578+
* tx_id: string;
579+
* status: 'PENDING' | 'SUCCESS' | 'FAIL' | 'PARTIAL_SUCCESS';
580+
* }>
581+
*/
582+
getTransferStatus(params: {
583+
client_order_id?: string;
584+
tx_id?: string;
585+
}): Promise<{
586+
tx_id: string;
587+
status: 'PENDING' | 'SUCCESS' | 'FAIL' | 'PARTIAL_SUCCESS';
588+
}> {
589+
return this.getPrivate('/wallet/order_status', params);
590+
}
591+
573592
/**
574593
* Retrieve withdrawal status
575594
*

src/types/response/futures.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ export interface FuturesPosition {
224224
mode?: 'single' | 'dual_long' | 'dual_short';
225225
cross_leverage_limit?: string;
226226
update_time?: number;
227+
update_id?: number;
227228
open_time?: number;
228229
}
229230

0 commit comments

Comments
 (0)