From fc81482d8623fc55940e1f192a658a10e85ad9cf Mon Sep 17 00:00:00 2001 From: Tiago Siebler Date: Wed, 26 Apr 2023 09:25:54 +0100 Subject: [PATCH] v1.1.1: fix(#10) ping syntax for websockets --- package.json | 2 +- src/websocket-client.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c6f8b6e..f9e0fa2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bitget-api", - "version": "1.1.0", + "version": "1.1.1", "description": "Node.js connector for Bitget REST APIs and WebSockets, with TypeScript & end-to-end tests.", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/src/websocket-client.ts b/src/websocket-client.ts index 611dad0..2ac02e6 100644 --- a/src/websocket-client.ts +++ b/src/websocket-client.ts @@ -331,7 +331,7 @@ export class WebsocketClient extends EventEmitter { this.clearPongTimer(wsKey); this.logger.silly('Sending ping', { ...LOGGER_CATEGORY, wsKey }); - this.tryWsSend(wsKey, JSON.stringify({ op: 'ping' })); + this.tryWsSend(wsKey, 'ping'); this.wsStore.get(wsKey, true).activePongTimer = setTimeout(() => { this.logger.info('Pong timeout - closing socket to reconnect', {