@pear-protocol/hyperliquid-sdk 0.0.53 → 0.0.54

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.
Files changed (2) hide show
  1. package/dist/index.js +3 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -188,6 +188,7 @@ const useHyperliquidWebSocket = ({ wsUrl, address, enabled = true, }) => {
188
188
  const ws = new WebSocket(wsUrl);
189
189
  wsRef.current = ws;
190
190
  ws.onopen = () => {
191
+ // Reset attempts on successful connection
191
192
  reconnectAttemptsRef.current = 0;
192
193
  setReadyState(ReadyState.OPEN);
193
194
  setLastError(null);
@@ -198,7 +199,8 @@ const useHyperliquidWebSocket = ({ wsUrl, address, enabled = true, }) => {
198
199
  };
199
200
  ws.onclose = () => {
200
201
  setReadyState(ReadyState.CLOSED);
201
- if (!manualCloseRef.current && reconnectAttemptsRef.current < 5) {
202
+ if (!manualCloseRef.current) {
203
+ setLastSubscribedAddress(null);
202
204
  reconnectAttemptsRef.current += 1;
203
205
  setTimeout(() => connect(), 3000);
204
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pear-protocol/hyperliquid-sdk",
3
- "version": "0.0.53",
3
+ "version": "0.0.54",
4
4
  "description": "React SDK for Pear Protocol Hyperliquid API integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",