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

[NWC] Add get_budget command for per-connection budget limits. #1504

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions 47.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,33 @@ Response:
}
```

### `get_budget`

Budgets can be used to limit the amount of funds that can be spent by a connection in a given time period.
Budgets are optional and can be set by the user if their wallet supports it. Support for this command indicates
that the wallet supports user-configured budgets. The budget will be reset at the `renews_at` timestamp.

Request:
```jsonc
{
"method": "get_budget",
"params": {
}
}
```

Response:
```jsonc
{
"result_type": "get_budget",
"result": {
"remaining_budget_msats": 10000,
jklein24 marked this conversation as resolved.
Show resolved Hide resolved
"total_budget_msats": 100000,
jklein24 marked this conversation as resolved.
Show resolved Hide resolved
"renews_at": 1693876973, // timestamp in seconds since epoch
jklein24 marked this conversation as resolved.
Show resolved Hide resolved
jklein24 marked this conversation as resolved.
Show resolved Hide resolved
}
}
```

### `get_info`

Request:
Expand Down