use std::fmt::Debug;
use async_trait::async_trait;
use cdk_common::{MeltQuoteRequest, MeltQuoteResponse, MintQuoteRequest, MintQuoteResponse};
use super::Error;
pub use crate::lightning_address::{LnurlPayInvoiceResponse, LnurlPayResponse};
use crate::nuts::{
BatchCheckMintQuoteRequest, BatchMintRequest, CheckStateRequest, CheckStateResponse, Id,
KeySet, KeysetResponse, MeltQuoteBolt11Response, MeltRequest, MintInfo,
MintQuoteBolt11Response, MintRequest, MintResponse, PaymentMethod, RestoreRequest,
RestoreResponse, SwapRequest, SwapResponse,
};
use crate::wallet::AuthWallet;
pub mod http_client;
pub mod transport;
pub type AuthHttpClient = http_client::AuthHttpClient<transport::Async>;
pub type HttpClient = http_client::HttpClient<transport::Async>;
#[cfg(all(feature = "tor", not(target_arch = "wasm32")))]
pub type TorHttpClient = http_client::HttpClient<transport::tor_transport::TorAsync>;
#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
pub trait MintConnector: Debug {
#[cfg(all(feature = "bip353", not(target_arch = "wasm32")))]
async fn resolve_dns_txt(&self, _domain: &str) -> Result<Vec<String>, Error>;
async fn fetch_lnurl_pay_request(
&self,
url: &str,
) -> Result<crate::lightning_address::LnurlPayResponse, Error>;
async fn fetch_lnurl_invoice(
&self,
url: &str,
) -> Result<crate::lightning_address::LnurlPayInvoiceResponse, Error>;
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: MintQuoteRequest,
) -> Result<MintQuoteResponse<String>, Error>;
async fn post_mint(
&self,
method: &PaymentMethod,
request: MintRequest<String>,
) -> Result<MintResponse, Error>;
async fn post_batch_check_mint_quote_status(
&self,
method: &PaymentMethod,
request: BatchCheckMintQuoteRequest<String>,
) -> Result<Vec<MintQuoteBolt11Response<String>>, Error>;
async fn post_batch_mint(
&self,
method: &PaymentMethod,
request: BatchMintRequest<String>,
) -> Result<MintResponse, Error>;
async fn post_melt_quote(
&self,
request: MeltQuoteRequest,
) -> Result<MeltQuoteResponse<String>, Error>;
async fn get_mint_quote_status(
&self,
method: PaymentMethod,
quote_id: &str,
) -> Result<MintQuoteResponse<String>, Error>;
async fn get_melt_quote_status(
&self,
method: PaymentMethod,
quote_id: &str,
) -> Result<MeltQuoteResponse<String>, Error>;
async fn post_melt(
&self,
method: &PaymentMethod,
request: MeltRequest<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>;
async fn get_auth_wallet(&self) -> Option<AuthWallet>;
async fn set_auth_wallet(&self, wallet: Option<AuthWallet>);
}