Cannot reverse lookup a .sol domain using @bonfida/spl-name-service

Hi, I’ve got some questions for reverse look up, when i use a public key which dose have a .sol domain on bonfida to look up , I always get an error. I’ve followed the guide GitHub - Bonfida/solana-name-service-guide: Small guide to the Solana name service

What error do you get?

Error: Invalid name account provided
at Function.retrieve (state.js?087f:16)
at async performReverseLookup (utils.js?36da:131)

It seems like you are not passing the right account. Can you share your code and the account you are trying to look up?

const network = WalletAdapterNetwork.Mainnet;
const endpoint = clusterApiUrl(network);
const connection = new Connection(endpoint, "confirmed");
const domainKey = new PublicKey(’EvtCpKEaL3qFUmUitSL3wvsdozjQXfxQTomDhhdKx127‘);
try {
          const domainName = await performReverseLookup(connection, domainKey);
          console.log(domainName);
        } catch (e) {
          console.log(e);
     }```

EvtCpKEaL3qFUmUitSL3wvsdozjQXfxQTomDhhdKx127 is not a domain name account Explorer | Solana. performReverseLookup takes a domain name account pubkey and returns the human readable name.

I guess what you are trying to do is to find all the domain names owned by someone? (GitHub - Bonfida/solana-name-service-guide: Small guide to the Solana name service)

1 Like