fetchEnsAvatar
Action for fetching avatar for ENS name.
import { fetchEnsAvatar } from '@wagmi/core'
Usage
import { fetchEnsAvatar } from '@wagmi/core'
const avatarUrl = await fetchEnsAvatar({
address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
})
Return Value
string
Configuration
address
Address or ENS name to fetch avatar for.
import { fetchEnsAvatar } from '@wagmi/core'
const ensAvatar = await fetchEnsAvatar({
address: '0xa5cc3c03994db5b0d9a5eedd10cabab0813678ac',
})
chainId (optional)
Force a specific chain id for the request. The wagmi Client
's ethers provider
must be set up as a chain-aware function for this to work correctly.
import { fetchEnsAvatar } from '@wagmi/core'
const ensAvatar = await fetchEnsAvatar({
address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
chainId: 1,
})