Got my first ever front end working!
It allows you to input the information needed to buy a royalty-enforced NFT!
As outlined in my older post about enforcing NFTs on Stellar the backend does the following:
- Change Trust
- Allow Trust
- Find and match the sell price on SDEx
- Send Royalty Payment
- Output XDR
You can then sign the XDR on Stellar Laboratory, or any other wallet that allows you to import an XDR transaction. I could also allow users to provide their secret key directly but I am not sure my endpoints are secure for transmitting that sensitive data.
I can store my own Issuer secret keys so that info won’t have to be input by the buyer but will need a way to do it for others once they start issuing NFTs under my framework.
Because of the way authorized assets work on Stellar, potential buyers cannot make an offer on the SDEx without being allowed trust, which cannot be done because combining that action with the royalty payment is how I enforce royalties.
Unfortunately, the royalty payment must be paid in ADDITION to the purchase price. Really, it should be paid by the seller but then it would also require having that secret key. I suppose it could be possible to set this up as a claimable balance requiring a bundled royalty payment but I really want to use the SDEx to complete the trades instead of just doing payments. I suppose I could utilize an escrow account that completes the transaction and then holds the funds until the seller authorizes the royalty payment. In fact, this might help get around the inability to make buy offers. Might be exploring this in the future.