feat(networks): add 5 EVM testnets from metadata v1.2.1-alpha.0#361
Merged
AugustoL merged 2 commits intoApr 22, 2026
Merged
Conversation
Bumps @openscan/metadata to 1.2.1-alpha.0 and registers Arbitrum Sepolia (421614), Optimism Sepolia (11155420), Base Sepolia (84532), Polygon Amoy (80002), and Avalanche Fuji (43113). Each new chain ID is mapped to its L1 family adapter (Arbitrum, OP, Base, Polygon, EVM) in AdapterFactory. Since @openscan/network-connectors does not yet register these testnet chain IDs in its ClientFactory, DataService instantiates the L1 family client directly for them. The L2 adapter constructors and AppChainId are widened to accept the new testnet chain IDs.
Types EVM_TESTNET_CLIENTS to return the client union instead of unknown so AdapterFactory.createAdapter can keep its strict client union without `| unknown`. Also narrows PolygonAdapter's constructor from SupportedChainId to `137 | 80002` to match sibling L2 adapters.
|
🚀 Preview: https://pr-361--openscan.netlify.app |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds 5 EVM testnets introduced in explorer-metadata PR #16 (released as
@openscan/metadata@1.2.1-alpha.0): Arbitrum Sepolia (421614), Optimism Sepolia (11155420), Base Sepolia (84532), Polygon Amoy (80002), and Avalanche Fuji (43113).Each new chain ID is routed to its L1 family's adapter so block/tx/account pages render the right L2-specific fields (Arbitrum
l1BlockNumber/sendCount/sendRoot, OP/Basel1Fee/l1GasPrice/l1GasUsed).Related Issue
N/A — follows explorer-metadata#16.
Type of Change
Changes Made
METADATA_VERSIONto1.2.1-alpha.0(src/services/MetadataService.ts) — fetches refreshed RPCs, new testnet RPC lists, and new logos from jsDelivr. Also acts as localStorage cache-bust.src/config/networks.jsonwith slugsarb-sepolia,op-sepolia,base-sepolia,polygon-amoy,avax-fuji, each markedisTestnet: truewith logo, color, currency, and faucet/bridge/docs links.AdapterFactory(src/services/adapters/adaptersFactory.ts):421614→ArbitrumAdapter11155420→OptimismAdapter84532→BaseAdapter80002→PolygonAdapter43113→EVMAdapter(same as Avalanche mainnet)ClientFactorysupport (src/services/DataService.ts) —@openscan/network-connectorsdoes not yet register these testnet chain IDs in itsCHAIN_REGISTRY, which would causeClientFactory.createTypedClientto throw at runtime.DataServicenow instantiates the L1 family's client directly for the 5 testnet chain IDs via anEVM_TESTNET_CLIENTSlookup (they share the same JSON-RPC surface).AppChainIdand L2 adapter constructor types to accept the new testnet chain IDs alongside their mainnet pair (42161 | 421614,10 | 11155420,8453 | 84532,137 | 80002).PolygonAdapterconstructor type fromSupportedChainIdto137 | 80002to match sibling L2 adapters (refactor commit).Screenshots
N/A — CDN-sourced logos and existing EVM page layouts.
Checklist
npm run format:fixandnpm run lint:fixnpm run typecheckwith no errorsnpm run test:run(88/88 pass)Additional Notes
BUILTIN_RPC_DEFAULTS(src/utils/rpcStorage.ts): the new testnets fetch RPCs purely from the metadata CDN, matching the pattern used by Sepolia and BSC Testnet.@openscan/network-connectors: once the library registers these 5 chain IDs in itsCHAIN_REGISTRY, theEVM_TESTNET_CLIENTSworkaround inDataService.tscan be removed and the widened types collapsed back.OPENSCAN_METADATA_RPCS, reload, confirm the new cache entry'sversionis"1.2.1-alpha.0"./arb-sepolia,/op-sepolia,/base-sepolia,/polygon-amoy,/avax-fujiand confirm each network dashboard loads with block number + gas price.l1BlockNumberrenders; on OP/Base Sepolia open a transaction and verify L1 fee fields.tracking/isOpenSourcemetadata from v1.2.1.