mod accounts;
mod core;
mod me;
mod refresh;
mod transactions;
use crate::{AppSecret, AppToken};
const DEFAULT_BASE_URL: &str = "https://api.akahu.io/v1";
pub struct AkahuClient {
client: reqwest::Client,
app_id_token: AppToken,
app_secret: Option<AppSecret>,
base_url: String,
}
impl AkahuClient {
pub fn new<T: Into<AppToken>>(
client: reqwest::Client,
app_id_token: T,
base_url: Option<String>,
) -> Self {
let base_url = base_url.unwrap_or_else(|| DEFAULT_BASE_URL.to_string());
Self {
client,
app_id_token: app_id_token.into(),
app_secret: None,
base_url,
}
}
pub fn with_app_secret<T: Into<AppSecret>>(mut self, app_secret: T) -> Self {
self.app_secret = Some(app_secret.into());
self
}
}