aboutsummaryrefslogtreecommitdiffstats
path: root/src/api.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-07-03 19:09:06 -0700
committerAdam Soltys <[email protected]>2026-07-03 19:09:06 -0700
commitfd5306a3091e14904c06c09b03bb59ca7ea597de (patch)
tree1dfc7600967c1c753705707fdc5965945b04368b /src/api.js
parent61f1b8e45f64c490cace9c4d1e82198ed5bac33c (diff)
downloadcoinosv3-fd5306a3091e14904c06c09b03bb59ca7ea597de.tar.gz
coinosv3-fd5306a3091e14904c06c09b03bb59ca7ea597de.zip
Ark: on by default with a per-network default server
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 <[email protected]> Claude-Session: https://claude.ai/code/session_01QFAcD4V284DvYZZHP7Rxxy
Diffstat (limited to 'src/api.js')
-rw-r--r--src/api.js15
1 files changed, 14 insertions, 1 deletions
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 {}