aboutsummaryrefslogtreecommitdiffstats
path: root/src/ark/manager.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-05 08:02:34 -0700
committerAdam Soltys <[email protected]>2026-07-05 08:02:34 -0700
commitdb7e70fac51e16c7f389e031a80355b2d9d0f57e (patch)
tree4592ced52154d56edee0991de1e2044431ee95d2 /src/ark/manager.js
parentb6875f7bcefe10c4c23868d7952c4584d557aa60 (diff)
downloadcoinosv3-db7e70fac51e16c7f389e031a80355b2d9d0f57e.tar.gz
coinosv3-db7e70fac51e16c7f389e031a80355b2d9d0f57e.zip
Boarding UX: label the funding tx and show an in-flight ark balance
The board's on-chain send showed as a generic 'Sent' and the sats vanished from the balance until the vtxo registered. The funding tx now reads 'Ark board' in History (with a detail section showing the net credit), and an 'Ark (boarding…)' line carries the pending amount from broadcast until the board completes. Co-Authored-By: Claude Fable 5 <[email protected]>
Diffstat (limited to 'src/ark/manager.js')
-rw-r--r--src/ark/manager.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ark/manager.js b/src/ark/manager.js
index 310bab5..e35bb89 100644
--- a/src/ark/manager.js
+++ b/src/ark/manager.js
@@ -122,7 +122,13 @@ export class ArkManager {
balance() {
const sum = (st) => this.state.vtxos.filter((v) => v.state === st).reduce((n, v) => n + v.amountSat, 0);
- return { spendableSat: sum('spendable'), pendingSat: sum('pending') };
+ // Boards whose funding tx is broadcast but whose vtxo isn't registered yet:
+ // the sats have left the on-chain balance, so surface them here instead of
+ // letting them vanish until the board completes.
+ const boardingSat = this.state.actions
+ .filter((a) => a.type === 'board' && a.fundingTxid && !['done', 'failed'].includes(a.step))
+ .reduce((n, a) => n + (a.amountSat - a.feeSat), 0);
+ return { spendableSat: sum('spendable'), pendingSat: sum('pending'), boardingSat };
}
// Receives newer than the last acknowledgement — the UI's "Payment