Metaplex Token Metadata program address.
Modulesolana-haskell-sdk-1.3.0.0GHC2021
Network.Solana.Metaplex.TokenMetadata
Client for the Metaplex Token Metadata program: attaches on-chain metadata (name, symbol, URI, creators, royalties) to SPL Token mints and registers "master edition" NFTs. Instruction data is Borsh-encoded (see Network.Solana.Core.Borsh), unlike the native and SPL programs covered elsewhere in this SDK, which use bincode or hand-rolled formats.
Only three instructions are modeled: createMetadataAccountV3, updateMetadataAccountV2 and createMasterEditionV3. The rest of the program (50+ instructions, programmable NFTs, delegates, Token-2022 support) is out of scope.
- 8 types
- 7 values
- Packagesolana-haskell-sdk-1.3.0.0
- Exports15
- LanguageGHC2021
- LicenceApache-2.0
- SourceTokenMetadata.hs
Derive the metadata PDA for a mint: the PDA of
["metadata", program id, mint] under the Token Metadata program.
Derive the master edition PDA for a mint: the PDA of
["metadata", program id, mint, "edition"] under the Token Metadata program.
Instances6Bounded, Enum, Eq, Show, Generic, Rep
Bounded UseMethodDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataEnum UseMethodDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataEq UseMethodDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow UseMethodDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric UseMethodDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep UseMethod = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"UseMethod"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Burn"
'PrefixI 'False) U1 :+: (C1 ('MetaCons"Multiple"
'PrefixI 'False) U1 :+: C1 ('MetaCons"Single"
'PrefixI 'False) U1))
A single NFT creator entry: address, whether they have verified their inclusion, and their royalty share (0-100).
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq CreatorDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow CreatorDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric CreatorDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary CreatorDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep Creator = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"Creator"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Creator"
'PrefixI 'True) (S1 ('MetaSel ('Just"crAddress"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey) :*: (S1 ('MetaSel ('Just"crVerified"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just"crShare"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8))))
The collection an NFT belongs to.
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq CollectionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow CollectionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric CollectionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary CollectionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep Collection = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"Collection"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Collection"
'PrefixI 'True) (S1 ('MetaSel ('Just"colVerified"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just"colKey"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SolanaPublicKey)))
Limited-use configuration for an NFT (e.g. burn-on-use tickets).
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq UsesDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow UsesDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric UsesDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary UsesDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep Uses = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"Uses"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"Uses"
'PrefixI 'True) (S1 ('MetaSel ('Just"usesUseMethod"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UseMethod) :*: (S1 ('MetaSel ('Just"usesRemaining"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Just"usesTotal"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64))))
Marks a Metadata account as a collection ("sized" collection, V1). Only the V1 variant is modeled; decoding any other variant tag fails.
Constructors
Instances5Eq, Show, Generic, Binary, Rep
Eq CollectionDetailsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow CollectionDetailsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric CollectionDetailsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary CollectionDetailsDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep CollectionDetails = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"CollectionDetails"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'True) (C1 ('MetaCons"CollectionDetailsV1"
'PrefixI 'True) (S1 ('MetaSel ('Just"cdSize"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64)))
The mutable on-chain fields of a Metadata account.
Instances5Eq, Show, Generic, Binary, Rep
Eq DataV2Defined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow DataV2Defined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric DataV2Defined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary DataV2Defined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep DataV2 = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"DataV2"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"DataV2"
'PrefixI 'True) ((S1 ('MetaSel ('Just"dName"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: (S1 ('MetaSel ('Just"dSymbol"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just"dUri"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) :*: ((S1 ('MetaSel ('Just"dSellerFeeBasisPoints"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word16) :*: S1 ('MetaSel ('Just"dCreators"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe [Creator]))) :*: (S1 ('MetaSel ('Just"dCollection"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Collection)) :*: S1 ('MetaSel ('Just"dUses"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Uses))))))
Token Metadata instructions covered by this client (Borsh u8
discriminants, arbitrated by the mpl-token-metadata crate's fixtures).
Constructors
CreateMetadataAccountV3Create a Metadata account (v3) for a mint. Discriminant 33.
UpdateMetadataAccountV2Update an existing Metadata account (v2). Discriminant 15.
CreateMasterEditionV3Register a Metadata account as a Master Edition (v3). Discriminant 17.
Instances5Eq, Show, Generic, Binary, Rep
Eq TokenMetadataInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataShow TokenMetadataInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataGeneric TokenMetadataInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadataBinary TokenMetadataInstructionDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadatatype Rep TokenMetadataInstruction = D1 ('MetaDataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata"TokenMetadataInstruction"
"Network.Solana.Metaplex.TokenMetadata"
"solana-haskell-sdk-1.3.0.0-JMJNnl7jmEh90dthY33ZzW"
'False) (C1 ('MetaCons"CreateMetadataAccountV3"
'PrefixI 'True) (S1 ('MetaSel ('Just"cmaData"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 DataV2) :*: (S1 ('MetaSel ('Just"cmaIsMutable"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just"cmaCollectionDetails"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe CollectionDetails)))) :+: (C1 ('MetaCons"UpdateMetadataAccountV2"
'PrefixI 'True) ((S1 ('MetaSel ('Just"umaData"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe DataV2)) :*: S1 ('MetaSel ('Just"umaUpdateAuthority"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe SolanaPublicKey))) :*: (S1 ('MetaSel ('Just"umaPrimarySaleHappened"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just"umaIsMutable"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) :+: C1 ('MetaCons"CreateMasterEditionV3"
'PrefixI 'True) (S1 ('MetaSel ('Just"cmeMaxSupply"
) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word64)))))
Create a new Metadata account (v3) for a mint.
Fails with error if PDA derivation fails (established precedent, see
Network.Solana.SplPrograms.AssociatedTokenAccount).
# Account references (no rent account — matches the reference crate,
which omits the optional rent account entirely when unset)
0. `[WRITE]` Metadata account (derived)
1. `[]` Mint account
2. `[SIGNER]` Mint authority
3. `[WRITE, SIGNER]` Payer
4. `[]` Update authority (signer iff updateAuthorityIsSigner)
5. `[]` System program
Update an existing Metadata account (v2). # Account references 0. `[WRITE]` Metadata account (derived) 1. `[SIGNER]` Update authority
Register a Metadata account as a Master Edition (v3), fixing the
maximum number of print editions (or making it unlimited when Nothing).
Fails with error if PDA derivation fails (see createMetadataAccountV3).
# Account references
0. `[WRITE]` Master Edition account (derived)
1. `[WRITE]` Mint account
2. `[SIGNER]` Update authority
3. `[SIGNER]` Mint authority
4. `[WRITE, SIGNER]` Payer
5. `[WRITE]` Metadata account (derived; the program upgrades its token_standard to
NonFungible only if it is writable)
6. `[]` Token program
7. `[]` System program
8. `[]` Rent sysvar
On-chain state of a Metadata account (the Metadata struct from
mpl-token-metadata). The head fields are always present; the tail
(edition nonce, token standard, collection, uses) was added across
several program upgrades, so older accounts simply end early.
Constructors
MetadatamdKey :: Word8mdUpdateAuthority :: SolanaPublicKeymdMint :: SolanaPublicKeymdName :: StringmdSymbol :: StringmdUri :: StringmdSellerFeeBasisPoints :: Word16mdCreators :: Maybe [Creator]mdPrimarySaleHappened :: BoolmdIsMutable :: BoolmdEditionNonce :: Maybe Word8mdTokenStandard :: Maybe Word8mdCollection :: Maybe CollectionmdUses :: Maybe Uses
Decodes a Metadata account's data: a Borsh-encoded key, two pubkeys,
the three NUL-padded name/symbol/uri strings, royalty fee, creators,
and the primarySaleHappened/isMutable flags, followed by a tolerant
tail of editionNonce, tokenStandard, collection and uses: each is
read only if bytes remain, and any bytes left over after uses (account
padding) are ignored. Fails if the key byte is not 4 (MetadataV1).