listinvoices: add index and start params.

Now we have defined ordering, we can add a start param.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Changelog-Added: JSON-RPC: `listinvoices` has `index` and `start` parameters for listing control.
This commit is contained in:
Rusty Russell
2023-07-22 17:21:47 +09:30
parent bbf4f312a4
commit 16c133746b
15 changed files with 426 additions and 275 deletions

View File

@@ -4,7 +4,7 @@ lightning-listinvoices -- Command for querying invoice status
SYNOPSIS
--------
**listinvoices** [*label*] [*invstring*] [*payment\_hash*] [*offer\_id*]
**listinvoices** [*label*] [*invstring*] [*payment\_hash*] [*offer\_id*] [*index* [*start*]]
DESCRIPTION
-----------
@@ -17,6 +17,10 @@ provided when creating the invoice, the `invstring` string representing
the invoice, the `payment_hash` of the invoice, or the local `offer_id`
this invoice was issued for. Only one of the query parameters can be used at once.
`index` controls ordering, by `created` (default) or `updated`. If
`index` is specified, `start` may be specified to start from that
value, which is generally returned from lightning-wait(7).
RETURN VALUE
------------

View File

@@ -27,6 +27,20 @@
"offer_id": {
"type": "string",
"description": ""
},
"index": {
"type": "string",
"added": "v23.08",
"enum": [
"created",
"updated"
],
"description": ""
},
"start": {
"type": "u64",
"added": "v23.08",
"description": ""
}
}
}