Ethereum Asked by TurbanMan on December 27, 2020
I am looking at web3.eth.ens library, I can see methods setText and getText, which allows you to set and get key value pairs against an ENS name. What is the purpose of this? Also is there a way to find all the keys against an ENS name?
The functions setText()
and text()
allow ENS name holders to associate metadata with a ENS name.
Both are functions of the TextResolver.sol
contract.
From ENS docs:
function setText(bytes32 node, string calldata key, string calldata value) external authorised(node)
Sets text metadata for
node
with the unique keykey
tovalue
, overwriting anything previously stored fornode
andkey
. To clear a text field, set it to the empty string.
function text(bytes32 node, string calldata key) external view returns (string memory)
Retrieves text metadata for
node
. Each name may have multiple pieces of metadata, identified by a unique stringkey
. If no text data exists fornode
with the keykey
, the empty string is returned.
Answered by alberto on December 27, 2020
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP