Skip to content
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

feat: add amount to nut05 #173

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
13 changes: 8 additions & 5 deletions 05.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ The wallet `Alice` includes the following `PostMeltQuoteBolt11Request` data in i
```json
{
"request": <str>,
"unit": <str_enum["sat"]>
"unit": <str_enum["sat"]>,
"amount": <int|null>
}
```

Here, `request` is the bolt11 Lightning invoice to be paid and `unit` is the unit the wallet would like to pay with.
Here, `request` is the bolt11 Lightning invoice to be paid and `unit` is the unit the wallet would like to pay with. `amount` is an integer or null, representing the amount to be paid. If the invoice already defines an amount, the amount in the PostMeltQuoteBolt11Request **MUST** match the amount in the invoice exactly. The request may only be in amountless invoice if support for amountless invoices is signaled in the `MeltMethodSettings`.
thesimplekid marked this conversation as resolved.
Show resolved Hide resolved

The mint `Bob` then responds with a `PostMeltQuoteBolt11Response`:

Expand Down Expand Up @@ -182,11 +183,12 @@ The mint's settings for this nut indicate the supported method-unit pairs for me
"method": <str>,
"unit": <str>,
"min_amount": <int|null>,
"max_amount": <int|null>
"max_amount": <int|null>,
"amountless": <bool|null>
}
```

`min_amount` and `max_amount` indicate the minimum and maximum amount for an operation of this method-unit pair.
`min_amount` and `max_amount` indicate the minimum and maximum amount for an operation of this method-unit pair. `amountless` signals if the backed supports paying an amountless invoice.

Example `MeltMethodSetting`:

Expand All @@ -195,7 +197,8 @@ Example `MeltMethodSetting`:
"method": "bolt11",
"unit": "sat",
"min_amount": 100,
"max_amount": 10000
"max_amount": 10000,
"amountless": true
}
```

Expand Down
1 change: 1 addition & 0 deletions error_codes.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| 11002 | Transaction is not balanced (inputs != outputs) | [NUT-02][02], [NUT-03][03], [NUT-05][05] |
| 11005 | Unit in request is not supported | [NUT-04][04], [NUT-05][05] |
| 11006 | Amount outside of limit range | [NUT-04][04], [NUT-05][05] |
| 11007 | Amountless invoice is not supported | [NUT-05][05] |
| 12001 | Keyset is not known | [NUT-02][02], [NUT-04][04] |
| 12002 | Keyset is inactive, cannot sign messages | [NUT-02][02], [NUT-03][03], [NUT-04][04] |
| 20001 | Quote request is not paid | [NUT-04][04] |
Expand Down