Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hackingbutlegal/8016c2a7ef66aed5b466ab191c66a02f to your computer and use it in GitHub Desktop.
Save hackingbutlegal/8016c2a7ef66aed5b466ab191c66a02f to your computer and use it in GitHub Desktop.
Solana Edition Minter
// THANK YOU 0xBANANA FOR THIS SOLANA NFT EDITION MINTER
// RUN THIS WITH 'node main.mjs' AT YOUR COMMAND LINE
import { Metaplex, keypairIdentity } from "@metaplex-foundation/js";
import { TokenStandard } from '@metaplex-foundation/mpl-token-metadata'
import { Connection, Keypair } from "@solana/web3.js";
import bs58 from "bs58";
const connection = new Connection(
"https://rpc.helius.xyz/?api-key=YOUR_API_KEY_GOES_HERE"
);
const SK =
"YOUR_WALLET_SECRET_KEY_GOES_HERE";
const SKua = bs58.decode(SK);
const keypair = Keypair.fromSecretKey(SKua);
const metaplex = new Metaplex(connection).use(keypairIdentity(keypair));
const name = "NAME_OF_YOUR_ARTWORK_GOES_HERE"
const description = "DESCRIPTION_OF_YOUR_ARTWORK_GOES_HERE"
const image = "https://cloudflare-ipfs.com/ipfs/YOUR_IPFS_URL_DATA_GOES HERE"
// REMOVE ANIMATION_URL IF NOT A VIDEO
const animation_url = "https://cloudflare-ipfs.com/ipfs/YOUR_IPFS_URL_DATA_GOES HERE"
const { uri } = await metaplex.nfts().uploadMetadata({
name,
description,
image,
animation_url
})
const { nft } = await metaplex.nfts().create({
uri: uri,
name,
sellerFeeBasisPoints: 1000, // Represents 10.00%.
symbol: "GRAFFITO",
tokenStandard: TokenStandard.NonFungible,
// CHANGE THIS FROM null to, say, "500" TO ADD LIMIT # TO POSSIBLE EDITIONS OFF THE MASTER
maxSupply: null
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment