Repository navigation
feat(adapter-evm): add opt-in evmLocalhost and an explorer-only config for createExplorer - #93
Conversation
…shared network lists
… 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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
two small additions to the EVM adapters, both opt-in. Nothing changes for apps that don't use them.
local devnet config.
evmLocalhostis a ready-made config for chain 31337 (Anvil, Hardhat, Foundry) on the defaulthttp://127.0.0.1:8545. You import it from@openzeppelin/adapter-evm/networksor the package root. I kept it out ofevmNetworks,evmMainnetNetworksandevmTestnetNetworkson 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 throughrpcEndpoints['evm-localhost'].Closes #91
explorer-only config.
createExplorernow also takesEvmExplorerNetworkConfig, which holds just the seven fields the explorer path reads. A browser app can build explorer links without shipping an RPC URL or writingrpcUrl: ''. A full network config still works, and links come out the same as before.resolveExplorerConfig,getEvmExplorerAddressUrlandgetEvmExplorerTxUrlaccept the narrower type too.Closes #92
release note. changesets bumps
@openzeppelin/adapters-viteto 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
mainacross every shipped networkmainlint:adapters, typecheck, build and the full test run are green locally