diff options
| author | Adam Soltys <[email protected]> | 2026-09-04 07:59:52 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-09-04 07:59:58 -0700 |
| commit | 2d17fd652c3c2c56d6027c9271bf9b9854412677 (patch) | |
| tree | 16e40643a80663cac790386cb01f445ba21f4ea6 /src/features/names.js | |
| parent | 3e45d8007db4bddf8170fde64f7414b32bbbd98f (diff) | |
| download | coinosv3-2d17fd652c3c2c56d6027c9271bf9b9854412677.tar.gz coinosv3-2d17fd652c3c2c56d6027c9271bf9b9854412677.zip | |
Lightning receives to a [email protected] address now wear the ⚡ instead of the Ark mark: a faucet paying the LN address settles on the registrar's CLN and arrives as an anonymous arkoor from the float (the mailbox protocol carries no memo), so the wallet genuinely couldn't tell the rail. The registrar now records a receipt {sat, hash, ts} per LN settlement it forwards via the float (7-day ring per name) and serves them at GET /lnreceipts (NIP-98, owner/manager only — it's a feed of incoming amounts); the wallet fetches them through the names feature (which holds the signer) and fuzzy-matches receive movements by exact amount + delivery within ±3 min, stamping viaLn + the payment hash so a receipt can never claim a second row. History row and detail view show ⚡ for viaLn receives; the tag rides the sync snapshot to other devices via merge enrichment. viaClink deliveries need none of this — the wallet's own LN-receive flow already tags itself. Best-effort by design: an amount+time collision only mislabels an icon
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MGzU12QrAA4G6BYGzGVdXz
Diffstat (limited to 'src/features/names.js')
| -rw-r--r-- | src/features/names.js | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/features/names.js b/src/features/names.js index f8f97cb..bd4ab4d 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -359,6 +359,8 @@ export function namesFeature(ctx) { // Suggest the identity's own nostr username as the claim default — nobody // should have to retype who they already are — but only when that name is // actually free on the registrar (or already theirs to retake). + let lnReceipts = { at: 0, p: null }; + let suggestedFor = null; function suggestName() { const me = (hook('nostrLoginIdentity') || {}).pubkey || (wallet.nostrPubkey && wallet.nostrPubkey()); @@ -764,6 +766,22 @@ export function namesFeature(ctx) { h('button', { class: 'btn-ghost btn-block', onClick: () => goBack(() => { ui.nameEditOpen = null; ui.nameClaimError = null; }) }, t('back'))); }, namesAdoptIdentity(signer, npub) { return adoptIdentity(signer, npub); }, + // Recent LN settlements the registrar forwarded to this wallet's name(s) + // as float arkoors — the ark feature matches them against its receive + // movements to put ⚡ on the rows that actually arrived over Lightning. + // Lives here because the registrar call needs the wallet's NIP-98 + // signer. Cached briefly: a receive burst asks more than once. + namesLnReceipts() { + if (!available()) return Promise.resolve([]); + if (lnReceipts.p && Date.now() - lnReceipts.at < 30_000) return lnReceipts.p; + lnReceipts = { + at: Date.now(), + p: post('/lnreceipts', 'GET') + .then((j) => j.receipts || []) + .catch(() => { lnReceipts.at = 0; return []; }), + }; + return lnReceipts.p; + }, // the claimed payment address, for anyone prefilling a lightning address namesAddress() { const st = load(); return st.name ? `${st.name}@${st.domain || DOMAIN()}` : null; }, // Sign-in races this lookup against the seed work: by the time the |
