1

I am using the following code:

public async getTokensAccountbyOwner(publicKey: PublicKey) {
const accounts = await this.connection.getParsedProgramAccounts(
  TOKEN_PROGRAM_ID, // new PublicKey("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA")
  {
    filters: [
      {
        dataSize: 165, // number of bytes
      },
      {
        memcmp: {
          offset: 32, // number of bytes
          bytes: publicKey.toBase58(), // base58 encoded string
        },
      },
    ],
  })
  return accounts;

}

to fetch SPL owner by wallet, how can i filter out NFTz address?

1 Answer 1

2

A better way would be to look into the decimals and supply of the Token Mint Account. If the decimals are 0 and the supply is 1 then its an NFT

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.