use crate::api::{Market, API};
use crate::client::Client;
use crate::errors::Result;
use crate::model::{ServerTime, ServerTimeResponse};
#[derive(Clone)]
pub struct General {
pub client: Client,
}
impl General {
pub async fn ping(&self) -> Result<String> {
let _response: ServerTimeResponse= self.client.get(API::Market(Market::Time), None).await?;
Ok("pong".to_string())
}
pub async fn get_server_time(&self) -> Result<ServerTime> {
let response: ServerTimeResponse = self.client.get(API::Market(Market::Time), None).await?;
Ok(response.result)
}
}