diff options
| author | Adam Soltys <[email protected]> | 2026-08-01 19:38:30 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-01 19:38:30 -0700 |
| commit | 348a57004f94dd0f58c4e70769e65ca7ea3f7619 (patch) | |
| tree | 5f8cd2930abd9c1e05bb7c18e0bec239780281ef /src/features/sp.js | |
| parent | 9196f4804851a87c8356418b1c4cade6e87c54ba (diff) | |
| download | coinosv3-348a57004f94dd0f58c4e70769e65ca7ea3f7619.tar.gz coinosv3-348a57004f94dd0f58c4e70769e65ca7ea3f7619.zip | |
Simplify: one Lightning path, one balance, fewer features
Dropped: silent payments (feature, wallet chains, scan worker, indexer
config), Boltz submarine/reverse swaps (feature + swap.js + tools), the
third-party ark swap bridge (config, client flows, settings card — the
ASP's own Lightning send is the one path now), and the Consolidate
coins settings action.
The NWC pouch is gone with them: background answering now spends the
WHOLE ark balance. The IndexedDB record mirrors the real manager state
plus the chain-3 keys for its live coins and a change-index window; the
worker pays through the ASP exactly like the open app, and the app
folds the worker's spends, change, and key allocations back in on
connect (additive merge + reconcile against the server). A leftover
chain-6 pouch from the short-lived pouch era is swept home
automatically using the keys stored in its own record. The stated
tradeoff: same-origin script access now reaches the ark balance, not a
carve-out — the ark balance is walking-around money, the on-chain
wallet's keys are never mirrored, and per-connection NWC budgets remain
the enforced ceiling.
Bundle: 726KB -> 602KB.
Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/features/sp.js')
| -rw-r--r-- | src/features/sp.js | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/src/features/sp.js b/src/features/sp.js deleted file mode 100644 index 92f091f..0000000 --- a/src/features/sp.js +++ /dev/null @@ -1,66 +0,0 @@ -// Silent payments (BIP-352) feature — the reusable sp1… receive address and -// the tweak-indexer settings. (The SP scanning/spending machinery itself lives -// in wallet.js/silentpay.js and ships with the core wallet for now.) - -import { isSilentPaymentAddress } from '../silentpay.js'; -import { installSpWallet } from './sp-wallet.js'; -import { getNetwork, getSpIndexerConfig, setSpIndexerConfig, spIndexerPresets } from '../api.js'; -import { t } from '../i18n.js'; -import { qrSvg } from '../qr.js'; - -export function spFeature(ctx) { - const { h, ui, render, wallet, copyBtn } = ctx; - installSpWallet(wallet); // the BIP-352 engine lives outside the core wallet - - function spIndexerCard() { - if (!wallet.silentPaymentKeys || !wallet.silentPaymentKeys()) return null; - const net = getNetwork(); - const cfg = getSpIndexerConfig(net); - return h( - 'div', - { class: 'card col' }, - h('h3', {}, t('spIndexerTitle')), - h('p', { class: 'small muted', style: 'margin:0' }, t('spIndexerDesc')), - h('select', { onChange: (e) => { setSpIndexerConfig({ server: e.target.value, url: cfg.url }, net); render(); } }, - spIndexerPresets(net).map((o) => h('option', { value: o.id, selected: o.id === cfg.server }, o.id === 'custom' ? o.label : o.url.replace(/^\w+:\/\//, '')))), - cfg.server === 'custom' - ? h('label', { class: 'field' }, - h('span', { class: 'lab' }, t('spIndexerUrl')), - h('input', { - type: 'text', class: 'mono-input', placeholder: 'https://your-indexer:8888', - autocapitalize: 'none', autocomplete: 'off', spellcheck: 'false', value: cfg.url, - onChange: (e) => { setSpIndexerConfig({ server: 'custom', url: e.target.value.trim() }, net); render(); }, - }), - h('div', { class: 'small faint' }, t('spIndexerHint'))) - : null - ); - } - - return { - id: 'sp', - receiveModes() { - const spAddr = wallet.silentPaymentsAvailable && wallet.silentPaymentsAvailable() ? wallet.silentPaymentAddress() : null; - if (!spAddr) return []; - return [{ - id: 'sp', label: t('receiveSpTab'), icon: '🕶️', - render: (seg) => h( - 'div', - { class: 'card col', style: 'align-items:center;gap:14px' }, - seg, - h('div', { html: qrSvg(spAddr) }), - h('div', { class: 'addr-box break', style: 'width:100%;font-size:12px' }, spAddr), - copyBtn(spAddr, t('copyAddress')) - ), - }]; - }, - isSendDest(a) { return isSilentPaymentAddress(a); }, - // Silent-payment receipts merge into the main history as on-chain-looking - // rows (tx.sp) — give them a rail glyph + tag so they're recognizable. - decorateTxRow(tx) { - return tx && tx.sp - ? { icon: '🕶️', label: h('span', {}, t('received'), ' ', h('span', { class: 'tag' }, t('receiveSpTab'))) } - : null; - }, - settingsCards() { return [spIndexerCard()]; }, - }; -} |
