Metaplex NFT packs Solana program

Supports creation of "mystery" packages of NFTs that are not revealed until after "opening", similar to the experience you have when purchasing a pack of baseball cards at the store.

NFT packs actions

Accounts

PackSet

| Parameter | Type | Description | |--------------------------|-------------------------|----------------------------------------------------------| | store | Pubkey | Store | | name | [u8; 32] | Pack's name | | description | String | Pack description | | imglink | String(limited to 200) | Link to Arweave cover image | | authority | Pubkey | Pack authority | | packcards | u32 | Card masters counter | | packvouchers | u32 | Pack voucher counter | | totalweight | u64 | Total weight | | totaleditions | u64 | Total amount of editions pack can mint | | mutable | bool | If true authority can make changes at deactivated phase | | packstate | enum | [not activated, activated, deactivated, ended] | | distributiontype | enum | [maxsupply, weighted, unlimited] | | allowedamounttoredeem | u32 | Count of cards user can try to redeem | | redeemstartdate | u64 | Date when users can start to redeem cards | | redeemend_date | Option(u64) | Date when pack set becomes inactive |

PackCard

PDA with seeds ['card', pack_key, index]

|Parameter|Type|Description| |--------|----------|--------------| |packset| Pubkey|Pack key | |master| Pubkey| MasterEdition account| |metadata| Pubkey| Metadata account| |tokenaccount| Pubkey| Program token account which holds MasterEdition token| |max_supply| u32| How many editions this card can mint| |weight| u16| Card weight. Uses in probability calculation for fixed and unlimited distribution types|

PackVoucher

PDA with seeds ['voucher', pack_key, index]

|Parameter|Type|Description| |--------|----------|--------------| |pack_set| Pubkey| Pack set key | |master| Pubkey| MasterEdition account| |metadata| Pubkey| Metadata account|

ProvingProcess

PDA with seeds ['proving', packkey, voucheredition_mint]

|Parameter|Type|Description| |--------|----------|--------------| |walletkey| Pubkey| User wallet key | |isexhausted| bool| Is there left any card in voucher | |packset| Pubkey| Pack set key | |vouchermint| Pubkey| Voucher mint | |cardsredeemed| u32| How many cards user already redeemed| |cardsto_redeem| BTreeMap(u32, u32)| BTreeMap with cards to redeem and statuses if it's already redeemed|

PackConfig

PDA with seeds ['config', pack_key]

|Parameter|Type|Description| |--------|----------|--------------| |weights| Vec<(u32, u32, u32)>| Weights Vec(u32 cardindex, u32 either maxsupply or weight, u32 maxsupply for weighted cards) | |actionto_do| enum[change, sort, none] | Action CleanUp instruction has to do |

Distribution types