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

@@ -1023,7 +1023,7 @@ class LightningRpc(UnixDomainSocketRpc):
"""
return self.call("listtransactions")
def listinvoices(self, label=None, payment_hash=None, invstring=None, offer_id=None):
def listinvoices(self, label=None, payment_hash=None, invstring=None, offer_id=None, index=None, start=None):
"""Query invoices
Show invoice matching {label}, {payment_hash}, {invstring} or {offer_id}
@@ -1035,6 +1035,8 @@ class LightningRpc(UnixDomainSocketRpc):
"payment_hash": payment_hash,
"invstring": invstring,
"offer_id": offer_id,
"index": index,
"start": start,
}
return self.call("listinvoices", payload)