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

useRegistrationPrice

Reads what registering names for a duration costs. Signature, options, result and examples for useRegistrationPrice in @ensforge/react.

Read hookstable
Since v1.0.0View source

Reads what registering names for a duration costs. Preset of useRead(Actions.registration.getPrice, …).

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

Signature

function useRegistrationPrice(options: Actions.registration.getPrice.Options | undefined, config?: ReadConfig): ReadResult<Actions.registration.getPrice.ReturnType, Actions.registration.getPrice.ErrorType>

Examples

Reading in a component
import { Duration } from "@ensforge/sdk"
import { useRegistrationPrice } from "@ensforge/react"

function View() {
  const { data: price } = useRegistrationPrice({ name: "alice.eth", duration: Duration.years(1) })
  return <span>{String(price?.total)}</span>
}

See also

  • The hook types: ReadResult, WriteResult and ReadConfig.

Was this page helpful?