Support Pump.fun Bonding Curve v2 unified trading interface with quote_mint parameter for SOL-paired (WSOL) and USDC-paired coins. - Add BUY_V2, SELL_V2, BUY_EXACT_QUOTE_IN_V2 discriminators - Implement 27/26-account v2 instruction layouts matching official IDL - Add PumpFunParams::quote_mint and use_v2_ix fields (default legacy) - Add with_quote_mint() builder, buyback fee recipient pool, and PDA helpers - Add v2 ix data encoders in pumpfun_ix_data.rs - Legacy instructions remain default for backward compatibility Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
66 lines
2.5 KiB
Rust
66 lines
2.5 KiB
Rust
use solana_sdk::{pubkey, pubkey::Pubkey};
|
|
|
|
pub const SYSTEM_PROGRAM: Pubkey = pubkey!("11111111111111111111111111111111");
|
|
pub const SYSTEM_PROGRAM_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: SYSTEM_PROGRAM,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
pub const TOKEN_PROGRAM: Pubkey = pubkey!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");
|
|
pub const TOKEN_PROGRAM_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: TOKEN_PROGRAM,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
pub const TOKEN_PROGRAM_2022: Pubkey = pubkey!("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");
|
|
pub const TOKEN_PROGRAM_2022_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: TOKEN_PROGRAM_2022,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
pub const SOL_TOKEN_ACCOUNT: Pubkey = pubkey!("So11111111111111111111111111111111111111111");
|
|
|
|
pub const WSOL_TOKEN_ACCOUNT: Pubkey = pubkey!("So11111111111111111111111111111111111111112");
|
|
pub const WSOL_TOKEN_ACCOUNT_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: WSOL_TOKEN_ACCOUNT,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
pub const USD1_TOKEN_ACCOUNT: Pubkey = pubkey!("USD1ttGY1N17NEEHLmELoaybftRBUSErhqYiQzvEmuB");
|
|
pub const USD1_TOKEN_ACCOUNT_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: USD1_TOKEN_ACCOUNT,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
// USDC (mainnet) mint and meta
|
|
pub const USDC_TOKEN_ACCOUNT: Pubkey = pubkey!("EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");
|
|
pub const USDC_TOKEN_ACCOUNT_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: USDC_TOKEN_ACCOUNT,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|
|
|
|
pub const RENT: Pubkey = solana_sdk::sysvar::rent::id();
|
|
pub const RENT_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta { pubkey: RENT, is_signer: false, is_writable: false };
|
|
|
|
pub const ASSOCIATED_TOKEN_PROGRAM_ID: Pubkey =
|
|
pubkey!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");
|
|
pub const ASSOCIATED_TOKEN_PROGRAM_META: solana_sdk::instruction::AccountMeta =
|
|
solana_sdk::instruction::AccountMeta {
|
|
pubkey: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
is_signer: false,
|
|
is_writable: false,
|
|
};
|