useEnsResolver
Hook for getting ENS resolver for name.
import { useEnsResolver } from 'wagmi'
Usage
import { useEnsResolver } from 'wagmi'
const App = () => { const [{ data, error, loading }, getEnsResolver] = useEnsResolver({ name: 'awkweb.eth', })
if (loading) return <div>Fetching resolver…</div> if (error || !data) return <div>Error fetching resolver</div> return <div>Success</div>}
Return Values
result
{ data?: EnsResolver error?: Error loading?: boolean}
getEnsResolver
(config?: { name: string}) => Promise<{ data?: EnsResolver; error?: Error }>
Configuration
name (optional)
Name to fetch resolver.
import { useEnsResolver } from 'wagmi'
const App = () => { const [{ data, error, loading }, getEnsResolver] = useEnsResolver({ name: 'awkweb.eth', })
return ...}
skip (optional)
Skips automatically fetching data on mount. Defaults to false
. Useful if you want to call getEnsResolver
manually at some other point.
import { useEnsResolver } from 'wagmi'
const App = () => { const [{ data, error, loading }, getEnsResolver] = useEnsResolver({ skip: true, })
return ...}