Skip to content

ENS: add coinType param to reverse resolver#8735

Merged
0xFirekeeper merged 2 commits intomainfrom
firekeeper/ens-regression
Apr 6, 2026
Merged

ENS: add coinType param to reverse resolver#8735
0xFirekeeper merged 2 commits intomainfrom
firekeeper/ens-regression

Conversation

@0xFirekeeper
Copy link
Copy Markdown
Member

@0xFirekeeper 0xFirekeeper commented Apr 6, 2026

Update generated UniversalResolver reverse read to include a coinType (uint256) parameter and new function selector; adjust FN_INPUTS/FN_OUTPUTS and encode/read params accordingly. Update resolve-name to call the new reverse signature (pass the raw address as reverseName and coinType: 60n), remove packetToBytes/toHex usage and unused imports, simplify error handling, and return the resolved name or null.


PR-Codex overview

This PR introduces a coinType parameter to the reverse resolver in the ENS extension of the thirdweb SDK, updating function signatures and logic to accommodate this new parameter.

Detailed summary

  • Added coinType parameter to ReverseParams and FN_INPUTS.
  • Updated FN_SELECTOR from "0xec11c823" to "0x5d78a217".
  • Modified encodeReverseParams to include options.coinType.
  • Changed reverse function to accept and pass options.coinType.
  • Updated resolveName to use a default coinType of 60n.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Bug Fixes

    • Improved ENS name resolution: lookups now accept an additional coinType for more accurate cross-chain reverse resolution and more consistent results with updated error handling.
  • Chores

    • Release metadata added to mark a patch release for the package.

Update generated UniversalResolver reverse read to include a coinType (uint256) parameter and new function selector; adjust FN_INPUTS/FN_OUTPUTS and encode/read params accordingly. Update resolve-name to call the new reverse signature (pass the raw address as reverseName and coinType: 60n), remove packetToBytes/toHex usage and unused imports, simplify error handling, and return the resolved name or null.
@0xFirekeeper 0xFirekeeper requested review from a team as code owners April 6, 2026 15:37
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-v2 Ready Ready Preview, Comment Apr 6, 2026 4:07pm
nebula Ready Ready Preview, Comment Apr 6, 2026 4:07pm
thirdweb_playground Ready Ready Preview, Comment Apr 6, 2026 4:07pm
thirdweb-www Ready Ready Preview, Comment Apr 6, 2026 4:07pm
wallet-ui Ready Ready Preview, Comment Apr 6, 2026 4:07pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 6, 2026

🦋 Changeset detected

Latest commit: 05b9f6c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
thirdweb Patch
@thirdweb-dev/nebula Patch
@thirdweb-dev/wagmi-adapter Patch
wagmi-inapp Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions github-actions bot added packages SDK Involves changes to the thirdweb SDK labels Apr 6, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6005a20e-2dff-43d9-82fd-09b0023c9e48

📥 Commits

Reviewing files that changed from the base of the PR and between 1d21a9c and 05b9f6c.

📒 Files selected for processing (1)
  • packages/thirdweb/src/extensions/ens/resolve-name.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/thirdweb/src/extensions/ens/resolve-name.ts

Walkthrough

The ENS reverse resolver in the thirdweb package was updated to pass coinType: 60n to reverse lookups, change error handling to swallow most errors while re-throwing ReverseAddressMismatch, remove construction/verification of a reverse lookup label, and simplify the function return to string | null.

Changes

Cohort / File(s) Summary
Changeset metadata
.changeset/every-donuts-stop.md
Added a changeset entry marking thirdweb as a patch release noting the ENS reverse resolver change.
ENS reverse lookup implementation
packages/thirdweb/src/extensions/ens/resolve-name.ts
Updated resolveName signature to `Promise<string

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description contains detailed technical information about the changes made, but does not follow the repository's required template structure with sections like 'Notes for the reviewer' and 'How to test'. Reorganize the description to match the template format: add 'Notes for the reviewer' section and 'How to test' section with specific testing instructions or verification steps.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding a coinType parameter to the ENS reverse resolver, which is the primary objective reflected in the raw summary and changeset.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch firekeeper/ens-regression

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 6, 2026

size-limit report 📦

Path Size
@thirdweb-dev/nexus (esm) 105.66 KB (0%)
@thirdweb-dev/nexus (cjs) 319.47 KB (0%)

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 6, 2026

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 52.71%. Comparing base (a138681) to head (1d21a9c).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...ckages/thirdweb/src/extensions/ens/resolve-name.ts 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8735      +/-   ##
==========================================
- Coverage   52.72%   52.71%   -0.02%     
==========================================
  Files         934      934              
  Lines       62968    62958      -10     
  Branches     4134     4132       -2     
==========================================
- Hits        33199    33187      -12     
- Misses      29671    29673       +2     
  Partials       98       98              
Flag Coverage Δ
packages 52.71% <83.33%> (-0.02%) ⬇️
Files with missing lines Coverage Δ
...ckages/thirdweb/src/extensions/ens/resolve-name.ts 93.10% <83.33%> (+8.48%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/thirdweb/src/extensions/ens/resolve-name.ts (1)

34-34: Add explicit return type.

The function lacks an explicit return type. As per coding guidelines, "Write idiomatic TypeScript with explicit function declarations and return types."

Proposed fix
-export async function resolveName(options: ResolveNameOptions) {
+export async function resolveName(options: ResolveNameOptions): Promise<string | null> {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/thirdweb/src/extensions/ens/resolve-name.ts` at line 34, The
resolveName function is missing an explicit return type; update the function
signature for resolveName(options: ResolveNameOptions) to include the concrete
return type that matches its implementation (for example Promise<string | null>
or the actual resolved type used in the body), and ensure ResolveNameOptions and
any callers remain type-compatible after adding the explicit return type.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/thirdweb/src/extensions/ens/resolve-name.ts`:
- Around line 45-53: The current catch-all on the reverse(...) call masks
verification failures; update the code around the reverse(...) invocation (the
reverse function call that returns [name]) to only swallow expected "no
resolver/no name" errors and let verification errors surface: replace the
.catch(() => [null]) with a try/catch (or inspect the thrown error), return
[null] for resolver-not-found / no-name cases, but re-throw if the error is a
ReverseAddressMismatch (or any other verification-related error) so callers can
detect data integrity issues; reference the reverse(...) call, the
ReverseAddressMismatch error type, and the address/coinType handling when making
this change.

---

Nitpick comments:
In `@packages/thirdweb/src/extensions/ens/resolve-name.ts`:
- Line 34: The resolveName function is missing an explicit return type; update
the function signature for resolveName(options: ResolveNameOptions) to include
the concrete return type that matches its implementation (for example
Promise<string | null> or the actual resolved type used in the body), and ensure
ResolveNameOptions and any callers remain type-compatible after adding the
explicit return type.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bf76f25f-bae0-45b9-a028-746d6c8308d3

📥 Commits

Reviewing files that changed from the base of the PR and between 83198b2 and 1d21a9c.

⛔ Files ignored due to path filters (1)
  • packages/thirdweb/src/extensions/ens/__generated__/UniversalResolver/read/reverse.ts is excluded by !**/__generated__/**
📒 Files selected for processing (2)
  • .changeset/every-donuts-stop.md
  • packages/thirdweb/src/extensions/ens/resolve-name.ts

Give resolveName an explicit Promise<string | null> return type and enhance its error handling: re-throw errors that include a data field starting with the ReverseAddressMismatch selector (0xef9c03ce) so callers can surface verification/data-integrity issues, while swallowing expected "no resolver"/"no name" errors. Also minor parameter formatting adjustments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages SDK Involves changes to the thirdweb SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant