From 8da44392be513929802a5f4329b29bfa125aaa04 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sun, 2 Aug 2026 18:17:27 -0700 Subject: Pay an npub: ark > lightning > on-chain, and fix the orphaned LN seams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Picking a search result (or pasting an npub) now resolves every way the person can be paid and takes the best: their kind-10037 ark advert; an ark= instruction in BIP-353 via their coinos name (registrar /pubkey returns the URI directly) or their nip05 name's own DNS record (a bare domain is the BIP-353 "_" user); then Lightning from profile lud16/ lud06 through the zap flow; then a BIP-353 on-chain address as last resort. Search results no longer put the nip05 identifier in the fill value — that's how fiatjaf.com ended up as a dead recipient. Along the way: the zaps feature's canLnPay/startLnPay seams had no provider since the swaps feature retired, so the whole Lightning-zap path was unreachable. Ark provides both now (the ASP pays invoices natively), which also revives zapping any LN-only npub. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi --- src/recipient-search.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/recipient-search.js') diff --git a/src/recipient-search.js b/src/recipient-search.js index 32319ab..d3e69eb 100644 --- a/src/recipient-search.js +++ b/src/recipient-search.js @@ -95,7 +95,7 @@ export async function searchRecipients(qRaw) { try { const m = JSON.parse(e.content); profileCache.set(e.pubkey, { name: m.display_name || m.name || null, picture: m.picture || null }); - add(e.pubkey, { name: m.display_name || m.name, picture: m.picture, address: typeof m.nip05 === 'string' ? m.nip05.replace(/^_@/, '') : undefined }, pri); + add(e.pubkey, { name: m.display_name || m.name, picture: m.picture, nip05: typeof m.nip05 === 'string' ? m.nip05.replace(/^_@/, '') : undefined }, pri); } catch {} }; const primal = await primalSearch(q); @@ -108,7 +108,7 @@ export async function searchRecipients(qRaw) { // Within a source, a name that actually contains the query outranks the // search relay's looser relevance matches. - const score = (r) => ((r.name || '').toLowerCase().includes(q) || (r.address || '').toLowerCase().includes(q)) ? 0 : 1; + const score = (r) => ((r.name || '').toLowerCase().includes(q) || (r.address || r.nip05 || '').toLowerCase().includes(q)) ? 0 : 1; const rows = [...out.values()].sort((a, b) => a.pri - b.pri || score(a) - score(b)).slice(0, MAX_RESULTS); await fillProfiles(rows).catch(() => {}); if (queryCache.size > 200) queryCache.clear(); @@ -147,5 +147,5 @@ export function resultRows(h, rows, onPick) { : h('div', { class: 'chat-avatar fallback' }, (r.name || npubOf(r.pk) || '??').slice(0, 2)), h('div', { class: 'col grow', style: 'min-width:0;gap:1px' }, h('div', { class: 'chat-name' }, r.name || (npubOf(r.pk) || '').slice(0, 14) + '…'), - h('div', { class: 'muted small chat-preview' }, r.address || (npubOf(r.pk) || '').slice(0, 24) + '…')))); + h('div', { class: 'muted small chat-preview' }, r.address || r.nip05 || (npubOf(r.pk) || '').slice(0, 24) + '…')))); } -- cgit v1.2.3