diff --git a/src/lib/resolver-web.js b/src/lib/resolver-web.js index 008cef8..4660e0b 100644 --- a/src/lib/resolver-web.js +++ b/src/lib/resolver-web.js @@ -443,6 +443,14 @@ export async function resolveName(input, opts = {}) { return index.get(name) ?? null; } +// Open one electrum connection against the pool and return the raw client, so +// callers can do ad-hoc queries or drive a delta-refresh loop (fetch just the +// tx bodies they don't already have). Same connection strategy buildIndex uses +// — try hostname first, fall back to pinned-IP+SNI when directIP is on. +export async function connectElectrum({ electrum = CHIPNET_ELECTRUM, WebSocket: WS, directIP = false } = {}) { + return connectAny(electrum, WS, { directIP }); +} + // ---- on-chain electrum discovery (step 2) -------------------------------- // The name ELECTRUM_LIST_NAME carries the current server pool in an "el" record: // a space-separated list of tokens, each "wss://host:port" or "wss://host:port|ip"