From 1d9cac6ca92187718eafbd567562875d25fa772b Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 4 Jul 2026 19:29:08 -0700 Subject: Ark: recover from stale vtxo state Match captaind's actual 'not spendable' error so a crashed or foreign spend fails the action instead of retrying forever, and reconcile locally-spendable vtxos against the server (GetVtxoStatus + ownership attestation) when an ark address lands in the send form. boardFee now treats absent proto3 fee fields as zero (Second's signet boards free). Co-Authored-By: Claude Fable 5 --- src/ark/board.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/ark/board.js') diff --git a/src/ark/board.js b/src/ark/board.js index 3352823..f71c0b3 100644 --- a/src/ark/board.js +++ b/src/ark/board.js @@ -21,8 +21,10 @@ const u64le = (n) => { return b; }; -export const boardFee = (amountSat, fees) => - Math.max(fees.minFeeSat, fees.baseFeeSat + Math.floor((amountSat * fees.ppm) / 1_000_000)); +// Fee fields are absent when zero (proto3) — e.g. Second's signet server +// boards for free — so every term defaults to 0. +export const boardFee = (amountSat, fees = {}) => + Math.max(fees.minFeeSat || 0, (fees.baseFeeSat || 0) + Math.floor((amountSat * (fees.ppm || 0)) / 1_000_000)); export const p2trAddress = (programXOnly, hrp = 'bcrt') => bech32m.encode(hrp, [1, ...bech32m.toWords(programXOnly)], 1023); -- cgit v1.2.3