Skip to content
docs

EnsResolverOptions

Defined in: names-ens/src/ens.ts:12

Options for ensResolver: an Ethereum-mainnet client or RPC URL, and caching.

optional cacheTtlMs?: number

Defined in: names-ens/src/ens.ts:29

Cache TTL for resolutions, reverse lookups and avatars. Default 5 min.


optional ccip?: EnsCcipOptions

Defined in: names-ens/src/ens.ts:27

How the client built from rpcUrl asks CCIP-Read gateways (see EnsCcipOptions). On React Native, offchain names resolve only with ccip.fetch (one that refuses redirects, e.g. through your server) or ccip.allowRedirectFollowingFetch. With your own client, use ccipRead: createEnsCcipRead(…) instead.


optional client?: object

Defined in: names-ens/src/ens.ts:19

A viem client on Ethereum mainnet (the registry + universal resolver live there). Create it with ccipRead: ensCcipRead (or ccipRead: false): with viem’s default, a name’s offchain resolver chooses URLs the user’s device fetches — http://192.168.1.1/… included. A client built from rpcUrl has it already.


optional foreignTlds?: readonly string[]

Defined in: names-ens/src/ens.ts:36

TLDs this resolver should leave to others (sol, near, ton …). Default: those three plus t.me.


optional ipfsGateway?: string

Defined in: names-ens/src/ens.ts:34

IPFS gateway for ipfs:// avatars: an origin (https://gw.example, /ipfs/<cid> is appended, as viem did) or a prefix ending in /ipfs/. Default https://ipfs.io/ipfs/. Point it at your own proxy to keep users’ IPs private.


optional rpcUrl?: string

Defined in: names-ens/src/ens.ts:21

…or a mainnet RPC URL to build one from. One of the two is required.