Skip to content

Add ENS owned-name lookup endpoint and claim UI ENS picker#290

Merged
GsCommand merged 1 commit into
mainfrom
codex/add-ens-name-picker-after-authentication
May 22, 2026
Merged

Add ENS owned-name lookup endpoint and claim UI ENS picker#290
GsCommand merged 1 commit into
mainfrom
codex/add-ens-name-picker-after-authentication

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Allow SIWE-authenticated wallets on the Claim flow to pick ENS names they own instead of typing them manually, while keeping the lookup scope limited to ENS identity data only.
  • Use existing provider/indexer options (Alchemy/RPC or SimpleHash) configurable via environment variables so the feature can run in deployed environments.

Description

  • Added a new API handler GET /api/ens/owned implemented in api/ens/owned.js that returns { ok, address, primaryName, ownedNames } with ownedNames entries shaped as { name, source: 'ens_nft', ownershipStatus: 'owned', controlStatus: 'not_checked' } and a stable PROVIDER_UNAVAILABLE fallback when no provider is configured.
  • Provider detection now accepts ALCHEMY_ETH_API_KEY, ALCHEMY_ETH_RPC_URL, ETH_RPC_URL, or SIMPLEHASH_API_KEY as valid configuration sources, and the handler performs a reverse lookup via ethers for the primary ENS name when an RPC/Alchemy provider is available.
  • When SIMPLEHASH_API_KEY is present the handler queries SimpleHash NFT owners to enumerate .eth ENS names (deduped, lowercased), and merges the primary name into results when appropriate.
  • Integrated client UI behavior in public/claim.html so 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 label and Use 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

  • Ran npm test which 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.
  • Ran cd examples/webhook-auto-verify && npm install && npm run check which completed successfully.
  • Attempted npm install at the repository root but it failed in this environment due to a registry policy error (403 for @neondatabase/serverless), and npm run build is not defined in package.json (so a build script was not run).

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented May 22, 2026

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

Project Deployment Actions Updated (UTC)
commandlayer-commandlayer-org Ready Ready Preview, Comment May 22, 2026 10:03pm
commandlayer-org Ready Ready Preview, Comment May 22, 2026 10:03pm
commandlayer-org111 Ready Ready Preview, Comment May 22, 2026 10:03pm

Request Review

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant