Skip to content

Add ENS reverse lookup endpoint and Claim prefill after SIWE#270

Open
GsCommand wants to merge 1 commit into
mainfrom
codex/add-ens-wallet-lookup-feature
Open

Add ENS reverse lookup endpoint and Claim prefill after SIWE#270
GsCommand wants to merge 1 commit into
mainfrom
codex/add-ens-wallet-lookup-feature

Conversation

@GsCommand
Copy link
Copy Markdown
Contributor

Motivation

  • Improve the Claim flow by detecting a wallet's primary ENS name after SIWE authentication so the ENS/tenant step can be prefilled and the user can opt-in to use it.
  • Provide a simple backend lookup endpoint to perform ENS reverse resolution using an RPC provider configured via environment variables.
  • Keep privacy and scope tight by only checking ENS identity and not performing ownership verification, token scans, provisioning, payment, or ERC-8004 registration.

Description

  • Added GET /api/ens/lookup?address=0x... at api/ens/lookup.js which validates the request, accepts ETH_RPC_URL or BASE_RPC_URL, performs a reverse lookup with ethers when available, and returns { ok, address, primaryName|null, source: 'reverse_resolution' } or structured errors including PROVIDER_UNAVAILABLE when no RPC is configured.
  • Updated public/claim.html to call the lookup after successful SIWE authentication, display status copy, show Primary ENS detected: name.eth with a Use this ENS name button when found, and provide clear privacy wording that only ENS identity is checked.
  • Implemented UI behavior and field changes for Step 3: CommandLayer mode suggests a tenant label derived from the primary ENS (stripping .eth), Your ENS and Single agent modes prefill the ENS name, and users may always manually override the input.
  • Added server-side tests at tests/api-ens-lookup.test.js covering missing address, invalid address, and provider-missing behavior, and made the ENS lookup handler tolerant when the ethers dependency is not present (returns DEPENDENCY_UNAVAILABLE).

Testing

  • Ran npm install and npm test at repo root, and all tests passed (34/34).
  • Ran npm install and npm run check in examples/webhook-auto-verify which completed successfully.
  • npm run build is not present in this repository and therefore 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 3:47am
commandlayer-org Ready Ready Preview, Comment May 22, 2026 3:47am
commandlayer-org111 Ready Ready Preview, Comment May 22, 2026 3:47am

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