diff --git a/package-lock.json b/package-lock.json index 4bd4cea..f288f6f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "gateio-api", - "version": "1.0.10", + "version": "1.0.11", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "gateio-api", - "version": "1.0.10", + "version": "1.0.11", "license": "MIT", "dependencies": { "axios": "^1.6.6", diff --git a/package.json b/package.json index 50ce40e..09ebb33 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gateio-api", - "version": "1.0.10", + "version": "1.0.11", "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/lib/BaseRestClient.ts b/src/lib/BaseRestClient.ts index 1950b5a..867b801 100644 --- a/src/lib/BaseRestClient.ts +++ b/src/lib/BaseRestClient.ts @@ -245,7 +245,8 @@ export abstract class BaseRestClient { // Dispatch request return axios(options) .then((response) => { - if (response.status == 200 || response.status == 201) { + // See: https://www.gate.io/docs/developers/apiv4/en/#return-format + if (response.status >= 200 && response.status <= 204) { // Throw API rejections by parsing the response code from the body if ( typeof response.data?.code === 'number' &&