Fix WS clientConfig types and clarify docs #3563
Labels
1.x
1.0 related issues
Documentation
Relates to project wiki or documentation
Types
Incorrect or missing types
In #1354 @naddison36 reports that the types and documentation for part of the WebsocketProvider client config that enables a long running connection to Infura are incorrect.
copied comment
For future devs looking for a solution to keeping a WebSocket connection to Infura alive, this worked for me
@ts-ignore
is required for TypeScript as the Web3js typings is expecting astring
for theclientConfig
option which is wrong. The doco for theWebSocketClient
used byWeb3js
also does not properly cover the keepalive config. https://github.com/theturtle32/WebSocket-Node/blob/master/docs/WebSocketClient.md#client-config-optionsThe
WebSocketConnection
code with the keepalive config is at https://github.com/theturtle32/WebSocket-Node/blob/574b703ca978709832c6c2f67d6c1de376d432b5/lib/WebSocketConnection.js#L111The text was updated successfully, but these errors were encountered: