-
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
a18e1d5
commit 7c3c23d
Showing
2 changed files
with
3 additions
and
5 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,3 +1 @@ | ||
To have more than just the display view, you can create your own Struct in your contract so that it may be used as a view in your NFT. | ||
|
||
Here we create a Traits structure. We then include the Traits view in the getViews function as well as include it as an option in the resolve view function. | ||
You can enhance your NFT contract by adding custom views, like a Traits structure, to provide more detailed information about your NFTs. The Traits view can represent specific attributes, such as characteristics or rarity, making your NFTs more informative and versatile. To enable this, you include the Traits view in the getViews function to indicate that it is supported and update the resolveView function to return the appropriate data when the Traits view is requested. This allows your NFTs to offer richer metadata, making them suitable for a wide range of applications like gaming or collectibles. |
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,3 +1,3 @@ | ||
Now, just as we did with the Display view, we resolve the view for the Traits view and can return it as a dictionary, or however you choose. | ||
Just as we implemented the Display view, we also resolve the Traits view by defining how it retrieves and returns its data. | ||
|
||
Now we have both views and metadata available with very little code needed. | ||
With this setup, both the Display view and the Traits view are accessible, along with the associated metadata. |