Logging and testing buying
This commit is contained in:
@@ -1,17 +1,34 @@
|
||||
use pump_rust_client::PumpSdk;
|
||||
|
||||
use crate::executor::Executor;
|
||||
|
||||
pub const PROGRAM_ID: &str = "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P";
|
||||
|
||||
pub struct PumpFun {
|
||||
pub private_key: String,
|
||||
pub sdk: PumpSdk,
|
||||
}
|
||||
|
||||
impl Executor for PumpFun {
|
||||
async fn buy(&self, token: solana_sdk::pubkey::Pubkey, amount: f64) -> anyhow::Result<()> {
|
||||
log::info!("Buying {token}");
|
||||
|
||||
// self.sdk.buy_v2_instructions(
|
||||
// global,
|
||||
// bonding_curve,
|
||||
// base_mint,
|
||||
// quote_token_program,
|
||||
// user,
|
||||
// amount,
|
||||
// max_quote_tokens,
|
||||
// );
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
async fn sell(&self, token: solana_sdk::pubkey::Pubkey, amount: f64) -> anyhow::Result<()> {
|
||||
log::info!("Selling {token}");
|
||||
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,10 @@ use tokio_tungstenite::connect_async;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> anyhow::Result<()> {
|
||||
let mut builder = env_logger::Builder::from_default_env();
|
||||
builder.filter_level(log::LevelFilter::Info);
|
||||
builder.init();
|
||||
|
||||
let (mut ws, _) = connect_async("wss://pumpdev.io/ws").await?;
|
||||
|
||||
ws.send(tokio_tungstenite::tungstenite::Message::Text(
|
||||
|
||||
Reference in New Issue
Block a user