diff options
| author | Adam Soltys <[email protected]> | 2026-08-17 23:48:59 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-08-17 23:48:59 -0700 |
| commit | 5a9deb5688ee560c2b020582d43dddbed0cda873 (patch) | |
| tree | 63a65b1e474d254ceee3ba1b567985d594e7d5a2 /src | |
| parent | abf96d89ceb6070bb490cbce2cf374bcc21a9daf (diff) | |
| download | coinosv3-5a9deb5688ee560c2b020582d43dddbed0cda873.tar.gz coinosv3-5a9deb5688ee560c2b020582d43dddbed0cda873.zip | |
Typed names take the instant rail too: a Send button outranks the Zap for our domains, resolving to the ark address instead of an LNURL round-trip that needs the recipient awake
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JtaatFfAbx91Nh3xqKVqKz
Diffstat (limited to 'src')
| -rw-r--r-- | src/features/names.js | 22 | ||||
| -rw-r--r-- | src/i18n.js | 1 |
2 files changed, 19 insertions, 4 deletions
diff --git a/src/features/names.js b/src/features/names.js index 69987e3..73e34de 100644 --- a/src/features/names.js +++ b/src/features/names.js @@ -593,10 +593,24 @@ export function namesFeature(ctx) { // instead of leaving a picked name looking ignored. sendFormNote(a) { const nr = ui.nameResolve; - if (!nr || nr.text !== a) return null; - return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, - h('span', { class: 'spinner sm' }), - h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + if (nr && nr.text === a) { + return h('div', { class: 'row gap6', style: 'align-items:center;justify-content:center' }, + h('span', { class: 'spinner sm' }), + h('span', { class: 'small muted' }, t('namesResolving', { name: String(a || '').trim() }))); + } + // A TYPED name on one of our domains: offer the native send (BIP-353 → + // instant ark) as a button, mirroring the zap affordance — typed input + // never auto-advances, since a half-typed domain parses as a name too. + // This note outranks the zaps one (feature order), so our names get the + // free instant rail instead of an LNURL round-trip. + const parsed = parsePaymentName(a); + if (parsed && OUR_DOMAINS.includes(parsed.domain) && hook('arkReady')) { + return h('button', { + type: 'button', class: 'btn-primary btn-block', + onClick: () => beginResolve(a), + }, t('namesSendTo', { name: `${parsed.name}@${parsed.domain}` })); + } + return null; }, settingsCards() { return [namesCard()]; }, }; diff --git a/src/i18n.js b/src/i18n.js index 95d54fb..570cdfc 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -656,6 +656,7 @@ const STR = { namesDesc: 'Claim your payment address — like [email protected]. People can pay you just by typing it, no codes to copy or QR to scan.', namesPlaceholder: 'username', namesResolving: 'Looking up {name}…', + namesSendTo: 'Send to {name}', namesClaim: 'Claim', namesClaimed: 'You are now {name}', namesCopy: 'Copy address', |
