Add ENS owned-name lookup endpoint and claim UI ENS picker#290
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Description
GET /api/ens/ownedimplemented inapi/ens/owned.jsthat returns{ ok, address, primaryName, ownedNames }withownedNamesentries shaped as{ name, source: 'ens_nft', ownershipStatus: 'owned', controlStatus: 'not_checked' }and a stablePROVIDER_UNAVAILABLEfallback when no provider is configured.ALCHEMY_ETH_API_KEY,ALCHEMY_ETH_RPC_URL,ETH_RPC_URL, orSIMPLEHASH_API_KEYas valid configuration sources, and the handler performs a reverse lookup viaethersfor the primary ENS name when an RPC/Alchemy provider is available.SIMPLEHASH_API_KEYis present the handler queries SimpleHash NFT owners to enumerate.ethENS names (deduped, lowercased), and merges the primary name into results when appropriate.public/claim.htmlso that after SIWE completes the page calls/api/ens/owned?address=<wallet>and shows a loading state (Checking ENS names...), a picker with ENS cards and action buttons (Use as tenant labelandUse as ENS namespace), and appropriate fallback messages when none are found or provider is unavailable; safety copy added clarifying that only ENS identity data is checked and that ownership does not imply record-writing control.Testing
npm testwhich executed the test suite (node --test tests/*.test.js) and all tests passed (54 passed, 0 failed). The API tests include: missing address, invalid address, provider-unavailable shape, and SimpleHash-only path producing stable ENS-only output.cd examples/webhook-auto-verify && npm install && npm run checkwhich completed successfully.npm installat the repository root but it failed in this environment due to a registry policy error (403for@neondatabase/serverless), andnpm run buildis not defined inpackage.json(so a build script was not run).Codex Task