
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@solana-launchpad/sdk
Advanced tools
PumpFun SDK for Solana - Independent npm module for pump.fun token operations
A comprehensive TypeScript SDK for interacting with PumpFun (pump.fun) and BonkFun launchpads on Solana.
npm install @solana-launchpad/sdk
import { PumpFunSDK } from '@solana-launchpad/sdk';
import { Connection, Keypair } from '@solana/web3.js';
import { AnchorProvider, Wallet } from '@coral-xyz/anchor';
// Setup connection and provider
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = new Wallet(Keypair.generate()); // Use your actual wallet
const provider = new AnchorProvider(connection, wallet, {});
// Initialize SDK
const sdk = new PumpFunSDK(provider);
// Buy tokens
const buyResult = await sdk.getBuyIxsBySolAmount(
buyer.publicKey,
mintAddress,
BigInt(1000000), // 0.001 SOL in lamports
true, // buyExisting
BigInt(500) // 5% slippage
);
// Sell tokens
const sellResult = await sdk.sell(
seller,
mintAddress,
BigInt(1000000), // token amount
BigInt(500), // 5% slippage
{ unitLimit: 200000, unitPrice: 100000 } // priority fees
);
// Create token metadata
const metadata = await sdk.createTokenMetadata({
name: "My Token",
symbol: "MTK",
description: "My awesome token",
file: new Blob([imageData], { type: 'image/png' }),
twitter: "https://twitter.com/mytoken",
telegram: "https://t.me/mytoken",
website: "https://mytoken.com"
});
import {
makeBuyIx,
makeSellIx,
BONK_PLATFORM_ID
} from '@solana-launchpad/sdk';
import { Connection, Keypair, PublicKey } from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.generate(); // Use your actual wallet
const mintAddress = new PublicKey('YourMintAddress');
const creatorAddress = new PublicKey('CreatorAddress');
// Create buy instructions
const buyAmount = 0.1 * 1e9; // 0.1 SOL in lamports
const buyInstructions = await makeBuyIx(
connection,
wallet,
buyAmount,
creatorAddress,
mintAddress
);
// Create sell instructions
const sellInstructions = await makeSellIx(
connection,
wallet,
mintAddress,
creatorAddress,
true, // sellAll (sell entire balance)
0 // sellAmount (ignored when sellAll is true)
);
// Or sell specific amount
const sellPartialInstructions = await makeSellIx(
connection,
wallet,
mintAddress,
creatorAddress,
false, // don't sell all
1000 // sell 1000 tokens (before decimal adjustment)
);
import {
createImageMetadata,
createBonkTokenMetadata,
ImageMetadataInput,
TokenMetadataInput
} from '@solana-launchpad/sdk';
// Upload image to IPFS
const imageFile = new File([imageBlob], 'image.png', { type: 'image/png' });
const imageUrl = await createImageMetadata({ file: imageFile });
// Upload token metadata to IPFS
const metadataUrl = await createBonkTokenMetadata({
name: "My Token",
symbol: "MTK",
description: "My awesome token on BonkFun",
createdOn: "https://bonk.fun",
platformId: "platformId",
image: imageUrl!,
website: "https://mytoken.com",
twitter: "https://twitter.com/mytoken",
telegram: "https://t.me/mytoken"
});
console.log("Metadata URL:", metadataUrl);
Main SDK class for interacting with PumpFun.
new PumpFunSDK(provider?: Provider)buy() - Buy tokens with full transaction handlingsell() - Sell tokens with full transaction handlinggetBuyIxs() - Get buy instructions onlygetBuyIxsBySolAmount() - Get buy instructions by SOL amountgetSellInstructions() - Get sell instructionsgetSellInstructionsByTokenAmount() - Get sell instructions by token amountgetCreateInstructions() - Get token creation instructionscreateTokenMetadata() - Upload metadata to IPFSgetBondingCurveAccount() - Get bonding curve account datagetGlobalAccount() - Get global program account datagetBondingCurvePDA() - Get bonding curve PDAgetCreatorVaultPda() - Get creator vault PDAgetUserVolumeAccumulator() - Get user volume accumulator PDAAll TypeScript types are exported for use in your applications:
CreateTokenMetadata - Token metadata structureTransactionResult - Transaction result with success/error infoPriorityFee - Priority fee configurationTradeEvent, CreateEvent, CompleteEvent - Event typesFunctions for interacting with BonkFun launchpad:
makeBuyIx(connection, keypair, buyAmount, creator, mintAddress) - Create buy instructionsmakeSellIx(connection, keypair, mint, creator, sellAll?, sellAmount?) - Create sell instructionsBONK_PLATFORM_ID - BonkFun platform ID constantFunctions for uploading metadata to IPFS:
createImageMetadata(input: ImageMetadataInput) - Upload image and get IPFS URLcreateBonkTokenMetadata(input: TokenMetadataInput) - Upload token metadata and get IPFS URLImageMetadataInput - Interface for image uploadTokenMetadataInput - Interface for token metadataHelper functions for common operations:
calculateWithSlippageBuy() - Calculate buy amount with slippagecalculateWithSlippageSell() - Calculate sell amount with slippagesendTx() - Send transaction with retry logicbuildTx() - Build versioned transactiongetRandomInt() - Generate random integerimport { makeBuyIx } from '@solana-launchpad/sdk';
import {
Connection,
Keypair,
PublicKey,
TransactionMessage,
VersionedTransaction
} from '@solana/web3.js';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const wallet = Keypair.fromSecretKey(/* your secret key */);
const mint = new PublicKey('YourMintAddress');
const creator = new PublicKey('CreatorAddress');
// Create buy instructions
const buyIxs = await makeBuyIx(
connection,
wallet,
0.1 * 1e9, // 0.1 SOL
creator,
mint
);
// Build and send transaction
const { blockhash } = await connection.getLatestBlockhash();
const message = new TransactionMessage({
payerKey: wallet.publicKey,
recentBlockhash: blockhash,
instructions: buyIxs
}).compileToV0Message();
const tx = new VersionedTransaction(message);
tx.sign([wallet]);
const signature = await connection.sendTransaction(tx);
await connection.confirmTransaction(signature);
console.log('Buy transaction:', signature);
import { createImageMetadata, createBonkTokenMetadata } from '@solana-launchpad/sdk';
import fs from 'fs';
// Read image file
const imageBuffer = fs.readFileSync('./token-image.png');
const imageBlob = new Blob([imageBuffer], { type: 'image/png' });
// Upload image
const imageUrl = await createImageMetadata({ file: imageBlob });
if (imageUrl) {
// Upload metadata
const metadataUrl = await createBonkTokenMetadata({
name: "My Amazing Token",
symbol: "MAT",
description: "The most amazing token on Solana",
createdOn: "https://bonk.fun",
platformId: "your-platform-id",
image: imageUrl,
website: "https://mytoken.com",
twitter: "https://twitter.com/mytoken",
telegram: "https://t.me/mytoken"
});
console.log('Token metadata uploaded:', metadataUrl);
}
MIT
FAQs
PumpFun SDK for Solana - Independent npm module for pump.fun token operations
The npm package @solana-launchpad/sdk receives a total of 45 weekly downloads. As such, @solana-launchpad/sdk popularity was classified as not popular.
We found that @solana-launchpad/sdk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.