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

@tomblabs/badges-sdk

v1.2.1

Published

A simple SDK to interact with the Tomb Labs Badges program

Readme

Tomb Labs Badges SDK

License: MIT

Star us on GitHub — it motivates us a lot!

This is a rudimentary SDK for interacting with the Tomb Labs Badges program. It is written in typescript and should have all necessary functions for interacting with the program. This SDK will be updated as the program is updated.

You can find the Program source code here.

Installation

npm install @tomblabs/badges-sdk
or
yarn add @tomblabs/badges-sdk

Usage

Initialize the badges class with the signer, RPC Endpoint and commitment level.

Node JS Example:

import { Badges } from "@tomblabs/badges-sdk";
import { Keypair } from "@solana/web3.js";

const keypairFile = JSON.parse(
  fs.readFileSync("path/to/keypair.json", "utf-8")
);
const keypair = Keypair.fromSecretKey(Uint8Array.from(keypairFile));
const rpcEndpoint = "https://api.devnet.solana.com";
const commitment = "confirmed";

const badges = new Badges(keypair, rpcEndpoint, commitment);

React Example:

import { Badges } from "@tomblabs/badges-sdk";
import { useWallet } from "@solana/wallet-adapter-react";

const BadgeExample = () => {
  const wallet = useWallet();
  const RPC_ENDPOINT = "https://api.devnet.solana.com";
  const badges = new Badges(wallet, RPC_ENDPOINT, "finalized");
};

Instructions

Project

createProject

Project Authority is Signer

const feeInLamports = 1000000;
const collectionAddress = new PublicKey("your collection mint address");
const feeAddress = new PublicKey("your fee address");

//Creates a project and returns a Transaction Signature or an Error
const createProject = await badges.createProject(
  feeInLamports,
  collectionAddress,
  "Project Name",
  feeAddress
);

//Gets the transaction for creating a project
const createProjectTx = await badges.getCreateProjectTx(
  feeInLamports,
  collectionAddress,
  "Project Name",
  feeAddress
);

changeProjectName

Project Authority is Signer

const newName = "New Project Name";
const collectionAddress = new PublicKey("your collection mint address");

//Changes the name for a project and returns a Transaction Signature or an Error
const changeProjectName = await badges.changeProjectName(
  newName,
  collectionAddress
);

//Gets the transaction for changing the project name
const changeProjectNameTx = await badges.getChangeProjectNameTx(
  newName,
  collectionAddress
);

changeProjectFeeWallet

Project Authority is Signer

const newFeeWallet = new PublicKey("your new fee wallet address");
const collectionAddress = new PublicKey("your collection mint address");

//Changes the fee wallet for a project and returns a Transaction Signature or an Error
const changeFeeWallet = await badges.changeFeeWallet(
  newFeeWallet,
  collectionAddress
);

//Gets the transaction for changing the project fee wallet
const changeFeeWalletTx = await badges.getChangeProjectNameTx(
  newFeeWallet,
  collectionAddress
);

changeProjectFee

Project Authority is Signer

const newFeeInLamports = 1000000;
const collectionAddress = new PublicKey("your collection mint address");

//Changes the fee for a project and returns a Transaction Signature or an Error
const changeProjectFee = await badges.changeProjectFee(
  newFeeInLamports,
  collectionAddress
);

//Gets the transaction for changing the project fee
const changeProjectFeeTx = await badges.getChangeProjectFeeTx(
  newFeeInLamports,
  collectionAddress
);

deleteProject

Project Authority is Signer

const collectionAddress = new PublicKey("your collection mint address");

//Deletes a project and returns a Transaction Signature or an Error
const deleteProject = await badges.deleteProject(collectionAddress);

//Gets the transaction for deleting a project
const deleteProjectTx = await badges.getDeleteProjectTx(collectionAddress);

Badges

createBadge

Project Authority is Signer

const name = "Badge Name";
const metadataUri = "https://yourmetadatauri.com";
const imageUri = "https://yourimageuri.com";
const royalty = 10;
const collectionAddress = new PublicKey("your collection mint address");

//Creates a badge and returns a Transaction Signature or an Error
const createBadge = await badges.createBadge(
  name,
  metadataUri,
  imageUri,
  royalty,
  collectionAddress
);

//Gets the transaction for creating a badge
const createBadgeTx = await badges.getCreateBadgeTx(
  name,
  metadataUri,
  imageUri,
  royalty,
  collectionAddress
);

deleteBadge

Project Authority is Signer

const mint = new PublicKey("your badge mint address");
const collectionAddress = new PublicKey("your collection mint address");

//Deletes a badge and returns a Transaction Signature or an Error
const deleteBadge = await badges.deleteBadge(mint, collectionAddress);

//Gets the transaction for deleting a badge
const deleteBadgeTx = await badges.getDeleteBadgeTx(mint, collectionAddress);

addBadgeToUser

Project Authority is Signer

const userAccountAuthority = new PublicKey("your user account authority");
const userAccountInitializer = new PublicKey("your user account initializer");
const mint = new PublicKey("your badge mint address");
const collectionAddress = new PublicKey("your collection mint address");

//Adds a badge to a user and returns a Transaction Signature or an Error
const addBadgeToUser = await badges.addBadgeToUser(
  userAccountAuthority,
  userAccountInitializer,
  mint,
  collectionAddress
);

//Gets the transaction for adding a badge to a user
const addBadgeToUserTx = await badges.getAddBadgeToUserTx(
  userAccountAuthority,
  userAccountInitializer,
  mint,
  collectionAddress
);

withdrawBadge

User Authority is Signer

const userAccountInitializer = new PublicKey("your user account initializer");
const mint = new PublicKey("your badge mint address");
const collectionAddress = new PublicKey("your collection mint address");
const projectAuth = new PublicKey("your project authority");

//Withdraws a badge from a user and returns a Transaction Signature or an Error
const withdrawBadge = await badges.withdrawBadge(
  userAccountInitializer,
  mint,
  collectionAddress,
  projectAuth
);

//Gets the transaction for withdrawing a badge from a user
const withdrawBadgeTx = await badges.getWithdrawBadgeTx(
  userAccountInitializer,
  mint,
  collectionAddress,
  projectAuth
);

User Accounts

createUserAccount

Project Authority is Signer

const dbId = "your database id"; //Optional Database Identifier
const collectionAddress = new PublicKey("your collection mint address");
const userWallet = new PublicKey("your user wallet address");

//Creates a user account and returns a Transaction Signature or an Error
const createUserAccount = await badges.createUserAccount(
  dbId,
  collectionAddress,
  userWallet
);

//Gets the transaction for creating a user account
const createUserAccountTx = await badges.getCreateUserAccountTx(
  dbId,
  collectionAddress,
  userWallet
);

deleteUserAccount

User Authority is Signer

const initializer = new PublicKey("your user  account initializer");
const collectionAddress = new PublicKey("your collection mint address");
const projectAuth = new PublicKey("your project authority");

//Deletes a user account and returns a Transaction Signature or an Error
const deleteUserAccount = await badges.deleteUserAccount(
  initializer,
  collectionAddress,
  projectAuth
);

//Gets the transaction for deleting a user account
const deleteUserAccountTx = await badges.getDeleteUserAccountTx(
  initializer,
  collectionAddress,
  projectAuth
);

changeUserAuth

User Authority is Signer

const initializer = new PublicKey("your user account initializer");
const newAuth = new PublicKey("your new user account authority");
const collectionAddress = new PublicKey("your collection mint address");
const projectAuth = new PublicKey("your project authority");

//Changes the authority for a user account and returns a Transaction Signature or an Error
const changeUserAuth = await badges.changeUserAuth(
  initializer,
  newAuth,
  collectionAddress,
  projectAuth
);

//Gets the transaction for changing the user account authority
const changeUserAuthTx = await badges.getChangeUserAuthTx(
  initializer,
  newAuth,
  collectionAddress,
  projectAuth
);

Data Fetching

Project

getProjectState

const collectionAddress = new PublicKey("your collection mint address");

//Gets the state of a project
const projectState = await badges.getProjectState(collectionAddress);

getAllProjects

//Gets all projects
const allProjects = await badges.getAllProjects();

Badges

getBadgeState

const mint = new PublicKey("your badge mint address");
const project = new PublicKey("your project address"); //This is the project state address

//Gets the state of a badge
const badgeState = await badges.getBadgeState(mint, project);

getBadgeMetadataUri

const mint = new PublicKey("your badge mint address");

//Gets the metadata uri for a badge
const metadataUri = await badges.getBadgeMetadataUri(mint);

getBadgeImageUri

const mint = new PublicKey("your badge mint address");

//Gets the image uri for a badge
const imageUri = await badges.getBadgeImageUri(mint);

getProjectBadges

const project = new PublicKey("your project address"); //This is the project state address

//Gets all badges for a project
const projectBadges = await badges.getProjectBadges(project);

User Accounts

getUserAccount

const initializer = new PublicKey("your user account initializer");
const collectionAddress = new PublicKey("your collection mint address");
const projectAuth = new PublicKey("your project authority");

//Gets the state of a user account
const userAccount = await badges.getUserAccount(
  initializer,
  collectionAddress,
  projectAuth
);

getAllUserAccounts

//Gets all user accounts
const allUserAccounts = await badges.getAllUserAccounts();