-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
cdk/crates/cdk/src/mint/melt/mod.rs
Lines 230 to 252 in 5bedc77
| /// Implementation of get_melt_bolt12_quote | |
| #[instrument(skip_all)] | |
| async fn get_melt_bolt12_quote_impl( | |
| &self, | |
| melt_request: &MeltQuoteBolt12Request, | |
| ) -> Result<MeltQuoteBolt11Response<QuoteId>, Error> { | |
| let MeltQuoteBolt12Request { | |
| request, | |
| unit, | |
| options, | |
| } = melt_request; | |
| let offer = Offer::from_str(request).map_err(|_| Error::InvalidPaymentRequest)?; | |
| let amount = match options { | |
| Some(options) => match options { | |
| MeltOptions::Amountless { amountless } => { | |
| to_unit(amountless.amount_msat, &CurrencyUnit::Msat, unit)? | |
| } | |
| _ => return Err(Error::UnsupportedUnit), | |
| }, | |
| None => amount_for_offer(&offer, unit).map_err(|_| Error::UnsupportedUnit)?, | |
| }; |
Metadata
Metadata
Assignees
Labels
No labels