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

supercharge-core

v0.0.2

Published

A Solana-based loyalty checkout program protocol

Readme

@supercharge-protocol/core

A Solana-based loyalty checkout program protocol that enables businesses to create and manage loyalty programs on the Solana blockchain.

Installation

npm install @supercharge-protocol/core
# or
yarn add @supercharge-protocol/core
# or
pnpm add @supercharge-protocol/core

Quick Start

import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
import { initializeProtocol } from '@supercharge-protocol/core';
import { publicKey } from '@metaplex-foundation/umi';

// Create UMI instance with your RPC URL
const umi = createUmi('YOUR_RPC_URL');

// Initialize protocol with your program authority
const protocol = initializeProtocol(
  umi,
  publicKey('YOUR_PROGRAM_AUTHORITY')
);

Core Features

1. Create a Loyalty Program

const result = await protocol.createLoyaltyProgram({
  loyaltyProgramName: "Coffee Shop Rewards",
  metadataUri: 'https://arweave.net/your-metadata-uri',
  programAuthority: publicKey('YOUR_PROGRAM_AUTHORITY'),
  metadata: {
    organizationName: 'Coffee Shop',
    brandColor: '#FF5733',
  },
  tiers: [
    {
      name: 'Bronze',
      xpRequired: 500,
      rewards: ['2% cashback'],
    },
    {
      name: 'Silver',
      xpRequired: 1000,
      rewards: ['5% cashback', 'Free coffee monthly'],
    },
    {
      name: 'Gold',
      xpRequired: 2000,
      rewards: ['10% cashback', 'Free coffee weekly', 'Priority service'],
    },
  ],
  pointsPerAction: {
    purchase: 100,
    review: 50,
    referral: 200,
  },
});

console.log('Program created:', result);
// {
//   collection: KeypairSigner,
//   signature: 'transaction_signature',
//   programAuthority: PublicKey
// }

2. Issue a Loyalty Pass

const pass = await protocol.issueLoyaltyPass({
  collectionAddress: publicKey('YOUR_COLLECTION_ADDRESS'),
  recipient: publicKey('CUSTOMER_WALLET_ADDRESS'),
  passName: 'Coffee Rewards Pass',
  passMetadataUri: 'https://arweave.net/pass-metadata-uri',
  updateAuthority: publicKey('YOUR_PROGRAM_AUTHORITY'),
});

console.log('Pass issued:', pass);
// {
//   asset: KeypairSigner,
//   signature: 'transaction_signature'
// }

3. Award Points

const pointsResult = await protocol.awardLoyaltyPoints({
  passAddress: publicKey('PASS_ADDRESS'),
  action: 'purchase',
  signer: publicKey('YOUR_PROGRAM_AUTHORITY'),
  multiplier: 1.5, // Optional: 1.5x points for special events
});

console.log('Points awarded:', pointsResult);
// {
//   points: 150,
//   signature: 'transaction_signature',
//   newTier: { name: 'Silver', xpRequired: 1000, rewards: [...] }
// }

4. Send Messages to Pass Holders

const message = await protocol.sendMessage({
  passAddress: publicKey('PASS_ADDRESS'),
  message: 'Welcome to our loyalty program!',
  sender: publicKey('YOUR_PROGRAM_AUTHORITY'),
  signer: publicKey('YOUR_PROGRAM_AUTHORITY'),
});

console.log('Message sent:', message);
// {
//   signature: 'transaction_signature',
//   message: {
//     id: 'message_id',
//     content: 'Welcome to our loyalty program!',
//     sender: 'sender_address',
//     timestamp: 1234567890,
//     read: false
//   }
// }

5. Send Broadcasts to All Holders

const broadcast = await protocol.sendBroadcast({
  collectionAddress: publicKey('COLLECTION_ADDRESS'),
  message: 'Special weekend promotion: Double points on all purchases!',
  sender: publicKey('YOUR_PROGRAM_AUTHORITY'),
  signer: publicKey('YOUR_PROGRAM_AUTHORITY'),
});

console.log('Broadcast sent:', broadcast);
// {
//   signature: 'transaction_signature',
//   broadcast: {
//     id: 'broadcast_id',
//     content: 'Special weekend promotion...',
//     sender: 'sender_address',
//     timestamp: 1234567890,
//     read: false
//   }
// }

6. Get Program Details

const programDetails = await protocol.getProgramDetails();

console.log('Program details:', programDetails);
// {
//   name: 'Coffee Shop Rewards',
//   uri: 'metadata_uri',
//   collectionAddress: 'collection_address',
//   updateAuthority: 'authority_address',
//   numMinted: 100,
//   creator: 'creator_address',
//   tiers: [...],
//   pointsPerAction: {
//     purchase: 100,
//     review: 50,
//     referral: 200
//   },
//   metadata: {
//     organizationName: 'Coffee Shop',
//     brandColor: '#FF5733'
//   }
// }

7. Get Asset Data

const assetData = await protocol.getAssetData(publicKey('PASS_ADDRESS'));

console.log('Asset data:', assetData);
// {
//   xp: 1500,
//   lastAction: 'purchase',
//   actionHistory: [...],
//   currentTier: 'Silver',
//   tierUpdatedAt: 1234567890,
//   rewards: ['5% cashback', 'Free coffee monthly'],
//   name: 'Coffee Rewards Pass',
//   uri: 'pass_metadata_uri',
//   owner: 'owner_address',
//   pass: 'pass_address',
//   metadata: {
//     organizationName: 'Coffee Shop',
//     brandColor: '#FF5733'
//   },
//   rewardTiers: [...]
// }

Additional Features

  • Revoke Points: Remove points from a pass
  • Gift Points: Award bonus points
  • Transfer Approval: Approve pass transfers
  • Message Management: Read and manage messages
  • Broadcast Management: Send and manage broadcasts
  • Tier Management: Update program tiers
  • Points Configuration: Update points per action

Error Handling

All methods return promises that can be caught and handled:

try {
  const result = await protocol.createLoyaltyProgram(params);
  console.log('Success:', result);
} catch (error) {
  console.error('Error creating loyalty program:', error);
}

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT