diff --git a/package-lock.json b/package-lock.json index 866315d..afeae0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gateio-api", - "version": "1.0.22", + "version": "1.1.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gateio-api", - "version": "1.0.22", + "version": "1.1.0", "license": "MIT", "dependencies": { "axios": "^1.6.6", diff --git a/package.json b/package.json index 948ac26..8d3673b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gateio-api", - "version": "1.0.22", + "version": "1.1.0", "description": "Complete & robust Node.js SDK for Gate.io's REST APIs, WebSockets & WebSocket APIs, with TypeScript declarations.", "scripts": { "clean": "rm -rf dist/*", diff --git a/src/RestClient.ts b/src/RestClient.ts index 1e3d402..08c209d 100644 --- a/src/RestClient.ts +++ b/src/RestClient.ts @@ -373,7 +373,7 @@ export class RestClient extends BaseRestClient { console.log(result); console.log( - `Your approximate latency to exchange server: + `Your approximate latency to exchange server: One way: ${estimatedOneWayLatency}ms. Round trip: ${roundTripTime}ms. `, @@ -2473,9 +2473,16 @@ export class RestClient extends BaseRestClient { * @returns Promise */ updateFuturesOrder(params: UpdateFuturesOrderReq): Promise { - const { settle, order_id, ...body } = params; + const { settle, order_id, ...rest } = params; + const { ['x-gate-exptime']: xGateExptime, ...body } = rest; + + const headers = xGateExptime + ? { 'x-gate-exptime': xGateExptime } + : undefined; + return this.putPrivate(`/futures/${settle}/orders/${order_id}`, { body: body, + headers: headers, }); }