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

useRegister

Registers names: commit, wait the minimum age, then register, with every step in steps. Signature, result and examples for useRegister.

Write hookstable
Since v1.0.0View source

Registers names: commit, wait the minimum age, then register, with every step in steps. Preset of useWrite(Actions.registration.register).

It wraps registration.register: the same options, result and errors.

Signature

function useRegister(config?: Parameters<typeof useWrite>[1]): WriteResult< Parameters<typeof Actions.registration.register>[1], Actions.registration.register.ReturnType, Actions.registration.register.ErrorType >

Examples

A button that sends it
import { Duration } from "@ensforge/sdk"
import { useRegister } from "@ensforge/react"

function Send() {
  const { mutate, isPending } = useRegister()
  return <button disabled={isPending} onClick={() => mutate({ names: "alice.eth", duration: Duration.years(1) })}>Send</button>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?