Documentation for agents: an index at /llms.txt, every docs page in one file at /llms-full.txt, and Markdown for any docs page by adding .md to its URL.

Skip to Content
ensforgeReact

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

A list with
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, WriteResult and ReadConfig.

Was this page helpful?