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.
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.
datais 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.getandresolver.getreport 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
| Option | Type | Default | Description |
|---|---|---|---|
name (required) | string | ENS name to resolve. Normalized automatically. | |
data (required) | Hex | Resolver 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.
| Field | Type | Description |
|---|---|---|
data | Hex | |
resolver | Address |
Errors
| Error | Codes | When |
|---|---|---|
InvalidInputError | INVALID_NAME, INVALID_RECORD_VALUE | an invalid name or calldata. |
NotFoundError | RESOLVER_NOT_FOUND | nothing resolves the name. |
UnsupportedError | RESOLVER_PROFILE_UNSUPPORTED | the resolver does not answer the call. |
GatewayError | GATEWAY_REQUEST_FAILED, GATEWAY_RESPONSE_INVALID, OFFCHAIN_LOOKUP_INVALID | an off-chain gateway fails. |
DnsError | a DNS name's DNSSEC proof does not verify. | |
ConfigError | CCIP_READ_DISABLED | off-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
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
resolver.getto inspect the resolver
Was this page helpful?