duneanalytics / duneanalytics/evm.codes

chore: improve etherscan v2 DX (configurable chainid + explicit errors)

Open
#411 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
827
Forks
199
Avg merge
15m
Merged PRs (30d)
1

Description

Summary

Follow-up to the Etherscan V2 migration for Contract Viewer.

Problem

After switching from the deprecated V1 endpoint to V2, there are two developer-experience gaps:

  1. chainid is hardcoded to mainnet (1), making non-mainnet usage harder.
  2. parser errors collapse to a generic etherscan response is not OK, which hides actionable upstream messages (e.g. invalid API key, unverified source, rate limits).

Proposal

  • Make chain id configurable via env (e.g. ETHERSCAN_CHAIN_ID, default 1).
  • Preserve Etherscan result/message in thrown parser errors so users can diagnose quickly.

Context

  • Related PR: #398
  • Affected paths: util/EtherscanApi.ts, util/EtherscanParser.ts

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading util/EtherscanApi.ts and util/EtherscanParser.ts, then trace how the Contract Viewer requests Etherscan V2 data and handles parser failures. Implement the configurable chain ID with a default of 1 and preserve Etherscan result/message details in thrown errors. Done means non-mainnet configuration works and upstream messages remain visible instead of only the generic error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, blockchain
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.