aboutsummaryrefslogtreecommitdiffstats
path: root/src/features
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-02 14:41:59 -0700
committerAdam Soltys <[email protected]>2026-10-02 14:41:59 -0700
commitdbee3dddba70783aa66b933ee48a187ef758efaa (patch)
treee5f6669c5d263aa7a1fb5aa9699399cb0ed701f6 /src/features
parentdb8b88b973635b7329cfd5f234c6f8dd6e9e2ccf (diff)
downloadcoinosv3-dbee3dddba70783aa66b933ee48a187ef758efaa.tar.gz
coinosv3-dbee3dddba70783aa66b933ee48a187ef758efaa.zip
Send: a lightning address moves on to the amount by itself
- Pasted with the keyboard (not only the Paste button) it is complete text: it advances at once, as a paste always did through the button. - Typed and then left alone for 0.9s, it is checked quietly (names: our registrar or BIP-353 DNS; zaps: the LNURL-pay endpoint answers) and the form moves on only if something answers. A half-typed domain answers nothing, so it just waits, with no error; finishing it moves on. - tools/send-lnaddr-advance-test.js (live registrar/DNS, [email protected]). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Dmcrt9KyNDKVWFKnb8BREo
Diffstat (limited to 'src/features')
-rw-r--r--src/features/names.js8
-rw-r--r--src/features/zaps.js6
2 files changed, 14 insertions, 0 deletions
diff --git a/src/features/names.js b/src/features/names.js
index 8f37b36..7e51c8c 100644
--- a/src/features/names.js
+++ b/src/features/names.js
@@ -923,6 +923,14 @@ export function namesFeature(ctx) {
render: (seg) => namePane(seg),
}];
},
+ // Is a typed name real yet? (the send form asks once typing pauses, and
+ // only moves on when something answers — never on a half-typed domain)
+ async probeLnAddress(text) {
+ const parsed = parsePaymentName(text);
+ if (!parsed) return false;
+ if (OUR_DOMAINS.includes(parsed.domain)) return !!(await registrarLookup(parsed.name, parsed.domain).catch(() => null));
+ return !!(await resolveBip353(parsed.name, parsed.domain).catch(() => null));
+ },
// BEFORE zaps in the registry: a pasted user@domain tries DNS first.
matchSendText(text, typed) {
if (typed) return false; // don't yank the form away mid-keystroke
diff --git a/src/features/zaps.js b/src/features/zaps.js
index a99de94..f0b655a 100644
--- a/src/features/zaps.js
+++ b/src/features/zaps.js
@@ -414,6 +414,12 @@ export function zapsFeature(ctx) {
begin(target, zapDisplay(target, text), tap);
return true;
},
+ // A lightning address is real when its server answers as a pay endpoint.
+ async probeLnAddress(text) {
+ const target = parseZapTarget(text);
+ if (!target || target.kind !== 'lnaddr') return false;
+ return fetchPayParams(target.url).then(() => true, () => false);
+ },
// The typed-lightning-address affordance on the send form.
sendFormNote(a) {
if (!canPay() || !ui.send || ui.send.recipients.length !== 1) return null;