useNamesForAddress
Lists the names an address owns, manages or is the primary name of, page by page, from the indexer. Signature, result and examples for useNamesForAddress.
Read hookstable
Since v1.0.0View source
Lists the names an address owns, manages or is the primary name of, page by page, from the indexer. Preset of useInfiniteRead(Actions.indexer.getNamesForAddress, …).
It wraps indexer.getNamesForAddress: the same options, result and errors.
Signature
function useNamesForAddress(options: Omit<Actions.indexer.getNamesForAddress.Options, "cursor">, config?: { readonly client?: ReadConfig["client"] }): InfiniteReadResult< Actions.indexer.getNamesForAddress.ReturnType, Actions.indexer.getNamesForAddress.ErrorType >Examples
import { useNamesForAddress } from "@ensforge/react"
function List() {
const { items, hasMore, loadMore } = useNamesForAddress({ address })
return <button disabled={!hasMore} onClick={loadMore}>{items.length}</button>
}See also
- The hook types:
ReadResult,WriteResultandReadConfig.
Was this page helpful?