This commit is contained in:
William
2025-01-03 15:26:44 +08:00
parent cc29851c67
commit 862651034e
4 changed files with 8 additions and 8 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ use mai3_pumpfun_sdk::{accounts::BondingCurveAccount, utils::CreateTokenMetadata
// Create a new PumpFun client // Create a new PumpFun client
let payer: Keypair = Keypair::new(); 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 // Mint keypair
let mint: Keypair = Keypair::new(); let mint: Keypair = Keypair::new();
+1 -1
View File
@@ -1,6 +1,6 @@
[package] [package]
name = "mai3-pumpfun-sdk" name = "mai3-pumpfun-sdk"
version = "2.4.0" version = "2.4.1"
edition = "2021" edition = "2021"
authors = ["William <william@mai3.io>"] authors = ["William <william@mai3.io>"]
repository = "https://github.com/MiracleAI-Labs/pumpfun-sdk" repository = "https://github.com/MiracleAI-Labs/pumpfun-sdk"
+1 -1
View File
@@ -30,7 +30,7 @@ use mai3_pumpfun_sdk::{accounts::BondingCurveAccount, utils::CreateTokenMetadata
// Create a new PumpFun client // Create a new PumpFun client
let payer: Keypair = Keypair::new(); 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 // Mint keypair
let mint: Keypair = Keypair::new(); let mint: Keypair = Keypair::new();
+5 -5
View File
@@ -55,10 +55,10 @@ pub struct PumpFun {
pub rpc: RpcClient, pub rpc: RpcClient,
/// Keypair used to sign transactions /// Keypair used to sign transactions
pub payer: Arc<Keypair>, pub payer: Arc<Keypair>,
/// Jito client instance
pub jito_client: Option<JitoClient>,
/// Anchor client instance /// Anchor client instance
pub client: Client<Arc<Keypair>>, pub client: Client<Arc<Keypair>>,
/// Jito client instance
pub jito_client: Option<JitoClient>,
/// Anchor program instance /// Anchor program instance
pub program: Program<Arc<Keypair>>, pub program: Program<Arc<Keypair>>,
} }
@@ -78,7 +78,7 @@ impl PumpFun {
/// Returns a new PumpFun client instance configured with the provided parameters /// Returns a new PumpFun client instance configured with the provided parameters
pub fn new( pub fn new(
cluster: Cluster, cluster: Cluster,
jito_url: String, jito_url: Option<String>,
payer: Arc<Keypair>, payer: Arc<Keypair>,
options: Option<CommitmentConfig>, options: Option<CommitmentConfig>,
ws: Option<bool>, ws: Option<bool>,
@@ -91,7 +91,7 @@ impl PumpFun {
}); });
let mut jito_client = None; let mut jito_client = None;
if !jito_url.is_empty() { if let Some(jito_url) = jito_url {
jito_client = Some(JitoClient::new(&jito_url)); jito_client = Some(JitoClient::new(&jito_url));
} }
@@ -757,7 +757,7 @@ mod tests {
#[test] #[test]
fn test_new_client() { fn test_new_client() {
let payer = Arc::new(Keypair::new()); 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()); assert_eq!(client.payer.pubkey(), payer.pubkey());
} }