aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/api.js22
-rw-r--r--src/swap.js2
-rw-r--r--src/wallet.js5
3 files changed, 22 insertions, 7 deletions
diff --git a/src/api.js b/src/api.js
index 10bbc1a..e011e9c 100644
--- a/src/api.js
+++ b/src/api.js
@@ -32,6 +32,7 @@ const NETWORK_KEY = 'btc-wallet-network';
export const NETWORKS = [
{ id: 'mainnet', label: 'Mainnet' },
{ id: 'testnet', label: 'Testnet' },
+ { id: 'signet', label: 'Signet' },
{ id: 'mutinynet', label: 'Mutinynet' },
{ id: 'regtest', label: 'Regtest' },
];
@@ -71,6 +72,11 @@ const DATA_SOURCES_BY_NET = {
{ id: 'blockstreamel', label: 'blockstream.info (Electrum)', type: 'electrum', url: 'wss://blockstream.info/testnet/electrum-websocket/' },
{ id: 'custom', label: 'Custom', type: 'auto', url: '' },
],
+ signet: [
+ { id: 'mempool', label: 'mempool.space', type: 'esplora', base: 'https://mempool.space/signet/api', web: 'https://mempool.space/signet', kind: 'mempool' },
+ { id: 'second', label: 'esplora.signet.2nd.dev', type: 'esplora', base: 'https://esplora.signet.2nd.dev', web: 'https://mempool.space/signet', kind: 'esplora' },
+ { id: 'custom', label: 'Custom', type: 'auto', url: '' },
+ ],
mutinynet: [
{ id: 'mutinynet', label: 'mutinynet.com', type: 'esplora', base: 'https://mutinynet.com/api', web: 'https://mutinynet.com', kind: 'esplora' },
{ id: 'custom', label: 'Custom', type: 'auto', url: '' },
@@ -81,7 +87,7 @@ const DATA_SOURCES_BY_NET = {
{ id: 'custom', label: 'Custom', type: 'auto', url: '' },
],
};
-const DATA_SOURCE_DEFAULT = { mainnet: 'coinos', testnet: 'mempool', mutinynet: 'mutinynet', regtest: 'local' };
+const DATA_SOURCE_DEFAULT = { mainnet: 'coinos', testnet: 'mempool', signet: 'mempool', mutinynet: 'mutinynet', regtest: 'local' };
export function dataSources(net = getNetwork()) { return DATA_SOURCES_BY_NET[net] || DATA_SOURCES_BY_NET.mainnet; }
const detectType = (url) => (/^wss?:\/\//i.test((url || '').trim()) ? 'electrum' : 'esplora');
@@ -90,6 +96,7 @@ const detectType = (url) => (/^wss?:\/\//i.test((url || '').trim()) ? 'electrum'
const NET_DEFAULTS = {
mainnet: { mode: 'electrum', electrum: 'coinos', explorer: 'mempool' },
testnet: { mode: 'esplora', electrum: 'blockstreamel', explorer: 'mempool' },
+ signet: { mode: 'esplora', electrum: 'custom', explorer: 'mempool' },
mutinynet: { mode: 'esplora', electrum: 'custom', explorer: 'mutinynet' },
regtest: { mode: 'electrum', electrum: 'local', explorer: 'localesplora' },
};
@@ -168,7 +175,8 @@ export function getBoltzProviderId() {
const net = getNetwork(); // default per network
// Mainnet defaults to public Boltz Exchange until our own swap.coinos.io
// node ('coinos') has channel liquidity; flip this to 'coinos' once funded.
- return net === 'regtest' ? 'local' : net === 'mutinynet' ? 'staging' : 'boltz';
+ // No Boltz-compatible instance runs on signet, so it defaults to custom/empty.
+ return net === 'regtest' ? 'local' : net === 'mutinynet' ? 'staging' : net === 'signet' ? 'custom' : 'boltz';
}
export function setBoltzProviderId(id) { try { localStorage.setItem(BOLTZ_PROVIDER_KEY, id); } catch {} }
@@ -198,6 +206,11 @@ const ARK_PRESETS_BY_NET = {
{ id: 'off', label: 'Off', ark: '', esplora: '' },
{ id: 'custom', label: 'Custom…', ark: '', esplora: '' },
],
+ signet: [
+ { id: 'off', label: 'Off', ark: '', esplora: '' },
+ { id: 'second', label: 'Second (ark.signet.2nd.dev)', ark: 'https://ark.signet.2nd.dev', esplora: 'https://esplora.signet.2nd.dev' },
+ { id: 'custom', label: 'Custom…', ark: '', esplora: '' },
+ ],
mutinynet: [
{ id: 'off', label: 'Off', ark: '', esplora: '' },
{ id: 'custom', label: 'Custom…', ark: '', esplora: '' },
@@ -210,7 +223,7 @@ const ARK_PRESETS_BY_NET = {
};
// 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_DEFAULT = { mainnet: 'second', testnet: 'off', signet: 'second', 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
@@ -251,10 +264,11 @@ export function getArkConfig(net = getNetwork()) {
const SP_INDEXER_PRESETS_BY_NET = {
mainnet: [{ id: 'coinos', label: 'coinos', url: 'https://sp.coinos.io' }, { id: 'custom', label: 'Custom', url: '' }],
testnet: [{ id: 'custom', label: 'Custom', url: '' }],
+ signet: [{ id: 'custom', label: 'Custom', url: '' }],
mutinynet: [{ id: 'custom', label: 'Custom', url: '' }],
regtest: [{ id: 'local', label: 'Local (proxied)', url: '/sp' }, { id: 'custom', label: 'Custom', url: '' }],
};
-const SP_INDEXER_DEFAULT = { mainnet: 'coinos', testnet: 'custom', mutinynet: 'custom', regtest: 'local' };
+const SP_INDEXER_DEFAULT = { mainnet: 'coinos', testnet: 'custom', signet: 'custom', mutinynet: 'custom', regtest: 'local' };
const SP_INDEXER_KEY = 'btc-wallet-sp-indexer';
export function spIndexerPresets(net = getNetwork()) { return SP_INDEXER_PRESETS_BY_NET[net] || SP_INDEXER_PRESETS_BY_NET.mainnet; }
export function getSpIndexerConfig(net = getNetwork()) {
diff --git a/src/swap.js b/src/swap.js
index d7a1e9c..7aec8cd 100644
--- a/src/swap.js
+++ b/src/swap.js
@@ -25,7 +25,7 @@ export const REGTEST = { ...btc.TEST_NETWORK, bech32: 'bcrt' };
// mutinynet is a signet — same address params as testnet (tb1…), matching Boltz's
// bitcoinSignet. Without this entry netFor() falls back to mainnet and the swap
// P2TR address is computed wrong → "lockup address mismatch".
-const NETS = { mainnet: btc.NETWORK, testnet: btc.TEST_NETWORK, mutinynet: btc.TEST_NETWORK, regtest: REGTEST };
+const NETS = { mainnet: btc.NETWORK, testnet: btc.TEST_NETWORK, signet: btc.TEST_NETWORK, mutinynet: btc.TEST_NETWORK, regtest: REGTEST };
export const netFor = (name) => NETS[name] || btc.NETWORK;
const TAP_LEAF_VERSION = 0xc0;
diff --git a/src/wallet.js b/src/wallet.js
index 647db99..93ebe63 100644
--- a/src/wallet.js
+++ b/src/wallet.js
@@ -55,8 +55,9 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
export const NETS = {
mainnet: { net: btc.NETWORK, coin: 0 },
testnet: { net: btc.TEST_NETWORK, coin: 1 },
- // mutinynet is a signet — same address format / version bytes / coin type as
- // testnet (`tb` HRP); only the chain + servers differ.
+ // signet + mutinynet share testnet's address format / version bytes / coin
+ // type (`tb` HRP); only the chain + servers differ.
+ signet: { net: btc.TEST_NETWORK, coin: 1 },
mutinynet: { net: btc.TEST_NETWORK, coin: 1 },
// Regtest shares testnet's version bytes / coin type; only the bech32 HRP
// differs (`bcrt`). @scure/btc-signer derives addresses + validates from this.