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.resolve

Calls the resolver of an ENS name with raw calldata through the Universal Resolver (ENSIP-10). Options, result, errors and examples for resolver.resolve.

ReadBatchablestable
Since v1.0.0View source

Calls the resolver of an ENS name with raw calldata through the Universal Resolver (ENSIP-10).

When to use

Use to read resolver profiles ensforge has no action for. Use record.get for the standard records.

Details

  • Finds the resolver like any ENS client: the name's own, a parent's wildcard, or off-chain through CCIP-Read.
  • data is the resolver call, with the name's node as its first argument.
  • Returns the ABI-encoded result and the resolver the Universal Resolver called: for ENSv1 names ENSv2 serves through the ENSv1 bridge, the bridge itself (record.get and resolver.get report the ENSv1 resolver behind it).

Signature

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

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

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

Parameters

OptionTypeDefaultDescription
name (required)stringENS name to resolve. Normalized automatically.
data (required)HexResolver calldata, e.g. text(node, key).

Also takes the read options.

Returns

Resolves to { readonly data: Hex; readonly resolver: Address }. The ABI-encoded result and the resolver that answered.

FieldTypeDescription
dataHex
resolverAddress

Errors

ErrorCodesWhen
InvalidInputErrorINVALID_NAME, INVALID_RECORD_VALUEan invalid name or calldata.
NotFoundErrorRESOLVER_NOT_FOUNDnothing resolves the name.
UnsupportedErrorRESOLVER_PROFILE_UNSUPPORTEDthe resolver does not answer the call.
GatewayErrorGATEWAY_REQUEST_FAILED, GATEWAY_RESPONSE_INVALID, OFFCHAIN_LOOKUP_INVALIDan off-chain gateway fails.
DnsErrora DNS name's DNSSEC proof does not verify.
ConfigErrorCCIP_READ_DISABLEDoff-chain names when CCIP-Read is disabled.

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

See How errors work.

Examples

Calling a custom profile
import { encodeFunctionData, namehash, parseAbi } from "viem"

const abi = parseAbi(["function text(bytes32, string) view returns (string)"])
const data = encodeFunctionData({ abi, functionName: "text", args: [namehash("nick.eth"), "url"] })
const { data: result } = await ens.resolver.resolve({ name: "nick.eth", data })

Example response

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

await ens.resolver.resolve({ name: "nick.eth", data: "0x3b3b57de05a67c0ee82964c4f7394cdd47fee7f4d9503a23c09c38341779ea012afe6e00" })
{
  "data": "0x000000000000000000000000b8c2c29ee19d8307cb7255e1cd9cbde883a267d5",
  "resolver": "0xF4f1007EA430848F2fAd60e405A54Fc100fEc341"
}

See also

Was this page helpful?