-
Notifications
You must be signed in to change notification settings - Fork 237
fix: etherscan urls #758
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
fix: etherscan urls #758
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
118 changes: 60 additions & 58 deletions
118
...es/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,73 +1,75 @@ | ||
| import { NetworkNames } from '@enkryptcom/types'; | ||
|
|
||
| const NetworkEndpoints: Record<string, string> = { | ||
| [NetworkNames.Ethereum]: 'https://eth.blockscout.com/', | ||
| [NetworkNames.Binance]: 'https://api.bscscan.com/', | ||
| [NetworkNames.Matic]: 'https://polygon.blockscout.com/', | ||
| [NetworkNames.Moonbeam]: 'https://api-moonbeam.moonscan.io/', | ||
| [NetworkNames.Moonriver]: 'https://api-moonriver.moonscan.io/', | ||
| [NetworkNames.KaruraEVM]: 'https://blockscout.karura.network/', | ||
| [NetworkNames.AstarEVM]: 'https://blockscout.com/astar/', | ||
| [NetworkNames.ShidenEVM]: 'https://blockscout.com/shiden/', | ||
| [NetworkNames.Optimism]: 'https://api-optimistic.etherscan.io/', | ||
| [NetworkNames.EdgeEVM]: 'https://edgscan.live/', | ||
| [NetworkNames.Rootstock]: 'https://blockscout.com/rsk/mainnet/', | ||
| [NetworkNames.RootstockTestnet]: 'https://rootstock-testnet.blockscout.com/', | ||
| [NetworkNames.Ethereum]: 'https://eth.blockscout.com/api?', | ||
| [NetworkNames.Binance]: 'https://api.etherscan.io/v2/api?chainid=56&', | ||
| [NetworkNames.Matic]: 'https://polygon.blockscout.com/api?', | ||
| [NetworkNames.Moonbeam]: 'https://api.etherscan.io/v2/api?chainid=1284&', | ||
| [NetworkNames.Moonriver]: 'https://api.etherscan.io/v2/api?chainid=1285&', | ||
| [NetworkNames.KaruraEVM]: 'https://blockscout.karura.network/api?', | ||
| [NetworkNames.AstarEVM]: 'https://blockscout.com/astar/api?', | ||
| [NetworkNames.ShidenEVM]: 'https://blockscout.com/shiden/api?', | ||
| [NetworkNames.Optimism]: 'https://api.etherscan.io/v2/api?chainid=10&', | ||
| [NetworkNames.EdgeEVM]: 'https://edgscan.live/api?', | ||
| [NetworkNames.Rootstock]: 'https://blockscout.com/rsk/mainnet/api?', | ||
| [NetworkNames.RootstockTestnet]: | ||
| 'https://rootstock-testnet.blockscout.com/api?', | ||
| [NetworkNames.SkaleBlockBrawlers]: | ||
| 'https://frayed-decent-antares.explorer.mainnet.skalenodes.com/', | ||
| 'https://frayed-decent-antares.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleCalypso]: | ||
| 'https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com/', | ||
| 'https://honorable-steel-rasalhague.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleCryptoBlades]: | ||
| 'https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com/', | ||
| 'https://affectionate-immediate-pollux.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleCryptoColosseum]: | ||
| 'https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com/', | ||
| 'https://haunting-devoted-deneb.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleEuropa]: | ||
| 'https://elated-tan-skat.explorer.mainnet.skalenodes.com/', | ||
| 'https://elated-tan-skat.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleExorde]: | ||
| 'https://light-vast-diphda.explorer.mainnet.skalenodes.com/', | ||
| 'https://light-vast-diphda.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleNebula]: | ||
| 'https://green-giddy-denebola.explorer.mainnet.skalenodes.com/', | ||
| 'https://green-giddy-denebola.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.SkaleTitan]: | ||
| 'https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/', | ||
| [NetworkNames.ZkSync]: 'https://block-explorer-api.mainnet.zksync.io/', | ||
| [NetworkNames.Arbitrum]: 'https://api.arbiscan.io/', | ||
| [NetworkNames.ArbitrumNova]: 'https://nova-explorer.arbitrum.io/', | ||
| [NetworkNames.Gnosis]: 'https://api.gnosisscan.io/', | ||
| [NetworkNames.Avalanche]: 'https://api.snowtrace.io/', | ||
| [NetworkNames.Aurora]: 'https://explorer.mainnet.aurora.dev/', | ||
| [NetworkNames.PuppyNet]: 'https://puppyscan.shib.io/', | ||
| [NetworkNames.Shibarium]: 'https://www.shibariumscan.io/', | ||
| [NetworkNames.MaticZK]: 'https://api-zkevm.polygonscan.com/', | ||
| [NetworkNames.Base]: 'https://api.basescan.org/', | ||
| [NetworkNames.Celo]: 'https://explorer.celo.org/mainnet/', | ||
| [NetworkNames.SyscoinNEVMTest]: 'https://explorer.tanenbaum.io/', | ||
| [NetworkNames.SyscoinNEVM]: 'https://explorer.syscoin.org/', | ||
| [NetworkNames.RolluxTest]: 'https://rollux.tanenbaum.io/', | ||
| [NetworkNames.Rollux]: 'https://explorer.rollux.com/', | ||
| [NetworkNames.Blast]: 'https://api.blastscan.io/', | ||
| [NetworkNames.Sanko]: 'https://explorer.sanko.xyz/', | ||
| [NetworkNames.Sonic]: 'https://api.sonicscan.org/', | ||
| [NetworkNames.Degen]: 'https://explorer.degen.tips/', | ||
| [NetworkNames.Ink]: 'https://explorer.inkonchain.com/', | ||
| [NetworkNames.ImmutableZkevm]: 'https://explorer.immutable.com/', | ||
| [NetworkNames.Rari]: 'https://mainnet.explorer.rarichain.org/', | ||
| [NetworkNames.Forma]: 'https://explorer.forma.art/', | ||
| [NetworkNames.XLayer]: 'https://www.oklink.com/api/v5/explorer/xlayer/', | ||
| [NetworkNames.Linea]: 'https://api.lineascan.build/', | ||
| [NetworkNames.MantaPacific]: 'https://pacific-explorer.manta.network/', | ||
| [NetworkNames.Mode]: 'https://explorer.mode.network/', | ||
| [NetworkNames.ProofOfPlayApex]: 'https://explorer.apex.proofofplay.com/', | ||
| [NetworkNames.Scroll]: 'https://api.scrollscan.com/', | ||
| [NetworkNames.Fraxtal]: 'https://api.fraxscan.com/', | ||
| [NetworkNames.Coti]: 'https://mainnet.cotiscan.io/', | ||
| 'https://parallel-stormy-spica.explorer.mainnet.skalenodes.com/api?', | ||
| [NetworkNames.ZkSync]: 'https://block-explorer-api.mainnet.zksync.io/api?', | ||
| [NetworkNames.Arbitrum]: 'https://api.etherscan.io/v2/api?chainid=42161&', | ||
| [NetworkNames.ArbitrumNova]: 'https://api.etherscan.io/v2/api?chainid=42170&', | ||
| [NetworkNames.Gnosis]: 'https://api.etherscan.io/v2/api?chainid=100&', | ||
| [NetworkNames.Avalanche]: 'https://api.snowtrace.io/api?', | ||
| [NetworkNames.Aurora]: 'https://explorer.mainnet.aurora.dev/api?', | ||
| [NetworkNames.PuppyNet]: 'https://puppyscan.shib.io/api?', | ||
| [NetworkNames.Shibarium]: 'https://www.shibariumscan.io/api?', | ||
| [NetworkNames.MaticZK]: 'https://api.etherscan.io/v2/api?chainid=1101&', | ||
| [NetworkNames.Base]: 'https://api.etherscan.io/v2/api?chainid=8453&', | ||
| [NetworkNames.Celo]: 'https://explorer.celo.org/mainnet/api?', | ||
| [NetworkNames.SyscoinNEVMTest]: 'https://explorer.tanenbaum.io/api?', | ||
| [NetworkNames.SyscoinNEVM]: 'https://explorer.syscoin.org/api?', | ||
| [NetworkNames.RolluxTest]: 'https://rollux.tanenbaum.io/api?', | ||
| [NetworkNames.Rollux]: 'https://explorer.rollux.com/api?', | ||
| [NetworkNames.Blast]: 'https://api.etherscan.io/v2/api?chainid=81457&', | ||
| [NetworkNames.Sanko]: 'https://explorer.sanko.xyz/api?', | ||
| [NetworkNames.Sonic]: 'https://api.etherscan.io/v2/api?chainid=146&', | ||
| [NetworkNames.Degen]: 'https://explorer.degen.tips/api?', | ||
| [NetworkNames.Ink]: 'https://explorer.inkonchain.com/api?', | ||
| [NetworkNames.ImmutableZkevm]: 'https://explorer.immutable.com/api?', | ||
| [NetworkNames.Rari]: 'https://mainnet.explorer.rarichain.org/api?', | ||
| [NetworkNames.Forma]: 'https://explorer.forma.art/api?', | ||
| [NetworkNames.XLayer]: 'https://www.oklink.com/api/v5/explorer/xlayer/api?', | ||
| [NetworkNames.Linea]: 'https://api.lineascan.build/api?', | ||
| [NetworkNames.MantaPacific]: 'https://pacific-explorer.manta.network/api?', | ||
| [NetworkNames.Mode]: 'https://explorer.mode.network/api?', | ||
| [NetworkNames.ProofOfPlayApex]: 'https://explorer.apex.proofofplay.com/api?', | ||
| [NetworkNames.Scroll]: 'https://api.scrollscan.com/api?', | ||
| [NetworkNames.Fraxtal]: 'https://api.etherscan.io/v2/api?chainid=252&', | ||
| [NetworkNames.Coti]: 'https://mainnet.cotiscan.io/api?', | ||
| [NetworkNames.CytonicTestnet]: | ||
| 'https://explorer-api.evm.testnet.cytonic.com/api/', | ||
| [NetworkNames.Derive]: 'https://explorer.derive.xyz/', | ||
| [NetworkNames.Conflux]: 'https://evmapi.confluxscan.org/', | ||
| [NetworkNames.Hemi]: 'https://explorer.hemi.xyz/', | ||
| [NetworkNames.AppLayerTestnet]: 'https://testnet-explorer.applayer.com/api/', | ||
| [NetworkNames.EthereumClassic]: 'https://etc.blockscout.com/', | ||
| [NetworkNames.TAC]: 'https://explorer.tac.build/', | ||
| 'https://explorer-api.evm.testnet.cytonic.com/api/api?', | ||
| [NetworkNames.Derive]: 'https://explorer.derive.xyz/api?', | ||
| [NetworkNames.Conflux]: 'https://evmapi.confluxscan.org/api?', | ||
| [NetworkNames.Hemi]: 'https://explorer.hemi.xyz/api?', | ||
| [NetworkNames.AppLayerTestnet]: | ||
| 'https://testnet-explorer.applayer.com/api/api?', | ||
| [NetworkNames.EthereumClassic]: 'https://etc.blockscout.com/api?', | ||
| [NetworkNames.TAC]: 'https://explorer.tac.build/api?', | ||
| }; | ||
|
|
||
| export { NetworkEndpoints }; | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Endpoint normalization looks coherent; verify provider mix and trailing delimiters.
?vs&is consistent with the new URL builder in this PR, but becomes unnecessary if we adopt URLSearchParams in index.ts.chainid, and several custom explorers. This can change payload nuances.Run this to sanity‑check all endpoints end with
?or&and to flag any double/api/api?:If adopting URLSearchParams in index.ts, consider dropping the trailing delimiters entirely in this map to reduce config footguns.
🏁 Script executed:
Length of output: 175
Fix duplicated
/api/api?entries & consider removing trailing delimiters?or&. Two entries contain a duplicated/api/api?in packages/extension/src/providers/ethereum/libs/activity-handlers/providers/etherscan/configs.ts:/api?) or the provider's canonical base URL.?/&from this map to avoid config footguns.