Skip to content

feat(ensnode-react): useAvatarUrl#1142

Closed
notrab wants to merge 78 commits intomainfrom
use-avatar-url
Closed

feat(ensnode-react): useAvatarUrl#1142
notrab wants to merge 78 commits intomainfrom
use-avatar-url

Conversation

@notrab
Copy link
Copy Markdown
Member

@notrab notrab commented Oct 2, 2025

Closes #1085

New Notes (from lightwalker)

  • Consider: https://viem.sh/docs/ens/actions/getEnsAvatar#assetgatewayurls-optional
  • Consider: transitioning these responsibilities into ENSApi.
    • Return "raw" avatar URL
    • For the case of images referenced through NFTs: maybe return the "nftRaw" avatar URL based on a lookup of the data for the associated NFT
    • Return "http-safe" avatar URL
    • Return cached / size-optimized / etc.. avatar URL (?)
  • Consider: full support for cover images as well

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Oct 2, 2025

🦋 Changeset detected

Latest commit: b7e971e

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

This PR includes changesets to release 14 packages
Name Type
@ensnode/ensnode-sdk Minor
ensadmin Minor
@ensnode/ensnode-react Minor
ensapi Minor
ensindexer Minor
ensrainbow Minor
@ensnode/ensrainbow-sdk Minor
@ensnode/datasources Minor
@ensnode/ponder-metadata Minor
@ensnode/ensnode-schema Minor
@ensnode/ponder-subgraph Minor
@ensnode/shared-configs Minor
@docs/ensnode Minor
@docs/ensrainbow Minor

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

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Oct 2, 2025

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

Project Deployment Preview Comments Updated (UTC)
admin.ensnode.io Ready Ready Preview Comment Nov 4, 2025 8:36pm
ensnode.io Ready Ready Preview Comment Nov 4, 2025 8:36pm
ensrainbow.io Ready Ready Preview Comment Nov 4, 2025 8:36pm

Copy link
Copy Markdown
Member

@lightwalker-eth lightwalker-eth left a comment

Choose a reason for hiding this comment

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

@notrab Hey here's some feedback

Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
notrab and others added 13 commits October 17, 2025 14:15
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
Co-authored-by: lightwalker.eth <126201998+lightwalker-eth@users.noreply.github.com>
@notrab
Copy link
Copy Markdown
Member Author

notrab commented Oct 20, 2025

@lightwalker-eth moving this out of draft since previous suggestions were implemented.

One thing to note, is that I made some changes to the url file which touches on some changes you applied in this branch. The buildUrl function was too permissive.

It automatically prepends "https://" to any string without "://", turning "not-a-valid-url" into the technically valid "https://not-a-valid-url". This didn't align with how the ensadmin app handles URLs, so I made it consistent.

}

/**
* Builds a browser-supported asset URL for a name's asset image from the name's raw asset text record value.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Suggested change
* Builds a browser-supported asset URL for a name's asset image from the name's raw asset text record value.
* Builds a browsersupported avatar image URL from the ENS avatar text record (key: "avatar").
* Accepts non‑browser protocols (ipfs://, ar://) and NFT URIs (CAIP‑22 ERC‑721 / CAIP‑29 ERC‑1155, eip155 chain namespace),
* and converts them via a proxy/gateway (default: ENS Metadata Service) to http/https/data URLs.

This keeps the "asset" generic type for reuse, but adjusts the JSDoc to emphasize the use of the "avatar text record" in this context.

@notrab
Copy link
Copy Markdown
Member Author

notrab commented Oct 31, 2025

I've just seen the changes made for ENSApi include the change of the config in #1211, so I'll update this PR with those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Attempt avatar image loading through useRecords

3 participants