Conversation
| CurrencyUnit::Sat, | ||
| PaymentMethod::Bolt11, | ||
| mint_melt_limits, | ||
| Some(true), |
There was a problem hiding this comment.
Changing it here just singles support for it but it doesn't actually add support for it. The ln backends need to be modified to support it.
There was a problem hiding this comment.
can you explain further on "The ln backends need to be modified to support it." @thesimplekid
crates/cdk/src/mint/melt.rs
Outdated
| } | ||
| } | ||
|
|
||
| fn check_amount_less_invoice( |
There was a problem hiding this comment.
This function is mostly a duplicate of the one above it, the check for is amountless is supported can just be added there.
| let amount_less_amount = amount.unwrap_or_default(); | ||
| // let amount_less_amount = amount.unwrap_or_else(|| Amount::new(0)); | ||
|
|
||
| let amount = match melt_request.options { |
There was a problem hiding this comment.
If this is executed on an invoice without an amount defined it will return an error. If we get an invoice without an amount we need to use the once defined in the request.
crates/cdk/src/mint/melt.rs
Outdated
| Error::UnitUnsupported | ||
| })?; | ||
|
|
||
| // check amountless (amount in meltbolt11request) is equal to payment_quote.amount |
There was a problem hiding this comment.
Why do we need to check this, shouldn't we be setting the amount?
There was a problem hiding this comment.
do you mean mint return an amount,
if this is the case, mint does not know the amount of ecash a wallet making the melt qoute request has.
There was a problem hiding this comment.
if mint is setting the amount coming from the option field in MeltQuoteBolt11Request then , we need to check to ensure only mint that support amountless payment can handle this.
|
close for #497 |
Description
Base on the current Open PR on nuts: cashubtc/nuts#173
this PR aim at closing issu #460
mint can accept amountless invoice when melting token,
added setting in
MeltMethodSettingsforamount_lessalso handle cases where we are trying to melt token and amount_less invoice is provvidedChecklist
just final-checkbefore committing