Skip to content

Commit

Permalink
Improve explanation content
Browse files Browse the repository at this point in the history
  • Loading branch information
lealobanov committed Dec 11, 2024
1 parent 6a51e73 commit 8858854
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 3 additions & 5 deletions explanations/contract.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
The following functions are to be included in your NFT resource when creating a contract.
The NFT resource in the contract is designed to provide a comprehensive metadata interface that allows users and applications to interact with the NFT in a meaningful way. The getViews function lists all the metadata views supported by the NFT, enabling others to understand the types of metadata the NFT can provide. For instance, these views might include details like display information, royalties, collection-specific data, and other standardized metadata views.

getViews tells someone all the views your NFT has, while resolveView returns the metadata from that view.
The resolveView function complements getViews by allowing users to retrieve the actual metadata associated with a specific view type. This function makes it possible to access detailed metadata for the NFT, such as its name, description, thumbnail, or any custom metadata provided by the contract.

In your Collection resource you will have the borrowViewResolver function that is available in the Metadata Contract. You will need to import the MetadataViews.ResolverCollection interface into your collection.

This returns the capability for the NFT to use the above functions.
Additionally, the Collection resource includes a borrowViewResolver function, which adheres to the MetadataViews.ResolverCollection interface from the Metadata contract. This function provides a reference to the ViewResolver for a specific NFT within the collection, enabling seamless access to its metadata. By implementing MetadataViews.ResolverCollection, the Collection resource ensures compatibility with standardized metadata handling, making it easier for external applications and marketplaces to interact with and display information about the NFTs in the collection.
6 changes: 3 additions & 3 deletions explanations/transaction.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Here we borrow the capability to use the borrowViewResolver function.
In this transaction, we begin by borrowing the capability from the Collection resource that allows us to access the borrowViewResolver function. This function is key to retrieving a reference to the ViewResolver for a specific NFT within the collection.

When that is done, we then have the ability to use the functions resolveView and getViews if they are in our NFT resource.
nce we have this reference, we gain the ability to use two functions defined in the NFT resource: resolveView and getViews. The getViews function lets us identify all the metadata views supported by the NFT, providing insight into the kinds of metadata available. The resolveView function then enables us to retrieve the actual metadata associated with a specific view type, such as display information or other custom-defined metadata.

After that we return the display.
Finally, we use this functionality to access and return the Display metadata view, which typically includes details like the name, description, and thumbnail of the NFT.

0 comments on commit 8858854

Please sign in to comment.