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

@pumpfunv2/sdk

v1.0.0

Published

Official SDK for PumpFunV2 token launchpad - launch tokens programmatically with multiple automation modes

Readme

@pumpfunv2/sdk

Official SDK for PumpFunV2 token launchpad. Launch Solana tokens programmatically with multiple automation modes.

Installation

npm install @pumpfunv2/sdk
# or
yarn add @pumpfunv2/sdk
# or
pnpm add @pumpfunv2/sdk

Quick Start

import { PumpFunV2Client } from '@pumpfunv2/sdk';

const client = new PumpFunV2Client({
  apiKey: 'pk_your_api_key_here'
});

// Launch a token
const result = await client.launch({
  name: 'My Token',
  symbol: 'MTK',
  description: 'My awesome token',
  mode: 'flywheel',
  creatorWalletPrivateKey: 'your_wallet_private_key'
});

console.log('Token launched:', result.mintAddress);
console.log('View on pump.fun:', result.pumpFunUrl);

Launch Modes

| Mode | Description | |------|-------------| | normal | Standard launch with no automation | | flywheel | Auto-buys tokens with claimed creator fees | | burn | Burns tokens using creator fees | | distribution | Distributes tokens to holders | | jackpot | Random holder wins accumulated fees | | xprotected | Requires X (Twitter) verification | | multi | Split fees across multiple automation types |

Usage Examples

Normal Launch

const result = await client.launch({
  name: 'My Token',
  symbol: 'MTK',
  description: 'A simple token launch',
  mode: 'normal',
  creatorWalletPrivateKey: 'your_key',
  initialBuyAmount: 0.1 // Optional: buy tokens at launch
});

Flywheel Launch

const result = await client.launch({
  name: 'Flywheel Token',
  symbol: 'FLY',
  description: 'Auto-buying flywheel token',
  mode: 'flywheel',
  flywheelPercentage: 75, // 75% of fees go to auto-buy
  creatorWalletPrivateKey: 'your_key'
});

Distribution Launch

const result = await client.launch({
  name: 'Distribution Token',
  symbol: 'DIST',
  description: 'Rewards all holders',
  mode: 'distribution',
  distributionPercentage: 50,
  minHoldersForDistribution: 10,
  creatorWalletPrivateKey: 'your_key'
});

Multi-Mode Launch

const result = await client.launch({
  name: 'Multi Token',
  symbol: 'MULTI',
  description: 'Split automation modes',
  mode: 'multi',
  allocations: [
    { mode: 'flywheel', percentage: 40 },
    { mode: 'burn', percentage: 30 },
    { mode: 'distribution', percentage: 30 }
  ],
  creatorWalletPrivateKey: 'your_key'
});

React Components

The SDK includes ready-to-use React components for easy integration.

LaunchButton

A self-contained button that opens a launch modal:

import { LaunchButton } from '@pumpfunv2/sdk/react';

function App() {
  return (
    <LaunchButton
      apiKey="pk_your_api_key"
      defaultMode="flywheel"
      buttonText="🚀 Launch Token"
      onSuccess={(result) => {
        console.log('Launched:', result.mintAddress);
      }}
      onError={(error) => {
        console.error('Failed:', error.message);
      }}
    />
  );
}

Using the Provider and Hooks

For more control, use the provider and hooks:

import { PumpFunV2Provider, useLaunch } from '@pumpfunv2/sdk/react';

function App() {
  return (
    <PumpFunV2Provider config={{ apiKey: 'pk_your_api_key' }}>
      <LaunchForm />
    </PumpFunV2Provider>
  );
}

function LaunchForm() {
  const { launch, isLoading, error, result } = useLaunch({
    onSuccess: (result) => console.log('Success!', result)
  });

  const handleLaunch = async () => {
    await launch({
      name: 'My Token',
      symbol: 'MTK',
      description: 'Created with SDK',
      mode: 'normal',
      creatorWalletPrivateKey: walletKey
    });
  };

  return (
    <button onClick={handleLaunch} disabled={isLoading}>
      {isLoading ? 'Launching...' : 'Launch Token'}
    </button>
  );
}

API Reference

PumpFunV2Client

Constructor Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | apiKey | string | required | Your partner API key | | baseUrl | string | https://pumpfunv2.fun | API base URL | | timeout | number | 60000 | Request timeout in ms | | retries | number | 3 | Number of retry attempts |

Methods

  • launch(options: LaunchOptions): Promise<LaunchResult> - Launch a new token
  • getStats(): Promise<PartnerStats> - Get your launch statistics
  • getTokens(): Promise<LaunchedToken[]> - List all your launched tokens
  • getLaunchModes(): Promise<LaunchModeInfo[]> - Get available launch modes
  • validateApiKey(): Promise<boolean> - Check if your API key is valid

Error Handling

import { PumpFunV2Error } from '@pumpfunv2/sdk';

try {
  await client.launch(options);
} catch (error) {
  if (error instanceof PumpFunV2Error) {
    switch (error.code) {
      case 'UNAUTHORIZED':
        console.log('Invalid API key');
        break;
      case 'RATE_LIMITED':
        console.log('Too many requests, slow down');
        break;
      case 'VALIDATION_ERROR':
        console.log('Invalid launch options:', error.message);
        break;
      default:
        console.log('Error:', error.message);
    }
  }
}

Getting an API Key

  1. Visit pumpfunv2.fun/partner
  2. Register with your email
  3. Copy your API key (shown only once)
  4. Start launching tokens!

Support

License

MIT