Search code examples
blockchainonflow-cadence

Get all NFTs of an Account on Flow Blockchain


Can I get a list of all NFTs to an account on the Flow Blockchain? There is account storage and the documentation says

...Cadence represents each NFT as a resource object that users store in their accounts...

Or does the respective user has to have a dedicated collection in order to allow others to have a look at their NFTs?


Solution

  • To obtain all NFTs under a user account, the following conditions are required:

    1. A collection needs to be created under the account to store NFT.
    2. The collection provides a public method to query its NFT list.