diff --git a/Cargo.toml b/Cargo.toml index c4f0871..9dc1f64 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -87,7 +87,7 @@ tokio-tungstenite = { version = "0.26.1", features = ["native-tls"] } indicatif = "0.17.11" toml = "0.8.20" -pumpfun_program = { version = "4.2.0", package = "pumpfun" } +pumpfun_program = { version = "4.3.0", package = "pumpfun" } diff --git a/src/common/types.rs b/src/common/types.rs index 47095a4..94daec8 100755 --- a/src/common/types.rs +++ b/src/common/types.rs @@ -3,7 +3,7 @@ use std::sync::Arc; use solana_client::rpc_client::RpcClient; use solana_sdk::{commitment_config::CommitmentConfig, pubkey::Pubkey, signature::Keypair}; use serde::Deserialize; -use crate::{constants::pumpfun::trade::{DEFAULT_BUY_TIP_FEE, DEFAULT_COMPUTE_UNIT_LIMIT, DEFAULT_COMPUTE_UNIT_PRICE, DEFAULT_SELL_TIP_FEE}, swqos::FeeClient}; +use crate::{constants::pumpfun::trade::{DEFAULT_BUY_TIP_FEE, DEFAULT_COMPUTE_UNIT_LIMIT, DEFAULT_COMPUTE_UNIT_PRICE, DEFAULT_RPC_UNIT_LIMIT, DEFAULT_RPC_UNIT_PRICE, DEFAULT_SELL_TIP_FEE}, swqos::FeeClient}; #[derive(Debug, Clone, PartialEq)] pub enum FeeType { @@ -87,8 +87,8 @@ impl Default for PriorityFee { Self { unit_limit: DEFAULT_COMPUTE_UNIT_LIMIT, unit_price: DEFAULT_COMPUTE_UNIT_PRICE, - rpc_unit_limit: 0, - rpc_unit_price: 0, + rpc_unit_limit: DEFAULT_RPC_UNIT_LIMIT, + rpc_unit_price: DEFAULT_RPC_UNIT_PRICE, buy_tip_fee: DEFAULT_BUY_TIP_FEE, buy_tip_fees: vec![], sell_tip_fee: DEFAULT_SELL_TIP_FEE diff --git a/src/constants/pumpfun/mod.rs b/src/constants/pumpfun/mod.rs index c59a2c9..38969cf 100755 --- a/src/constants/pumpfun/mod.rs +++ b/src/constants/pumpfun/mod.rs @@ -165,6 +165,8 @@ pub mod trade { pub const DEFAULT_COMPUTE_UNIT_PRICE: u64 = 500000; pub const DEFAULT_BUY_TIP_FEE: f64 = 0.0006; pub const DEFAULT_SELL_TIP_FEE: f64 = 0.0001; + pub const DEFAULT_RPC_UNIT_LIMIT: u32 = 1000000; + pub const DEFAULT_RPC_UNIT_PRICE: u64 = 500000; } pub struct Symbol; diff --git a/src/lib.rs b/src/lib.rs index 47823af..0ee710e 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -640,6 +640,15 @@ impl PumpFun { Ok(actual_sol_reserves) } + #[inline] + pub async fn get_creator(&self, mint: &Pubkey) -> Result { + let (bonding_curve, _) = pumpfun::common::get_bonding_curve_account_v2(&self.rpc, mint).await?; + + let creator = bonding_curve.creator; + + Ok(creator) + } + #[inline] pub async fn get_current_price_with_pumpswap(&self, pool_address: &Pubkey) -> Result { let pool = pumpswap::pool::Pool::fetch(&self.rpc, pool_address).await?; diff --git a/src/swqos/mod.rs b/src/swqos/mod.rs index 8a92dab..1e9ad67 100755 --- a/src/swqos/mod.rs +++ b/src/swqos/mod.rs @@ -95,6 +95,7 @@ impl FeeClientTrait for SolRpcClient { Ok(_) => (), Err(_) => (), } + println!(" signature: {:?}", signature); println!(" rpc{}确认: {:?}", trade_type, start_time.elapsed()); Ok(signature)