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

resolver.getLink

Reads which record set an ENS name uses on its PermissionedResolver. Parameters, return value, errors and examples for resolver.getLink in @ensforge/sdk.

ReadBatchablestable
Since v1.0.0View source

Reads which record set an ENS name uses on its PermissionedResolver.

When to use

Use to tell whether names share records: linked names have the same recordId on the same resolver.

Details

  • Every name gets its own record ID on its first write; resolver.link points a name at another name's record ID.
  • Returns null when the name has no records on the resolver yet, unless strict is set.

Signature

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

Call it as ens.resolver.getLink(options) on a client, or Actions.resolver.getLink(client, options).

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

Parameters

OptionTypeDefaultDescription
name (required)stringENS name to read. Normalized automatically.

Also takes the read options.

Returns

Resolves to { readonly resolver: Address; readonly recordId: bigint } | null. The resolver and the name's record ID, or null when it has no records there.

FieldTypeDescription
resolverAddress
recordIdbigint

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAMEthe name cannot be normalized.
NotFoundErrorRESOLVER_NOT_FOUND, RECORD_NOT_FOUNDwithout a resolver, or with strict and no records.
UnsupportedErrorRESOLVER_PROFILE_UNSUPPORTEDthe resolver is not a PermissionedResolver.
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

Checking whether two names share records
const [a, b] = await Promise.all([
  ens.resolver.getLink({ name: "alice.eth" }),
  ens.resolver.getLink({ name: "alice-main.eth" }),
])
const shared = a !== null && b !== null && a.resolver === b.resolver && a.recordId === b.recordId

Example response

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

await ens.resolver.getLink({ name: "nick.eth" })
{
  "resolver": "0xF4f1007EA430848F2fAd60e405A54Fc100fEc341",
  "recordId": "3n"
}

See also

Was this page helpful?