From f012aec416849b942ebc822b76d916aa5f43c1dc Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Fri, 31 Jul 2026 09:51:18 -0700 Subject: mintdemux: present old (recovery) keysets as inactive MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The old mint's keysets are redeem/melt-only — wallets must never mint or swap into them. Force active:false in the merged /v1/keysets so mint.coinos.io advertises a single active sat keyset (the new one) instead of two. The old mint is panic-locked (mint/swap disabled) regardless; this fixes the client-facing view a reviewer flagged. --- mintdemux.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mintdemux.ts b/mintdemux.ts index 4ae1a6fd..b205a39c 100644 --- a/mintdemux.ts +++ b/mintdemux.ts @@ -92,7 +92,13 @@ Bun.serve({ if (path === "/v1/keysets") { const [rn, ro] = await Promise.all([fetch(`${NEW}/v1/keysets`).then(r => r.json()).catch(() => ({})), fetch(`${OLD}/v1/keysets`).then(r => r.json()).catch(() => ({}))]); const seen = new Set(); const keysets: any[] = []; - for (const k of [...((rn as any).keysets || []), ...((ro as any).keysets || [])]) { const id = String(k.id); if (!seen.has(id)) { seen.add(id); keysets.push(k); } } + // NEW mint keysets keep their flags. OLD (recovery) keysets are forced + // active:false — they're redeem/melt-only, so wallets never mint or swap + // into them. Prevents advertising two active "sat" keysets at + // mint.coinos.io (the old mint is panic-locked anyway; this is the + // client-facing view). + for (const k of ((rn as any).keysets || [])) { const id = String(k.id); if (!seen.has(id)) { seen.add(id); keysets.push(k); } } + for (const k of ((ro as any).keysets || [])) { const id = String(k.id); if (!seen.has(id)) { seen.add(id); keysets.push({ ...k, active: false }); } } return new Response(JSON.stringify({ keysets }), { headers: J }); } const km = path.match(/^\/v1\/keys\/(.+)$/); -- cgit v1.2.3