use std::sync::Arc;
use crate::client::HttpCore;
use crate::error::Result;
use crate::types::*;
#[derive(Debug, Clone)]
pub struct WalletTracker {
pub(crate) core: Arc<HttpCore>,
}
impl WalletTracker {
pub async fn watchlist(&self) -> Result<WatchlistResponse> {
self.core.get("/wallet-tracker/watchlist", &()).await
}
pub async fn add_to_watchlist(
&self,
params: &WatchlistAddParams,
) -> Result<WatchlistAddResponse> {
self.core
.post_json("/wallet-tracker/watchlist", params)
.await
}
pub async fn remove_from_watchlist(
&self,
wallet: &str,
) -> Result<WalletTrackerDeleteResponse> {
self.core
.delete(&format!("/wallet-tracker/watchlist/{}", wallet))
.await
}
pub async fn update_label(
&self,
wallet: &str,
params: &WatchlistUpdateParams,
) -> Result<WalletEntry> {
self.core
.patch_json(
&format!("/wallet-tracker/watchlist/{}", wallet),
params,
)
.await
}
pub async fn trades(
&self,
params: &WalletTrackerTradesParams,
) -> Result<WalletTrackerTradesResponse> {
self.core.get("/wallet-tracker/trades", params).await
}
pub async fn summary(
&self,
params: &WalletTrackerSummaryParams,
) -> Result<WalletTrackerSummaryResponse> {
self.core.get("/wallet-tracker/summary", params).await
}
}