Domain
A component for resolving and displaying Avalanche domain names for Ethereum addresses.
Domain
The Domain component resolves and displays Avalanche domain names for Ethereum addresses, with fallback to abbreviated addresses.
Usage
Props
Prop | Type | Default | Description |
---|---|---|---|
address | string | - | The Ethereum address to resolve domain for (optional if used within Identity context) |
showAddressIfNotAvailable | boolean | false | Show abbreviated address if no domain is found |
Features
- Resolves Avalanche domain names using
useAvaxDomain
hook - Shows loading indicator while resolving
- Optional fallback to abbreviated address display
- Can use address from Identity context if not provided directly
- Validates input addresses
Examples
Basic Domain Display
With Address Fallback
With Identity Context
States
- Loading: Shows a loading indicator while resolving the domain
- Resolved: Displays the resolved domain name
- Not Found:
- Shows nothing if
showAddressIfNotAvailable
is false - Shows abbreviated address if
showAddressIfNotAvailable
is true
- Shows nothing if
Error Handling
The component will throw an error if:
- No address is provided (either via props or context)
- The provided address is not a valid Ethereum address
Edit on GitHub
Last updated on