Move the encoded referrer library module to @namehash/ens-referrals#1972
Move the encoded referrer library module to @namehash/ens-referrals#1972
@namehash/ens-referrals#1972Conversation
Uses data model from `enssdk`. Also, as a workaround, defines an inline copy for the `decodeReferrer` function that cannot be imported from `@namehash/ens-referrals` package due to circular references issue.
…rals` Replaces the ENSNode SDK import
Replaces the ENSNode SDK imports
Replaces the ENSNode SDK import
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
🦋 Changeset detectedLatest commit: 1c645e4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 23 packages
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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR moves referrer encode/decode utilities from Changes
Sequence Diagram(s)Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR completes the migration of Confidence Score: 5/5Safe to merge — all P0/P1 findings from prior rounds are resolved, no new issues found. All previously flagged issues (continue/i++ bug, decodeReferrer duplication explained by circular dependency) are resolved. The type changes are internally consistent: Referrer is the loose base for raw onchain bytes, EncodedReferrer is the branded validated subtype. Consumer sites are all updated. No remaining issues rise above P2. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
subgraph enssdk["enssdk"]
Referrer["Referrer = Hex\n(raw 32-byte onchain value)"]
end
subgraph ens_referrals["@namehash/ens-referrals"]
EncodedReferrer["EncodedReferrer\n(Referrer & branded)\nvalidly-encoded subset"]
buildEncodedReferrer["buildEncodedReferrer(Address)\n→ EncodedReferrer"]
decodeReferrer["decodeReferrer(Referrer)\n→ NormalizedAddress"]
ZERO["ZERO_ENCODED_REFERRER"]
end
subgraph ensnode_sdk["@ensnode/ensnode-sdk"]
RegistrarAction["RegistrarActionReferralAvailable\nencodedReferrer: Referrer\ndecodedReferrer: NormalizedAddress"]
LocalDecodeReferrer["local decodeReferrer copy\n(circular dep workaround)"]
end
subgraph consumers["Consumers"]
ensindexer["ensindexer"]
ensapi["ensapi"]
namehash_ui["namehash-ui"]
end
Referrer --> EncodedReferrer
Referrer --> RegistrarAction
EncodedReferrer --> buildEncodedReferrer
EncodedReferrer --> ZERO
buildEncodedReferrer --> decodeReferrer
ens_referrals --> consumers
ensnode_sdk --> consumers
LocalDecodeReferrer -.->|"mirrors logic"| decodeReferrer
Reviews (2): Last reviewed commit: "Apply AI PR feedback" | Re-trigger Greptile |
There was a problem hiding this comment.
Pull request overview
Moves the encoded referrer encode/decode utilities out of @ensnode/ensnode-sdk into the community-facing @namehash/ens-referrals, while hoisting the shared raw referrer type into enssdk to avoid dependency cycles.
Changes:
- Added
Referrertype toenssdkand updated downstream typing to use it for “raw bytes32 referrer” fields. - Introduced
encoded-referrermodule in@namehash/ens-referrals(brandedEncodedReferrer,buildEncodedReferrer,decodeReferrer, constants) and ported tests/docs. - Removed
encoded-referrerexports from@ensnode/ensnode-sdkregistrars surface and inlined decode logic where needed (zod invariant), updating app/package callsites and deps.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds workspace links for @namehash/ens-referrals where newly depended upon. |
| packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx | Switches ZERO_ENCODED_REFERRER import to @namehash/ens-referrals. |
| packages/namehash-ui/package.json | Adds dependency on @namehash/ens-referrals. |
| packages/enssdk/src/lib/types/evm.ts | Introduces Referrer type alias. |
| packages/ensnode-sdk/src/registrars/zod-schemas.ts | Inlines decodeReferrer + constants for zod invariant checks (no runtime import from ens-referrals). |
| packages/ensnode-sdk/src/registrars/registrar-action.ts | Replaces EncodedReferrer with Referrer and tightens decodedReferrer to NormalizedAddress; removes re-exports. |
| packages/ensnode-sdk/src/registrars/index.ts | Stops exporting the removed encoded-referrer module. |
| packages/ensdb-sdk/src/ensindexer-abstract/ensv2.schema.ts | Updates schema typing from EncodedReferrer to Referrer. |
| packages/ens-referrals/src/index.ts | Exports the new encoded-referrer module from the package root. |
| packages/ens-referrals/src/encoded-referrer.ts | Implements branded EncodedReferrer, buildEncodedReferrer(Address), and decodeReferrer(Referrer). |
| packages/ens-referrals/src/encoded-referrer.test.ts | Updates tests for renamed decoder and updated buildEncodedReferrer input type. |
| packages/ens-referrals/src/api/zod-schemas.ts | Refactors edition config parsing loop (introduces an indexing bug; see PR comments). |
| packages/ens-referrals/README.md | Documents buildEncodedReferrer under “Other Utilities”. |
| apps/ensindexer/src/plugins/registrars/shared/lib/universal-registrar-renewal-with-referrer-events.ts | Updates referral typing from EncodedReferrer to Referrer. |
| apps/ensindexer/src/plugins/registrars/shared/lib/registrar-controller-events.ts | Updates referral typing from EncodedReferrer to Referrer. |
| apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_UniversalRegistrarRenewalWithReferrer.ts | Switches decoding import/usage to decodeReferrer from @namehash/ens-referrals. |
| apps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_RegistrarController.ts | Switches decoding import/usage to decodeReferrer from @namehash/ens-referrals. |
| apps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.ts | Updates event arg typing from EncodedReferrer to Referrer. |
| apps/ensindexer/src/plugins/ensv2/handlers/ensv1/RegistrarController.ts | Updates event arg typing from EncodedReferrer to Referrer. |
| apps/ensindexer/package.json | Adds dependency on @namehash/ens-referrals. |
| apps/ensapi/src/lib/registrar-actions/find-registrar-actions.ts | Switches ZERO_ENCODED_REFERRER import to @namehash/ens-referrals. |
| .changeset/dirty-swans-arrive.md | Adds release notes + bumps for enssdk, @namehash/ens-referrals, and @ensnode/ensnode-sdk. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 5
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/ens-referrals/src/api/zod-schemas.ts (1)
342-372:⚠️ Potential issue | 🔴 CriticalBug:
continueon line 358 skipsi++, causing index drift in error paths.With the index-based loop this refactor replaces,
i++ran in the loop header and always incremented — including aftercontinue. In the newfor...ofform, thei++has been moved to the end of the body (line 371), so thecontinueon line 358 bypasses it. As a result, once an unrecognized item fails base-parse validation, every subsequent item's re-emitted issues (and any later unrecognized-branchcontinue) will be reported under a stale/incorrect array index, misaligning issue paths with the original input.🛠️ Proposed fix
- let i = 0; - - for (const item of items) { + for (const [i, item] of items.entries()) { if (knownAwardModels.includes(item.rules.awardModel)) { // Known award model — fully validate. const parsed = configSchema.safeParse(item); if (!parsed.success) { reemitIssues(ctx, parsed.error.issues, [i]); } else { result.push(parsed.data); } } else { // Unknown award model — preserve as ReferralProgramRulesUnrecognized using base fields. const parsed = unrecognizedBaseSchema.safeParse(item); if (!parsed.success) { reemitIssues(ctx, parsed.error.issues, [i]); continue; } result.push({ ...parsed.data, rules: { ...parsed.data.rules, awardModel: ReferralProgramAwardModels.Unrecognized, originalAwardModel: item.rules.awardModel, } satisfies ReferralProgramRulesUnrecognized, }); } - - i++; }Alternatively, move
i++before theif/elseblock (or use atry/finally-style guard) so it is unconditionally executed each iteration.Note: this file's changes are unrelated to the PR's stated objective (moving encoded-referrer helpers). Consider whether this refactor belongs in a separate PR.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ens-referrals/src/api/zod-schemas.ts` around lines 342 - 372, The loop's index variable i is incremented at the end of the for...of body, but a continue in the unrecognized-item failure path skips i++, causing subsequent error indices to be wrong; to fix, ensure i is incremented every iteration regardless of control flow — e.g., increment i at the top of the loop (before checking knownAwardModels) or restructure with a try/finally so i++ runs in finally; adjust the block around items, knownAwardModels, configSchema, unrecognizedBaseSchema, and reemitIssues so all paths (including the continue after unrecognizedBaseSchema.safeParse failure) execute the unconditional i++ and keep the ReferralProgramAwardModels.Unrecognized/ originalAwardModel logic unchanged.packages/ens-referrals/README.md (1)
155-183: 🧹 Nitpick | 🔵 TrivialDocs LGTM.
Two new subsections correctly document
buildEnsReferralUrlandbuildEncodedReferrerwith accurate input/output examples. The intro sentence at Line 157 is a bit bare — optionally expand to mention both referral-link and encoded-referrer helpers for discoverability.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ens-referrals/README.md` around lines 155 - 183, Update the brief intro under "Other Utilities" to clearly mention both referral-link and encoded-referrer helpers for discoverability: revise the sentence that currently reads "The package also includes helpers." to explicitly reference the functions buildEnsReferralUrl and buildEncodedReferrer and state that the section shows how to build a referrer URL and an encoded referrer value.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In
`@apps/ensindexer/src/plugins/registrars/shared/lib/universal-registrar-renewal-with-referrer-events.ts`:
- Line 1: The local variable decodedReferrer (and any places around lines
~80-85) is widened to Address; update the import to bring in NormalizedAddress
from "enssdk" (replace Address with NormalizedAddress) and change the type
annotations for referral.decodedReferrer / decodedReferrer to NormalizedAddress
so the normalized invariant is preserved through the DB update path and matches
the treatment in registrar-controller-events.ts.
In `@packages/ens-referrals/src/encoded-referrer.ts`:
- Around line 67-76: Update the JSDoc grammar in the referrer decode docblock:
change the opening sentence from "Decode an {`@link` Referrer} value..." to
"Decode a {`@link` Referrer} value..." and similarly adjust the `@throws` lines to
use "Throws when ..." (e.g., "@throws when referrer value is not represented by
{`@link` ENCODED_REFERRER_BYTE_LENGTH} bytes." → "@throws when the referrer value
is not represented by {`@link` ENCODED_REFERRER_BYTE_LENGTH} bytes." and "@throws
when decodedReferrer is not a valid EVM address." → "@throws when the decoded
referrer is not a valid EVM address."); update the docblock that documents the
referrer decode function in encoded-referrer.ts accordingly.
- Around line 17-28: The JSDoc on ENCODED_REFERRER_BYTE_OFFSET (and the
accompanying encoded length constant) incorrectly links to Referrer instead of
the encoded representation; update the doc comments to reference EncodedReferrer
(and/or clarify "encoded referrer") and adjust wording to state these constants
describe the encoded layout (12-byte left padding, 32-byte total) rather than a
raw Referrer so the comments accurately refer to EncodedReferrer and the
encoding layout.
In `@packages/ensnode-sdk/src/registrars/zod-schemas.ts`:
- Around line 55-64: The JSDoc for the referrer decoding routine (describing
decoding a {`@link` Referrer} into a {`@link` NormalizedAddress} and referencing
{`@link` ENCODED_REFERRER_BYTE_LENGTH} and decodedReferrer) contains a redundant
`@returns` tag; remove that `@returns` line so the summary and return type alone
describe the returned decoded referrer address, leaving the rest of the comment
and exception tags intact.
- Around line 35-53: These SDK-local referrer layout constants
(ENCODED_REFERRER_BYTE_OFFSET, ENCODED_REFERRER_BYTE_LENGTH,
EXPECTED_ENCODED_REFERRER_PADDING) should be made private to the module: remove
the export keyword and keep them as internal constants (or prefix with an
underscore) so they are not exported from ensnode-sdk; update any internal
usages in this file to reference the now-non-exported symbols and do not
re-export them—if other packages need them, export from `@namehash/ens-referrals`
instead.
---
Outside diff comments:
In `@packages/ens-referrals/README.md`:
- Around line 155-183: Update the brief intro under "Other Utilities" to clearly
mention both referral-link and encoded-referrer helpers for discoverability:
revise the sentence that currently reads "The package also includes helpers." to
explicitly reference the functions buildEnsReferralUrl and buildEncodedReferrer
and state that the section shows how to build a referrer URL and an encoded
referrer value.
In `@packages/ens-referrals/src/api/zod-schemas.ts`:
- Around line 342-372: The loop's index variable i is incremented at the end of
the for...of body, but a continue in the unrecognized-item failure path skips
i++, causing subsequent error indices to be wrong; to fix, ensure i is
incremented every iteration regardless of control flow — e.g., increment i at
the top of the loop (before checking knownAwardModels) or restructure with a
try/finally so i++ runs in finally; adjust the block around items,
knownAwardModels, configSchema, unrecognizedBaseSchema, and reemitIssues so all
paths (including the continue after unrecognizedBaseSchema.safeParse failure)
execute the unconditional i++ and keep the
ReferralProgramAwardModels.Unrecognized/ originalAwardModel logic unchanged.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: 0829a18e-8243-4926-8c51-40ef32cf1516
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (21)
.changeset/dirty-swans-arrive.mdapps/ensapi/src/lib/registrar-actions/find-registrar-actions.tsapps/ensindexer/package.jsonapps/ensindexer/src/plugins/ensv2/handlers/ensv1/RegistrarController.tsapps/ensindexer/src/plugins/ensv2/handlers/ensv2/ETHRegistrar.tsapps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_RegistrarController.tsapps/ensindexer/src/plugins/registrars/ethnames/handlers/Ethnames_UniversalRegistrarRenewalWithReferrer.tsapps/ensindexer/src/plugins/registrars/shared/lib/registrar-controller-events.tsapps/ensindexer/src/plugins/registrars/shared/lib/universal-registrar-renewal-with-referrer-events.tspackages/ens-referrals/README.mdpackages/ens-referrals/src/api/zod-schemas.tspackages/ens-referrals/src/encoded-referrer.test.tspackages/ens-referrals/src/encoded-referrer.tspackages/ens-referrals/src/index.tspackages/ensdb-sdk/src/ensindexer-abstract/ensv2.schema.tspackages/ensnode-sdk/src/registrars/index.tspackages/ensnode-sdk/src/registrars/registrar-action.tspackages/ensnode-sdk/src/registrars/zod-schemas.tspackages/enssdk/src/lib/types/evm.tspackages/namehash-ui/package.jsonpackages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx
💤 Files with no reviewable changes (1)
- packages/ensnode-sdk/src/registrars/index.ts
…in referrer bytes). Runtime helpers (`buildEncodedReferrer`, `decodeReferrer` — renamed from `decodeEncodedReferrer`, `ZERO_ENCODED_REFERRER`, and related constants) moved from `@ensnode/ensnode-sdk` to `@namehash/ens-referrals`, which now owns a branded `EncodedReferrer` type returned by `buildEncodedReferrer`. `buildEncodedReferrer` now accepts `Address` (previously `NormalizedAddress`) and normalizes internally.
…coded-referrer-to-ens-referrals
fcdb3d4 to
425d2b3
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/ens-referrals/README.md (1)
7-9:⚠️ Potential issue | 🟡 MinorInclude
enssdkin the install command.The new examples import
Addressfromenssdk, but the installation step does not install it directly. This can fail for consumers using strict dependency resolution.📝 Proposed docs fix
-npm install `@namehash/ens-referrals` viem +npm install `@namehash/ens-referrals` enssdk viemAlso applies to: 161-183
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ens-referrals/README.md` around lines 7 - 9, Update the installation instruction so consumers install the enssdk package alongside the other dependencies: change the npm install command that currently references "@namehash/ens-referrals viem" to also include "enssdk" because the examples import Address from enssdk; ensure the README's install line (the code block containing npm install `@namehash/ens-referrals` viem) is updated wherever it appears (including the other occurrence around lines 161-183).
♻️ Duplicate comments (1)
packages/ensnode-sdk/src/registrars/zod-schemas.ts (1)
55-64: 🧹 Nitpick | 🔵 TrivialRemove the redundant
@returnstag.Line 60 restates the function summary and return type; this was already flagged and still applies.
As per coding guidelines, “Do not add JSDoc
@returnstags that merely restate the method summary; remove such redundancy during PR review”.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/ensnode-sdk/src/registrars/zod-schemas.ts` around lines 55 - 64, The JSDoc block that begins "Decode a {`@link` Referrer} value into a {`@link` NormalizedAddress}..." contains a redundant `@returns` tag that restates the summary; remove that `@returns` tag from the referrer decoder JSDoc (the comment attached to the referrer decoding function) so only the summary and throws tags remain, leaving no duplicate return description.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.changeset/dirty-swans-arrive.md:
- Line 7: The changeset uses the non-hyphenated adjective "onchain"; change it
to the hyphenated form "on-chain" in the description so the sentence reads "raw
32-byte on-chain referrer bytes"; update the phrase within the same line that
mentions Referrer, buildEncodedReferrer, decodeReferrer, ZERO_ENCODED_REFERRER,
EncodedReferrer, Address and NormalizedAddress to use "on-chain" instead of
"onchain".
In `@packages/ens-referrals/src/encoded-referrer.ts`:
- Around line 67-76: Remove the redundant JSDoc `@returns` tag in the
decodeReferrer function's comment block (the block starting "Decode a {`@link`
Referrer} value into a {`@link` NormalizedAddress}") — delete the line that
restates the summary/return type and keep the other tags (`@param`, `@throws`)
intact so the documentation is not repetitive.
---
Outside diff comments:
In `@packages/ens-referrals/README.md`:
- Around line 7-9: Update the installation instruction so consumers install the
enssdk package alongside the other dependencies: change the npm install command
that currently references "@namehash/ens-referrals viem" to also include
"enssdk" because the examples import Address from enssdk; ensure the README's
install line (the code block containing npm install `@namehash/ens-referrals`
viem) is updated wherever it appears (including the other occurrence around
lines 161-183).
---
Duplicate comments:
In `@packages/ensnode-sdk/src/registrars/zod-schemas.ts`:
- Around line 55-64: The JSDoc block that begins "Decode a {`@link` Referrer}
value into a {`@link` NormalizedAddress}..." contains a redundant `@returns` tag
that restates the summary; remove that `@returns` tag from the referrer decoder
JSDoc (the comment attached to the referrer decoding function) so only the
summary and throws tags remain, leaving no duplicate return description.
🪄 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: ASSERTIVE
Plan: Pro
Run ID: a7a21eef-2f58-479d-b638-1d6d22612f30
📒 Files selected for processing (5)
.changeset/dirty-swans-arrive.mdpackages/ens-referrals/README.mdpackages/ens-referrals/src/api/zod-schemas.tspackages/ens-referrals/src/encoded-referrer.tspackages/ensnode-sdk/src/registrars/zod-schemas.ts
shrugs
left a comment
There was a problem hiding this comment.
Looking good and headed in the right direction.
…coded-referrer-to-ens-referrals
|
@greptile review |
There was a problem hiding this comment.
Pull request overview
This PR relocates encoded-referrer runtime helpers from @ensnode/ensnode-sdk into the community-facing @namehash/ens-referrals package, while hoisting the raw referrer bytes type into enssdk to avoid circular dependencies and keep SDK validation self-contained.
Changes:
- Added
Referrertype (Hex) toenssdkto represent raw on-chain bytes32 referrer values. - Moved/refactored runtime helpers into
@namehash/ens-referrals(buildEncodedReferrer(Address),decodeReferrer(Referrer), constants, brandedEncodedReferrer). - Updated SDK schemas and downstream apps/packages to use the new helper locations and the unbranded
Referrertype where appropriate.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Adds workspace dependency entries for @namehash/ens-referrals where newly imported. |
| packages/namehash-ui/src/components/registrar-actions/RegistrarActionCard.tsx | Switches ZERO_ENCODED_REFERRER import to @namehash/ens-referrals. |
| packages/namehash-ui/package.json | Adds @namehash/ens-referrals dependency. |
| packages/enssdk/src/lib/types/evm.ts | Introduces exported Referrer type alias. |
| packages/ensnode-sdk/src/registrars/zod-schemas.ts | Inlines decodeReferrer logic for invariant checking without importing ens-referrals. |
| packages/ensnode-sdk/src/registrars/registrar-action.ts | Updates referral field types: encodedReferrer: Referrer, decodedReferrer: NormalizedAddress; removes encoded-referrer re-exports. |
| packages/ensnode-sdk/src/registrars/index.ts | Stops exporting removed encoded-referrer module. |
| packages/ensdb-sdk/src/ensindexer-abstract/ensv2.schema.ts | Updates DB schema typing from EncodedReferrer to Referrer. |
| packages/ens-referrals/src/index.ts | Exposes new encoded-referrer module from package root. |
| packages/ens-referrals/src/encoded-referrer.ts | Adds branded EncodedReferrer + helpers/constants in ens-referrals. |
| packages/ens-referrals/src/encoded-referrer.test.ts | Ports/updates tests for decodeReferrer and buildEncodedReferrer(Address) behavior. |
| packages/ens-referrals/src/api/zod-schemas.ts | Minor loop refactor using items.entries(). |
| packages/ens-referrals/README.md | Documents buildEncodedReferrer usage from @namehash/ens-referrals. |
| apps/ensindexer/... | Switches decoding to decodeReferrer from @namehash/ens-referrals and updates types to Referrer/NormalizedAddress. |
| apps/ensindexer/package.json | Adds @namehash/ens-referrals dependency. |
| apps/ensapi/src/lib/registrar-actions/find-registrar-actions.ts | Switches ZERO_ENCODED_REFERRER import to @namehash/ens-referrals. |
| .changeset/dirty-swans-arrive.md | Declares minor bumps and describes the move/rename/type hoist. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Lite PR
Tip: Review docs on the ENSNode PR process
Summary
Why
buildEncodedReferrer/decodeEncodedReferrerlive in@ensnode/ensnode-sdkbut are really community-facing utilities for the ENS Referral Program — they belong in@namehash/ens-referrals. Also:buildEncodedReferrershould acceptAddress(notNormalizedAddress) and normalize internally viatoNormalizedAddress, which already throws on invalid input.Testing
Notes for Reviewer (Optional)
Pre-Review Checklist (Blocking)