aboutsummaryrefslogtreecommitdiffstats
path: root/src/features/ark.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-30 09:31:25 -0700
committerAdam Soltys <[email protected]>2026-08-30 09:31:25 -0700
commitd7d5484b76459c068135ebd7fb33ef19adf33bc0 (patch)
tree3abb240544cbeb487e80b723d7da27e9b85c3f6d /src/features/ark.js
parentce7ebbd5d057d9ef5a04b7d704d26ece2ed00ff7 (diff)
downloadcoinosv3-d7d5484b76459c068135ebd7fb33ef19adf33bc0.tar.gz
coinosv3-d7d5484b76459c068135ebd7fb33ef19adf33bc0.zip
DMs stop losing the race with the signer, and your own address stops paying yourself: undecrypted wraps are kept and retried when a signer comes live (the backfill used to be consumed and dropped whenever the login signer hadn't resumed yet — each device kept a different random subset of history), the inbox also reads the relays our kind-10050 actually advertises, and pasting your own ark address or coinos name into Send now opens the board panel from Savings instead of a silent Spending→Spending self-send; a foreign ark address while Savings is selected says to switch instead of quietly spending the other balance
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr
Diffstat (limited to 'src/features/ark.js')
-rw-r--r--src/features/ark.js30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/features/ark.js b/src/features/ark.js
index 5811a2d..df08e35 100644
--- a/src/features/ark.js
+++ b/src/features/ark.js
@@ -2535,8 +2535,34 @@ export function arkFeature(ctx) {
if (!arkAvailable()) throw new Error(t('arkNotConnected'));
const sats = ctx.parseAmount(s.recipients[0].amount, ctx.getUnit());
if (!sats || sats <= 0) throw new Error(t('enterValidAmtForN', { n: 1 }));
- ui.arkSend = { address: s.recipients[0].address.trim(), amountSat: sats };
- render();
+ const dest = s.recipients[0].address.trim();
+ const fromSavings = ctx.getAccount() !== 'spending';
+ (async () => {
+ // Whose address is this? The manager may still be connecting, so
+ // resolve async before painting a review.
+ let own = false;
+ try { const mgr = await connectArk(); own = dest === mgr.address(); }
+ catch (e) { ui.sendError = e.message; render(); return; }
+ if (own) {
+ // Your OWN ark address is never a payment — pasting it (or a
+ // coinos name that resolves to it) means "top up Spending", so
+ // open the board panel, funded from on-chain Savings. The old
+ // path made a silent Spending→Spending self-send.
+ ctx.goHome();
+ ui.arkMoveOpen = true;
+ ui.arkMoveDir = 'toSpending';
+ ui.arkBoardAmt = String(sats);
+ ui.send = blankSend();
+ toast(t('arkOwnAddrBoard'));
+ } else if (fromSavings) {
+ // An ark payment spends the Spending balance — never silently
+ // spend a different balance than the one selected.
+ ui.sendError = t('arkPayFromSpending');
+ } else {
+ ui.arkSend = { address: dest, amountSat: sats };
+ }
+ render();
+ })();
return true;
}
return false;