Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get the list of assets associated to a Solana wallet address

I am using web3 sdk of Solana to query balances or make transactions. Now I would like to know if it's possible to achieve one of the following actions:

  1. Get a list of the assets from a provided wallet address.
  2. Get a wallet address from a provided nft address. This one will be better if both are possible.
like image 711
Jaume Avatar asked Oct 22 '25 16:10

Jaume


1 Answers

Absolutely, to answer your questions:

  1. getTokenAccountsByOwner, where the owner is the wallet address: https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getTokenAccountsByOwner
  2. getTokenLargestAccounts will give the holders for the nft: https://solana-labs.github.io/solana-web3.js/classes/Connection.html#getTokenLargestAccounts
like image 98
Jon C Avatar answered Oct 25 '25 22:10

Jon C