From e2d26d506cfaff9420c9071f436afd1ac917de57 Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 12 Mar 2026 20:19:56 -0700 Subject: [PATCH] feat(rwallet): add 5 more testnet chains for EVM balance scanning Adds Arbitrum Sepolia, Optimism Sepolia, Polygon Amoy, Avalanche Fuji, and BSC Testnet with RPC URLs, native tokens, popular ERC-20s, and Alchemy slug mappings. Co-Authored-By: Claude Opus 4.6 --- .../rwallet/components/folk-wallet-viewer.ts | 5 +++ modules/rwallet/mod.ts | 37 +++++++++++++++++-- 2 files changed, 39 insertions(+), 3 deletions(-) diff --git a/modules/rwallet/components/folk-wallet-viewer.ts b/modules/rwallet/components/folk-wallet-viewer.ts index b3753c3..02cd821 100644 --- a/modules/rwallet/components/folk-wallet-viewer.ts +++ b/modules/rwallet/components/folk-wallet-viewer.ts @@ -61,6 +61,11 @@ const CHAIN_COLORS: Record = { "324": "#8c8dfc", "11155111": "#f59e0b", "84532": "#f59e0b", + "421614": "#9ca3af", + "11155420": "#ff6680", + "80002": "#a855f7", + "43113": "#fb923c", + "97": "#fbbf24", }; const CHAIN_NAMES: Record = { diff --git a/modules/rwallet/mod.ts b/modules/rwallet/mod.ts index f9f5ee1..df2b1bd 100644 --- a/modules/rwallet/mod.ts +++ b/modules/rwallet/mod.ts @@ -121,9 +121,14 @@ const CHAIN_MAP: Record = { "324": { name: "zkSync", prefix: "zksync" }, "11155111": { name: "Sepolia", prefix: "sep" }, "84532": { name: "Base Sepolia", prefix: "basesep" }, + "421614": { name: "Arbitrum Sepolia", prefix: "arbsep" }, + "11155420": { name: "Optimism Sepolia", prefix: "optsep" }, + "80002": { name: "Polygon Amoy", prefix: "polyamoy" }, + "43113": { name: "Avalanche Fuji", prefix: "avaxfuji" }, + "97": { name: "BSC Testnet", prefix: "bsctest" }, }; -const TESTNET_CHAIN_IDS = new Set(["11155111", "84532"]); +const TESTNET_CHAIN_IDS = new Set(["11155111", "84532", "421614", "11155420", "80002", "43113", "97"]); function getChains(includeTestnets: boolean): [string, { name: string; prefix: string }][] { return Object.entries(CHAIN_MAP).filter(([id]) => includeTestnets || !TESTNET_CHAIN_IDS.has(id)); @@ -151,6 +156,11 @@ const DEFAULT_RPC_URLS: Record = { "324": "https://mainnet.era.zksync.io", "11155111": "https://rpc.sepolia.org", "84532": "https://sepolia.base.org", + "421614": "https://sepolia-rollup.arbitrum.io/rpc", + "11155420": "https://sepolia.optimism.io", + "80002": "https://rpc-amoy.polygon.technology", + "43113": "https://api.avax-test.network/ext/bc/C/rpc", + "97": "https://data-seed-prebsc-1-s1.binance.org:8545", }; // Chain ID → env var name fragment + Alchemy subdomain (for auto-construct) @@ -165,8 +175,13 @@ const CHAIN_ENV_NAMES: Record "43114": { envName: "AVALANCHE" }, "56": { envName: "BSC" }, "324": { envName: "ZKSYNC" }, - "11155111": { envName: "SEPOLIA" }, - "84532": { envName: "BASE_SEPOLIA" }, + "11155111": { envName: "SEPOLIA", alchemySlug: "eth-sepolia" }, + "84532": { envName: "BASE_SEPOLIA", alchemySlug: "base-sepolia" }, + "421614": { envName: "ARB_SEPOLIA", alchemySlug: "arb-sepolia" }, + "11155420": { envName: "OPT_SEPOLIA", alchemySlug: "opt-sepolia" }, + "80002": { envName: "POLYGON_AMOY", alchemySlug: "polygon-amoy" }, + "43113": { envName: "AVAX_FUJI" }, + "97": { envName: "BSC_TESTNET" }, }; /** @@ -204,6 +219,11 @@ const NATIVE_TOKENS: Record { @@ -440,6 +460,17 @@ const POPULAR_TOKENS: Record