pub enum MeltQuoteResponse<Q> {
Bolt11(MeltQuoteBolt11Response<Q>),
Bolt12(MeltQuoteBolt12Response<Q>),
Onchain(MeltQuoteOnchainResponse<Q>),
Custom((PaymentMethod, MeltQuoteCustomResponse<Q>)),
}Expand description
Unified melt quote response for all payment methods
Variants§
Bolt11(MeltQuoteBolt11Response<Q>)
Bolt11 (Lightning invoice)
Bolt12(MeltQuoteBolt12Response<Q>)
Bolt12 (Offers)
Onchain(MeltQuoteOnchainResponse<Q>)
Onchain
Custom((PaymentMethod, MeltQuoteCustomResponse<Q>))
Custom payment method
Implementations§
Source§impl<Q> MeltQuoteResponse<Q>
impl<Q> MeltQuoteResponse<Q>
Sourcepub fn method(&self) -> PaymentMethod
pub fn method(&self) -> PaymentMethod
Returns the payment method for this response.
Source§impl<Q: ToString> MeltQuoteResponse<Q>
impl<Q: ToString> MeltQuoteResponse<Q>
Sourcepub fn to_string_id(self) -> MeltQuoteResponse<String>
pub fn to_string_id(self) -> MeltQuoteResponse<String>
Convert the MeltQuoteResponse with a quote type Q to a String
Sourcepub fn fee_reserve(&self) -> Amount
pub fn fee_reserve(&self) -> Amount
Returns the fee reserve.
Sourcepub fn state(&self) -> MeltQuoteState
pub fn state(&self) -> MeltQuoteState
Returns the quote state.
Sourcepub fn payment_proof(&self) -> Option<&str>
pub fn payment_proof(&self) -> Option<&str>
Returns the payment proof.
For Bolt11/Bolt12/Custom methods this is the Lightning payment
preimage. For Onchain, the “proof” is the broadcast outpoint
(txid:vout) — it plays the same role of a canonical,
method-specific artifact proving the mint executed the payment.
Callers inspecting payment_proof to decide whether an irreversible
settlement has occurred can treat Onchain uniformly with the other
methods.
Sourcepub fn change(&self) -> Option<&Vec<BlindSignature>>
pub fn change(&self) -> Option<&Vec<BlindSignature>>
Returns the change signatures when present.
Sourcepub fn unit(&self) -> Option<CurrencyUnit>
pub fn unit(&self) -> Option<CurrencyUnit>
Returns the unit when present.
Trait Implementations§
Source§impl<Q: Clone> Clone for MeltQuoteResponse<Q>
impl<Q: Clone> Clone for MeltQuoteResponse<Q>
Source§fn clone(&self) -> MeltQuoteResponse<Q>
fn clone(&self) -> MeltQuoteResponse<Q>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<Q: Debug> Debug for MeltQuoteResponse<Q>
impl<Q: Debug> Debug for MeltQuoteResponse<Q>
Source§impl<'de, Q> Deserialize<'de> for MeltQuoteResponse<Q>where
Q: Serialize + DeserializeOwned,
impl<'de, Q> Deserialize<'de> for MeltQuoteResponse<Q>where
Q: Serialize + DeserializeOwned,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl<Q: Eq> Eq for MeltQuoteResponse<Q>
Source§impl<Q> From<MeltQuote> for MeltQuoteResponse<Q>
Available on crate feature mint only.
impl<Q> From<MeltQuote> for MeltQuoteResponse<Q>
mint only.Source§impl From<MeltQuoteResponse<QuoteId>> for MeltQuoteResponse<String>
Available on crate feature mint only.
impl From<MeltQuoteResponse<QuoteId>> for MeltQuoteResponse<String>
mint only.Source§fn from(value: MeltQuoteResponse<QuoteId>) -> Self
fn from(value: MeltQuoteResponse<QuoteId>) -> Self
Source§impl<Q: PartialEq> PartialEq for MeltQuoteResponse<Q>
impl<Q: PartialEq> PartialEq for MeltQuoteResponse<Q>
Source§fn eq(&self, other: &MeltQuoteResponse<Q>) -> bool
fn eq(&self, other: &MeltQuoteResponse<Q>) -> bool
self and other values to be equal, and is used by ==.