From 0064b59c3f4543fa709f2b6166174a08d6689506 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 2 Sep 2026 22:25:11 -0700 Subject: An offboard's price stops hiding in one number: the miners' cut and the ASP's service charge (base + lifetime ppm) record separately and the history detail shows them on their own lines — settling the mystery of a ~350-sat chain fee inside a ~650-sat total. The community row's member count anchors to last session's settled figure instead of ticking upward through the guestbook replay, and a profile's Pay button reached from search actually reaches Send — the lingering search screen was winning the router MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01MrkLsNScXe9b6BviUSdmMr --- src/ark/manager.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/ark/manager.js') diff --git a/src/ark/manager.js b/src/ark/manager.js index a190480..59f9f09 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -45,7 +45,7 @@ import { encodeVtxoFromDecoded, } from './refresh.js'; import { - getOffboardFeeRate, feeRateKwu, offboardFee, offboardAttestation, + getOffboardFeeRate, feeRateKwu, offboardFeeParts, offboardAttestation, prepareOffboard, validateOffboardTx, signOffboardForfeits, finishOffboard, P2TR_DUST, } from './offboard.js'; @@ -564,16 +564,18 @@ export class ArkManager { const tip = await this.chain.tipHeight(); const satVkb = await getOffboardFeeRate(this.arkUrl); const grossSat = inputs.reduce((n, v) => n + v.amountSat, 0); - const feeSat = offboardFee({ + const feeParts = offboardFeeParts({ spkLen: spk.length, satVkb, fees: this.info.offboardFees, tip, inputs: inputs.map((v) => ({ amountSat: v.amountSat, expiryHeight: v.expiryHeight })), }); + const feeSat = feeParts.totalSat; const netSat = grossSat - feeSat; if (netSat < P2TR_DUST) throw new Error('ark balance too small to offboard after fees'); const action = { id: `offboard-${Date.now()}`, type: 'offboard', step: 'created', inputIds: inputs.map((v) => v.id), address, spkHex: hex.encode(spk), - grossSat, feeSat, netSat, rateKwu: feeRateKwu(satVkb), + grossSat, feeSat, chainFeeSat: feeParts.chainSat, serviceFeeSat: feeParts.serviceSat, + netSat, rateKwu: feeRateKwu(satVkb), }; for (const v of inputs) v.state = 'pending'; this.state.actions.push(action); @@ -626,6 +628,8 @@ export class ArkManager { this._movement({ type: 'offboard', amountSat: action.netSat, status: 'complete', txid: action.txid, detail: `fee ${action.feeSat} sat`, to: action.address, + feeSat: action.feeSat, chainFeeSat: action.chainFeeSat, serviceFeeSat: action.serviceFeeSat, + inputIds: action.inputIds, }); this._save(); } else { @@ -640,6 +644,8 @@ export class ArkManager { this._movement({ type: 'offboard', amountSat: action.netSat, status: 'complete', txid: action.txid, detail: `fee ${action.feeSat} sat`, to: action.address, + feeSat: action.feeSat, chainFeeSat: action.chainFeeSat, serviceFeeSat: action.serviceFeeSat, + inputIds: action.inputIds, }); this._save(); } -- cgit v1.2.3