diff --git a/modules/rwallet/mod.ts b/modules/rwallet/mod.ts index 9f96b17..fbad47a 100644 --- a/modules/rwallet/mod.ts +++ b/modules/rwallet/mod.ts @@ -70,6 +70,15 @@ routes.get("/api/safe/detect/:address", async (c) => { }) ); + // Always include testnet chains when toggled on (skip detection) + if (includeTestnets) { + for (const [chainId, info] of Object.entries(CHAIN_MAP)) { + if (TESTNET_CHAIN_IDS.has(chainId) && !results.some((r) => r.chainId === chainId)) { + results.push({ chainId, name: info.name, prefix: info.prefix }); + } + } + } + return c.json({ address, chains: results.sort((a, b) => a.name.localeCompare(b.name)) }); }); @@ -341,6 +350,15 @@ routes.get("/api/eoa/detect/:address", async (c) => { }) ); + // Always include testnet chains when toggled on (skip detection) + if (includeTestnets) { + for (const [chainId, info] of Object.entries(CHAIN_MAP)) { + if (TESTNET_CHAIN_IDS.has(chainId) && !results.some((r) => r.chainId === chainId)) { + results.push({ chainId, name: info.name, prefix: info.prefix, balance: "0x0" }); + } + } + } + return c.json({ address, chains: results.sort((a, b) => a.name.localeCompare(b.name)) }); });