aboutsummaryrefslogtreecommitdiffstats
path: root/src/wallet.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-27 09:43:07 -0700
committerAdam Soltys <[email protected]>2026-06-27 09:43:07 -0700
commitaa7ccfeae4d778ab62decbd58c3ddb3f74268274 (patch)
treeef8f2225997eeda7706a2dab9756d7152a7b0516 /src/wallet.js
parent1d0c1c9bfb9ccfb8a28e0cf147af12c37655cdcc (diff)
downloadcoinosv3-aa7ccfeae4d778ab62decbd58c3ddb3f74268274.tar.gz
coinosv3-aa7ccfeae4d778ab62decbd58c3ddb3f74268274.zip
Use Fulcrum (Electrum/WS) for regtest data + push, dropping esplora
Regtest now talks to a local Fulcrum over its native Electrum WebSocket for both chain data and realtime push, instead of esplora REST + a separate watcher. This matches prod (Fulcrum) and gives ~2-3x lower latency than the previous electrs polling. getBackend()/electrumCandidates() route regtest to the Electrum backend at the configured Fulcrum WS (default ws://localhost:50003); the wallet's realtime path is ungated for regtest. ElectrumApi already covers every call (utxos, history, fees, broadcast), incl. the swap feature. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'src/wallet.js')
-rw-r--r--src/wallet.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wallet.js b/src/wallet.js
index a721c00..a3b2429 100644
--- a/src/wallet.js
+++ b/src/wallet.js
@@ -1269,8 +1269,8 @@ export class Wallet {
// and balances update with no polling.
wsUrl() {
// Electrum backend: pick the current failover candidate (rotated on failure).
- // Electrum is mainnet-only here; testnet/regtest use esplora + polling.
- if (getBackend() === 'electrum' && this.netName === 'mainnet') {
+ // Mainnet (when cut over to Fulcrum) and regtest (local Fulcrum) use Electrum.
+ if (getBackend() === 'electrum' && (this.netName === 'mainnet' || this.netName === 'regtest')) {
if (!this._wsCandidates || !this._wsCandidates.length) { this._wsCandidates = electrumCandidates(); this._wsCandIdx = 0; }
const list = this._wsCandidates;
return list.length ? list[(this._wsCandIdx || 0) % list.length] : null;