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

@bagsfm/bags-sdk

v1.3.7

Published

TypeScript SDK for Bags

Downloads

7,630

Readme

@bagsfm/bags-sdk

npm version npm downloads license TypeScript Solana

A TypeScript SDK for interacting with the Bags Public API - Solana token launch and management platform.

For detailed API documentation, guides, and examples, visit docs.bags.fm.

Installation

npm install @bagsfm/bags-sdk

Usage

import { BagsSDK } from '@bagsfm/bags-sdk';
import { Connection, PublicKey } from '@solana/web3.js';

// Initialize the SDK
const connection = new Connection('https://mainnet.helius-rpc.com/?api-key=your-helius-api-key'); // Or any other RPC provider
const sdk = new BagsSDK('your-bags-api-key', connection, 'processed');

// Query token creators
const tokenMint = new PublicKey('your-token-mint-address');
const creators = await sdk.state.getTokenCreators(tokenMint);
console.log('Token creators:', creators);

// Get a swap quote
const quote = await sdk.trade.getQuote({
  inputMint: 'So11111111111111111111111111111111111111112',
  outputMint: 'your-token-mint-address',
  amount: 1_000_000_000, // 1 SOL in lamports
  slippageMode: 'dynamic',
});
console.log('Swap quote:', quote);

// Claim fees
const claimable = await sdk.fee.getAllClaimablePositions(walletPublicKey);
console.log('Claimable positions:', claimable);

API Reference

BagsSDK

The main SDK class that provides access to all services.

Constructor

new BagsSDK(apiKey: string, connection: Connection, commitment?: Commitment)

Parameters:

  • apiKey: Your Bags API key
  • connection: Solana web3.js Connection instance
  • commitment: (optional) Transaction commitment level (default: 'processed')

Services

| Service | Property | Description | |---------|----------|-------------| | API Client | sdk.bagsApiClient | Low-level HTTP client for direct Bags API calls | | Token Launch | sdk.tokenLaunch | Create token launches and upload token metadata | | State | sdk.state | Query token creators, lifetime fees, leaderboards, launch wallets, and claim stats | | Config | sdk.config | Create and manage fee-share configurations and lookup tables | | Fees | sdk.fee | List claimable fee positions and build claim transactions | | Partner | sdk.partner | Read/create partner configs and claim partner fees | | Trade | sdk.trade | Get swap quotes and build swap transactions | | Solana | sdk.solana | Submit Jito bundles, check bundle statuses, and query Jito tip fees | | Fee Share Admin | sdk.feeShareAdmin | Transfer admin roles, list admin mints, and update fee-share configs | | Dexscreener | sdk.dexscreener | Check order availability, create orders, and submit payments for Dexscreener listings | | Incorporation | sdk.incorporation | Start payments, register incorporation details, and manage incorporation projects | | Auth | sdk.auth | Fetch the API key owner's user profile |

Exported Utilities

The SDK also exports helper functions and types you can import directly:

import {
  sleep,
  chunkArray,
  signAndSendTransaction,
  sendBundleAndConfirm,
  createTipTransaction,
  serializeVersionedTransaction,
  prepareImageForFormData,
  detectImageInputType,
  sortKeys,
} from '@bagsfm/bags-sdk';

Exported Constants

Common program IDs and addresses are available as named exports:

import {
  BAGS_FEE_SHARE_V1_PROGRAM_ID,
  BAGS_FEE_SHARE_V2_PROGRAM_ID,
  METEORA_DBC_PROGRAM_ID,
  METEORA_DAMM_V2_PROGRAM_ID,
  BAGS_GLOBAL_LUT,
  WRAPPED_SOL_MINT,
  JITO_TIP_ACCOUNTS,
} from '@bagsfm/bags-sdk';

Requirements

  • Node.js >= 18.0.0
  • A Bags API key (get one at https://dev.bags.fm)
  • A Solana RPC provider (we recommend Helius - they offer a free tier)

Development

# Install dependencies
npm install

# Build the project
npm run build

# Watch mode for development
npm run dev

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Lint source files
npm run lint

# Lint and auto-fix
npm run lint:fix

# Format source files
npm run format

# Check formatting
npm run format:check

# Clean build artifacts
npm run clean

License

MIT

Support

For issues and questions, please visit our GitHub Issues.