You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor changes needed to align it with how our other SDKs support proxies for WebSockets.
Proxy configuration in @siebly/hyperliquid-api is more involved than in the Binance, Bybit and Kraken SDKs. There are two separate issues:
The other SDKs support wsOptions: { agent }. Hyperliquid currently accepts webSocketConstructor and calls it with the URL alone, so consumers need a wrapper around ws and a TypeScript compatibility assertion.
WebsocketClient passes requestOptions to its internal metadata REST client, but the default keep-alive setup replaces a supplied HTTPS agent. This affects explicit metadata helpers such as nameToCoin(), resolveAsset() and refreshAssetMetadata(), not ordinary stream subscriptions.
High level notes:
Support wsOptions: { agent } for Node.js WebSocket connections, including reconnects and WebsocketAPIClient.
Preserve an explicitly supplied REST agent instead of replacing it with the default keep-alive agent.
Keep existing webSocketConstructor usage working, define how it interacts with the new options, and preserve browser compatibility.
Simplify the proxy examples while keeping WebSocket and REST routing clear.
Verify that the agent is used on connection and reconnection, that the metadata REST client preserves a custom agent, and that existing custom-constructor and browser usage still works.
Activity