Skip to content

feat: network-scoped ENS resolution + AddressFieldWithResolvedPreview#195

Merged
pasevin merged 7 commits into
mainfrom
feat/network-scoped-ens-resolution
Jul 19, 2026
Merged

feat: network-scoped ENS resolution + AddressFieldWithResolvedPreview#195
pasevin merged 7 commits into
mainfrom
feat/network-scoped-ens-resolution

Conversation

@pasevin

@pasevin pasevin commented Jul 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add optional network-scoped ENS resolution in @openzeppelin/ui-react: useRuntimeNameResolver(scopedNetwork?) and useResolveAddress(..., { network }) load the target runtime via RuntimeProvider.getRuntimeForNetwork without mutating the wallet-global active network, sharing SF-2 cache keys (INV-119).
  • Wire AddressBookWidget Add Alias dialog to resolve forward and reverse ENS against the dialog network dropdown (AddAliasDialog, AddressNameResolutionProvider, ResolvedAddressFieldPreviewWithNameResolution).
  • Add AddressFieldWithResolvedPreview + ResolvedAddressFieldPreview in @openzeppelin/ui-components for the recommended forward + rich reverse preview card UX.
  • Update basic-react-app demos (Address Book, ENS Resolution, AddressField) with network-scoped wiring examples and docs.

Test plan

  • pnpm test in packages/react (162 tests)
  • pnpm test in packages/renderer (128 tests)
  • Manual: rwa-wizard with pnpm dev:local — Add Alias on Ethereum Mainnet resolves pasevin.eth with name + avatar preview while wizard global network stays Stellar
  • Manual: basic-react-app → Account Alias → enable ENS → Add Alias with dropdown network ≠ header network
  • Manual: basic-react-app → Name Resolution page → verify integrator wiring snippets render

Made with Cursor

pasevin and others added 3 commits July 19, 2026 00:35
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]>
@pasevin
pasevin requested a review from a team as a code owner July 19, 2026 14:09
@netlify

netlify Bot commented Jul 19, 2026

Copy link
Copy Markdown

Deploy Preview for openzeppelin-ui ready!

Name Link
🔨 Latest commit e81af4d
🔍 Latest deploy log https://app.netlify.com/projects/openzeppelin-ui/deploys/6a5d534f366b7000084e1e30
😎 Deploy Preview https://deploy-preview-195--openzeppelin-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

pasevin and others added 3 commits July 19, 2026 19:58
…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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread packages/react/src/hooks/nameResolution/useNetworkRuntimeSource.ts Outdated
Comment thread packages/renderer/src/components/AddressNameResolutionProvider.tsx
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]>
@pasevin
pasevin merged commit b56165d into main Jul 19, 2026
14 checks passed
@pasevin
pasevin deleted the feat/network-scoped-ens-resolution branch July 19, 2026 22:48
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants