Web3JS Online
Viem Online
The getEnsAvatar function retrieves the avatar associated with a given ENS name. It does this by calling the getEnsText function with the key set to 'avatar'. The function takes an ENS name as input and returns the avatar URI for that name.
The function also allows for specifying a block number or block tag to perform the read against, as well as an optional gatewayUrls object to resolve IPFS and/or Arweave assets. Additionally, an optional universalResolverAddress can be provided to specify the address of the ENS Universal Resolver Contract.
The function returns a string representing the avatar URI for the ENS name, or null if the avatar cannot be resolved from the ENS name.
It's important to note that ENS names can have certain forbidden characters and validation rules, so it's recommended to normalize ENS names with UTS-46 normalization before passing them to getEnsAvatar. The built-in normalize function can be used for this. Overall, getEnsAvatar is a helpful function for retrieving the avatar associated with an ENS name, and can be useful in a variety of contexts, such as when building Ethereum-based applications or when working with ENS names in general.
Webhooks, Alerts, and a simple API.