Skip to content

Commit

Permalink
Improve expl
Browse files Browse the repository at this point in the history
  • Loading branch information
lealobanov committed Dec 11, 2024
1 parent a18e1d5 commit 7c3c23d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions explanations/contract.txt
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.
4 changes: 2 additions & 2 deletions explanations/transaction.txt
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.

0 comments on commit 7c3c23d

Please sign in to comment.