portalpayments/solana-wallet-names

Fetch all domains for address

mcintyre94 opened this issue · 1 comments

I'd like to use this in Explorer to get support for multiple domain services (we currently only support .sol). See solana-labs/explorer#271

One requirement we have is being able to display all the domains owned by an address, eg. https://explorer.solana.com/address/HcKjeHNnRVHhaaRNmvAf4YKDeWWnDqCzQEAvaFig2Dir/domains

It looks like this SDK currently only has a function to get a single domain (I think ANS only?) for an address using walletAddressToNameAndProfilePicture

It'd be great to be able to get all domains for any provider using this SDK. I think that we'd need to combine a few requests for this, but most services do support fetching all domains for an owner. For example parser.getAllUserDomains for ANS and https://sns-sdk-proxy.bonfida.workers.dev/domains/HcKjeHNnRVHhaaRNmvAf4YKDeWWnDqCzQEAvaFig2Dir for .sol

I'd like to use this in Explorer to get support for multiple domain services

Excellent! 😃

It looks like this SDK currently only has a function to get a single domain (I think ANS only?)

No, it gets a single domain, but not ANS only. If it was ANS only, that would defeat the entire purpose of the project, and make the README a lie. See https://github.com/portalpayments/solana-wallet-names/blob/main/src/index.ts#L380

That's very easy to add - just copy the function above and do something like an await Promise.all() - visit https://github.com/portalpayments/solana-wallet-names#contributing and if you send a PR I'll merge it.