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

useSetPrimaryName

Sets the signer's primary name. Signature, options, result and examples for useSetPrimaryName in @ensforge/react. Includes examples.

Write hookstable
Since v1.0.0View source

Sets the signer's primary name. Preset of useWrite(Actions.primaryName.set).

It wraps primaryName.set: the same options, result and errors.

Signature

function useSetPrimaryName(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.primaryName.set>[1], Actions.primaryName.set.ReturnType, Actions.primaryName.set.ErrorType >

Examples

A button that sends it
import { useSetPrimaryName } from "@ensforge/react"

function Send() {
  const { mutate, isPending } = useSetPrimaryName()
  return <button disabled={isPending} onClick={() => mutate({ name: "alice.eth" })}>Send</button>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?