2

Using getTokenAccountsByOwner we can get all token accounts and using getTokenAccountBalanace we can use the token account to get it's balance. However I was wondering what would be the most efficient and fastest method to get all mints of tokens held by an account? What I want to do is to display all tokens held by a user but unsure how to do so.

1 Answer 1

1

You can do this using findDataByOwner via Metaplex js library.

Example:

const myNfts = await metaplex
    .nfts()
    .findAllByOwner({ owner: metaplex.identity().publicKey })
    .run();

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.