pub struct MintQuote {Show 14 fields
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,
pub estimated_blocks: Option<u32>,
pub used_by_operation: Option<String>,
pub version: u32,
}Expand description
Mint Quote Info
Fields§
§id: StringQuote id
mint_url: MintUrlMint Url
payment_method: PaymentMethodPayment method
amount: Option<Amount>Requested or fixed quote amount, when defined by the payment method.
Variable-amount methods such as onchain leave this unset and track
funds through amount_paid and amount_issued.
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
estimated_blocks: Option<u32>Estimated confirmation target in blocks for onchain quotes
used_by_operation: Option<String>Operation ID that has reserved this quote (for saga pattern)
version: u32Version for optimistic locking
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 state_from_amounts(&self) -> MintQuoteState
pub fn state_from_amounts(&self) -> MintQuoteState
Derive quote state from the tracked payment and issuance counters.
Sourcepub fn update_state_from_amounts(&mut self)
pub fn update_state_from_amounts(&mut self)
Update quote state from the tracked payment and issuance counters.
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