@@ -464,7 +464,14 @@ service Lightning {
464464
465465 /**
466466 SubscribeInvoices returns a uni-directional stream (sever -> client) for
467- notifying the client of newly added/settled invoices.
467+ notifying the client of newly added/settled invoices. The caller can
468+ optionally specify the add_index and/or the settle_index. If the add_index
469+ is specified, then we'll first start by sending add invoice events for all
470+ invoices with an add_index greater than the specified value. If the
471+ settle_index is specified, the next, we'll send out all settle events for
472+ invoices with a settle_index greater than the specified value. One or both
473+ of these fields can be set. If no fields are set, then we'll only send out
474+ the latest add/settle events.
468475 */
469476 rpc SubscribeInvoices (InvoiceSubscription ) returns (stream Invoice ) {
470477 option (google.api.http ) = {
@@ -1435,6 +1442,7 @@ message RoutingPolicy {
14351442 int64 min_htlc = 2 [json_name = "min_htlc" ];
14361443 int64 fee_base_msat = 3 [json_name = "fee_base_msat" ];
14371444 int64 fee_rate_milli_msat = 4 [json_name = "fee_rate_milli_msat" ];
1445+ bool disabled = 5 [json_name = "disabled" ];
14381446}
14391447
14401448/**
@@ -1642,6 +1650,32 @@ message Invoice {
16421650
16431651 /// Whether this invoice should include routing hints for private channels.
16441652 bool private = 15 [json_name = "private" ];
1653+
1654+ /**
1655+ The "add" index of this invoice. Each newly created invoice will increment
1656+ this index making it monotonically increasing. Callers to the
1657+ SubscribeInvoices call can use this to instantly get notified of all added
1658+ invoices with an add_index greater than this one.
1659+ */
1660+ uint64 add_index = 16 [json_name = "add_index" ];
1661+
1662+ /**
1663+ The "settle" index of this invoice. Each newly settled invoice will
1664+ increment this index making it monotonically increasing. Callers to the
1665+ SubscribeInvoices call can use this to instantly get notified of all
1666+ settled invoices with an settle_index greater than this one.
1667+ */
1668+ uint64 settle_index = 17 [json_name = "settle_index" ];
1669+
1670+ /**
1671+ The amount that was accepted for this invoice. This will ONLY be set if
1672+ this invoice has been settled. We provide this field as if the invoice was
1673+ created with a zero value, then we need to record what amount was
1674+ ultimately accepted. Additionally, it's possible that the sender paid MORE
1675+ that was specified in the original invoice. So we'll record that here as
1676+ well.
1677+ */
1678+ int64 amt_paid = 18 [json_name = "amt_paid" ];
16451679}
16461680message AddInvoiceResponse {
16471681 bytes r_hash = 1 [json_name = "r_hash" ];
@@ -1652,6 +1686,14 @@ message AddInvoiceResponse {
16521686 payment to the recipient.
16531687 */
16541688 string payment_request = 2 [json_name = "payment_request" ];
1689+
1690+ /**
1691+ The "add" index of this invoice. Each newly created invoice will increment
1692+ this index making it monotonically increasing. Callers to the
1693+ SubscribeInvoices call can use this to instantly get notified of all added
1694+ invoices with an add_index greater than this one.
1695+ */
1696+ uint64 add_index = 16 [json_name = "add_index" ];
16551697}
16561698message PaymentHash {
16571699 /**
@@ -1672,6 +1714,21 @@ message ListInvoiceResponse {
16721714}
16731715
16741716message InvoiceSubscription {
1717+ /**
1718+ If specified (non-zero), then we'll first start by sending out
1719+ notifications for all added indexes with an add_index greater than this
1720+ value. This allows callers to catch up on any events they missed while they
1721+ weren't connected to the streaming RPC.
1722+ */
1723+ uint64 add_index = 1 [json_name = "add_index" ];
1724+
1725+ /**
1726+ If specified (non-zero), then we'll first start by sending out
1727+ notifications for all settled indexes with an settle_index greater than
1728+ this value. This allows callers to catch up on any events they missed while
1729+ they weren't connected to the streaming RPC.
1730+ */
1731+ uint64 settle_index = 2 [json_name = "settle_index" ];
16751732}
16761733
16771734
@@ -1825,4 +1882,4 @@ message ForwardingHistoryResponse {
18251882
18261883 /// The index of the last time in the set of returned forwarding events. Can be used to seek further, pagination style.
18271884 uint32 last_offset_index = 2 [json_name = "last_offset_index" ];
1828- }
1885+ }
0 commit comments