Product management
Product Account: Monetizable Data Structure
The Product data structure encapsulates key details of digital products. It includes seller identity or product authority, a split unique identifier, the marketplace to which it belongs and payment details like price and payment mint.
Init product: The main validation done during this instructions is checking if the user holds the access mint to be able to list products, in case of a token-gate marketplace.
Init product tree: It creates a merkle tree for cNFTs and a metaplex master editon to be able to fetch cNFTs from different merkle trees.
Edit product: Product authority can change payment mint, product price and update the merkle tree (but planning to delete the constraint to allow anyone or marketplace authority to update those trees for the seller).
These register buy instructions handles multiple transfers: payment and optional fees and rewards.
Register buy with token: Mints a fungible token representing the product purchase, the product pda is the mint authority, only calling this instruction and paying users receive this token.
Register buy with cNFT: Similar to the previous option but the user receives a cNFT, as the user does not need an ATA is cheaper, but the seller has to pay upfront for the merkle tree.
Register buy: The indexing strategy with this instruction is using a payment pda as an account input, in this case is not initialized:
Register buy with counter: In this case the Payment account is initialized and just holds the authority and a counter, representing the units purchased of that product by that signer.
Last updated