Skip to content

Commit 0671060

Browse files
authored
Merge pull request #6641 from priyanshiiit/invoice_params
lnrpc: improves invoice documentation
2 parents 593962b + 1e0a271 commit 0671060

File tree

4 files changed

+76
-36
lines changed

4 files changed

+76
-36
lines changed

lnrpc/invoicesrpc/invoices.swagger.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@
452452
"r_hash": {
453453
"type": "string",
454454
"format": "byte",
455-
"description": "The hash of the preimage. When using REST, this field must be encoded as\nbase64."
455+
"description": "The hash of the preimage. When using REST, this field must be encoded as\nbase64.\nNote: Output only, don't specify for creating an invoice."
456456
},
457457
"value": {
458458
"type": "string",
@@ -473,16 +473,16 @@
473473
"creation_date": {
474474
"type": "string",
475475
"format": "int64",
476-
"title": "When this invoice was created"
476+
"description": "When this invoice was created.\nNote: Output only, don't specify for creating an invoice."
477477
},
478478
"settle_date": {
479479
"type": "string",
480480
"format": "int64",
481-
"title": "When this invoice was settled"
481+
"description": "When this invoice was settled.\nNote: Output only, don't specify for creating an invoice."
482482
},
483483
"payment_request": {
484484
"type": "string",
485-
"description": "A bare-bones invoice for a payment within the Lightning Network. With the\ndetails of the invoice, the sender has all the data necessary to send a\npayment to the recipient."
485+
"description": "A bare-bones invoice for a payment within the Lightning Network. With the\ndetails of the invoice, the sender has all the data necessary to send a\npayment to the recipient.\nNote: Output only, don't specify for creating an invoice."
486486
},
487487
"description_hash": {
488488
"type": "string",
@@ -517,12 +517,12 @@
517517
"add_index": {
518518
"type": "string",
519519
"format": "uint64",
520-
"description": "The \"add\" index of this invoice. Each newly created invoice will increment\nthis index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all added\ninvoices with an add_index greater than this one."
520+
"description": "The \"add\" index of this invoice. Each newly created invoice will increment\nthis index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all added\ninvoices with an add_index greater than this one.\nNote: Output only, don't specify for creating an invoice."
521521
},
522522
"settle_index": {
523523
"type": "string",
524524
"format": "uint64",
525-
"description": "The \"settle\" index of this invoice. Each newly settled invoice will\nincrement this index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all\nsettled invoices with an settle_index greater than this one."
525+
"description": "The \"settle\" index of this invoice. Each newly settled invoice will\nincrement this index making it monotonically increasing. Callers to the\nSubscribeInvoices call can use this to instantly get notified of all\nsettled invoices with an settle_index greater than this one.\nNote: Output only, don't specify for creating an invoice."
526526
},
527527
"amt_paid": {
528528
"type": "string",
@@ -532,39 +532,39 @@
532532
"amt_paid_sat": {
533533
"type": "string",
534534
"format": "int64",
535-
"description": "The amount that was accepted for this invoice, in satoshis. This will ONLY\nbe set if this invoice has been settled. We provide this field as if the\ninvoice was created with a zero value, then we need to record what amount\nwas ultimately accepted. Additionally, it's possible that the sender paid\nMORE that was specified in the original invoice. So we'll record that here\nas well."
535+
"description": "The amount that was accepted for this invoice, in satoshis. This will ONLY\nbe set if this invoice has been settled. We provide this field as if the\ninvoice was created with a zero value, then we need to record what amount\nwas ultimately accepted. Additionally, it's possible that the sender paid\nMORE that was specified in the original invoice. So we'll record that here\nas well.\nNote: Output only, don't specify for creating an invoice."
536536
},
537537
"amt_paid_msat": {
538538
"type": "string",
539539
"format": "int64",
540-
"description": "The amount that was accepted for this invoice, in millisatoshis. This will\nONLY be set if this invoice has been settled. We provide this field as if\nthe invoice was created with a zero value, then we need to record what\namount was ultimately accepted. Additionally, it's possible that the sender\npaid MORE that was specified in the original invoice. So we'll record that\nhere as well."
540+
"description": "The amount that was accepted for this invoice, in millisatoshis. This will\nONLY be set if this invoice has been settled. We provide this field as if\nthe invoice was created with a zero value, then we need to record what\namount was ultimately accepted. Additionally, it's possible that the sender\npaid MORE that was specified in the original invoice. So we'll record that\nhere as well.\nNote: Output only, don't specify for creating an invoice."
541541
},
542542
"state": {
543543
"$ref": "#/definitions/InvoiceInvoiceState",
544-
"description": "The state the invoice is in."
544+
"description": "The state the invoice is in.\nNote: Output only, don't specify for creating an invoice."
545545
},
546546
"htlcs": {
547547
"type": "array",
548548
"items": {
549549
"$ref": "#/definitions/lnrpcInvoiceHTLC"
550550
},
551-
"description": "List of HTLCs paying to this invoice [EXPERIMENTAL]."
551+
"description": "List of HTLCs paying to this invoice [EXPERIMENTAL].\nNote: Output only, don't specify for creating an invoice."
552552
},
553553
"features": {
554554
"type": "object",
555555
"additionalProperties": {
556556
"$ref": "#/definitions/lnrpcFeature"
557557
},
558-
"description": "List of features advertised on the invoice."
558+
"description": "List of features advertised on the invoice.\nNote: Output only, don't specify for creating an invoice."
559559
},
560560
"is_keysend": {
561561
"type": "boolean",
562-
"description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL]."
562+
"description": "Indicates if this invoice was a spontaneous payment that arrived via keysend\n[EXPERIMENTAL].\nNote: Output only, don't specify for creating an invoice."
563563
},
564564
"payment_addr": {
565565
"type": "string",
566566
"format": "byte",
567-
"description": "The payment address of this invoice. This value will be used in MPP\npayments, and also for newer invoices that always require the MPP payload\nfor added end-to-end security."
567+
"description": "The payment address of this invoice. This value will be used in MPP\npayments, and also for newer invoices that always require the MPP payload\nfor added end-to-end security.\nNote: Output only, don't specify for creating an invoice."
568568
},
569569
"is_amp": {
570570
"type": "boolean",
@@ -575,7 +575,7 @@
575575
"additionalProperties": {
576576
"$ref": "#/definitions/lnrpcAMPInvoiceState"
577577
},
578-
"description": "Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the\ngiven set ID. This field is always populated for AMP invoices, and can be\nused along side LookupInvoice to obtain the HTLC information related to a\ngiven sub-invoice.",
578+
"description": "Maps a 32-byte hex-encoded set ID to the sub-invoice AMP state for the\ngiven set ID. This field is always populated for AMP invoices, and can be\nused along side LookupInvoice to obtain the HTLC information related to a\ngiven sub-invoice.\nNote: Output only, don't specify for creating an invoice.",
579579
"title": "[EXPERIMENTAL]:"
580580
}
581581
}

lnrpc/lightning.pb.go

Lines changed: 22 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lnrpc/lightning.proto

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3171,6 +3171,7 @@ message Invoice {
31713171
/*
31723172
The hash of the preimage. When using REST, this field must be encoded as
31733173
base64.
3174+
Note: Output only, don't specify for creating an invoice.
31743175
*/
31753176
bytes r_hash = 4;
31763177

@@ -3191,16 +3192,23 @@ message Invoice {
31913192
// Whether this invoice has been fulfilled
31923193
bool settled = 6 [deprecated = true];
31933194

3194-
// When this invoice was created
3195+
/*
3196+
When this invoice was created.
3197+
Note: Output only, don't specify for creating an invoice.
3198+
*/
31953199
int64 creation_date = 7;
31963200

3197-
// When this invoice was settled
3201+
/*
3202+
When this invoice was settled.
3203+
Note: Output only, don't specify for creating an invoice.
3204+
*/
31983205
int64 settle_date = 8;
31993206

32003207
/*
32013208
A bare-bones invoice for a payment within the Lightning Network. With the
32023209
details of the invoice, the sender has all the data necessary to send a
32033210
payment to the recipient.
3211+
Note: Output only, don't specify for creating an invoice.
32043212
*/
32053213
string payment_request = 9;
32063214

@@ -3235,6 +3243,7 @@ message Invoice {
32353243
this index making it monotonically increasing. Callers to the
32363244
SubscribeInvoices call can use this to instantly get notified of all added
32373245
invoices with an add_index greater than this one.
3246+
Note: Output only, don't specify for creating an invoice.
32383247
*/
32393248
uint64 add_index = 16;
32403249

@@ -3243,6 +3252,7 @@ message Invoice {
32433252
increment this index making it monotonically increasing. Callers to the
32443253
SubscribeInvoices call can use this to instantly get notified of all
32453254
settled invoices with an settle_index greater than this one.
3255+
Note: Output only, don't specify for creating an invoice.
32463256
*/
32473257
uint64 settle_index = 17;
32483258

@@ -3256,6 +3266,7 @@ message Invoice {
32563266
was ultimately accepted. Additionally, it's possible that the sender paid
32573267
MORE that was specified in the original invoice. So we'll record that here
32583268
as well.
3269+
Note: Output only, don't specify for creating an invoice.
32593270
*/
32603271
int64 amt_paid_sat = 19;
32613272

@@ -3266,6 +3277,7 @@ message Invoice {
32663277
amount was ultimately accepted. Additionally, it's possible that the sender
32673278
paid MORE that was specified in the original invoice. So we'll record that
32683279
here as well.
3280+
Note: Output only, don't specify for creating an invoice.
32693281
*/
32703282
int64 amt_paid_msat = 20;
32713283

@@ -3278,25 +3290,34 @@ message Invoice {
32783290

32793291
/*
32803292
The state the invoice is in.
3293+
Note: Output only, don't specify for creating an invoice.
32813294
*/
32823295
InvoiceState state = 21;
32833296

3284-
// List of HTLCs paying to this invoice [EXPERIMENTAL].
3297+
/*
3298+
List of HTLCs paying to this invoice [EXPERIMENTAL].
3299+
Note: Output only, don't specify for creating an invoice.
3300+
*/
32853301
repeated InvoiceHTLC htlcs = 22;
32863302

3287-
// List of features advertised on the invoice.
3303+
/*
3304+
List of features advertised on the invoice.
3305+
Note: Output only, don't specify for creating an invoice.
3306+
*/
32883307
map<uint32, Feature> features = 24;
32893308

32903309
/*
32913310
Indicates if this invoice was a spontaneous payment that arrived via keysend
32923311
[EXPERIMENTAL].
3312+
Note: Output only, don't specify for creating an invoice.
32933313
*/
32943314
bool is_keysend = 25;
32953315

32963316
/*
32973317
The payment address of this invoice. This value will be used in MPP
32983318
payments, and also for newer invoices that always require the MPP payload
32993319
for added end-to-end security.
3320+
Note: Output only, don't specify for creating an invoice.
33003321
*/
33013322
bytes payment_addr = 26;
33023323

@@ -3312,6 +3333,7 @@ message Invoice {
33123333
given set ID. This field is always populated for AMP invoices, and can be
33133334
used along side LookupInvoice to obtain the HTLC information related to a
33143335
given sub-invoice.
3336+
Note: Output only, don't specify for creating an invoice.
33153337
*/
33163338
map<string, AMPInvoiceState> amp_invoice_state = 28;
33173339
}

0 commit comments

Comments
 (0)