Skip to content

feat: add Onchain Subnames SDK for registration and renewal - #52

Draft
HAPPYS1NGH wants to merge 2 commits into
releasefrom
feat/onchain-sdk
Draft

HAPPYS1NGH wants to merge 2 commits into
releasefrom
feat/onchain-sdk

Conversation

@HAPPYS1NGH

@HAPPYS1NGH HAPPYS1NGH commented Nov 1, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Add @thenamespace/onchain-subnames so applications can quote and prepare ENSv2 subname registrations and renewals without duplicating contract reads, proof retrieval, payment approvals, and simulation. Applications retain control of wallet prompts and transaction submission.

  • Expose registration/account terminology, explicit ready, blocked, and account_required quote outcomes, nullable USD prices, and nullable expiry information.
  • Refresh state and Merkle proofs during preparation; verify proofs against onchain roots and preserve typed error codes, causes, and actionable messages. Keep managerApiUrl unchanged.
  • Return ordered calls, payment details, and balance/network-fee estimates. Keep raw contract configuration out of ordinary quotes and provide separate advanced reads.
  • Include Ethereum/Sepolia deployments, ESM/CommonJS builds, ABI source tracking, and usage documentation. Existing SDK packages keep their public APIs.

Validation

  • SDK tests: 75 passed across four suites.
  • SDK typecheck and build passed; PR diff checked for whitespace errors and credentials.
  • Local ENS Components integration: 20 mocked browser tests passed, including disconnected pricing, approvals, proof outages, stale prices, rejected transactions, and reverted receipts.
  • Live Sepolia integration: 4 registrations and 1 renewal passed, covering ETH/USDC and sequential/atomic registration. Three duplicate renewal cases were intentionally skipped.

Release notes

This is an unpublished new package. Requires Node.js 18+ or compatible browser APIs, Viem, and an RPC supporting eth_simulateV1 for simulation. maxPriceUsd guards preparation; it is not an onchain execution-price cap. Sequential ERC20 flows must prepare and simulate again after approval.

ENS Components integration: thenamespace/ens-components#63. Land and publish this SDK before removing the integration PR's local dependency override and completing its package checks. Publishing workflow selection for this package remains a follow-up; this PR does not publish or deploy anything.

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.

1 participant