use std::sync::Arc;
use crate::client::HttpCore;
use crate::error::Result;
use crate::types::*;
#[derive(Debug, Clone)]
pub struct Sniper {
pub(crate) core: Arc<HttpCore>,
}
impl Sniper {
pub async fn recent(&self, params: &SniperRecentParams) -> Result<SniperRecentResponse> {
self.core.get("/sniper/recent", params).await
}
pub async fn by_deployer(
&self,
wallet: &str,
params: &SniperByDeployerParams,
) -> Result<SniperByDeployerResponse> {
self.core
.get(&format!("/sniper/by-deployer/{}", wallet), params)
.await
}
pub async fn watchlist(&self) -> Result<SniperWatchlistResponse> {
self.core.get("/sniper/watchlist", &()).await
}
pub async fn add_to_watchlist(
&self,
params: &SniperWatchlistAddParams,
) -> Result<SniperWatchlistAddResponse> {
self.core.post_json("/sniper/watchlist", params).await
}
pub async fn remove_from_watchlist(
&self,
wallet: &str,
) -> Result<SniperWatchlistRemoveResponse> {
self.core
.delete(&format!("/sniper/watchlist/{}", wallet))
.await
}
}