Merge pull request #6559 from ErikEk/doc-subscribe-invoice-rest

doc: subscribe/cancel/lookup invoices rest
This commit is contained in:
Oliver Gugger 2022-06-27 12:12:13 +02:00 committed by GitHub
commit a00964febb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 6 deletions

View File

@ -5,5 +5,11 @@
* [Add `payment_addr` flag to `buildroute`](https://github.com/lightningnetwork/lnd/pull/6576)
so that the mpp record of the route can be set correctly.
## Documentation
* [Add minor comment](https://github.com/lightningnetwork/lnd/pull/6559) on
subscribe/cancel/lookup invoice parameter encoding.
# Contributors (Alphabetical Order)
* Elle Mouton
* ErikEk

View File

@ -84,7 +84,8 @@ type CancelInvoiceMsg struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Hash corresponding to the (hold) invoice to cancel.
// Hash corresponding to the (hold) invoice to cancel. When using
// REST, this field must be encoded as base64.
PaymentHash []byte `protobuf:"bytes,1,opt,name=payment_hash,json=paymentHash,proto3" json:"payment_hash,omitempty"`
}
@ -477,7 +478,8 @@ type SubscribeSingleInvoiceRequest struct {
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
// Hash corresponding to the (hold) invoice to subscribe to.
// Hash corresponding to the (hold) invoice to subscribe to. When using
// REST, this field must be encoded as base64url.
RHash []byte `protobuf:"bytes,2,opt,name=r_hash,json=rHash,proto3" json:"r_hash,omitempty"`
}
@ -605,6 +607,7 @@ type isLookupInvoiceMsg_InvoiceRef interface {
}
type LookupInvoiceMsg_PaymentHash struct {
// When using REST, this field must be encoded as base64.
PaymentHash []byte `protobuf:"bytes,1,opt,name=payment_hash,json=paymentHash,proto3,oneof"`
}

View File

@ -44,7 +44,8 @@ service Invoices {
}
message CancelInvoiceMsg {
// Hash corresponding to the (hold) invoice to cancel.
// Hash corresponding to the (hold) invoice to cancel. When using
// REST, this field must be encoded as base64.
bytes payment_hash = 1;
}
message CancelInvoiceResp {
@ -138,7 +139,8 @@ message SettleInvoiceResp {
message SubscribeSingleInvoiceRequest {
reserved 1;
// Hash corresponding to the (hold) invoice to subscribe to.
// Hash corresponding to the (hold) invoice to subscribe to. When using
// REST, this field must be encoded as base64url.
bytes r_hash = 2;
}
@ -163,6 +165,7 @@ enum LookupModifier {
message LookupInvoiceMsg {
oneof invoice_ref {
// When using REST, this field must be encoded as base64.
bytes payment_hash = 1;
bytes payment_addr = 2;
bytes set_id = 3;

View File

@ -103,6 +103,7 @@
"parameters": [
{
"name": "payment_hash",
"description": "When using REST, this field must be encoded as base64.",
"in": "query",
"required": false,
"type": "string",
@ -204,7 +205,7 @@
"parameters": [
{
"name": "r_hash",
"description": "Hash corresponding to the (hold) invoice to subscribe to.",
"description": "Hash corresponding to the (hold) invoice to subscribe to. When using\nREST, this field must be encoded as base64url.",
"in": "path",
"required": true,
"type": "string",
@ -309,7 +310,7 @@
"payment_hash": {
"type": "string",
"format": "byte",
"description": "Hash corresponding to the (hold) invoice to cancel."
"description": "Hash corresponding to the (hold) invoice to cancel. When using\nREST, this field must be encoded as base64."
}
}
},