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: StringQuote id
mint_url: MintUrlMint Url
payment_method: PaymentMethodPayment method
amount: Option<Amount>Amount of quote
unit: CurrencyUnitUnit of quote
request: StringQuote payment request e.g. bolt11
state: MintQuoteStateQuote state
expiry: u64Expiration time of quote
secret_key: Option<SecretKey>Secretkey for signing mint quotes [NUT-20]
amount_issued: AmountAmount minted
amount_paid: AmountAmount 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