aboutsummaryrefslogtreecommitdiffstats
path: root/src/wallet.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-06-29 08:49:16 -0700
committerAdam Soltys <[email protected]>2026-06-29 08:49:16 -0700
commit81df06c53eef1ef2931ed48955aded1e6ce0fa4f (patch)
treece00441809d4cb5a9cbaa12cb1167e2cb3ddcb25 /src/wallet.js
parent5c87dc5e6e09c3cc5e359852621575dbbec8e784 (diff)
downloadcoinosv3-81df06c53eef1ef2931ed48955aded1e6ce0fa4f.tar.gz
coinosv3-81df06c53eef1ef2931ed48955aded1e6ce0fa4f.zip
Send progressive disclosure, swap context in tx detail, LN amount placeholder
- Send: show only the destination input ('Address or Lightning invoice') until a valid on-chain/SP address is entered, then reveal amount + fee rate + coin selection + Review. A pasted bolt11 still auto-advances to its own confirmation, so those controls never appear for it. New wallet.isOnchainAddress() validator + a destReady() gate; recipient onInput/paste re-render only when validity flips. - History: stop listing swaps at the top. Instead, a send/receive that was part of a swap shows its Lightning context (invoice, swap fee, status, refund) on the tx detail screen via swaps.findByTxid(). Removed the dead swapListView. - Lightning receive: drop the '50000' amount placeholder — a bare number looked like a value was already entered; the min/max hint below covers it. Verified in-browser: controls hidden until a valid address, then revealed; LN receive placeholder empty; no errors. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Diffstat (limited to 'src/wallet.js')
-rw-r--r--src/wallet.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wallet.js b/src/wallet.js
index 519e3e1..b3e3d40 100644
--- a/src/wallet.js
+++ b/src/wallet.js
@@ -401,6 +401,11 @@ export class Wallet {
return k ? encodeSilentPaymentAddress(k.scanPub, k.spendPub, { testnet: this.netName !== 'mainnet' }) : null;
}
+ // True if addr is a valid on-chain address for this wallet's network.
+ isOnchainAddress(addr) {
+ try { btc.Address(this.netCfg.net).decode((addr || '').trim()); return true; } catch { return false; }
+ }
+
// Is SP receiving available here? (we can derive keys AND an indexer is set)
silentPaymentsAvailable() {
return !!(this.silentPaymentKeys() && spIndexerUrl(this.netName));