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

indexer.getNamesByExpiry

Lists names by when they expire or leave their grace period. Parameters, return value, errors and examples for indexer.getNamesByExpiry in @ensforge/sdk.

ReadBatchablestable
Since v1.0.0View source

Lists names by when they expire or leave their grace period.

When to use

Use to find names expiring soon, e.g. renewal reminders or a drop-catching list.

Details

  • Pass either expiry bounds (expiresAfter, expiresBefore, windows) or grace bounds (graceEndsAfter, graceEndsBefore, graceWindows), not both.
  • With windows, each name reports the window it matched (windowIndex).

Signature

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

Call it as ens.indexer.getNamesByExpiry(options) on a client, or Actions.indexer.getNamesByExpiry(client, options).

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

Parameters

OptionTypeDefaultDescription
limitnumberRows per page, 1–200. @default 50
cursorstringThe previous page's cursor.
includeTotalbooleanCount every row (totalCount); slower.
expiresAfterbigint | Date
expiresBeforebigint | Date
windowsreadonly Window[]Up to 32 disjoint expiry windows; results report the matching windowIndex.
graceEndsAfterbigint | Date
graceEndsBeforebigint | Date
graceWindowsreadonly Window[]
authorityAuthority | readonly Authority[]
parentstring
sort"expiry" | "graceEnd"Field the rows are sorted by.
order"asc" | "desc"Sort direction.
namespaceNamespace"ens"

Also takes the read options.

Returns

Resolves to Page<ExpiringName>. One page of names, soonest first unless order says otherwise.

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAMEparent does not normalize.
ConfigErrorINDEXER_NOT_CONFIGUREDthe client has no indexer.
IndexerErrorINDEXER_UNSUPPORTEDthe indexer does not serve the query or its namespace.
IndexerErrorINDEXER_UNAVAILABLE, INDEXER_RATE_LIMITED, INDEXER_BEHIND, INDEXER_REQUEST_REJECTED, INDEXER_RESPONSE_INVALIDthe indexer is unavailable, rate limiting, behind, rejects the request or answers unexpectedly.

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

See How errors work.

Examples

Listing names expiring this month
const page = await ens.indexer.getNamesByExpiry({ expiresAfter: new Date(), expiresBefore: inAMonth })

Was this page helpful?