Resolving
Forward Resolve (from Name to Address)
Onchain
Assuming you have minted yourname.hemi with correct data (or correct setAddr), you need to call resolve on the universal resolver passing the dns encoded form of the name and the function you want to call (in this case, addr(bytes node)). Code can be found HERE
With Viem
const ensAddress = await publicClient.getEnsAddress({
name: normalize('test.hemi'),
})
Reverse Resolve (from Address to Name)
Onchain
Assuming you have minted test.hemi with correct data (or correct setAddr), you need to call reverse on the universal resolver passing the dns encoded form of the reverse address. Check ENS documentation if you need more
With Viem
const ensName = await publicClient.getEnsName({
address: '<your address>',
})
return ensName // =>yourname.hemi
Last updated