Module mpl_token_metadata::utils
source · Re-exports
pub use crate::assertions::edition::assert_edition_is_not_mint_authority;
pub use crate::assertions::edition::assert_edition_valid;
pub use crate::assertions::metadata::assert_currently_holding;
pub use crate::assertions::metadata::assert_data_valid;
pub use crate::assertions::metadata::assert_update_authority_is_correct;
pub use crate::assertions::metadata::assert_verified_member_of_collection;
Structs
Constants
Functions
assert initialized account
Close src_account and transfer lamports to dst_account, lifted from Solana Cookbook
Creates a new master edition account for the specified
edition_account_info
and
mint_info
. Master editions only exist for non-fungible assets, therefore the supply
of the mint must thei either 0 or 1; any value higher than that will generate an
error.Create account almost from scratch, lifted from
https://github.com/solana-labs/solana-program-library/tree/master/associated-token-account/program/src/processor.rs#L51-L98
cheap method to just get supply off a mint without unpacking whole object
cheap method to just get supply off a mint without unpacking whole object
Cheap method to just grab owner Pubkey from token account, instead of deserializing entire thing
Create a new account instruction
Strings need to be appended with
\0
s in order to have a deterministic length.
This supports the memcmp
filter on get program account calls.
NOTE: it is assumed that the metadata fields are never larger than the respective MAX_LENGTHPads the string to the desired size with
0u8
s.
NOTE: it is assumed that the string’s size is never larger than the given size.Resize an account using realloc, lifted from Solana Cookbook
Pads the string to the desired size with
0u8
s.
NOTE: it is assumed that the string’s size is never larger than the given size.