Closed alexandr-kazakov closed 6 months ago
Hi @alexandr-kazakov - please see our docs: useDomainsForOwner
thanks, for some reason I couldn't find it.
Look, I asked about this lib https://github.com/Bonfida/sns-sdk/blob/main/react/README.md
npm install @bonfida/sns-react
It has useDomainOwner hook, your docs doesn't have info about it, can you give me an example how I can use useDomainOwner hook in react please?
Oh my apologies, I misread the hook in question. The example below will log "domain owner: HKKp49qGWXd639QsuH7JiLijfVW5UtCVY4s1n2HANwEA" which is the owner address of the "bonfida" domain. The initial return is of type Public Key, but using the .toBase58()
method will give us the address as a string.
const { connection } = useConnection();
const { data: domainOwner } = useDomainOwner(connection, "bonfida");
console.log("domain owner:", domainOwner?.toBase58());
If you need further assistance we have a dev-general channel on Discord where our team can assist.
@alexandr-kazakov I'm going to close this issue. Please feel free to reach back out on here or on Discord if you need anything further.
Any example please?