pub struct MintQuote {
pub id: String,
pub mint_url: MintUrl,
pub payment_method: PaymentMethod,
pub amount: Option<Amount>,
pub unit: CurrencyUnit,
pub request: String,
pub state: MintQuoteState,
pub expiry: u64,
pub secret_key: Option<SecretKey>,
pub amount_issued: Amount,
pub amount_paid: Amount,
}
Expand description
Mint Quote Info
Fields§
§id: String
Quote id
mint_url: MintUrl
Mint Url
payment_method: PaymentMethod
Payment method
amount: Option<Amount>
Amount of quote
unit: CurrencyUnit
Unit of quote
request: String
Quote payment request e.g. bolt11
state: MintQuoteState
Quote state
expiry: u64
Expiration time of quote
secret_key: Option<SecretKey>
Secretkey for signing mint quotes [NUT-20]
amount_issued: Amount
Amount minted
amount_paid: Amount
Amount paid to the mint for the quote
Implementations§
Source§impl MintQuote
impl MintQuote
Sourcepub fn new(
id: String,
mint_url: MintUrl,
payment_method: PaymentMethod,
amount: Option<Amount>,
unit: CurrencyUnit,
request: String,
expiry: u64,
secret_key: Option<SecretKey>,
) -> Self
pub fn new( id: String, mint_url: MintUrl, payment_method: PaymentMethod, amount: Option<Amount>, unit: CurrencyUnit, request: String, expiry: u64, secret_key: Option<SecretKey>, ) -> Self
Create a new MintQuote
Sourcepub fn total_amount(&self) -> Amount
pub fn total_amount(&self) -> Amount
Calculate the total amount including any fees
Sourcepub fn is_expired(&self, current_time: u64) -> bool
pub fn is_expired(&self, current_time: u64) -> bool
Check if the quote has expired
Sourcepub fn amount_mintable(&self) -> Amount
pub fn amount_mintable(&self) -> Amount
Amount that can be minted
Trait Implementations§
Source§impl<'de> Deserialize<'de> for MintQuote
impl<'de> Deserialize<'de> for MintQuote
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for MintQuote
impl StructuralPartialEq for MintQuote
Auto Trait Implementations§
impl Freeze for MintQuote
impl RefUnwindSafe for MintQuote
impl Send for MintQuote
impl Sync for MintQuote
impl Unpin for MintQuote
impl UnwindSafe for MintQuote
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