diff options
| author | Adam Soltys <[email protected]> | 2026-07-04 07:08:42 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-07-04 07:08:42 -0700 |
| commit | d39aa82e0e97f1f3373980cb28f04e0415965723 (patch) | |
| tree | 1c9fc1d30b6c19530c47e0153c6fc90b16518487 | |
| parent | 035e81375784b766027b403e4f2685105c4b2150 (diff) | |
| download | coinosv3-d39aa82e0e97f1f3373980cb28f04e0415965723.tar.gz coinosv3-d39aa82e0e97f1f3373980cb28f04e0415965723.zip | |
Ark: hide fee-rate, coin control, Max, and add-recipient for Ark sends
An arkoor send has no mining fee and no coin selection, so pasting an
Ark address now shows just the amount field plus a hint line; the
irrelevant on-chain controls stay hidden.
Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
| -rw-r--r-- | src/app.js | 10 | ||||
| -rw-r--r-- | src/i18n.js | 1 | ||||
| -rw-r--r-- | tools/ark/ui-test.js | 5 |
3 files changed, 12 insertions, 4 deletions
@@ -3378,7 +3378,7 @@ function recipientRow(s, r, i) { }, }), h('button', { type: 'button', title: t('switchUnit'), onClick: toggleUnit }, unitLabel()), - single && h('button', { type: 'button', class: s.max ? 'btn-primary' : '', onClick: () => { s.max = !s.max; render(); } }, t('max')) + single && !isArkAddress(r.address) && h('button', { type: 'button', class: s.max ? 'btn-primary' : '', onClick: () => { s.max = !s.max; render(); } }, t('max')) ) : null ); syncCheck(); @@ -3390,6 +3390,7 @@ function sendForm() { // Progressive disclosure: until the destination is a valid on-chain/SP address, // show only the destination input (a Lightning invoice auto-advances instead). const ready = destReady((s.recipients[0] || {}).address); + const arkDest = s.recipients.length === 1 && isArkAddress((s.recipients[0] || {}).address); const feeOpts = [ ['economyFee', t('feeEconomy')], ['halfHourFee', t('feeNormal')], @@ -3406,13 +3407,14 @@ function sendForm() { h('div', { class: 'col', style: 'gap:14px' }, s.recipients.map((r, i) => recipientRow(s, r, i)) ), - ready && s.recipients.length < 10 && + ready && !arkDest && s.recipients.length < 10 && h('button', { type: 'button', class: 'linklike small mt8', onClick: () => { s.recipients.push({ address: '', amount: '' }); s.max = false; render(); }, }, t('addRecipient')) ), - ready && h( + ready && arkDest && h('div', { class: 'small faint' }, t('arkSendHint')), + ready && !arkDest && h( 'div', { class: 'field' }, h('span', { class: 'lab' }, t('feeRate')), @@ -3440,7 +3442,7 @@ function sendForm() { s.feeChoice !== 'custom' && h('div', { class: 'small faint mt8' }, t('selectedRate', { n: currentFeeRate() })) ), - ready ? coinControl() : null, + ready && !arkDest ? coinControl() : null, ui.sendError && h('div', { class: 'notice err' }, ui.sendError), ready && h('button', { class: 'btn-primary btn-block', onClick: reviewSend }, t('reviewTx')), h('button', { class: 'linklike small', style: 'align-self:center;margin-top:2px', onClick: () => { ui.giftMode = true; ui.sendError = ''; render(); } }, '🎁 ' + t('giftLink')) diff --git a/src/i18n.js b/src/i18n.js index 7380661..5371e5c 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -371,6 +371,7 @@ const STR = { arkRefreshBtn: 'Refresh / consolidate {n} coin(s)', arkRefreshStarted: 'Refresh submitted — completes with the next round.', arkSendTitle: 'Send over Ark', + arkSendHint: 'Ark address — sent instantly off-chain, no mining fee.', arkPayTo: 'To', arkNoFee: 'none — instant off-chain send', arkSendBtn: 'Send', diff --git a/tools/ark/ui-test.js b/tools/ark/ui-test.js index 259172f..2c488d8 100644 --- a/tools/ark/ui-test.js +++ b/tools/ark/ui-test.js @@ -123,6 +123,11 @@ try { await page.type('.mono-input', aliceAddr); await sleep(400); // destReady re-render reveals the amount input await page.type('input[type="number"]', '7000'); + const noFeeUi = await page.evaluate(() => { + const txt = document.body.innerText.toLowerCase(); + return !txt.includes('fee rate') && !txt.includes('coin control') && txt.includes('no mining fee'); + }); + check('no fee/coin controls for ark dest', noFeeUi); await clickText('button.btn-primary', 'Review transaction'); check('ark review shown', await waitText('Send over Ark', 5000)); await clickText('button.btn-primary', 'Send'); |
