Conversation
Replace the hardcoded `chainIdMap` and `chainNameMap` with two data
files in `data/`:
data/etherscan-chains.csv 64 chains, Etherscan V2 supported
(chainId,name)
data/blockscout-chains.csv 723 chains with a Blockscout instance
(chainId,url); Etherscan chains are
pre-filtered out so Etherscan wins for
chains on both
`src/chains.js` is now just a minimal CSV loader (no external deps,
no quoting). `src/main.js` resolves in this order:
1. etherscanChains[chainId] β Etherscan V2 (preferred)
2. blockscoutChains[chainId] β Blockscout V2
3. error β chain not in any registry
The Blockscout fetch + multi-file parser are added (carried over from
the original Robinhood Chain support, now generalised via the CSV).
Validation is relaxed from `^\d+$` to `^[A-Za-z0-9_-]+$` so newer
chains with alphanumeric IDs (e.g. `5dax`, `arise`) work.
Verified end-to-end:
- Ethereum / Polygon / Gnosis β Etherscan V2
- Scroll / ZetaChain β Blockscout V2
- Unknown chain β clear error pointing at the CSVs
Refresh workflow: edit the CSVs, no code changes needed.
π€ Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
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.
Summary
Replaces the hardcoded
chainIdMap/chainNameMapchain alias tableswith two data files in
data/:data/etherscan-chains.csvchainId,namedata/blockscout-chains.csvchainId,url(Etherscan chains excluded)src/chains.jsis now a minimal CSV loader (no external deps, noquoting).
src/main.jsresolves in this order:etherscanChains[chainId]β Etherscan V2 (preferred for chains it supports)blockscoutChains[chainId]β Blockscout V2 (chains not on Etherscan)The Blockscout V2 fetcher and multi-file source parser are included
so any chain with a Blockscout instance (not just the ones the tool
originally supported) works out of the box.
Validation is relaxed from
^\d+$to^[A-Za-z0-9_-]+$so newerchains with alphanumeric IDs (e.g.
5dax,arise) work.Files changed
Verified end-to-end
Refresh workflow
For new Etherscan chains: append to
data/etherscan-chains.csvandremove from
data/blockscout-chains.csv. For new Blockscout-onlychains: append to
data/blockscout-chains.csv. No code changes.