-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore:add support for amountless in mintinfo and createMeltQuote #230
base: development
Are you sure you want to change the base?
Conversation
@@ -94,4 +94,7 @@ export class MintInfo { | |||
get motd() { | |||
return this._mintInfo.motd; | |||
} | |||
get amountless() { | |||
return this._mintInfo.amountless; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mint signals support via the MeltMethodOptions, not on the root level of the InfoReponse. Please check the PR again and make sure to adjust this accordingly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i can't seem to find MeltMethodOptions
, is this something that already exist or we have to create a new one for it @Egge21M
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is there, but it might need some refactoring for this PR. You can find it as GetInfoResponse.nuts.5.methods
const meltQuotePayload: MeltQuotePayload = { | ||
unit: this._unit, | ||
request: invoice | ||
}; | ||
|
||
if (this._mintInfo?.amountless) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only be adding the amount, if the caller explicitly passes amount. Otherwise this implementation defaults to 0 and mints that support this will throw an error if amount != invoiceAmount.
Also amount passed needs to be in msats
Fixes: #225
Description
PR base on cashubtc/nuts#173 for handling amountless when melting quote
Changes
MeltQuotePayload
PR Tasks
npm run test
--> no failing unit testsnpm run format