mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-03-04 09:48:19 +01:00
lnrpc: expose PaymentStatus for ListPayments
Also make it optional to list non-succeeded payments.
This commit is contained in:
parent
89f6db11e6
commit
6794708ed5
4 changed files with 589 additions and 489 deletions
1034
lnrpc/rpc.pb.go
1034
lnrpc/rpc.pb.go
File diff suppressed because it is too large
Load diff
|
@ -558,10 +558,18 @@ func request_Lightning_DecodePayReq_0(ctx context.Context, marshaler runtime.Mar
|
|||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_Lightning_ListPayments_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
|
||||
)
|
||||
|
||||
func request_Lightning_ListPayments_0(ctx context.Context, marshaler runtime.Marshaler, client LightningClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListPaymentsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_Lightning_ListPayments_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListPayments(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
|
|
|
@ -2158,9 +2158,21 @@ message Payment {
|
|||
|
||||
/// The optional payment request being fulfilled.
|
||||
string payment_request = 9 [json_name = "payment_request"];
|
||||
|
||||
enum PaymentStatus {
|
||||
UNKNOWN = 0;
|
||||
IN_FLIGHT = 1;
|
||||
SUCCEEDED = 2;
|
||||
FAILED = 3;
|
||||
}
|
||||
|
||||
// The status of the payment.
|
||||
PaymentStatus status = 10 [json_name = "status"];
|
||||
}
|
||||
|
||||
message ListPaymentsRequest {
|
||||
/// Set to also return payments that are not (yet) succeeded.
|
||||
bool non_succeeded = 1;
|
||||
}
|
||||
|
||||
message ListPaymentsResponse {
|
||||
|
|
|
@ -938,6 +938,16 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"parameters": [
|
||||
{
|
||||
"name": "non_succeeded",
|
||||
"description": "/ Set to also return payments that are not (yet) succeeded.",
|
||||
"in": "query",
|
||||
"required": false,
|
||||
"type": "boolean",
|
||||
"format": "boolean"
|
||||
}
|
||||
],
|
||||
"tags": [
|
||||
"Lightning"
|
||||
]
|
||||
|
@ -1297,6 +1307,16 @@
|
|||
],
|
||||
"default": "OPEN"
|
||||
},
|
||||
"PaymentPaymentStatus": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"UNKNOWN",
|
||||
"IN_FLIGHT",
|
||||
"SUCCEEDED",
|
||||
"FAILED"
|
||||
],
|
||||
"default": "UNKNOWN"
|
||||
},
|
||||
"PeerSyncType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
|
@ -2835,6 +2855,10 @@
|
|||
"payment_request": {
|
||||
"type": "string",
|
||||
"description": "/ The optional payment request being fulfilled."
|
||||
},
|
||||
"status": {
|
||||
"$ref": "#/definitions/PaymentPaymentStatus",
|
||||
"description": "The status of the payment."
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue