use std::sync::Arc;
use crate::client::HttpCore;
use crate::error::Result;
use crate::types::*;
pub const RHC_KOL_TRADES: &str = "rhc:kol_trades";
pub const RHC_TRADES: &str = "rhc:trades";
#[derive(Debug, Clone)]
pub struct Stream {
pub(crate) core: Arc<HttpCore>,
}
impl Stream {
pub async fn get_token(&self) -> Result<StreamToken> {
self.core.post_empty("/stream/token").await
}
pub async fn sessions(&self) -> Result<StreamSessionsResponse> {
self.core.get("/stream/sessions", &()).await
}
pub async fn kill_session(&self, id: &str) -> Result<StreamSessionEvicted> {
self.core
.delete(&format!("/stream/sessions/{}", id))
.await
}
}