usePrimaryName
Reads the primary name of an address, verified against its forward address. Signature, options, result and examples for usePrimaryName in @ensforge/react.
Read hookstable
Since v1.0.0View source
Reads the primary name of an address, verified against its forward address. Preset of useRead(Actions.primaryName.get, …).
It wraps primaryName.get: the same options, result and errors.
Signature
function usePrimaryName(options: Actions.primaryName.get.Options | undefined, config?: ReadConfig): ReadResult<Actions.primaryName.get.ReturnType, Actions.primaryName.get.ErrorType>Examples
import { usePrimaryName } from "@ensforge/react"
function View() {
const { data: primary } = usePrimaryName({ address })
return <span>{primary}</span>
}See also
- The hook types:
ReadResult,WriteResultandReadConfig.
Was this page helpful?