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
ensforgeSDK

registration.getRenewalPrice

Quotes renewing one or more .eth names, in an ERC-20 payment token. Options, result, errors and examples for registration.getRenewalPrice.

ReadBatchablestable
Since v1.0.0View source

Quotes renewing one or more .eth names, in an ERC-20 payment token.

When to use

Use to show the cost of extending names before calling registration.renew.

Details

  • ENSv2 names renew through the ETHRegistrar; names still on ENSv1 renew through ETHRenewerV1. Each item says which (route).
  • Costs one batched call for any number of names.

Signature

function getRenewalPrice(
  client: Like,
  options: getRenewalPrice.Options,
): Promise<getRenewalPrice.ReturnType>

Call it as ens.registration.getRenewalPrice(options) on a client, or Actions.registration.getRenewalPrice(client, options).

registration.getRenewalPrice.request(options) builds a deferred read for Actions.batch. See Look up many at once.

Parameters

OptionTypeDefaultDescription
names (required)string | readonly string[]One or more .eth second-level names. Normalized automatically.
duration (required)bigintRenewal length in seconds.
paymentTokenPaymentToken"usdc"Token to pay with.

Also takes the read options.

Returns

Resolves to getRenewalPrice.ReturnType. The total and one item per name, in token units.

FieldTypeDescription
totalbigint
tokenTokenInfo
itemsreadonly { readonly name: string; readonly route: RenewalRoute; readonly amount: bigint; }[]

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAME, INVALID_ADDRESSinvalid input.
NameStateErrorNAME_NOT_RENEWABLEa name is neither registered nor in its grace period.
UnsupportedErrorPAYMENT_TOKEN_UNSUPPORTED, UNSUPPORTED_ON_DEPLOYMENTan unaccepted token or without ENSv2.
NetworkErrorRPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITEDthe RPC request fails.

It can also fail with the errors every read can (Errors.CommonError: ConfigError, ContractRevertError, InternalError, NetworkError).

See How errors work.

Examples

Quoting two names
const { total, items } = await ens.registration.getRenewalPrice({ names: ["alice.eth", "bob.eth"], duration: 31536000n })

Example response

Recorded from Ethereum mainnet on 2026-11-18 at block 26443964. Values change as the chain does.

await ens.registration.getRenewalPrice({ names: "nick.eth", duration: 31_536_000n })
{
  "total": "160000009n",
  "token": {
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "symbol": "USDC",
    "decimals": 6
  },
  "items": [
    {
      "name": "nick.eth",
      "route": "v2-registrar",
      "amount": "160000009n"
    }
  ]
}

See also

Was this page helpful?