--- id: solana/metaplex-nft name: Metaplex NFT Minting version: 1.0.0 ecosystem: solana type: docs time_sensitivity: evergreen source: verified confidence: high maintainer: Metaplex Foundation last_updated: 2026-03-19 --- ## Overview Metaplex is the standard NFT infrastructure on Solana. Candy Machine v3 handles collection minting with guards (payment, whitelist, etc.). The umi SDK is the modern TypeScript client replacing the old `@metaplex-foundation/js`. ## Setup umi ```typescript import { createUmi } from '@metaplex-foundation/umi-bundle-defaults' import { mplCandyMachine } from '@metaplex-foundation/mpl-candy-machine' import { mplTokenMetadata } from '@metaplex-foundation/mpl-token-metadata' import { keypairIdentity } from '@metaplex-foundation/umi' const umi = createUmi('https://api.devnet.solana.com') .use(mplTokenMetadata()) .use(mplCandyMachine()) // Load keypair const keypair = umi.eddsa.createKeypairFromSecretKey(secretKeyBytes) umi.use(keypairIdentity(keypair)) ``` ## NFT Metadata Standard ```json { "name": "My NFT #1", "symbol": "MNFT", "description": "A description of my NFT", "image": "https://arweave.net/abc123/image.png", "attributes": [ { "trait_type": "Background", "value": "Blue" }, { "trait_type": "Rarity", "value": "Rare" } ], "properties": { "files": [{ "uri": "https://arweave.net/abc123/image.png", "type": "image/png" }], "category": "image" } } ``` ## Create Collection NFT ```typescript import { createNft, fetchDigitalAsset } from '@metaplex-foundation/mpl-token-metadata' import { generateSigner, percentAmount } from '@metaplex-foundation/umi' const collectionMint = generateSigner(umi) await createNft(umi, { mint: collectionMint, name: 'My Collection', symbol: 'MC', uri: 'https://arweave.net/metadata.json', sellerFeeBasisPoints: percentAmount(5), // 5% royalty isCollection: true, }).sendAndConfirm(umi) ``` ## Candy Machine v3 ```typescript import { create, addConfigLines } from '@metaplex-foundation/mpl-candy-machine' import { generateSigner, sol, dateTime } from '@metaplex-foundation/umi' const candyMachine = generateSigner(umi) // Create await create(umi, { candyMachine, collectionMint: collectionMint.publicKey, collectionUpdateAuthority: umi.identity, itemsAvailable: 1000, sellerFeeBasisPoints: percentAmount(5), guards: { solPayment: { lamports: sol(0.1), destination: umi.identity.publicKey }, startDate: { date: dateTime('2026-04-01T00:00:00Z') }, }, }).sendAndConfirm(umi) // Add items await addConfigLines(umi, { candyMachine: candyMachine.publicKey, index: 0, configLines: [ { name: '#1', uri: 'https://arweave.net/item1.json' }, { name: '#2', uri: 'https://arweave.net/item2.json' }, ], }).sendAndConfirm(umi) ``` ## Mint from Candy Machine ```typescript import { mintV2 } from '@metaplex-foundation/mpl-candy-machine' import { setComputeUnitLimit } from '@metaplex-foundation/mpl-toolbox' import { transactionBuilder, generateSigner } from '@metaplex-foundation/umi' const nftMint = generateSigner(umi) await transactionBuilder() .add(setComputeUnitLimit(umi, { units: 800_000 })) .add(mintV2(umi, { candyMachine: candyMachine.publicKey, nftMint, collectionMint: collectionMint.publicKey, collectionUpdateAuthority: umi.identity.publicKey, })) .sendAndConfirm(umi) ``` ## Installation ```bash npm install @metaplex-foundation/umi-bundle-defaults npm install @metaplex-foundation/mpl-candy-machine npm install @metaplex-foundation/mpl-token-metadata ``` ## Reference - [Metaplex docs](https://developers.metaplex.com) - [Candy Machine v3](https://developers.metaplex.com/candy-machine) - [umi SDK](https://developers.metaplex.com/umi)