Skip to content

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

@sanbir

Description

@sanbir

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions