From fd5306a3091e14904c06c09b03bb59ca7ea597de Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 3 Jul 2026 19:09:06 -0700 Subject: Ark: on by default with a per-network default server MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mainnet defaults to Second (ark.second.tech), regtest to the local stack. Testnet/mutinynet get their own preset lists (off/custom only — no public ASP exists there) instead of falling back to mainnet's, and stay off by default. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy --- src/api.js | 15 ++++++++++++++- src/i18n.js | 2 +- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/api.js b/src/api.js index 17deded..10bbc1a 100644 --- a/src/api.js +++ b/src/api.js @@ -192,12 +192,25 @@ const ARK_PRESETS_BY_NET = { { id: 'second', label: 'Second (ark.second.tech)', ark: 'https://ark.second.tech', esplora: 'https://mempool.second.tech/api' }, { id: 'custom', label: 'Custom…', ark: '', esplora: '' }, ], + // No public ASP on these networks (Second runs signet + mainnet only) — + // custom lets you point at a self-hosted captaind. + testnet: [ + { id: 'off', label: 'Off', ark: '', esplora: '' }, + { id: 'custom', label: 'Custom…', ark: '', esplora: '' }, + ], + mutinynet: [ + { id: 'off', label: 'Off', ark: '', esplora: '' }, + { id: 'custom', label: 'Custom…', ark: '', esplora: '' }, + ], regtest: [ { id: 'off', label: 'Off', ark: '', esplora: '' }, { id: 'local', label: 'Local (regtest)', ark: 'http://localhost:3535', esplora: 'http://localhost:30002' }, { id: 'custom', label: 'Custom…', ark: '', esplora: '' }, ], }; +// On by default where a known-good server exists; the Settings card can +// always turn it off. +const ARK_DEFAULT = { mainnet: 'second', testnet: 'off', mutinynet: 'off', regtest: 'local' }; const ARK_PROVIDER_KEY = 'btc-wallet-ark-provider'; // selected preset id, per network const ARK_CUSTOM_KEY = 'btc-wallet-ark-custom'; // { ark, esplora } for custom, per network @@ -209,7 +222,7 @@ export function getArkProviderId(net = getNetwork()) { const id = localStorage.getItem(nk(ARK_PROVIDER_KEY, net)); if (id && arkPresets(net).some((p) => p.id === id)) return id; } catch {} - return 'off'; + return ARK_DEFAULT[net] || 'off'; } export function setArkProviderId(id, net = getNetwork()) { try { localStorage.setItem(nk(ARK_PROVIDER_KEY, net), id); } catch {} diff --git a/src/i18n.js b/src/i18n.js index cb5efb2..77a14c5 100644 --- a/src/i18n.js +++ b/src/i18n.js @@ -351,7 +351,7 @@ const STR = { receiveSpTab: 'Silent payment', receiveArkTab: 'Ark', arkReceiveIntro: 'Receive instantly over Ark — off-chain, self-custodial, no fees.', - arkDesc: 'Off-chain payments via an Ark server: instant, no mining fees, self-custodial (you can always exit on-chain). Off unless you pick a server.', + arkDesc: 'Off-chain payments via an Ark server: instant, no mining fees, self-custodial (you can always exit on-chain).', arkServerUrl: 'Ark server URL', arkEsploraUrl: 'Esplora URL (chain source)', arkWatchOnly: 'Ark needs the wallet keys — load the seed to use it.', -- cgit v1.2.3