Ready for backend integration and subsequent end to end adjustments.
This supersedes D10430 given the revised design and the godzilla amount of effort to rebase that diff to the current master.
User Story:
- User opens wallet and clicks on the NFT button.
- UI greets the user with the ability to create an NFT Collection or an NFT itself, along with their existing Collections/NFTs associated with their wallet, segmented in tab form.
- An NFT needs to be associated with a Collection, therefore a Collection needs to be created first before they are able to create individual NFTs.
- User completes the Create Collection form and notes the Collection ID and sees the newly created Collection in the Collection tab.
- User references the Collection ID as part of completing the Create NFT form and sees the newly created NFT in the NFT tab.
- The Collection token corresponding to the newly created NFT is burned.
- User clicks on the individual Collection or NFT to send various Collections and NFTs to other eToken addresses.
UI notes:
- This diff loosely follows the wireframes in T1793. Due to the limited UI real estate I opted away from T1793's approach of an expanding Collection card revealing the linked NFTs because the NFTs would have had to shrink to an unacceptable level.
- NFT Projects (i.e. Collections) that are intending to create several thousands of NFTs will need to develop their own custom scripts as it would not be practical to repeat this UI a few thousand times. Cashtab should be able to display those Collections/NFTs but recommendation is for projects to have their own sites that displays them to their requirements.
Coding notes:
- Within useBCH.js, I originally planned to utilise the existing createToken() and pass in various NFT flags, but that function was already a spaghetti junction. Hence separate functions are created for creating and sending Collections and NFTs, particularly since there are unique logic (e.g. parsing for the UTXO holding the Collection ID token). Keeping these as separate functions will also facilitate future NFT functionality.
- Unit tests will be added once the backend is integrated.