feat: network-scoped ENS resolution + AddressFieldWithResolvedPreview#195
Merged
Conversation
Extract the forward-resolution field + reverse ENS preview card into reusable ui-components exports, wire ui-renderer Address Book to the shared pattern, and update the examples app demos accordingly. Co-authored-by: Cursor <[email protected]>
Add missing React type imports, exclude resolvedName from displayProps, clarify announcer suppression comment, and fix renderer changeset package. Co-authored-by: Cursor <[email protected]>
Allow forward and reverse ENS lookups to follow a selected network via RuntimeProvider without switching the wallet-global active network. Address Book Add Alias uses the dialog dropdown network for both directions. Update the basic-react-app examples with network-scoped wiring docs. Co-authored-by: Cursor <[email protected]>
✅ Deploy Preview for openzeppelin-ui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…tion Keep network-scoped runtime wiring on top of main's AddressFieldWithResolvedPreview integration. AddAliasDialog uses dialogNetwork + useRuntimeNameResolver(network). Co-authored-by: Cursor <[email protected]>
Stop passing header-network addressing into the widget when ENS is enabled so the dialog loads per-network validators via resolveAddressing. Rebuild clears stale Vite bundles that still showed the forward "Resolved to" announcer. Co-authored-by: Cursor <[email protected]>
Always turn on enableNameResolution and app-wide mainnet-L1 fallback for the address-book demo; remove ENS opt-in UI from Account Alias Storage. Remount the Add Alias ENS field when the dialog network changes. Co-authored-by: Cursor <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces network-scoped ENS resolution so forward/reverse lookups can target a selected network (e.g., a dialog dropdown) without mutating the wallet-global active network, and wires that behavior into renderer components and basic-react-app demos.
Changes:
- Add network-scoped resolution plumbing in
@openzeppelin/ui-react(network runtime source support;useRuntimeNameResolver(scopedNetwork?),useResolveAddress(..., { network }), plus deprecated wrapper hooks). - Update renderer Address Book “Add Alias” flow and preview components to resolve ENS against the dialog-selected network.
- Update basic-react-app demos/docs and add changesets for the new/updated APIs and components.
Reviewed changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/renderer/src/components/ResolvedAddressFieldPreviewWithNameResolution.tsx | Adds optional network prop and forwards it to async reverse-resolution provider. |
| packages/renderer/src/components/index.ts | Exports the new props type for the preview-with-resolution component. |
| packages/renderer/src/components/AddressNameResolutionProvider.tsx | Adds optional network prop and forwards it to useResolveAddress. |
| packages/renderer/src/components/AddressBookWidget/AddAliasDialog.tsx | Wires Add Alias dialog forward+reverse ENS to the dropdown-selected network/runtime without switching wallet-global network. |
| packages/renderer/src/components/AddressBookWidget/tests/AddAliasDialog.sf5.test.tsx | Updates tests to mount RuntimeProvider to support network-scoped runtime loading. |
| packages/react/src/index.ts | Exposes new (deprecated) network wrapper hooks from the package entrypoint. |
| packages/react/src/hooks/nameResolution/useRuntimeNameResolver.ts | Adds optional scoped network support and refactors resolver creation into helper. |
| packages/react/src/hooks/nameResolution/useResolveAddress.ts | Adds options.network and routes resolution through a network runtime source when set. |
| packages/react/src/hooks/nameResolution/useResolutionEngine.ts | Adds optional runtime source override to support network-scoped resolution paths. |
| packages/react/src/hooks/nameResolution/useNetworkRuntimeSource.ts | New hook to fetch runtime for a specific network via RuntimeProvider registry. |
| packages/react/src/hooks/nameResolution/useNetworkResolveAddress.ts | Deprecated wrapper hook for network-scoped reverse resolution. |
| packages/react/src/hooks/nameResolution/useNetworkNameResolver.ts | Deprecated wrapper hook for network-scoped forward resolution seam. |
| packages/react/src/hooks/nameResolution/mapAddressEngineResult.ts | Extracts engine→address result mapping into a shared helper. |
| packages/react/src/hooks/nameResolution/index.ts | Re-exports the newly added deprecated wrapper hooks. |
| packages/react/src/hooks/nameResolution/createNameResolver.ts | New helper to project a capability into the SF-3 NameResolver seam with SF-2 cache-key parity. |
| examples/basic-react-app/src/providers/AppProviders.tsx | Changes demo default to enable mainnet L1 miss fallback. |
| examples/basic-react-app/src/components/ENSResolutionDemo.tsx | Updates wiring snippets and adds network-scoped example snippet. |
| examples/basic-react-app/src/components/AddressFieldDemo.tsx | Updates snippet/docs to show passing network for dialog-scoped reverse resolution. |
| examples/basic-react-app/src/components/AccountAliasDemo.tsx | Simplifies demo by enabling name resolution in the widget and updating copy. |
| .changeset/renderer-resolved-preview.md | Patch note: switch renderer Address Book preview to shared ui-components preview. |
| .changeset/network-scoped-name-resolution.md | Minor note: network-scoped ENS resolution API additions and deprecations. |
| .changeset/address-field-resolved-preview.md | Minor note: new AddressFieldWithResolvedPreview and ResolvedAddressFieldPreview in ui-components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
When RuntimeContext is absent, keep network.id for cache keys and UNSUPPORTED_NETWORK signaling. Derive scope-gating networkId from network.id when both props are set. Co-authored-by: Cursor <[email protected]>
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
@openzeppelin/ui-react:useRuntimeNameResolver(scopedNetwork?)anduseResolveAddress(..., { network })load the target runtime viaRuntimeProvider.getRuntimeForNetworkwithout mutating the wallet-global active network, sharing SF-2 cache keys (INV-119).AddressBookWidgetAdd Alias dialog to resolve forward and reverse ENS against the dialog network dropdown (AddAliasDialog,AddressNameResolutionProvider,ResolvedAddressFieldPreviewWithNameResolution).AddressFieldWithResolvedPreview+ResolvedAddressFieldPreviewin@openzeppelin/ui-componentsfor the recommended forward + rich reverse preview card UX.basic-react-appdemos (Address Book, ENS Resolution, AddressField) with network-scoped wiring examples and docs.Test plan
pnpm testinpackages/react(162 tests)pnpm testinpackages/renderer(128 tests)pnpm dev:local— Add Alias on Ethereum Mainnet resolvespasevin.ethwith name + avatar preview while wizard global network stays StellarMade with Cursor