Method Signature
Parameters
string
required
ENS name (e.g.,
vitalik.eth)JsonRpcProvider
required
Ethereum mainnet provider (ENS only works on mainnet)
Returns
Returns the address as a string, ornull if not found.
Examples
- TypeScript
- JavaScript
Accept ENS or Address
ENS resolution only works on Ethereum mainnet. The SDK uses the mainnet
provider regardless of which network you’re transacting on.
Related Methods
Lookup Address
Reverse ENS lookup
Validate Address
Check address format