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

NUT-4/NUT-5: Method-unit pair is object with settings #82

Merged
merged 2 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 27 additions & 3 deletions 04.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,37 @@ The settings for this nut indicate the supported method-unit pairs for minting a
{
"4": {
"methods": [
["bolt11", "sat"]
<MintMethodSetting>,
callebtc marked this conversation as resolved.
Show resolved Hide resolved
...
],
"disabled": false
"disabled": <bool>
}
}
```
Here, `methods` is an array of arrays with `[method, unit]` pairs. `disabled` indicates whether this minting is disabled and the mint only allows melting ecash.

`MintMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether this minting is disabled.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I liked the wording you had above, and could combine both like so:

Here, methods is an array of MintMethodSetting. MintMethodSetting indicates supported method and unit pairs and additional settings of the mint. disabled indicates whether this minting is disabled.


`MintMethodSetting` is of the form:
```json
{
"method": <str>,
"unit": <str>,
"min_amount": <int|null>,
"max_amount": <int|null>
}
```
`min_amount` and `max_amount` indicate the minimum and maximum amount for an operation of this method-unit pair.

Example `MintMethodSetting`:

```json
{
"method": "bolt11",
"unit": "sat",
"min_amount": 0,
"max_amount": 10000
}
```

[00]: 00.md
[01]: 01.md
Expand Down
31 changes: 28 additions & 3 deletions 05.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,14 +157,39 @@ Response of `Bob`:
The settings for this nut indicate the supported method-unit pairs for melting. They are part of the info response of the mint ([NUT-06][06]) which in this case reads
```json
{
"5": {
"4": {
callebtc marked this conversation as resolved.
Show resolved Hide resolved
"methods": [
["bolt11", "sat"]
<MeltMethodSetting>,
callebtc marked this conversation as resolved.
Show resolved Hide resolved
...
],
"disabled": <bool>
}
}
```
Here, `methods` is an array of arrays with `[method, unit]` pairs.

`MeltMethodSetting` indicates supported `method` and `unit` pairs and additional settings of the mint. `disabled` indicates whether this melting is disabled.

`MeltMethodSetting` is of the form:
```json
{
"method": <str>,
"unit": <str>,
"min_amount": <int|null>,
"max_amount": <int|null>
}
```
`min_amount` and `max_amount` indicate the minimum and maximum amount for an operation of this method-unit pair.

Example `MeltMethodSetting`:

```json
{
"method": "bolt11",
"unit": "sat",
"min_amount": 100,
"max_amount": 10000
}
```

[00]: 00.md
[01]: 01.md
Expand Down
15 changes: 13 additions & 2 deletions 06.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,24 @@ With the mint's response being of the form `GetInfoResponse`:
"nuts": {
"4": {
"methods": [
["bolt11", "sat"]
{
"method": "bolt11",
"unit": "sat",
"min_amount": 0,
"max_amount": 10000
}
],
"disabled": false
},
"5": {
"methods": [
["bolt11", "sat"]
{
"method": "bolt11",
"unit": "sat",
"min_amount": 100,
"max_amount": 10000
},
"disabled": false
]
},
"7": {"supported": true},
Expand Down