aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/ark.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-03 07:48:31 -0700
committerAdam Soltys <[email protected]>2026-08-03 07:48:31 -0700
commit51e0a583ca29019bced1e4e6349afd1c7572a988 (patch)
tree6408a352c9a8109ff6cfd2a69a4e6a9ef53cc37f /src/features/ark.js
parent161adb250e4273d0bcaa160516bc950f5f46310f (diff)
downloadcoinosv3-51e0a583ca29019bced1e4e6349afd1c7572a988.tar.gz
coinosv3-51e0a583ca29019bced1e4e6349afd1c7572a988.zip
Zap screens show the recipient, cap amounts to Spending, faster search
The zap flows (ark-direct and Lightning) show the recipient's avatar chip instead of a bare name, and their LNURL ceiling is now capped by our own Spending balance — when Spending can't cover their minimum the amount field is replaced by a plain "not enough in Spending" notice rather than an impossible "min 1 · max 0" range. The confirm path enforces the same cap. Recipient search feels instant now: the first short query fires after 120ms (the wait users actually notice) and longer mid-word queries wait 500ms to skip characters still being typed; cached prefixes stay instant. Onboarding success screen: check below the title and larger. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/features/ark.js')
-rw-r--r--src/features/ark.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index 7407bb7..5209de8 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -982,7 +982,7 @@ export function arkFeature(ctx) {
if (!z) return null;
return h('div', { class: 'card col', style: 'gap:12px' },
h('h3', {}, '⚡ ' + t('arkZapTitle')),
- h('div', { class: 'small muted', style: 'word-break:break-all' }, z.npub),
+ ctx.hook('profileChip', z.pk) || h('div', { class: 'small muted', style: 'word-break:break-all' }, z.npub),
z.status === 'lookup' ? h('div', { class: 'row gap6', style: 'align-items:center' }, h('span', { class: 'spinner sm' }), h('span', { class: 'small muted' }, t('arkZapLookup'))) : null,
z.status === 'noark' ? h('div', { class: 'notice err' }, t('arkZapNoArk')) : null,
// No Ark address, but they may still take a Lightning zap — hand off to
@@ -991,7 +991,9 @@ export function arkFeature(ctx) {
? h('button', { class: 'btn-primary btn-block', onClick: () => { ctx.hook('lnZapNpub', z.pk, z.npub); } }, '⚡ ' + t('lnZapFallback'))
: null,
z.status === 'wrongnet' ? h('div', { class: 'notice err' }, t('arkGiftWrongNet', { net: z.net })) : null,
- z.status === 'ready'
+ z.status === 'ready' && (arkBalance()?.spendableSat || 0) < 330
+ ? h('div', { class: 'notice info' }, t('zapNoBalance'))
+ : z.status === 'ready'
? h('div', { class: 'col gap6' },
h('div', { class: 'input-group' },
h('input', { type: 'number', min: '0', inputmode: 'decimal', placeholder: t('lnPayAmount'), value: z.amount,
@@ -1004,7 +1006,7 @@ export function arkFeature(ctx) {
ui.sendError ? h('div', { class: 'notice err' }, ui.sendError) : null,
h('div', { class: 'row gap6' },
h('button', { class: 'btn-ghost', onClick: () => { ui.arkZap = null; ui.sendError = ''; ui.send = blankSend(); render(); } }, t('back')),
- z.status === 'ready'
+ z.status === 'ready' && (arkBalance()?.spendableSat || 0) >= 330
? (ui.busy
? h('button', { class: 'btn-primary grow', disabled: true }, h('span', { class: 'spinner' }))
: h('button', { class: 'btn-primary grow', onClick: doArkZap }, t('arkZapBtn')))
@@ -1604,6 +1606,7 @@ export function arkFeature(ctx) {
// The zaps feature's generic Lightning seams (once served by the retired
// swaps feature): the ASP pays invoices natively over ark.
canLnPay() { return arkAvailable() && !wallet.watchOnly && !!(ark && ark.info); },
+ lnSpendableSat() { const b = arkBalance(); return b ? b.spendableSat : 0; },
startLnPay(invoice, meta) { return startArkLnPay(invoice, meta); },
// ---- headless seam for the NWC wallet service ----
arkPayInvoice(invoice, opts) { return payInvoiceHeadless(invoice, opts); },