mirror of
https://github.com/0xfnzero/solana-streamer.git
synced 2026-08-22 21:38:05 +00:00
fix jito
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "mai3-pumpfun-sdk"
|
||||
version = "2.4.0"
|
||||
version = "2.4.1"
|
||||
edition = "2021"
|
||||
authors = ["William <william@mai3.io>"]
|
||||
repository = "https://github.com/MiracleAI-Labs/pumpfun-sdk"
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -55,10 +55,10 @@ pub struct PumpFun {
|
||||
pub rpc: RpcClient,
|
||||
/// Keypair used to sign transactions
|
||||
pub payer: Arc<Keypair>,
|
||||
/// Jito client instance
|
||||
pub jito_client: Option<JitoClient>,
|
||||
/// Anchor client instance
|
||||
pub client: Client<Arc<Keypair>>,
|
||||
/// Jito client instance
|
||||
pub jito_client: Option<JitoClient>,
|
||||
/// Anchor program instance
|
||||
pub program: Program<Arc<Keypair>>,
|
||||
}
|
||||
@@ -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<String>,
|
||||
payer: Arc<Keypair>,
|
||||
options: Option<CommitmentConfig>,
|
||||
ws: Option<bool>,
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user