A modern TypeScript SDK for the LetsBonk trading protocol on Solana.
- 🔥 Buy/Sell tokens with slippage protection
- 🚀 Launch new tokens with metadata
- 🏊 Pool management and state queries
- 🛡️ Type-safe with full TypeScript support
- ⚡ High performance with structured logging
- 🔧 Modular architecture for optimal bundle size
npm install letsbonkdotfun-sdkimport { Connection, Keypair } from '@solana/web3.js';
import { createSDK } from 'letsbonkdotfun-sdk';
const connection = new Connection('https://api.mainnet-beta.solana.com');
const sdk = createSDK(connection);
// Buy tokens
const buyer = Keypair.fromSecretKey(/* your private key */);
const result = await sdk.buy(
buyer,
mintAddress,
BigInt(1000000), // amount in lamports
BigInt(0) // minimum tokens out
);
if (result.success) {
console.log('Buy successful:', result.data.signature);
}sdk.buy(buyer, mint, amountIn, minimumOut)- Buy tokenssdk.sell(seller, mint, amountIn, minimumOut)- Sell tokenssdk.initialize(payer, creator, mint, metadata)- Create new token poolsdk.initializeAndBuy(...)- Launch token and buy in one transaction
sdk.accounts- Account management and queriessdk.transactions- Transaction building and executionsdk.pools- Pool state and operationssdk.metadata- Token metadata handling
const sdk = createSDK(connection, {
commitment: 'confirmed',
skipPreflight: true,
logging: { level: 'info' }
});See the examples/ directory for complete working examples:
- Token launch and trading
- Pool queries
- Error handling patterns
- Node.js 18+
- Solana Web3.js dependencies
- Artem Gasparyan - Initial work and core development
Special thanks to the following projects and contributors:
MIT - see LICENSE file.