HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

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
datadata UseMethod
#

Which "uses" behavior an NFT carries (Borsh u8 enum index 0/1/2).

Instances6Bounded, Enum, Eq, Show, Generic, Rep
datadata Creator
#

A single NFT creator entry: address, whether they have verified their inclusion, and their royalty share (0-100).

Instances5Eq, Show, Generic, Binary, Rep
datadata Collection
#

The collection an NFT belongs to.

Instances5Eq, Show, Generic, Binary, Rep
datadata Uses
#

Limited-use configuration for an NFT (e.g. burn-on-use tickets).

Instances5Eq, Show, Generic, Binary, Rep
newtypenewtype CollectionDetails
#

Marks a Metadata account as a collection ("sized" collection, V1). Only the V1 variant is modeled; decoding any other variant tag fails.

Instances5Eq, Show, Generic, Binary, Rep
datadata DataV2
#

The mutable on-chain fields of a Metadata account.

Instances5Eq, Show, Generic, Binary, Rep

Token Metadata instructions covered by this client (Borsh u8 discriminants, arbitrated by the mpl-token-metadata crate's fixtures).

Constructors

Instances5Eq, Show, Generic, Binary, Rep

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

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

datadata Metadata
#

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.

Instances2Eq, Show
  • Eq MetadataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata
  • Show MetadataDefined in solana-haskell-sdk-1.3.0.0 · Network.Solana.Metaplex.TokenMetadata

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).