Support URL path in WebSocket connections#23
Merged
lukasz-zimnoch merged 5 commits intomainfrom Mar 3, 2026
Merged
Conversation
Some Electrum providers require path-based API keys in the WebSocket URL (e.g. wss://host:port/api-key). The library previously constructed URLs as protocol://host:port, discarding any path component. Add an optional `path` parameter to the constructor chain (ElectrumClient -> SocketClient -> WebSocketClient) and append it to the WebSocket URL. The parameter is backwards-compatible and defaults to an empty string. TCP/SSL clients are unaffected since paths are only meaningful for WebSocket connections. Update integration tests to use mainnet servers and support path-based authentication via the ELECTRUMX_API_KEY env variable.
Node 14 is EOL and actions/setup-node@v2 cache protocol is no longer supported by GitHub, causing "Cache service responded with 400" errors.
No changes to the logic, just linting.
Not all Electrum servers will be ElectrumX. Renaming for clarity.
Repository secrets need to be explicitly mapped to environment variables
via env: — they aren't injected into process.env automatically.
The ${{ secrets.ELECTRUM_API_KEY }} expression reads the secret and
exposes it as the ELECTRUM_API_KEY env var for the test step.
lukasz-zimnoch
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Some Electrum providers require path-based API keys in the WebSocket URL (e.g. wss://host:port/api-key). The library previously constructed URLs as protocol://host:port, discarding any path component.
Add an optional
pathparameter to the constructor chain (ElectrumClient -> SocketClient -> WebSocketClient) and append it to the WebSocket URL. The parameter is backwards-compatible and defaults to an empty string. TCP/SSL clients are unaffected since paths are only meaningful for WebSocket connections.Update integration tests to use mainnet servers and support path-based authentication via the ELECTRUM_API_KEY env variable.