🛒Product
Th data structure representing a product is defined as follows:
#[account]
pub struct Product {
pub authority: Pubkey,
pub first_id: [u8; 32],
pub second_id: [u8; 32],
pub marketplace: Pubkey,
pub product_mint: Pubkey,
pub merkle_tree: Pubkey,
pub seller_config: SellerConfig,
pub bumps: ProductBumps,
}
The Product
struct contains the following components:
authority
: The public key of the seller who owns the product.first_id
: The first part of the product identifier, split across two arrays due to size limitations.second_id
: The second part of the product identifier, split across two arrays due to size limitations.marketplace
: The public key of the associated marketplace.product_mint
: The mint representing the product. Owning this token indicates that the product has been paid for.seller_config
: Configuration specific to the seller's preferences for the product.bumps
: Bump seed parameters used for deterministic address derivation.
Seller Configuration
The SellerConfig
struct contains configurations defined by the seller for the product:
pub struct SellerConfig {
pub payment_mint: Pubkey,
pub product_price: u64,
}
payment_mint
: The token selected by the seller to receive as payment for the product.product_price
: The price of the product in terms of the payment token.
Product Bumps
The ProductBumps
struct represents the bump seed parameters used for deterministic address derivation:
pub struct ProductBumps {
pub bump: u8,
pub mint_bump: u8,
}
Last updated