I want to get a list of tokens I currently own, for a given wallet public key.
Currently I am using https://api.solscan.io/account/tokens?address="PUBLIC_KEY">&price=1
to get the tokens I own.
Okay. So I found this. Using the SPL Token ID as the program ID will return all the user owned tokens.
connection
.getParsedTokenAccountsByOwner(
new PublicKey("PUBLIC_KEY"),
{
programId: new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
}
)