Crates.io | mpl-nft-packs |
lib.rs | mpl-nft-packs |
version | 0.1.0 |
source | src |
created_at | 2022-11-01 13:44:32.574684 |
updated_at | 2022-11-01 13:44:32.574684 |
description | NFT Packs: mystery packs NFTs that are not revealed until after opening the pack. |
homepage | |
repository | https://github.com/metaplex-foundation/metaplex-program-library |
max_upload_size | |
id | 702805 |
size | 343,195 |
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.
RequestCardForRedeem
and ClaimPack
methods)CleanUp
instructionRequest card for redeem
name
, description
, URI
(pack wallpaper) and mutable
fieldsEndDateNotArrived
errorPackSet
Parameter | Type | Description |
---|---|---|
store | Pubkey | Store |
name | [u8; 32] | Pack's name |
description | String | Pack description |
img_link | String(limited to 200) | Link to Arweave cover image |
authority | Pubkey | Pack authority |
pack_cards | u32 | Card masters counter |
pack_vouchers | u32 | Pack voucher counter |
total_weight | u64 | Total weight |
total_editions | u64 | Total amount of editions pack can mint |
mutable | bool | If true authority can make changes at deactivated phase |
pack_state | enum | [not activated, activated, deactivated, ended] |
distribution_type | enum | [max_supply, weighted, unlimited] |
allowed_amount_to_redeem | u32 | Count of cards user can try to redeem |
redeem_start_date | u64 | Date when users can start to redeem cards |
redeem_end_date | Option(u64) | Date when pack set becomes inactive |
PackCard
PDA with seeds ['card', pack_key, index]
Parameter | Type | Description |
---|---|---|
pack_set | Pubkey | Pack key |
master | Pubkey | MasterEdition account |
metadata | Pubkey | Metadata account |
token_account | 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', pack_key, voucher_edition_mint]
Parameter | Type | Description |
---|---|---|
wallet_key | Pubkey | User wallet key |
is_exhausted | bool | Is there left any card in voucher |
pack_set | Pubkey | Pack set key |
voucher_mint | Pubkey | Voucher mint |
cards_redeemed | u32 | How many cards user already redeemed |
cards_to_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 card_index, u32 either max_supply or weight, u32 max_supply for weighted cards) |
action_to_do | enum[change, sort, none] | Action CleanUp instruction has to do |
Unlimited
Probability is set by user, putting weight (chance of revealing) for each card.
Supply — unlimited (cards never run out), user can't choose amount of each cards for the pack.
Cards with unlimited edition could be used inside the pack.
Weighted
Probability is set by user, putting weight (chance of revealing) for each card.
Supply — limited, user chooses amount of each cards for the pack.
Cards with limited and unlimited (user needs to set max supply for unlimited ones) edition could be used inside the pack.
Supply
Probability is set automatically depending on supply of each card.
Supply — limited, user chooses amount of each cards for the pack.
Cards with limited and unlimited (user needs to set max supply for unlimited ones) edition could be used inside the pack.