hopper-metaplex
Hopper-owned Metaplex Token Metadata builders, PDA helpers, and a stack-buffer
Borsh encoder. Powers the metadata::* / master_edition::* field keywords on
#[derive(Accounts)] contexts and the
hopper-nft-mint reference
program. The lower-level #[hopper::context] spelling remains supported for
older migration code.
Part of the Hopper framework.
When to reach for this
Anything that mints, updates, or reads NFT metadata on Solana through the Metaplex Token Metadata program. The crate ships the three calls every NFT program reaches for:
CreateMetadataAccountV3- initialise the metadata PDA for a mint.CreateMasterEditionV3- lock a mint as a master edition (setmax_supply = Some(0)for a 1-of-1 NFT).UpdateMetadataAccountV2- mutate an existing metadata account.
Each builder uses a stack buffer to encode the Borsh payload. No heap, no
Vec, no alloc::String. Buffer overflow returns
ProgramError::InvalidInstructionData so a malicious oversized name can't
push the program into UB.
Quick start
[]
= { = "hopper-lang", = "0.2.1", = ["metaplex"] }
use *;
CreateMetadataAccountV3
.invoke?;
CreateMasterEditionV3
.invoke?;
PDA helpers:
let = metadata_pda;
let = master_edition_pda;
Optional, opt-in
The crate is gated behind the metaplex feature on the root hopper crate.
Programs that don't touch Metaplex get no extra compile time and no extra
dependencies pulled in. Enable with:
= { = "hopper-lang", = "0.2.1", = ["metaplex"] }
What's not (yet) shipped
- Bubblegum compressed NFTs.
- pNFT (programmable NFT) lifecycle.
- Edition prints (
MintNewEditionFromMasterEditionViaToken). - Collection verification (
VerifyCollection,SetAndVerifyCollection).
Each of these is mechanical given the existing BorshTape encoder. Open an
issue if you want one prioritised.
Docs: https://docs.rs/crate/hopper-metaplex/0.2.1
Support
Public-goods support and donations can be sent to solanadevdao.sol /
F42ZovBoRJZU4av5MiESVwJWnEx8ZQVFkc1RM29zMxNT.
License
Apache-2.0. See LICENSE.