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
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,WriteResultandReadConfig.
Was this page helpful?