use std::sync::Arc;
use crate::client::HttpCore;
use crate::error::Result;
use crate::types::*;
#[derive(Debug, Clone)]
pub struct Tokens {
pub(crate) core: Arc<HttpCore>,
}
impl Tokens {
pub async fn list(&self, params: &TokensListParams) -> Result<TokensListResponse> {
self.core.get("/rhc/tokens", params).await
}
pub async fn get(&self, address: &str) -> Result<TokenDetailResponse> {
self.core
.get(&format!("/rhc/tokens/{}", address), &())
.await
}
pub async fn candles(
&self,
address: &str,
params: &CandlesParams,
) -> Result<CandlesResponse> {
self.core
.get(&format!("/rhc/tokens/{}/candles", address), params)
.await
}
pub async fn kol_consensus(&self, address: &str) -> Result<KolConsensusResponse> {
self.core
.get(&format!("/rhc/tokens/{}/kol-consensus", address), &())
.await
}
pub async fn buyer_quality(&self, address: &str) -> Result<BuyerQualityResponse> {
self.core
.get(&format!("/rhc/tokens/{}/buyer-quality", address), &())
.await
}
pub async fn bundle(&self, address: &str) -> Result<RhcBundleResponse> {
self.core
.get(&format!("/rhc/tokens/{}/bundle", address), &())
.await
}
}