This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
# Install dependencies
bun install
# Start development server
bun dev
# Build for production
bun run build
# Run linter
bun run lint
# Preview production build
bun run previewThis is a React + TypeScript demo application showcasing JustaName SDK integration for ENS subname management. The application allows users to:
- Connect Ethereum wallets via Wagmi
- Claim and manage ENS subnames
- Update text records, addresses, and content hashes
- Resolve ENS names to addresses
- Framework: React 19 with TypeScript
- Build Tool: Vite
- Blockchain: Wagmi + @justaname.id/react SDK
- UI Components: shadcn/ui with Tailwind CSS
- State Management: React Query (TanStack Query)
src/providers.tsx: Wraps app with JustANameProvider, WagmiProvider, and QueryClientProvidersrc/wagmi/config.ts: Wagmi configuration for wallet connectionssrc/config/constants.ts: Environment variables and configurationsrc/components/subname/: ENS subname management componentssrc/components/wallet/: Wallet connection componentssrc/components/ui/: shadcn/ui components library
The app requires environment variables in .env file:
VITE_APP_ORIGIN=http://localhost:5173
VITE_APP_DOMAIN=localhost:5173
VITE_APP_MAINNET_PROVIDER_URL=<ethereum-rpc-provider-url>
VITE_APP_MAINNET_ENS_DOMAIN=<ens-domain>
VITE_APP_MAINNET_API_KEY=<justaname-api-key>The JustaNameProvider must wrap the entire application. Key hooks include:
useAddSubname: Claim new subnamesuseAccountSubnames: List user's subnamesuseUpdateSubname: Update subname recordsuseRevokeSubname: Delete subnamesuseIsSubnameAvailable: Check availabilityuseLookupAddress: Resolve ENS names
- Cointype for addresses: When setting addresses, use the appropriate cointype (e.g., 2147492101 for Base chain)
- Provider Wrapping: JustANameProvider must wrap the app for hooks to function
- Path Aliases: Use
@/for imports fromsrc/directory - Toast Notifications: Use sonner for user feedback on subname operations