v1.1.1: fix(#10) ping syntax for websockets

This commit is contained in:
Tiago Siebler
2023-04-26 09:25:54 +01:00
parent 1619c1a894
commit fc81482d86
2 changed files with 2 additions and 2 deletions

View File

@@ -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",

View File

@@ -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', {