Skip to content

feat(adapter-evm): add opt-in evmLocalhost and an explorer-only config for createExplorer - #93

Merged
pasevin merged 7 commits into
mainfrom
005-adapter-requests
Nov 15, 2026
Merged

pasevin merged 7 commits into
mainfrom
005-adapter-requests

Conversation

@pasevin

@pasevin pasevin commented Nov 12, 2026

Copy link
Copy Markdown
Collaborator

two small additions to the EVM adapters, both opt-in. Nothing changes for apps that don't use them.

local devnet config. evmLocalhost is a ready-made config for chain 31337 (Anvil, Hardhat, Foundry) on the default http://127.0.0.1:8545. You import it from @openzeppelin/adapter-evm/networks or the package root. I kept it out of evmNetworks, evmMainnetNetworks and evmTestnetNetworks on purpose: those lists feed every app's wallet chain set, the network catalog and the ecosystem definition. So wallet connect and wallet-signed writes don't work on it, read-only calls do. A different port goes through rpcEndpoints['evm-localhost'].

Closes #91

explorer-only config. createExplorer now also takes EvmExplorerNetworkConfig, which holds just the seven fields the explorer path reads. A browser app can build explorer links without shipping an RPC URL or writing rpcUrl: ''. A full network config still works, and links come out the same as before. resolveExplorerConfig, getEvmExplorerAddressUrl and getEvmExplorerTxUrl accept the narrower type too.

Closes #92

release note. changesets bumps @openzeppelin/adapters-vite to a major here because it peers on the adapters. That's the usual pattern in this repo, nothing breaks in it.

how I checked it

  • unit and type-level tests for both: the localhost config and its isolation from the shared lists, and the explorer type's field set, assignability and parity with main across every shipped network
  • against the built packages: localhost stays out of every list in dist, and a real contract read on a local anvil node returns the expected value through the adapter
  • in the UIKit example app, with the adapters linked locally in headless Chromium: the network selector still lists no localhost, a view call through the app's runtime works, and explorer links are byte-identical to main
  • format, lint, lint:adapters, typecheck, build and the full test run are green locally

… in createExplorer

Add EvmExplorerNetworkConfig, a Pick of the seven fields the explorer path
reads, exported from both roots and both /explorer entries. createExplorer
now takes NetworkConfig | EvmExplorerNetworkConfig, and the three core
explorer helpers take EvmExplorerNetworkConfig<string>, so the compiler
pins what the explorer path may read. Runtime link bodies are unchanged;
the non-EVM guard throws the same error at construction.

Refs #92
…lorer-only parity

Type-level tests (gated by typecheck:tests) pin the seven-key field set,
backward-compatible assignability for every NetworkConfig arm, and
compile-time rejection of foreign explorer-only literals. Runtime tests
pin read coverage via a Proxy access trap, guard parity with
asTypedEvmNetworkConfig, null semantics, late-bound resolution, the log
trail, no I/O, no API-key leaks, and full-vs-explorer-only parity across
all four resolution paths. adapter-evm adds the parity matrix for every
shipped network through the public /explorer entry and the profile
factory.

Refs #92
Copilot AI balanced review requested due to automatic review settings November 12, 2026 12:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

Keeps the evmLocalhost and EvmExplorerNetworkConfig additions a minor on the 6.x line (6.1.0) instead of jumping to 7.1.0 with adapter-polkadot. Docs no longer describe adapter-evm as part of the linked set.
Copilot AI balanced review requested due to automatic review settings November 12, 2026 14:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.

@pasevin
pasevin merged commit 2a0f3ed into main Nov 15, 2026
9 checks passed
@pasevin
pasevin deleted the 005-adapter-requests branch November 15, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants