@ens:text
Read a text record from an ENS name.
On-chain (@ens:text!): Mainnet only, and a missing record or a name with no resolver reads as an empty string instead of erroring.
Returns: string
Syntax
Section titled “Syntax”@ens:text(name key)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
name | string | ENS name (e.g. vitalik.eth) |
key | string | Text record key (e.g. "url", "com.twitter", "description") |
Examples
Section titled “Examples”# Read a URL text recordset $url @ens:text("vitalik.eth" "url")print $url
# Read a Twitter handleset $twitter @ens:text("vitalik.eth" "com.twitter")print $twitterOn-chain face (@ens:text!)
Section titled “On-chain face (@ens:text!)”Mainnet only, like every ENS face: an assertion is judged on the chain it
runs on, and ENS cannot be reached from another chain. The face is the
@addr! shape with the resolver's text(node, key) call in the chain
hop: resolver(node) on the registry, a hop into whatever resolver that
word holds at judgement, and a cond that turns an unset resolver into
the empty string. A resolver that exists but has no record for the key
also answers the empty string — where the plain face errors — so assert
against "" to express absence.
See Also
Section titled “See Also”- @ens:name — reverse-resolve an address
- @ens:avatar — get the avatar URI