BaseHttpClient

Struct BaseHttpClient 

Source
pub struct BaseHttpClient<T>
where T: Transport + Send + Sync + 'static,
{ /* private fields */ }
Expand description

Http Client

Implementations§

Source§

impl<T> HttpClient<T>
where T: Transport + Send + Sync + 'static,

Source

pub fn with_transport( mint_url: MintUrl, transport: T, auth_wallet: Option<AuthWallet>, ) -> Self

Create new HttpClient with a provided transport implementation.

Source

pub fn new(mint_url: MintUrl, auth_wallet: Option<AuthWallet>) -> Self

Create new HttpClient

Source

pub async fn get_auth_token( &self, method: Method, path: RoutePath, ) -> Result<Option<AuthToken>, Error>

Get auth token for a protected endpoint

Source

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>
where T: Transport + Send + Sync + 'static + Clone,

Source§

fn clone(&self) -> HttpClient<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for HttpClient<T>
where T: Transport + Send + Sync + 'static + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> MintConnector for HttpClient<T>
where T: Transport + Send + Sync + 'static,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

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,

Resolve the DNS record getting the TXT value
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,

Get the auth wallet for the client
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,

Set auth wallet on client

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,