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

sns-cnft-backoffice-sdk

v1.2.0

Published

Backoffice SDK for cNFT Core Candy Machine operations

Downloads

17

Readme

PNFT Backoffice SDK

Backoffice SDK for PNFT Core Candy Machine operations. This SDK provides instruction generation without signing, allowing backoffice applications to integrate with Core Candy Machine functionality.

Features

  • fetchCCM: Fetch Core Candy Machine information
  • checkUserCcmInfo: Check user's mint count and eligibility
  • airdropToUser: Generate airdrop instructions for admin operations
  • TypeScript Support: Full type definitions included
  • No Signing: Returns instructions only, no transaction signing

Installation

npm install @pnft/backoffice-sdk

Usage

Basic Setup

import { createBackofficeSDK, SDKConfig } from '@pnft/backoffice-sdk';

const config: SDKConfig = {
  rpcUrl: 'https://api.devnet.solana.com',
  candyMachineAddress: 'YOUR_CANDY_MACHINE_ADDRESS',
  collectionAddress: 'YOUR_COLLECTION_ADDRESS'
};

const sdk = createBackofficeSDK(config);

Fetch Candy Machine Information

// Get Candy Machine details
const ccmInfo = await sdk.fetchCCM();
console.log('Items Available:', ccmInfo.itemsAvailable);
console.log('Items Minted:', ccmInfo.itemsMinted);
console.log('Items Remaining:', ccmInfo.itemsRemaining);

Check User Mint Information

// Check user's mint status
const userPubkey = 'USER_PUBLIC_KEY';
const userInfo = await sdk.checkUserCcmInfo(userPubkey, 'admin'); // Optional group label

console.log('Minted Count:', userInfo.mintedCount);
console.log('Max Mintable:', userInfo.maxMintable);
console.log('Remaining Mints:', userInfo.remainingMints);

Check Mint Eligibility

// Check if user can mint
const eligibility = await sdk.checkMintEligibility(userPubkey, 'admin');

if (eligibility.isEligible) {
  console.log('User can mint!');
} else {
  console.log('Cannot mint:', eligibility.reason);
}

Generate Airdrop Instructions

// Generate airdrop instructions (no signing)
// Note: All signers must be created by the calling application
const airdropParams = {
  candyMachineAddress: 'YOUR_CANDY_MACHINE_ADDRESS',
  recipientAddress: 'RECIPIENT_PUBLIC_KEY',
  collectionAddress: 'YOUR_COLLECTION_ADDRESS',
  groupLabel: 'admin', // Required
  candyGuardAddress: 'CANDY_GUARD_ADDRESS',
  authorityPubkey: 'AUTHORITY_PUBLIC_KEY',
  adminSigner: adminSignerObject, // Created by calling app
  botSigner: botSignerObject // Created by calling app
};

const result = await sdk.airdropToUser(airdropParams);

// result.instructions contains the instructions to execute
// result.signers contains the signers needed
// result.metadata contains additional information

console.log('Instructions:', result.instructions);
console.log('Signers:', result.signers);
console.log('Asset Address:', result.metadata.assetAddress);

API Reference

BackofficeSDK Class

Constructor

new BackofficeSDK(config: SDKConfig)

Methods

fetchCCM(): Promise<CandyMachineInfo>

Fetches Core Candy Machine information from the blockchain.

Returns:

  • address: Candy Machine address
  • authority: Authority public key
  • collection: Collection address (if set)
  • itemsAvailable: Total items available
  • itemsMinted: Number of items minted
  • itemsRemaining: Number of items remaining
  • isMutable: Whether the machine is mutable
checkUserCcmInfo(userPubkey: string, groupLabel?: string): Promise<UserMintInfo>

Checks user's mint information and limits.

Parameters:

  • userPubkey: User's public key
  • groupLabel: Optional group label for group-based limits

Returns:

  • userPubkey: User's public key
  • mintedCount: Number of NFTs minted by user
  • maxMintable: Maximum number user can mint
  • remainingMints: Remaining mints available
  • groupLabel: Group label used
airdropToUser(params: AirdropParams): Promise<InstructionResult>

Generates airdrop instructions without signing.

Parameters:

  • candyMachineAddress: Candy Machine address
  • recipientAddress: Recipient's public key
  • collectionAddress: Collection address
  • groupLabel: Optional group label

Returns:

  • instructions: Array of instructions to execute
  • signers: Array of signers needed
  • metadata: Additional metadata including asset address

Types

SDKConfig

interface SDKConfig {
  rpcUrl: string;
  candyMachineAddress: string;
  collectionAddress: string;
}

CandyMachineInfo

interface CandyMachineInfo {
  address: string;
  authority: string;
  collection?: string;
  itemsAvailable: number;
  itemsMinted: number;
  itemsRemaining: number;
  isMutable: boolean;
  configLineSettings?: any;
  guards?: any;
  groups?: any[];
}

UserMintInfo

interface UserMintInfo {
  userPubkey: string;
  mintedCount: number;
  maxMintable: number;
  remainingMints: number;
  groupLabel?: string;
}

AirdropParams

interface AirdropParams {
  candyMachineAddress: string;
  recipientAddress: string;
  groupLabel: string; // Required
  collectionAddress: string;
  candyGuardAddress: string;
  authorityPubkey: string;
  adminSigner: any; // Signer object created by calling app
  botSigner: any; // Signer object created by calling app
}

InstructionResult

interface InstructionResult {
  instructions: any[];
  signers: any[];
  metadata?: any;
}

Error Handling

The SDK throws descriptive errors for common issues:

  • Failed to fetch Candy Machine: Candy Machine not found or invalid
  • Candy Guard not found: No Candy Guard associated with the machine
  • Failed to check user mint info: Error retrieving user information
  • Failed to generate airdrop instructions: Error creating instructions

Development

Building

npm run build

Development Mode

npm run dev

Publishing

npm run prepublishOnly
npm publish

License

MIT