summaryrefslogtreecommitdiffstats
path: root/src/i18n.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-26 08:23:57 -0700
committerAdam Soltys <[email protected]>2026-06-26 08:23:57 -0700
commitff69e7e9f166e01102500b559b0cd66e3a019fab (patch)
treed3e26d58118559f59d69222c852dcb01b41f1899 /src/i18n.js
parentaa044138337c947b26eea910db57f2d5b743b5b8 (diff)
downloadcoinosv3-ff69e7e9f166e01102500b559b0cd66e3a019fab.tar.gz
coinosv3-ff69e7e9f166e01102500b559b0cd66e3a019fab.zip
Add Electrum-over-WebSocket as an alternative data backend
Settings → Data source now offers 'Electrum' alongside the Esplora REST explorer. One Electrum WebSocket serves BOTH the wallet's data queries and scripthash push notifications, so pointing Hal at your own Fulcrum/electrs gives a fully self-hosted setup — no coinos, no public REST, nothing shared off your node. - src/electrum.js: ElectrumApi maps the Esplora shapes the wallet consumes onto Electrum methods (scripthash get_balance/listunspent/get_history, estimatefee, transaction.broadcast). electrs has no verbose tx lookup, so it parses raw txs and resolves input values from parent txs to compute fees (cached, in-flight deduped, bounded-parallel). Validated field-for-field against mempool.space: addressTxs (fee/vin/vout/status), getTx, outspend, balance, utxos. - wallet.js: the realtime socket already spoke Electrum's notify protocol; added request/response (_rpcCall) so the same connection answers data calls. Real Electrum notifications carry no tx data, so they reconcile via the backend. Replaced the fragile newline parser with a string-aware brace-depth scanner that handles every framing (newline, one-per-frame, concatenated, split) — fixes a buffer-poisoning hang under concurrent calls; also hardens the coinos watcher path. Esplora stays the default; nothing changes for existing users. Verified end-to-end against blockstream's electrs: concurrent transport, a full fresh-wallet scan (~2s), and the parser unit-tested on all framings. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/i18n.js')
-rw-r--r--src/i18n.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/i18n.js b/src/i18n.js
index 8ed57f3..aa8b499 100644
--- a/src/i18n.js
+++ b/src/i18n.js
@@ -259,6 +259,12 @@ const STR = {
explorerDesc: 'The server this wallet queries for balances and history. Point it at your own node for maximum privacy.',
explorerUrl: 'Server URL',
explorerUrlHint: 'Esplora / electrs REST base, e.g. https://mempool.space/api',
+ dataSource: 'Data source',
+ backendEsplora: 'Explorer',
+ backendElectrum: 'Electrum',
+ backendElectrumDesc: 'Fetch data and get instant payments over one Electrum WebSocket. Point it at your own Fulcrum/electrs for a fully self-hosted wallet — no coinos, no REST.',
+ electrumUrl: 'Electrum server (wss://)',
+ electrumUrlHint: 'A WebSocket Electrum server, e.g. wss://your-node:50004',
silentPaymentNote: 'Silent payment',
instantNotif: 'Instant notifications',
instantNotifDesc: 'Uses coinos to push payments the instant they arrive. Turn off to poll the explorer above instead — a bit slower, but your addresses are never sent to coinos.',