pub struct BaseHttpClient<T>{ /* private fields */ }Expand description
Http Client
Implementations§
Source§impl<T> HttpClient<T>
impl<T> HttpClient<T>
Sourcepub fn with_transport(
mint_url: MintUrl,
transport: T,
auth_wallet: Option<AuthWallet>,
) -> Self
pub fn with_transport( mint_url: MintUrl, transport: T, auth_wallet: Option<AuthWallet>, ) -> Self
Create new HttpClient with a provided transport implementation.
Sourcepub fn new(mint_url: MintUrl, auth_wallet: Option<AuthWallet>) -> Self
pub fn new(mint_url: MintUrl, auth_wallet: Option<AuthWallet>) -> Self
Create new HttpClient
Sourcepub async fn get_auth_token(
&self,
method: Method,
path: RoutePath,
) -> Result<Option<AuthToken>, Error>
pub async fn get_auth_token( &self, method: Method, path: RoutePath, ) -> Result<Option<AuthToken>, Error>
Get auth token for a protected endpoint
Sourcepub fn with_proxy(
mint_url: MintUrl,
proxy: Url,
host_matcher: Option<&str>,
accept_invalid_certs: bool,
) -> Result<Self, Error>
pub fn with_proxy( mint_url: MintUrl, proxy: Url, host_matcher: Option<&str>, accept_invalid_certs: bool, ) -> Result<Self, Error>
Create new HttpClient with a proxy for specific TLDs.
Specifying None for host_matcher will use the proxy for all
requests.
Trait Implementations§
Source§impl<T> Clone for HttpClient<T>
impl<T> Clone for HttpClient<T>
Source§fn clone(&self) -> HttpClient<T>
fn clone(&self) -> HttpClient<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T> Debug for HttpClient<T>
impl<T> Debug for HttpClient<T>
Source§impl<T> MintConnector for HttpClient<T>
impl<T> MintConnector for HttpClient<T>
Source§fn fetch_lnurl_pay_request<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LnurlPayResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_lnurl_pay_request<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LnurlPayResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch Lightning address pay request data
Source§fn fetch_lnurl_invoice<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LnurlPayInvoiceResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn fetch_lnurl_invoice<'life0, 'life1, 'async_trait>(
&'life0 self,
url: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<LnurlPayInvoiceResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Fetch invoice from Lightning address callback
Source§fn get_mint_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeySet>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mint_keys<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<KeySet>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get Active Mint Keys [NUT-01]
Source§fn get_mint_keyset<'life0, 'async_trait>(
&'life0 self,
keyset_id: Id,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mint_keyset<'life0, 'async_trait>(
&'life0 self,
keyset_id: Id,
) -> Pin<Box<dyn Future<Output = Result<KeySet, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get Keyset Keys [NUT-01]
Source§fn get_mint_keysets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<KeysetResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mint_keysets<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<KeysetResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get Keysets [NUT-02]
Source§fn post_mint_quote<'life0, 'async_trait>(
&'life0 self,
request: MintQuoteBolt11Request,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_mint_quote<'life0, 'async_trait>(
&'life0 self,
request: MintQuoteBolt11Request,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mint Quote [NUT-04]
Source§fn get_mint_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mint_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mint Quote status
Source§fn post_mint<'life0, 'async_trait>(
&'life0 self,
request: MintRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MintResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_mint<'life0, 'async_trait>(
&'life0 self,
request: MintRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MintResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mint Tokens [NUT-04]
Source§fn post_melt_quote<'life0, 'async_trait>(
&'life0 self,
request: MeltQuoteBolt11Request,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_melt_quote<'life0, 'async_trait>(
&'life0 self,
request: MeltQuoteBolt11Request,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Melt Quote [NUT-05]
Source§fn get_melt_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_melt_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Melt Quote Status
Source§fn post_melt<'life0, 'async_trait>(
&'life0 self,
request: MeltRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_melt<'life0, 'async_trait>(
&'life0 self,
request: MeltRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Melt [NUT-05] [Nut-08] Lightning fee return if outputs defined
Source§fn post_swap<'life0, 'async_trait>(
&'life0 self,
swap_request: SwapRequest,
) -> Pin<Box<dyn Future<Output = Result<SwapResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_swap<'life0, 'async_trait>(
&'life0 self,
swap_request: SwapRequest,
) -> Pin<Box<dyn Future<Output = Result<SwapResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Swap Token [NUT-03]
Source§fn get_mint_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MintInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_mint_info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<MintInfo, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Helper to get mint info
Source§fn post_check_state<'life0, 'async_trait>(
&'life0 self,
request: CheckStateRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckStateResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_check_state<'life0, 'async_trait>(
&'life0 self,
request: CheckStateRequest,
) -> Pin<Box<dyn Future<Output = Result<CheckStateResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Spendable check [NUT-07]
Source§fn post_restore<'life0, 'async_trait>(
&'life0 self,
request: RestoreRequest,
) -> Pin<Box<dyn Future<Output = Result<RestoreResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_restore<'life0, 'async_trait>(
&'life0 self,
request: RestoreRequest,
) -> Pin<Box<dyn Future<Output = Result<RestoreResponse, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Restore request [NUT-13]
Source§fn post_mint_bolt12_quote<'life0, 'async_trait>(
&'life0 self,
request: MintQuoteBolt12Request,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt12Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_mint_bolt12_quote<'life0, 'async_trait>(
&'life0 self,
request: MintQuoteBolt12Request,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt12Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Mint Quote Bolt12 [NUT-23]
Source§fn get_mint_quote_bolt12_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt12Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mint_quote_bolt12_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MintQuoteBolt12Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Mint Quote Bolt12 status
Source§fn post_melt_bolt12_quote<'life0, 'async_trait>(
&'life0 self,
request: MeltQuoteBolt12Request,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_melt_bolt12_quote<'life0, 'async_trait>(
&'life0 self,
request: MeltQuoteBolt12Request,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Melt Quote Bolt12 [NUT-23]
Source§fn get_melt_bolt12_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_melt_bolt12_quote_status<'life0, 'life1, 'async_trait>(
&'life0 self,
quote_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Melt Quote Bolt12 Status [NUT-23]
Source§fn post_melt_bolt12<'life0, 'async_trait>(
&'life0 self,
request: MeltRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn post_melt_bolt12<'life0, 'async_trait>(
&'life0 self,
request: MeltRequest<String>,
) -> Pin<Box<dyn Future<Output = Result<MeltQuoteBolt11Response<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Melt Bolt12 [NUT-23]
Source§fn resolve_dns_txt<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn resolve_dns_txt<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_auth_wallet<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<AuthWallet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_auth_wallet<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Option<AuthWallet>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn set_auth_wallet<'life0, 'async_trait>(
&'life0 self,
wallet: Option<AuthWallet>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_auth_wallet<'life0, 'async_trait>(
&'life0 self,
wallet: Option<AuthWallet>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Auto Trait Implementations§
impl<T> Freeze for HttpClient<T>
impl<T> !RefUnwindSafe for HttpClient<T>
impl<T> Send for HttpClient<T>
impl<T> Sync for HttpClient<T>
impl<T> Unpin for HttpClient<T>
impl<T> !UnwindSafe for HttpClient<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request