npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@pauldevlee/sns-cnft-mint-sdk

v1.0.3

Published

User SDK for cNFT minting and transfer operations

Readme

SNS cNFT Mint SDK

A user-friendly SDK for minting and transferring Core NFTs (cNFTs) on Solana. This SDK generates transaction instructions that can be signed by user wallets, ensuring security and user control.

Features

  • Mint NFTs from Core Candy Machine
  • Transfer NFTs between wallets
  • Instruction-only approach - No transaction signing within SDK
  • Type-safe TypeScript implementation
  • User-controlled - All sensitive operations handled by calling application

Installation

npm install sns-cnft-mint-sdk

Quick Start

import { createMintSDK } from 'sns-cnft-mint-sdk';

// Initialize SDK
const sdk = createMintSDK({
  rpcUrl: 'https://api.devnet.solana.com'
});

// Mint NFT
const mintResult = await sdk.mintNft({
  candyMachineAddress: 'YOUR_CANDY_MACHINE_ADDRESS',
  userSigner: userWalletSigner, // From user's wallet
  collectionAddress: 'YOUR_COLLECTION_ADDRESS',
  candyGuardAddress: 'YOUR_CANDY_GUARD_ADDRESS',
  groupLabel: 'public',
  metadataUri: 'https://arweave.net/your-metadata',
  name: 'My NFT #1'
});

// Send instructions to user's wallet for signing
// await userWallet.sendTransaction(mintResult.instructions);

API Reference

SDK Configuration

interface SDKConfig {
  rpcUrl: string; // Solana RPC endpoint
}

Mint NFT

interface MintNftParams {
  candyMachineAddress: string;  // Core Candy Machine address
  userSigner: any;              // User's wallet signer
  collectionAddress: string;    // Collection address
  candyGuardAddress: string;    // Candy Guard address
  groupLabel: string;           // Guard group label (e.g., 'public', 'whitelist')
  metadataUri: string;          // NFT metadata URI
  name: string;                 // NFT name
}

async mintNft(params: MintNftParams): Promise<MintResult>

Transfer NFT

interface TransferNftParams {
  assetAddress: string;         // NFT asset address
  newOwnerAddress: string;      // Recipient wallet address
  ownerSigner: any;             // Current owner's wallet signer
  collectionAddress: string;    // Collection address
}

async transferNft(params: TransferNftParams): Promise<TransferResult>

Result Types

interface MintResult {
  instructions: any[];          // Transaction instructions
  signers: any[];              // Required signers
  assetAddress: string;        // Generated NFT address
  metadataUri: string;         // Metadata URI
  name: string;                // NFT name
}

interface TransferResult {
  instructions: any[];          // Transaction instructions
  signers: any[];              // Required signers
  assetAddress: string;        // NFT address
  newOwnerAddress: string;     // New owner address
}

Usage Examples

Basic Minting

import { createMintSDK } from 'sns-cnft-mint-sdk';

const sdk = createMintSDK({
  rpcUrl: 'https://api.devnet.solana.com'
});

// Mint single NFT
const result = await sdk.mintNft({
  candyMachineAddress: 'CM_ADDRESS',
  userSigner: userWalletSigner,
  collectionAddress: 'COLLECTION_ADDRESS',
  candyGuardAddress: 'GUARD_ADDRESS',
  groupLabel: 'public',
  metadataUri: 'https://arweave.net/metadata',
  name: 'My NFT'
});

console.log('NFT will be minted at:', result.assetAddress);

Batch Minting

// Mint multiple NFTs
const batchParams = [
  { /* mint params 1 */ },
  { /* mint params 2 */ },
  { /* mint params 3 */ }
];

const results = await Promise.all(
  batchParams.map(params => sdk.mintNft(params))
);

console.log(`Generated instructions for ${results.length} NFTs`);

Transfer NFT

// Transfer NFT to another wallet
const transferResult = await sdk.transferNft({
  assetAddress: 'NFT_ASSET_ADDRESS',
  newOwnerAddress: 'RECIPIENT_WALLET',
  ownerSigner: currentOwnerSigner,
  collectionAddress: 'COLLECTION_ADDRESS'
});

console.log('Transfer instructions generated');

Security Considerations

  • No Private Keys: This SDK never handles private keys or keypairs
  • User-Controlled Signing: All transactions must be signed by user wallets
  • No Default Values: All parameters must be explicitly provided
  • Instruction-Only: SDK only generates instructions, never executes transactions

Integration with Wallets

Solana Wallet Adapter

import { useWallet } from '@solana/wallet-adapter-react';

function MintButton() {
  const { publicKey, signTransaction } = useWallet();
  
  const handleMint = async () => {
    const result = await sdk.mintNft({
      // ... params
      userSigner: { publicKey, signTransaction }
    });
    
    // Send to wallet for signing
    const signedTx = await signTransaction(result.instructions);
    // Submit to blockchain
  };
}

Phantom Wallet

// With Phantom wallet
const result = await sdk.mintNft({
  // ... params
  userSigner: window.solana // Phantom wallet object
});

Error Handling

try {
  const result = await sdk.mintNft(params);
  // Handle success
} catch (error) {
  if (error.message.includes('required')) {
    // Handle missing parameter
  } else if (error.message.includes('invalid')) {
    // Handle invalid address
  } else {
    // Handle other errors
  }
}

Development

# Install dependencies
npm install

# Build SDK
npm run build

# Run example
npm run example

License

MIT

Support

For support and questions, please contact the SNS Team.