use std::fmt::Debug;
use async_trait::async_trait;
use super::Error;
use crate::nuts::{
CheckStateRequest, CheckStateResponse, Id, KeySet, KeysetResponse, MeltBolt11Request,
MeltQuoteBolt11Request, MeltQuoteBolt11Response, MintBolt11Request, MintBolt11Response,
MintInfo, MintQuoteBolt11Request, MintQuoteBolt11Response, RestoreRequest, RestoreResponse,
SwapRequest, SwapResponse,
};
#[cfg(feature = "auth")]
use crate::wallet::AuthWallet;
mod http_client;
#[cfg(feature = "auth")]
pub use http_client::AuthHttpClient;
pub use http_client::HttpClient;
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
pub trait MintConnector: Debug {
async fn get_mint_keys(&self) -> Result<Vec<KeySet>, Error>;
async fn get_mint_keyset(&self, keyset_id: Id) -> Result<KeySet, Error>;
async fn get_mint_keysets(&self) -> Result<KeysetResponse, Error>;
async fn post_mint_quote(
&self,
request: MintQuoteBolt11Request,
) -> Result<MintQuoteBolt11Response<String>, Error>;
async fn get_mint_quote_status(
&self,
quote_id: &str,
) -> Result<MintQuoteBolt11Response<String>, Error>;
async fn post_mint(
&self,
request: MintBolt11Request<String>,
) -> Result<MintBolt11Response, Error>;
async fn post_melt_quote(
&self,
request: MeltQuoteBolt11Request,
) -> Result<MeltQuoteBolt11Response<String>, Error>;
async fn get_melt_quote_status(
&self,
quote_id: &str,
) -> Result<MeltQuoteBolt11Response<String>, Error>;
async fn post_melt(
&self,
request: MeltBolt11Request<String>,
) -> Result<MeltQuoteBolt11Response<String>, Error>;
async fn post_swap(&self, request: SwapRequest) -> Result<SwapResponse, Error>;
async fn get_mint_info(&self) -> Result<MintInfo, Error>;
async fn post_check_state(
&self,
request: CheckStateRequest,
) -> Result<CheckStateResponse, Error>;
async fn post_restore(&self, request: RestoreRequest) -> Result<RestoreResponse, Error>;
#[cfg(feature = "auth")]
async fn get_auth_wallet(&self) -> Option<AuthWallet>;
#[cfg(feature = "auth")]
async fn set_auth_wallet(&self, wallet: Option<AuthWallet>);
}