diff options
| author | Adam Soltys <[email protected]> | 2026-06-26 08:23:57 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-06-26 08:23:57 -0700 |
| commit | ff69e7e9f166e01102500b559b0cd66e3a019fab (patch) | |
| tree | d3e26d58118559f59d69222c852dcb01b41f1899 /src/format.js | |
| parent | aa044138337c947b26eea910db57f2d5b743b5b8 (diff) | |
| download | coinosv3-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/format.js')
0 files changed, 0 insertions, 0 deletions
