pub struct CrossPlatformHttpClient { /* private fields */ }
Implementations§
Source§impl CrossPlatformHttpClient
impl CrossPlatformHttpClient
pub fn new() -> Self
pub async fn do_get<T: DeserializeOwned>( &self, url: &Url, ) -> Result<T, MokshaWalletError>
pub async fn do_post<T: DeserializeOwned, B: Serialize>( &self, url: &Url, body: &B, ) -> Result<T, MokshaWalletError>
pub async fn get_status(&self, url: &Url) -> Result<u16, MokshaWalletError>
Trait Implementations§
Source§impl CashuClient for CrossPlatformHttpClient
impl CashuClient for CrossPlatformHttpClient
fn get_keys<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<KeysResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_keys_by_id<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
keyset_id: String,
) -> Pin<Box<dyn Future<Output = Result<KeysResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_keysets<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<V1Keysets, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_swap<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
inputs: Proofs,
outputs: Vec<BlindedMessage>,
) -> Pin<Box<dyn Future<Output = Result<PostSwapResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_melt_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
inputs: Proofs,
quote: String,
outputs: Vec<BlindedMessage>,
) -> Pin<Box<dyn Future<Output = Result<PostMeltBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_melt_quote_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
payment_request: String,
unit: CurrencyUnit,
) -> Pin<Box<dyn Future<Output = Result<PostMeltQuoteBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_melt_quote_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
) -> Pin<Box<dyn Future<Output = Result<PostMeltQuoteBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_mint_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
blinded_messages: Vec<BlindedMessage>,
) -> Pin<Box<dyn Future<Output = Result<PostMintBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_mint_quote_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
amount: u64,
unit: CurrencyUnit,
) -> Pin<Box<dyn Future<Output = Result<PostMintQuoteBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mint_quote_bolt11<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
) -> Pin<Box<dyn Future<Output = Result<PostMintQuoteBolt11Response, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_mint_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
blinded_messages: Vec<BlindedMessage>,
) -> Pin<Box<dyn Future<Output = Result<PostMintOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_mint_quote_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
amount: u64,
unit: CurrencyUnit,
) -> Pin<Box<dyn Future<Output = Result<PostMintQuoteOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_mint_quote_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
) -> Pin<Box<dyn Future<Output = Result<PostMintQuoteOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_info<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<MintInfoResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_v1_supported<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
) -> Pin<Box<dyn Future<Output = Result<bool, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_melt_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
inputs: Proofs,
quote: String,
) -> Pin<Box<dyn Future<Output = Result<PostMeltOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn post_melt_quote_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
address: String,
amount: u64,
unit: CurrencyUnit,
) -> Pin<Box<dyn Future<Output = Result<Vec<PostMeltQuoteOnchainResponse>, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_melt_quote_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
quote: String,
) -> Pin<Box<dyn Future<Output = Result<PostMeltQuoteOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_melt_onchain<'life0, 'life1, 'async_trait>(
&'life0 self,
mint_url: &'life1 Url,
txid: String,
) -> Pin<Box<dyn Future<Output = Result<GetMeltOnchainResponse, MokshaWalletError>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl Clone for CrossPlatformHttpClient
impl Clone for CrossPlatformHttpClient
Source§fn clone(&self) -> CrossPlatformHttpClient
fn clone(&self) -> CrossPlatformHttpClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CrossPlatformHttpClient
impl Debug for CrossPlatformHttpClient
Auto Trait Implementations§
impl Freeze for CrossPlatformHttpClient
impl !RefUnwindSafe for CrossPlatformHttpClient
impl Send for CrossPlatformHttpClient
impl Sync for CrossPlatformHttpClient
impl Unpin for CrossPlatformHttpClient
impl !UnwindSafe for CrossPlatformHttpClient
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
Mutably borrows from an owned value. Read more
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>
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 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>
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