pump-solana-dev
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-10-08
- Stars
- ★ 0
- Forks
- 0
02 资源文件 2
- 参考文档metadata.json408 B
- 参考文档verification.json1.1 KB
03 SKILL.md 正文
Solana Development — Web3.js, Anchor, SPL Tokens & On-Chain Patterns
Apply Solana development patterns used throughout the Pump SDK: Anchor IDL-based program interaction, SPL Token and Token-2022 account management, transaction construction with instruction composition, RPC batching, and cross-program account coordination.
Anchor Program Initialization
import { Program, AnchorProvider } from '@coral-xyz/anchor';
function getPumpProgram(connection: Connection): Program<Pump> {
const provider = new AnchorProvider(
connection,
{ publicKey: PublicKey.default, signTransaction: async (tx) => tx, signAllTransactions: async (txs) => txs },
{ commitment: 'confirmed' }
);
return new Program(pumpIdl as Pump, PUMP_PROGRAM_ID, provider);
}
Offline pattern: Uses a dummy provider (no wallet) for building instructions. Actual signing happens in the caller's code.
Instruction Building with accountsStrict
const ix = await program.methods
.buy(amount, maxSolCost, flags)
.accountsStrict({
global: GLOBAL_PDA,
bondingCurve: bondingCurvePda(mint),
user: userPublicKey,
// ... all required accounts
})
.remainingAccounts(additionalAccounts)
.instruction();
PDA Derivation
const [pda, bump] = PublicKey.findProgramAddressSync(
[Buffer.from("bonding-curve"), mint.toBuffer()],
PUMP_PROGRAM_ID
);
RPC Batching
const accounts = await connection.getMultipleAccountsInfo([
bondingCurvePda(mint),
GLOBAL_PDA,
FEE_CONFIG_PDA,
]);
Token-2022 Support
The SDK supports both SPL Token and Token-2022:
createV2Instructioncreates Token-2022 mintstokenProgramparameter selects the appropriate program- Associated Token Accounts (ATAs) are created idempotently
Account Decoding
const bondingCurve = program.coder.accounts.decode('bondingCurve', accountInfo.data);
Nullable variants handle missing accounts:
const bc = decodeBondingCurveNullable(accountInfo); // returns null instead of throwing
Transaction Simulation
const result = await connection.simulateTransaction(tx, [signer]);
// Parse return data from simulation logs
BN.js Arithmetic
All amounts use BN for arbitrary-precision integer arithmetic:
const fee = amount.mul(new BN(feeBps)).div(new BN(10000));
const ceilFee = amount.mul(new BN(feeBps)).add(new BN(9999)).div(new BN(10000));
Patterns to Follow
- Always use
accountsStrict— notaccounts— for type-safe account specification - Use
getMultipleAccountsInfoto batch account fetches - Build instruction arrays, not transactions — let callers compose
- Handle both Token and Token-2022 programs via parameter
- Use nullable decoders for optional accounts
Common Pitfalls
AnchorProviderwith dummy wallet is for instruction building only — never sign with itgetMultipleAccountsInforeturns nulls for missing accounts — always check- Transaction size limit is 1232 bytes — large instruction sets may need multiple transactions
remainingAccountsorder matters — the on-chain program reads them positionally
04 同仓库更多 Skills
zkrouter
Self-hosted OpenAI-compatible LLM router — smart tier-based routing, ZK-stamped routing decisions, mode overrides, free OpenRouter at install via the Birth bot. Save 60-80% on inference costs by routing to the cheapest capable model across 12+ OpenRouter models.
zk
For custom ZK Solana programs and privacy-preserving applications to prevent double spending. Guide to integrate rent-free nullifier PDAs for double-spend prevention.
zk-omni-messaging
Zero-knowledge omnichain messaging between Robinhood Chain and Solana using CheshireZkOmniMessenger (msgType 4) with nullifier anti-replay and the zk-omni-relayer service.
zerion-wallet-data
Use when the user asks to check a wallet's portfolio, token balances, DeFi positions, PnL, transaction history, or NFTs. Provides interpreted on-chain data across 40+ EVM chains and Solana via x402 pay-per-request or API key — no raw RPC decoding needed.
youtube-clipper
YouTube 视频智能剪辑工具。下载视频和字幕,AI 分析生成精细章节(几分钟级别), 用户选择片段后自动剪辑、翻译字幕为中英双语、烧录字幕到视频,并生成总结文案。 使用场景:当用户需要剪辑 YouTube 视频、生成短视频片段、制作双语字幕版本时。 关键词:视频剪辑、YouTube、字幕翻译、双语字幕、视频下载、clip video
yield-optimization
Multi-chain yield optimization via yield.xyz (StakeKit). Discover 2,988+ yield opportunities across 75+ blockchains, build deposit/withdrawal transactions with shell scripts, and sign them with a MoonPay wallet. Use when the user wants to earn yield, find the best lending or staking rate, enter/exit a position, or check portfolio balances.