registration.getRenewalPrice
Quotes renewing one or more .eth names, in an ERC-20 payment token. Options, result, errors and examples for registration.getRenewalPrice.
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 throughETHRenewerV1. 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
| Option | Type | Default | Description |
|---|---|---|---|
names (required) | string | readonly string[] | One or more .eth second-level names. Normalized automatically. | |
duration (required) | bigint | Renewal length in seconds. | |
paymentToken | PaymentToken | "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.
| Field | Type | Description |
|---|---|---|
total | bigint | |
token | TokenInfo | |
items | readonly { readonly name: string; readonly route: RenewalRoute; readonly amount: bigint; }[] |
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME, INVALID_ADDRESS | invalid input. |
NameStateError | NAME_NOT_RENEWABLE | a name is neither registered nor in its grace period. |
UnsupportedError | PAYMENT_TOKEN_UNSUPPORTED, UNSUPPORTED_ON_DEPLOYMENT | an unaccepted token or without ENSv2. |
NetworkError | RPC_REQUEST_FAILED, RPC_TIMEOUT, RATE_LIMITED | the RPC request fails. |
It can also fail with the errors every read can (Errors.CommonError: ConfigError, ContractRevertError, InternalError, NetworkError).
See How errors work.
Examples
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
registration.renewto renew
Was this page helpful?