Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch all domains for address #6

Open
mcintyre94 opened this issue Jul 13, 2023 · 1 comment
Open

Fetch all domains for address #6

mcintyre94 opened this issue Jul 13, 2023 · 1 comment

Comments

@mcintyre94
Copy link

mcintyre94 commented Jul 13, 2023

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

@mikemaccana
Copy link
Contributor

mikemaccana commented Jul 17, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants