Skip to content

Commit

Permalink
Merge pull request #41 from JJ-Cro/update10122024
Browse files Browse the repository at this point in the history
v1.1.2 feat(): added new transfer endpoint, updated response types
  • Loading branch information
tiagosiebler authored Dec 10, 2024
2 parents db2df5a + 8c37a79 commit 077f353
Show file tree
Hide file tree
Showing 6 changed files with 305 additions and 264 deletions.
523 changes: 262 additions & 261 deletions docs/endpointFunctionList.md

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions examples/apidoc/RestClient/getTransferStatus.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/order_status
// METHOD: GET
// PUBLIC: NO

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

client.getTransferStatus(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.1.1",
"version": "1.1.2",
"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
19 changes: 19 additions & 0 deletions src/RestClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,25 @@ export class RestClient extends BaseRestClient {
});
}

/**
* Query transfer status based on client_order_id or tx_id
*
* @param params Parameters for querying transfer status
* @returns Promise<{
* tx_id: string;
* status: 'PENDING' | 'SUCCESS' | 'FAIL' | 'PARTIAL_SUCCESS';
* }>
*/
getTransferStatus(params: {
client_order_id?: string;
tx_id?: string;
}): Promise<{
tx_id: string;
status: 'PENDING' | 'SUCCESS' | 'FAIL' | 'PARTIAL_SUCCESS';
}> {
return this.getPrivate('/wallet/order_status', params);
}

/**
* Retrieve withdrawal status
*
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 @@ -224,6 +224,7 @@ export interface FuturesPosition {
mode?: 'single' | 'dual_long' | 'dual_short';
cross_leverage_limit?: string;
update_time?: number;
update_id?: number;
open_time?: number;
}

Expand Down

0 comments on commit 077f353

Please sign in to comment.