From freeCodeCampWeb3's Solana curriculum, build-a-university-nft-certification project:
"getMintAccounts should return all mint accounts owned by the provided payer parameter"
export async function getMintAccounts({ payer }) {
const mintAccounts = await connection.getParsedTokenAccountsByOwner(
payer.publicKey,
{
mint,
},
);
console.log(mintAccounts);
return mintAccounts.value.map(({ account }) => account);
}
For somewhat reason it returns an empty array. Performing a JSONRPC call using method of getProgramAccounts using the TOKEN_PROGRAM_ID shows an account with a pubkey value corresponding to the newly created mint.