diff --git a/README.md b/README.md index 5a37a38..93031ee 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ use mai3_pumpfun_sdk::{accounts::BondingCurveAccount, utils::CreateTokenMetadata // Create a new PumpFun client let payer: Keypair = Keypair::new(); -let client: PumpFun = PumpFun::new(Cluster::Mainnet, &payer, None, None); +let client: PumpFun = PumpFun::new(Cluster::Mainnet, None, &payer, None, None); // Mint keypair let mint: Keypair = Keypair::new(); diff --git a/crates/pumpfun/Cargo.toml b/crates/pumpfun/Cargo.toml index 90f7cf0..8fd2eaa 100644 --- a/crates/pumpfun/Cargo.toml +++ b/crates/pumpfun/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "mai3-pumpfun-sdk" -version = "2.4.0" +version = "2.4.1" edition = "2021" authors = ["William "] repository = "https://github.com/MiracleAI-Labs/pumpfun-sdk" diff --git a/crates/pumpfun/RUSTDOC.md b/crates/pumpfun/RUSTDOC.md index 9b6dde3..5ec0730 100644 --- a/crates/pumpfun/RUSTDOC.md +++ b/crates/pumpfun/RUSTDOC.md @@ -30,7 +30,7 @@ use mai3_pumpfun_sdk::{accounts::BondingCurveAccount, utils::CreateTokenMetadata // Create a new PumpFun client let payer: Keypair = Keypair::new(); -let client: PumpFun<'_> = PumpFun::new(Cluster::Mainnet, &payer, None, None); +let client: PumpFun = PumpFun::new(Cluster::Mainnet, None, &payer, None, None); // Mint keypair let mint: Keypair = Keypair::new(); diff --git a/crates/pumpfun/src/lib.rs b/crates/pumpfun/src/lib.rs index beb7096..1242002 100644 --- a/crates/pumpfun/src/lib.rs +++ b/crates/pumpfun/src/lib.rs @@ -55,10 +55,10 @@ pub struct PumpFun { pub rpc: RpcClient, /// Keypair used to sign transactions pub payer: Arc, - /// Jito client instance - pub jito_client: Option, /// Anchor client instance pub client: Client>, + /// Jito client instance + pub jito_client: Option, /// Anchor program instance pub program: Program>, } @@ -78,7 +78,7 @@ impl PumpFun { /// Returns a new PumpFun client instance configured with the provided parameters pub fn new( cluster: Cluster, - jito_url: String, + jito_url: Option, payer: Arc, options: Option, ws: Option, @@ -91,7 +91,7 @@ impl PumpFun { }); let mut jito_client = None; - if !jito_url.is_empty() { + if let Some(jito_url) = jito_url { jito_client = Some(JitoClient::new(&jito_url)); } @@ -757,7 +757,7 @@ mod tests { #[test] fn test_new_client() { let payer = Arc::new(Keypair::new()); - let client = PumpFun::new(Cluster::Devnet, Arc::clone(&payer), None, None); + let client = PumpFun::new(Cluster::Devnet, None,Arc::clone(&payer), None, None); assert_eq!(client.payer.pubkey(), payer.pubkey()); }