2018-10-23 07:43:47 +03:00
|
|
|
syntax = "proto3";
|
|
|
|
|
2019-03-14 18:31:39 +03:00
|
|
|
import "rpc.proto";
|
|
|
|
|
2018-10-23 07:43:47 +03:00
|
|
|
package routerrpc;
|
|
|
|
|
2019-03-14 18:31:39 +03:00
|
|
|
option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc";
|
|
|
|
|
2020-05-06 17:41:47 +03:00
|
|
|
// Router is a service that offers advanced interaction with the router
|
|
|
|
// subsystem of the daemon.
|
|
|
|
service Router {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
SendPaymentV2 attempts to route a payment described by the passed
|
|
|
|
PaymentRequest to the final destination. The call returns a stream of
|
|
|
|
payment updates.
|
|
|
|
*/
|
|
|
|
rpc SendPaymentV2 (SendPaymentRequest) returns (stream lnrpc.Payment);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
TrackPaymentV2 returns an update stream for the payment identified by the
|
|
|
|
payment hash.
|
|
|
|
*/
|
|
|
|
rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
|
|
|
|
may cost to send an HTLC to the target end destination.
|
|
|
|
*/
|
|
|
|
rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-03 11:59:44 +03:00
|
|
|
Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via
|
|
|
|
the specified route. This method differs from SendPayment in that it
|
|
|
|
allows users to specify a full route manually. This can be used for
|
|
|
|
things like rebalancing, and atomic swaps. It differs from the newer
|
|
|
|
SendToRouteV2 in that it doesn't return the full HTLC information.
|
|
|
|
*/
|
|
|
|
rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse) {
|
|
|
|
option deprecated = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
2020-06-03 18:36:08 +03:00
|
|
|
SendToRouteV2 attempts to make a payment via the specified route. This
|
|
|
|
method differs from SendPayment in that it allows users to specify a full
|
|
|
|
route manually. This can be used for things like rebalancing, and atomic
|
|
|
|
swaps.
|
2020-05-06 17:41:47 +03:00
|
|
|
*/
|
2020-04-03 11:59:44 +03:00
|
|
|
rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt);
|
2020-05-06 17:41:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
ResetMissionControl clears all mission control state and starts with a clean
|
|
|
|
slate.
|
|
|
|
*/
|
|
|
|
rpc ResetMissionControl (ResetMissionControlRequest)
|
|
|
|
returns (ResetMissionControlResponse);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
QueryMissionControl exposes the internal mission control state to callers.
|
|
|
|
It is a development feature.
|
|
|
|
*/
|
|
|
|
rpc QueryMissionControl (QueryMissionControlRequest)
|
|
|
|
returns (QueryMissionControlResponse);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
QueryProbability returns the current success probability estimate for a
|
|
|
|
given node pair and amount.
|
|
|
|
*/
|
|
|
|
rpc QueryProbability (QueryProbabilityRequest)
|
|
|
|
returns (QueryProbabilityResponse);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
BuildRoute builds a fully specified route based on a list of hop public
|
|
|
|
keys. It retrieves the relevant channel policies from the graph in order to
|
|
|
|
calculate the correct fees and time locks.
|
|
|
|
*/
|
|
|
|
rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
SubscribeHtlcEvents creates a uni-directional stream from the server to
|
|
|
|
the client which delivers a stream of htlc events.
|
|
|
|
*/
|
|
|
|
rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest)
|
|
|
|
returns (stream HtlcEvent);
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-06-03 18:36:08 +03:00
|
|
|
Deprecated, use SendPaymentV2. SendPayment attempts to route a payment
|
2020-05-06 17:41:47 +03:00
|
|
|
described by the passed PaymentRequest to the final destination. The call
|
|
|
|
returns a stream of payment status updates.
|
|
|
|
*/
|
|
|
|
rpc SendPayment (SendPaymentRequest) returns (stream PaymentStatus) {
|
|
|
|
option deprecated = true;
|
|
|
|
}
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-06 17:41:47 +03:00
|
|
|
Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for
|
|
|
|
the payment identified by the payment hash.
|
|
|
|
*/
|
|
|
|
rpc TrackPayment (TrackPaymentRequest) returns (stream PaymentStatus) {
|
|
|
|
option deprecated = true;
|
|
|
|
}
|
2020-05-19 12:57:36 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
HtlcInterceptor dispatches a bi-directional streaming RPC in which
|
|
|
|
Forwarded HTLC requests are sent to the client and the client responds with
|
|
|
|
a boolean that tells LND if this htlc should be intercepted.
|
|
|
|
In case of interception, the htlc can be either settled, cancelled or
|
|
|
|
resumed later by using the ResolveHoldForward endpoint.
|
|
|
|
*/
|
|
|
|
rpc HtlcInterceptor (stream ForwardHtlcInterceptResponse) returns (stream ForwardHtlcInterceptRequest);
|
2020-05-06 17:41:47 +03:00
|
|
|
}
|
|
|
|
|
2019-03-22 12:21:25 +03:00
|
|
|
message SendPaymentRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The identity pubkey of the payment recipient
|
2019-04-18 10:34:28 +03:00
|
|
|
bytes dest = 1;
|
2018-10-23 07:43:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-11-11 18:44:08 +03:00
|
|
|
Number of satoshis to send.
|
|
|
|
|
|
|
|
The fields amt and amt_msat are mutually exclusive.
|
|
|
|
*/
|
2019-04-18 10:34:28 +03:00
|
|
|
int64 amt = 2;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-11-11 18:44:08 +03:00
|
|
|
Number of millisatoshis to send.
|
2020-03-02 17:35:25 +03:00
|
|
|
|
2019-11-11 18:44:08 +03:00
|
|
|
The fields amt and amt_msat are mutually exclusive.
|
|
|
|
*/
|
|
|
|
int64 amt_msat = 12;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The hash to use within the payment's HTLC
|
2019-04-18 10:34:28 +03:00
|
|
|
bytes payment_hash = 3;
|
2020-02-11 15:58:45 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-04-18 10:34:28 +03:00
|
|
|
The CLTV delta from the current height that should be used to set the
|
|
|
|
timelock for the final hop.
|
2018-10-23 07:43:47 +03:00
|
|
|
*/
|
2019-04-18 10:34:28 +03:00
|
|
|
int32 final_cltv_delta = 4;
|
2018-10-23 07:43:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-04-18 10:34:28 +03:00
|
|
|
A bare-bones invoice for a payment within the Lightning Network. With the
|
|
|
|
details of the invoice, the sender has all the data necessary to send a
|
|
|
|
payment to the recipient. The amount in the payment request may be zero. In
|
|
|
|
that case it is required to set the amt field as well. If no payment request
|
|
|
|
is specified, the following fields are required: dest, amt and payment_hash.
|
2018-10-23 07:43:47 +03:00
|
|
|
*/
|
2019-04-18 10:34:28 +03:00
|
|
|
string payment_request = 5;
|
2018-10-23 07:43:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-10-23 07:43:47 +03:00
|
|
|
An upper limit on the amount of time we should spend when attempting to
|
|
|
|
fulfill the payment. This is expressed in seconds. If we cannot make a
|
|
|
|
successful payment within this time frame, an error will be returned.
|
2019-04-18 10:34:28 +03:00
|
|
|
This field must be non-zero.
|
|
|
|
*/
|
|
|
|
int32 timeout_seconds = 6;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-04-18 10:34:28 +03:00
|
|
|
The maximum number of satoshis that will be paid as a fee of the payment.
|
|
|
|
If this field is left to the default value of 0, only zero-fee routes will
|
|
|
|
be considered. This usually means single hop routes connecting directly to
|
|
|
|
the destination. To send the payment without a fee limit, use max int here.
|
2019-11-11 18:44:08 +03:00
|
|
|
|
|
|
|
The fields fee_limit_sat and fee_limit_msat are mutually exclusive.
|
2018-10-23 07:43:47 +03:00
|
|
|
*/
|
2019-04-18 10:34:28 +03:00
|
|
|
int64 fee_limit_sat = 7;
|
2018-10-23 07:43:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-02 17:35:25 +03:00
|
|
|
The maximum number of millisatoshis that will be paid as a fee of the
|
|
|
|
payment. If this field is left to the default value of 0, only zero-fee
|
|
|
|
routes will be considered. This usually means single hop routes connecting
|
|
|
|
directly to the destination. To send the payment without a fee limit, use
|
|
|
|
max int here.
|
|
|
|
|
|
|
|
The fields fee_limit_sat and fee_limit_msat are mutually exclusive.
|
|
|
|
*/
|
2019-11-11 18:44:08 +03:00
|
|
|
int64 fee_limit_msat = 13;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-05-07 12:48:39 +03:00
|
|
|
Deprecated, use outgoing_chan_ids. The channel id of the channel that must
|
|
|
|
be taken to the first hop. If zero, any channel may be used (unless
|
|
|
|
outgoing_chan_ids are set).
|
|
|
|
*/
|
|
|
|
uint64 outgoing_chan_id = 8 [jstype = JS_STRING, deprecated = true];
|
|
|
|
|
|
|
|
/*
|
|
|
|
The channel ids of the channels are allowed for the first hop. If empty,
|
2018-10-23 07:43:47 +03:00
|
|
|
any channel may be used.
|
|
|
|
*/
|
2020-05-07 12:48:39 +03:00
|
|
|
repeated uint64 outgoing_chan_ids = 19;
|
2019-04-18 10:34:28 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-11-18 14:08:42 +03:00
|
|
|
The pubkey of the last hop of the route. If empty, any hop may be used.
|
|
|
|
*/
|
|
|
|
bytes last_hop_pubkey = 14;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-10-11 22:46:10 +03:00
|
|
|
An optional maximum total time lock for the route. This should not exceed
|
|
|
|
lnd's `--max-cltv-expiry` setting. If zero, then the value of
|
|
|
|
`--max-cltv-expiry` is enforced.
|
2019-04-18 10:34:28 +03:00
|
|
|
*/
|
|
|
|
int32 cltv_limit = 9;
|
2019-06-18 11:36:29 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-06-18 11:36:29 +03:00
|
|
|
Optional route hints to reach the destination through private channels.
|
|
|
|
*/
|
2020-02-11 15:58:45 +03:00
|
|
|
repeated lnrpc.RouteHint route_hints = 10;
|
2019-07-31 07:44:02 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-07-31 07:44:02 +03:00
|
|
|
An optional field that can be used to pass an arbitrary set of TLV records
|
|
|
|
to a peer which understands the new records. This can be used to pass
|
2019-11-20 14:00:25 +03:00
|
|
|
application specific data during the payment attempt. Record types are
|
|
|
|
required to be in the custom range >= 65536. When using REST, the values
|
|
|
|
must be encoded as base64.
|
2019-07-31 07:44:02 +03:00
|
|
|
*/
|
2019-11-20 14:00:25 +03:00
|
|
|
map<uint64, bytes> dest_custom_records = 11;
|
2019-11-25 16:13:21 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// If set, circular payments to self are permitted.
|
2019-11-25 16:13:21 +03:00
|
|
|
bool allow_self_payment = 15;
|
2019-12-19 10:57:23 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-12-19 10:57:23 +03:00
|
|
|
Features assumed to be supported by the final node. All transitive feature
|
2020-01-18 00:12:02 +03:00
|
|
|
dependencies must also be set properly. For a given feature bit pair, either
|
2019-12-20 03:25:59 +03:00
|
|
|
optional or remote may be set, but not both. If this field is nil or empty,
|
|
|
|
the router will try to load destination features from the graph as a
|
|
|
|
fallback.
|
2019-12-19 10:57:23 +03:00
|
|
|
*/
|
|
|
|
repeated lnrpc.FeatureBit dest_features = 16;
|
2020-01-28 18:07:34 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-01-28 18:07:34 +03:00
|
|
|
The maximum number of partial payments that may be use to complete the full
|
|
|
|
amount.
|
|
|
|
*/
|
2020-04-22 10:19:11 +03:00
|
|
|
uint32 max_parts = 17;
|
2020-04-20 09:06:35 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-20 09:06:35 +03:00
|
|
|
If set, only the final payment update is streamed back. Intermediate updates
|
|
|
|
that show which htlcs are still in flight are suppressed.
|
|
|
|
*/
|
|
|
|
bool no_inflight_updates = 18;
|
2018-10-23 07:43:47 +03:00
|
|
|
}
|
|
|
|
|
2019-03-22 12:21:25 +03:00
|
|
|
message TrackPaymentRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The hash of the payment to look up.
|
2019-03-22 12:21:25 +03:00
|
|
|
bytes payment_hash = 1;
|
2020-04-20 09:06:35 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-20 09:06:35 +03:00
|
|
|
If set, only the final payment update is streamed back. Intermediate updates
|
|
|
|
that show which htlcs are still in flight are suppressed.
|
|
|
|
*/
|
|
|
|
bool no_inflight_updates = 2;
|
2019-03-22 12:21:25 +03:00
|
|
|
}
|
|
|
|
|
2018-10-23 07:43:47 +03:00
|
|
|
message RouteFeeRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-10-23 07:43:47 +03:00
|
|
|
The destination once wishes to obtain a routing fee quote to.
|
|
|
|
*/
|
|
|
|
bytes dest = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-10-23 07:43:47 +03:00
|
|
|
The amount one wishes to send to the target destination.
|
|
|
|
*/
|
|
|
|
int64 amt_sat = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message RouteFeeResponse {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-10-23 07:43:47 +03:00
|
|
|
A lower bound of the estimated fee to the target destination within the
|
|
|
|
network, expressed in milli-satoshis.
|
|
|
|
*/
|
|
|
|
int64 routing_fee_msat = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2018-10-23 07:43:47 +03:00
|
|
|
An estimate of the worst case time delay that can occur. Note that callers
|
|
|
|
will still need to factor in the final CLTV delta of the last hop into this
|
|
|
|
value.
|
|
|
|
*/
|
|
|
|
int64 time_lock_delay = 2;
|
|
|
|
}
|
|
|
|
|
2019-03-14 18:31:39 +03:00
|
|
|
message SendToRouteRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The payment hash to use for the HTLC.
|
2019-03-14 18:31:39 +03:00
|
|
|
bytes payment_hash = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// Route that should be used to attempt to complete the payment.
|
2019-03-14 18:31:39 +03:00
|
|
|
lnrpc.Route route = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message SendToRouteResponse {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The preimage obtained by making the payment.
|
2019-03-14 18:31:39 +03:00
|
|
|
bytes preimage = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The failure message in case the payment failed.
|
2020-02-13 13:40:51 +03:00
|
|
|
lnrpc.Failure failure = 2;
|
2019-03-14 18:31:39 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
message ResetMissionControlRequest {
|
|
|
|
}
|
2019-05-10 19:00:15 +03:00
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
message ResetMissionControlResponse {
|
|
|
|
}
|
2019-03-14 18:31:39 +03:00
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
message QueryMissionControlRequest {
|
|
|
|
}
|
2019-05-10 11:38:31 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// QueryMissionControlResponse contains mission control state.
|
2019-05-10 11:38:31 +03:00
|
|
|
message QueryMissionControlResponse {
|
2019-09-27 12:19:30 +03:00
|
|
|
reserved 1;
|
2019-07-29 16:10:58 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// Node pair-level mission control state.
|
2020-02-11 15:58:45 +03:00
|
|
|
repeated PairHistory pairs = 2;
|
2019-05-10 11:38:31 +03:00
|
|
|
}
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// PairHistory contains the mission control state for a particular node pair.
|
2019-07-29 16:10:58 +03:00
|
|
|
message PairHistory {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The source node pubkey of the pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
bytes node_from = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The destination node pubkey of the pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
bytes node_to = 2;
|
2019-09-30 10:12:50 +03:00
|
|
|
|
|
|
|
reserved 3, 4, 5, 6;
|
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
PairData history = 7;
|
2019-09-30 10:12:50 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
message PairData {
|
2020-05-06 17:51:14 +03:00
|
|
|
// Time of last failure.
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 fail_time = 1;
|
2019-05-10 11:38:31 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-09-26 18:04:02 +03:00
|
|
|
Lowest amount that failed to forward rounded to whole sats. This may be
|
|
|
|
set to zero if the failure is independent of amount.
|
|
|
|
*/
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 fail_amt_sat = 2;
|
2019-09-26 18:04:02 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-09-26 18:04:02 +03:00
|
|
|
Lowest amount that failed to forward in millisats. This may be
|
|
|
|
set to zero if the failure is independent of amount.
|
|
|
|
*/
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 fail_amt_msat = 4;
|
2019-09-26 18:04:02 +03:00
|
|
|
|
|
|
|
reserved 3;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// Time of last success.
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 success_time = 5;
|
2019-09-26 17:33:08 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// Highest amount that we could successfully forward rounded to whole sats.
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 success_amt_sat = 6;
|
2019-07-29 15:20:06 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// Highest amount that we could successfully forward in millisats.
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 success_amt_msat = 7;
|
2019-05-10 11:38:31 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
message QueryProbabilityRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The source node pubkey of the pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
bytes from_node = 1;
|
2019-09-27 12:43:12 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The destination node pubkey of the pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
bytes to_node = 2;
|
2019-09-27 12:43:12 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The amount for which to calculate a probability.
|
2020-02-11 15:58:45 +03:00
|
|
|
int64 amt_msat = 3;
|
2019-09-27 12:43:12 +03:00
|
|
|
}
|
|
|
|
|
2020-02-11 15:58:45 +03:00
|
|
|
message QueryProbabilityResponse {
|
2020-05-06 17:51:14 +03:00
|
|
|
// The success probability for the requested pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
double probability = 1;
|
2019-09-27 12:43:12 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
// The historical data for the requested pair.
|
2020-02-11 15:58:45 +03:00
|
|
|
PairData history = 2;
|
2019-09-27 12:43:12 +03:00
|
|
|
}
|
|
|
|
|
2019-08-29 14:03:37 +03:00
|
|
|
message BuildRouteRequest {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-08-29 14:03:37 +03:00
|
|
|
The amount to send expressed in msat. If set to zero, the minimum routable
|
|
|
|
amount is used.
|
|
|
|
*/
|
|
|
|
int64 amt_msat = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-08-29 14:03:37 +03:00
|
|
|
CLTV delta from the current height that should be used for the timelock
|
|
|
|
of the final hop
|
|
|
|
*/
|
|
|
|
int32 final_cltv_delta = 2;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-08-29 14:03:37 +03:00
|
|
|
The channel id of the channel that must be taken to the first hop. If zero,
|
|
|
|
any channel may be used.
|
|
|
|
*/
|
2018-12-19 23:49:41 +03:00
|
|
|
uint64 outgoing_chan_id = 3 [jstype = JS_STRING];
|
2019-08-29 14:03:37 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-08-29 14:03:37 +03:00
|
|
|
A list of hops that defines the route. This does not include the source hop
|
|
|
|
pubkey.
|
|
|
|
*/
|
|
|
|
repeated bytes hop_pubkeys = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
message BuildRouteResponse {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2019-08-29 14:03:37 +03:00
|
|
|
Fully specified route that can be used to execute the payment.
|
|
|
|
*/
|
|
|
|
lnrpc.Route route = 1;
|
|
|
|
}
|
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message SubscribeHtlcEventsRequest {
|
|
|
|
}
|
2020-03-13 10:30:16 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
HtlcEvent contains the htlc event that was processed. These are served on a
|
|
|
|
best-effort basis; events are not persisted, delivery is not guaranteed
|
|
|
|
(in the event of a crash in the switch, forward events may be lost) and
|
|
|
|
some events may be replayed upon restart. Events consumed from this package
|
|
|
|
should be de-duplicated by the htlc's unique combination of incoming and
|
|
|
|
outgoing channel id and htlc id. [EXPERIMENTAL]
|
|
|
|
*/
|
2020-03-20 12:11:45 +03:00
|
|
|
message HtlcEvent {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
The short channel id that the incoming htlc arrived at our node on. This
|
|
|
|
value is zero for sends.
|
|
|
|
*/
|
|
|
|
uint64 incoming_channel_id = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
The short channel id that the outgoing htlc left our node on. This value
|
|
|
|
is zero for receives.
|
|
|
|
*/
|
|
|
|
uint64 outgoing_channel_id = 2;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
Incoming id is the index of the incoming htlc in the incoming channel.
|
|
|
|
This value is zero for sends.
|
|
|
|
*/
|
|
|
|
uint64 incoming_htlc_id = 3;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
Outgoing id is the index of the outgoing htlc in the outgoing channel.
|
|
|
|
This value is zero for receives.
|
|
|
|
*/
|
|
|
|
uint64 outgoing_htlc_id = 4;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
The time in unix nanoseconds that the event occurred.
|
|
|
|
*/
|
|
|
|
uint64 timestamp_ns = 5;
|
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
enum EventType {
|
2020-03-13 10:30:16 +03:00
|
|
|
UNKNOWN = 0;
|
|
|
|
SEND = 1;
|
|
|
|
RECEIVE = 2;
|
|
|
|
FORWARD = 3;
|
|
|
|
}
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
The event type indicates whether the htlc was part of a send, receive or
|
|
|
|
forward.
|
|
|
|
*/
|
|
|
|
EventType event_type = 6;
|
|
|
|
|
|
|
|
oneof event {
|
|
|
|
ForwardEvent forward_event = 7;
|
|
|
|
ForwardFailEvent forward_fail_event = 8;
|
|
|
|
SettleEvent settle_event = 9;
|
|
|
|
LinkFailEvent link_fail_event = 10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message HtlcInfo {
|
2020-03-13 10:30:16 +03:00
|
|
|
// The timelock on the incoming htlc.
|
|
|
|
uint32 incoming_timelock = 1;
|
|
|
|
|
|
|
|
// The timelock on the outgoing htlc.
|
|
|
|
uint32 outgoing_timelock = 2;
|
|
|
|
|
|
|
|
// The amount of the incoming htlc.
|
|
|
|
uint64 incoming_amt_msat = 3;
|
|
|
|
|
|
|
|
// The amount of the outgoing htlc.
|
|
|
|
uint64 outgoing_amt_msat = 4;
|
|
|
|
}
|
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message ForwardEvent {
|
2020-03-13 10:30:16 +03:00
|
|
|
// Info contains details about the htlc that was forwarded.
|
|
|
|
HtlcInfo info = 1;
|
|
|
|
}
|
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message ForwardFailEvent {
|
|
|
|
}
|
2020-03-13 10:30:16 +03:00
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message SettleEvent {
|
|
|
|
}
|
2020-03-13 10:30:16 +03:00
|
|
|
|
2020-03-20 12:11:45 +03:00
|
|
|
message LinkFailEvent {
|
2020-03-13 10:30:16 +03:00
|
|
|
// Info contains details about the htlc that we failed.
|
|
|
|
HtlcInfo info = 1;
|
|
|
|
|
|
|
|
// FailureCode is the BOLT error code for the failure.
|
|
|
|
lnrpc.Failure.FailureCode wire_failure = 2;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-03-13 10:30:16 +03:00
|
|
|
FailureDetail provides additional information about the reason for the
|
|
|
|
failure. This detail enriches the information provided by the wire message
|
|
|
|
and may be 'no detail' if the wire message requires no additional metadata.
|
|
|
|
*/
|
|
|
|
FailureDetail failure_detail = 3;
|
|
|
|
|
|
|
|
// A string representation of the link failure.
|
|
|
|
string failure_string = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum FailureDetail {
|
|
|
|
UNKNOWN = 0;
|
|
|
|
NO_DETAIL = 1;
|
|
|
|
ONION_DECODE = 2;
|
|
|
|
LINK_NOT_ELIGIBLE = 3;
|
|
|
|
ON_CHAIN_TIMEOUT = 4;
|
|
|
|
HTLC_EXCEEDS_MAX = 5;
|
2020-03-20 12:11:45 +03:00
|
|
|
INSUFFICIENT_BALANCE = 6;
|
2020-03-13 10:30:16 +03:00
|
|
|
INCOMPLETE_FORWARD = 7;
|
|
|
|
HTLC_ADD_FAILED = 8;
|
|
|
|
FORWARDS_DISABLED = 9;
|
|
|
|
INVOICE_CANCELED = 10;
|
|
|
|
INVOICE_UNDERPAID = 11;
|
|
|
|
INVOICE_EXPIRY_TOO_SOON = 12;
|
|
|
|
INVOICE_NOT_OPEN = 13;
|
|
|
|
MPP_INVOICE_TIMEOUT = 14;
|
|
|
|
ADDRESS_MISMATCH = 15;
|
|
|
|
SET_TOTAL_MISMATCH = 16;
|
|
|
|
SET_TOTAL_TOO_LOW = 17;
|
|
|
|
SET_OVERPAID = 18;
|
|
|
|
UNKNOWN_INVOICE = 19;
|
|
|
|
INVALID_KEYSEND = 20;
|
|
|
|
MPP_IN_PROGRESS = 21;
|
|
|
|
CIRCULAR_ROUTE = 22;
|
|
|
|
}
|
|
|
|
|
2020-04-13 13:16:55 +03:00
|
|
|
enum PaymentState {
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
Payment is still in flight.
|
|
|
|
*/
|
|
|
|
IN_FLIGHT = 0;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
Payment completed successfully.
|
|
|
|
*/
|
|
|
|
SUCCEEDED = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
There are more routes to try, but the payment timeout was exceeded.
|
|
|
|
*/
|
|
|
|
FAILED_TIMEOUT = 2;
|
2020-05-06 17:41:47 +03:00
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
All possible routes were tried and failed permanently. Or were no
|
|
|
|
routes to the destination at all.
|
|
|
|
*/
|
|
|
|
FAILED_NO_ROUTE = 3;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
A non-recoverable error has occured.
|
|
|
|
*/
|
|
|
|
FAILED_ERROR = 4;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
Payment details incorrect (unknown hash, invalid amt or
|
|
|
|
invalid final cltv delta)
|
|
|
|
*/
|
|
|
|
FAILED_INCORRECT_PAYMENT_DETAILS = 5;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
Insufficient local balance.
|
|
|
|
*/
|
|
|
|
FAILED_INSUFFICIENT_BALANCE = 6;
|
|
|
|
}
|
|
|
|
|
|
|
|
message PaymentStatus {
|
2020-05-06 17:51:14 +03:00
|
|
|
// Current state the payment is in.
|
2020-04-13 13:16:55 +03:00
|
|
|
PaymentState state = 1;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
The pre-image of the payment when state is SUCCEEDED.
|
|
|
|
*/
|
|
|
|
bytes preimage = 2;
|
|
|
|
|
|
|
|
reserved 3;
|
|
|
|
|
2020-05-06 17:51:14 +03:00
|
|
|
/*
|
2020-04-13 13:16:55 +03:00
|
|
|
The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
|
|
|
|
*/
|
|
|
|
repeated lnrpc.HTLCAttempt htlcs = 4;
|
|
|
|
}
|
2020-05-19 12:57:36 +03:00
|
|
|
|
|
|
|
message CircuitKey {
|
|
|
|
/// The id of the channel that the is part of this circuit.
|
|
|
|
uint64 chan_id = 1;
|
|
|
|
|
|
|
|
/// The index of the incoming htlc in the incoming channel.
|
|
|
|
uint64 htlc_id = 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
message ForwardHtlcInterceptRequest {
|
|
|
|
/*
|
|
|
|
The key of this forwarded htlc. It defines the incoming channel id and
|
|
|
|
the index in this channel.
|
|
|
|
*/
|
|
|
|
CircuitKey incoming_circuit_key = 1;
|
|
|
|
|
|
|
|
/*
|
|
|
|
The htlc payment hash. This value is not guaranteed to be unique per
|
|
|
|
request.
|
|
|
|
*/
|
|
|
|
bytes htlc_payment_hash = 2;
|
|
|
|
|
|
|
|
/// The htlc amount.
|
|
|
|
uint64 amount_msat = 3;
|
|
|
|
|
|
|
|
/// The htlc expiry.
|
|
|
|
uint32 expiry = 4;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
ForwardHtlcInterceptResponse enables the caller to resolve a previously hold forward.
|
|
|
|
The caller can choose either to:
|
|
|
|
- `Resume`: Execute the default behavior (usually forward).
|
|
|
|
- `Reject`: Fail the htlc backwards.
|
|
|
|
- `Settle`: Settle this htlc with a given preimage.
|
|
|
|
*/
|
|
|
|
message ForwardHtlcInterceptResponse {
|
|
|
|
/**
|
|
|
|
The key of this forwarded htlc. It defines the incoming channel id and
|
|
|
|
the index in this channel.
|
|
|
|
*/
|
|
|
|
CircuitKey incoming_circuit_key = 1;
|
|
|
|
|
|
|
|
// The resolve action for this intercepted htlc.
|
|
|
|
ResolveHoldForwardAction action = 2;
|
|
|
|
|
|
|
|
// The preimage in case the resolve action is Settle.
|
|
|
|
bytes preimage = 3;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum ResolveHoldForwardAction {
|
|
|
|
SETTLE = 0;
|
|
|
|
FAIL = 1;
|
|
|
|
RESUME = 2;
|
|
|
|
}
|
|
|
|
|