0

I want to show a list of Tokens and can't figure out where to find the url to the token icon. It does not seem to be in the meta data like for NFTs. https://explorer.solana.com/address/orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE/metadata

Seems its coming from the TokenList https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE/logo.png

Do I need to parse the Solana token list and match it to the Symbol of the AccountInfo data? Or is there an easier way to do it? https://github.com/solana-labs/token-list?

2 Answers 2

1

This works:

string tokenIconUrl = $"https://github.com/solana-labs/token-list/blob/main/assets/mainnet/{tokenMint}/logo.png?raw=true";

But seems to be old way of doing things and should use the meta data account instead according to this: https://github.com/solana-labs/token-list

-1

The "token-list" repo is old and outdated since summer 2022.

It has been superceded by a new API. You can get the token metadata (including the image) programmatically.

When I get home from work I will show you some sample code here.

3
  • Thanks, i checked the meta data, but could not figure out yet how to deserialize it and looks like the orca token for example does not have a URL set in the meta data. At least from what i can see in the explorer: explorer.solana.com/address/…
    – Jonas H.
    Commented Sep 26, 2022 at 14:25
  • @JonasH. what is the token address? Commented Sep 27, 2022 at 6:13
  • orcaEKTdK7LKz57vaAYr9QeNsVEPfiu6QeMU1kektZE
    – Jonas H.
    Commented Sep 27, 2022 at 8:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.