I'm currently working on a Solana Dapp portfolio project where users can connect their wallets and view their token and NFT holdings. I am done making the wallet connection buttons and installing Solana Web3.js and SPL tokens for browser use. However, I've been getting a problem when I want to display holdings of tokens other than SOL.

I've seen YouTube tutorials and documentation, but I couldn't find a comprehensive solution for fetching and displaying the holdings of various tokens in a Solana wallet. While I can retrieve the SOL balance using the getAccountInfo() function, I'm struggling to find a similar method for other tokens in the wallet.

If anyone in the community has experience or insights on how to achieve this, I would greatly appreciate your guidance. Sharing code examples or pointing me in the right direction in the Solana documentation would be incredibly helpful. Thank you in advance for your assistance!

I wanna do this in Javascript, that will be used in browser, not in node.

1 Answer 1


i think you should use this method: https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getParsedTokenAccountsByOwner

You can use it in JS

  • Thanks, let me try this method. But I think this doesn't let us fetch name, metadata and symbol of tokens, I am using this method already in typescript in previous projects, it gives Token Address, mint Acount address and balance in wallet. But Donot Give other info about token. Commented Sep 28, 2023 at 12:14
  • no that's 2 separate things, first you get token accounts and balances, then you look for the metadata for each token
    – Effe2
    Commented Sep 28, 2023 at 13:44
  • Oh, I thought this method should give u all the metadata, Can I know whats method for NFT fetch, whole, I mean is there even a method we can use that we give wallet address, the code gives us NFT all info, metadata etc., I searched stack exchange not found any. its becoming difficult for me. But anyhow now I know that Metadata and Token Address are 2 Different things, thanks for this info. Commented Sep 28, 2023 at 13:54
  • as far as i know, there is not a method. May be in metaplex/js, but not sure. check metaplex/js to decode data, it's quite easy now with their js library
    – Effe2
    Commented Sep 28, 2023 at 15:22

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.