diff --git a/package-lock.json b/package-lock.json index d40e608..34c5f81 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "bybit-api", - "version": "4.0.0-beta.0", + "version": "4.0.0-beta.1", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "bybit-api", - "version": "4.0.0-beta.0", + "version": "4.0.0-beta.1", "license": "MIT", "dependencies": { "axios": "^1.7.9", diff --git a/package.json b/package.json index ee4385c..83b6a1f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bybit-api", - "version": "4.0.0-beta.0", + "version": "4.0.0-beta.1", "description": "Complete & robust Node.js SDK for Bybit's REST APIs and WebSockets, with TypeScript & strong end to end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/util/BaseRestClient.ts b/src/util/BaseRestClient.ts index 8a6dc0f..fb34e64 100644 --- a/src/util/BaseRestClient.ts +++ b/src/util/BaseRestClient.ts @@ -4,7 +4,6 @@ import https from 'https'; import { APIID, - REST_CLIENT_TYPE_ENUM, RestClientOptions, RestClientType, getRestBaseUrl, diff --git a/src/websocket-client.ts b/src/websocket-client.ts index 3ed2ccf..d26df78 100644 --- a/src/websocket-client.ts +++ b/src/websocket-client.ts @@ -550,10 +550,18 @@ export class WebsocketClient extends BaseWebsocketClient< switch (market) { case 'all': { + const topics = requests.map((r) => r.topic); + + // Previously used to track topics in a request. Keeping this for subscribe/unsubscribe requests, no need for incremental values + const req_id = + ['subscribe', 'unsubscribe'].includes(operation) && topics.length + ? topics.join('_') + : this.getNewRequestId(); + const wsEvent: WsRequestOperationBybit = { - req_id: this.getNewRequestId(), + req_id: req_id, op: operation, - args: requests.map((r) => r.topic), + args: topics, }; const midflightWsEvent: MidflightWsRequestEvent<