-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a51e73
commit 8858854
Showing
2 changed files
with
6 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |