@pythnetwork/pyth-lazer-sdk 0.3.0 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright 2024 Pyth Data Association.
1
+ Copyright 2025 Pyth Data Association.
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -10,6 +10,7 @@ export declare class WebSocketPool {
10
10
  private messageListeners;
11
11
  private allConnectionsDownListeners;
12
12
  private wasAllDown;
13
+ private checkConnectionStatesInterval;
13
14
  private constructor();
14
15
  /**
15
16
  * Creates a new WebSocketPool instance that uses multiple redundant WebSocket connections for reliability.
@@ -16,6 +16,7 @@ class WebSocketPool {
16
16
  messageListeners;
17
17
  allConnectionsDownListeners;
18
18
  wasAllDown = true;
19
+ checkConnectionStatesInterval;
19
20
  constructor(logger = ts_log_1.dummyLogger) {
20
21
  this.logger = logger;
21
22
  this.rwsPool = [];
@@ -24,7 +25,7 @@ class WebSocketPool {
24
25
  this.messageListeners = [];
25
26
  this.allConnectionsDownListeners = [];
26
27
  // Start monitoring connection states
27
- setInterval(() => {
28
+ this.checkConnectionStatesInterval = setInterval(() => {
28
29
  this.checkConnectionStates();
29
30
  }, 100);
30
31
  }
@@ -183,6 +184,7 @@ class WebSocketPool {
183
184
  this.subscriptions.clear();
184
185
  this.messageListeners = [];
185
186
  this.allConnectionsDownListeners = [];
187
+ clearInterval(this.checkConnectionStatesInterval);
186
188
  }
187
189
  }
188
190
  exports.WebSocketPool = WebSocketPool;
@@ -10,6 +10,7 @@ export declare class WebSocketPool {
10
10
  private messageListeners;
11
11
  private allConnectionsDownListeners;
12
12
  private wasAllDown;
13
+ private checkConnectionStatesInterval;
13
14
  private constructor();
14
15
  /**
15
16
  * Creates a new WebSocketPool instance that uses multiple redundant WebSocket connections for reliability.
@@ -11,6 +11,7 @@ export class WebSocketPool {
11
11
  messageListeners;
12
12
  allConnectionsDownListeners;
13
13
  wasAllDown = true;
14
+ checkConnectionStatesInterval;
14
15
  constructor(logger = dummyLogger) {
15
16
  this.logger = logger;
16
17
  this.rwsPool = [];
@@ -19,7 +20,7 @@ export class WebSocketPool {
19
20
  this.messageListeners = [];
20
21
  this.allConnectionsDownListeners = [];
21
22
  // Start monitoring connection states
22
- setInterval(() => {
23
+ this.checkConnectionStatesInterval = setInterval(() => {
23
24
  this.checkConnectionStates();
24
25
  }, 100);
25
26
  }
@@ -178,5 +179,6 @@ export class WebSocketPool {
178
179
  this.subscriptions.clear();
179
180
  this.messageListeners = [];
180
181
  this.allConnectionsDownListeners = [];
182
+ clearInterval(this.checkConnectionStatesInterval);
181
183
  }
182
184
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pythnetwork/pyth-lazer-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Pyth Lazer SDK",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -67,5 +67,5 @@
67
67
  "ts-log": "^2.2.7",
68
68
  "ws": "^8.18.0"
69
69
  },
70
- "gitHead": "1c6530498edb3112be05a4f7e44a3973310df8ed"
70
+ "gitHead": "bf18253126f281a3ae0606ac748ca5496795fbc9"
71
71
  }