Skip to content

Add patch for ElectrumNetworkProvider #327

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/cashscript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"dependencies": {
"@bitauth/libauth": "^3.1.0-next.2",
"@cashscript/utils": "^0.11.2",
"@electrum-cash/network": "^4.1.1",
"@electrum-cash/network": "^4.1.3",
"@mr-zwets/bchn-api-wrapper": "^1.0.1",
"delay": "^6.0.0",
"fast-deep-equal": "^3.1.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/cashscript/src/network/ElectrumNetworkProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class ElectrumNetworkProvider implements NetworkProvider {
private instantiateElectrumClient(network: Network, options: Options): ElectrumClient<ElectrumClientEvents> {
if ('electrum' in options) return options.electrum;
const server = 'hostname' in options ? options.hostname : this.getServerForNetwork(network);
return new ElectrumClient('CashScript Application', '1.4.1', server);
return new ElectrumClient('CashScript Application', '1.4.1', server, { disableBrowserVisibilityHandling: true });
}

// Get Electrum server based on network
Expand Down
5 changes: 5 additions & 0 deletions website/docs/releases/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
title: Release Notes
---

## v0.11.3

#### CashScript SDK
- :bug: Fix bug with where `ElectrumNetworkProvider` would disconnect in browser on visibility change of the page

## v0.11.2

#### CashScript SDK
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1063,10 +1063,10 @@
dependencies:
debug "^4.3.7"

"@electrum-cash/network@^4.1.1":
version "4.1.1"
resolved "https://registry.yarnpkg.com/@electrum-cash/network/-/network-4.1.1.tgz#1f9571c783f613ce960374b4bffb73c27b28c429"
integrity sha512-v5abF2qGRTnBoi9tcS/iz7j82D8HYsK9iY0NM5v8/Qu8SnlMGGNz8UDFl+YzRPFXb4SUL3K0uf3Oydy82DB3oA==
"@electrum-cash/network@^4.1.3":
version "4.1.3"
resolved "https://registry.yarnpkg.com/@electrum-cash/network/-/network-4.1.3.tgz#195a96e8bb34493c622223992da0649c753aafff"
integrity sha512-amMvdcEfHhquoUkhN7x/H04KPYfqd5LilOGcg6O1OdUks1Mcrcah8WfHICHW/qyZ3Rgoos9o7Wx8gKz8qcSNzg==
dependencies:
"@electrum-cash/debug-logs" "^1.0.0"
"@electrum-cash/web-socket" "^1.0.0"
Expand Down