From 3a947830743f1db247ae0969378efe540f813342 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Sat, 29 Aug 2026 08:45:30 -0700 Subject: Staging gets the mainnet fee model end to end: /lnquote?network=mutinynet quotes from the staging ASP's own CLN (helpers take their backend), the client asks it by default on mutinynet, and the quote URL concat survives a query string Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_019WboeoetMF3MTmgT7Ew8yi --- src/ark/lightning.js | 3 ++- src/ark/manager.js | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ark/lightning.js b/src/ark/lightning.js index da5ad8e..0ac80a5 100644 --- a/src/ark/lightning.js +++ b/src/ark/lightning.js @@ -119,7 +119,8 @@ export const lnReceiveFee = (amountSat, fees) => // surplus to CLN as the routing budget, so this number is the user's entire // network cost — 0 between wallets on this ASP and to direct peers. export async function fetchLnRouteFee(quoteUrl, invoice, amountSat) { - const r = await fetch(`${quoteUrl}?invoice=${encodeURIComponent(invoice)}&amount_msat=${amountSat * 1000}`); + const sep = quoteUrl.includes('?') ? '&' : '?'; + const r = await fetch(`${quoteUrl}${sep}invoice=${encodeURIComponent(invoice)}&amount_msat=${amountSat * 1000}`); if (!r.ok) throw new Error(`quote failed: ${r.status}`); const d = await r.json(); if (d.error) throw new Error(d.error); diff --git a/src/ark/manager.js b/src/ark/manager.js index 920eda3..e60d2f3 100644 --- a/src/ark/manager.js +++ b/src/ark/manager.js @@ -75,7 +75,9 @@ export class ArkManager { this.network = network; // where to ask what a lightning payment's route will cost (names /lnquote) this.lnQuoteUrl = lnQuoteUrl !== undefined ? lnQuoteUrl - : (network === 'mainnet' ? 'https://names.halwallet.app/lnquote' : null); + : network === 'mainnet' ? 'https://names.halwallet.app/lnquote' + : network === 'mutinynet' ? 'https://names.halwallet.app/lnquote?network=mutinynet' + : null; this.onUpdate = onUpdate || (() => {}); this.state = null; this.info = null; -- cgit v1.2.3