- The updated Cashtab backend is structured around the concept of the Group vs subgroup NFTs
- new NFT components created for Group NFTs in the form of CreateGroupNftForm.js, SendNFT.js, GroupNFTList.js
- new NFT components created for Child NFTs in the form of CreateChildNftForm.js, SendChildNFT.js, ChildNFTList.js
- new routes added to App.js to enable the navigation to the new Send NFT pages by clicking on the Group or Child NFTs
- updated Tokens.js and TokenList.js with NFT processing logic
- new createGroupNFT() and createChildNFT() functions created in useBCH.js to take in the config object containing the NFT attributes and calls on SLP.NFT1.newNFTGroupOpReturn and SLP.NFT1.generateNFTChildGenesisOpReturn via bch-js to create the group/child NFTs
- new sendGroupNFT() and sendChildNFT() functions created in useBCH.js which calls on SLP.NFT1.generateNFTGroupSendOpReturn and SLP.NFT1.generateNFTChildSendOpReturn via bch-js and transfers it accordingly.
- updated the getSlpBalancesAndUtxos() function in useBCH.js to look for the '129' Group NFT and '65' Child NFT tokenType and flags the isGroupNFT or isChildNFT booleans in the returned token object. These booleans are also used for front end delination between eTokens, Group NFT and Child NFTs
- UI will need some further work to ensure it's not cluttering the front end
- will create snapshots for the new screens once we're closer to finalising this diff
- minting functions can be left for a subsequent diff once this is working in prod
Question for @bytesofman
- How do you want to handle image storage and displays? I've left this aspect untouched for now subject to your input. Upload to IPFS via Cashtab or store some sort of hash of the image onchain to be retrieved in subsequent calls. Don't think the existing token icon reference is workable for NFT as you wouldn't want dead links showing up on what is supposed to be a non-fungible object.
- Default token type field for Group NFTs is 0x81, and subgroup NFT is 0x41. We'll need to decide if we want different standards for eCash NFTs. Similarly the decimal precision is set to 0 for the NFT group as per existing SLP NFT1 specs
- The concept of creating vs minting will be a learning curve for the average user so will need to agree on how much of the NFT attributes do we expose to the UI and how many do we hardcode with a nominal value to streamline the UX.
T1793