Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for lnd v0.9.0 #71

Merged
merged 8 commits into from
Jan 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,20 @@ message AddHoldInvoiceRequest {
/// The hash of the preimage
bytes hash = 2 [json_name = "hash"];

/// The value of this invoice in satoshis
/**
The value of this invoice in satoshis

The fields value and value_msat are mutually exclusive.
*/
int64 value = 3 [json_name = "value"];

/**
The value of this invoice in millisatoshis

The fields value and value_msat are mutually exclusive.
*/
int64 value_msat = 10 [json_name = "value_msat"];

/**
Hash (SHA-256) of a description of the payment. Used if the description of
payment (memo) is too long to naturally fit within the description field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,20 @@ message SendPaymentRequest {
/// The identity pubkey of the payment recipient
bytes dest = 1;

/// Number of satoshis to send.
/**
Number of satoshis to send.

The fields amt and amt_msat are mutually exclusive.
*/
int64 amt = 2;

/**
Number of millisatoshis to send.

The fields amt and amt_msat are mutually exclusive.
*/
int64 amt_msat = 12;

/// The hash to use within the payment's HTLC
bytes payment_hash = 3;

Expand Down Expand Up @@ -44,14 +55,32 @@ message SendPaymentRequest {
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.
*/
int64 fee_limit_sat = 7;

/**
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.
*/
int64 fee_limit_msat = 13;

/**
The channel id of the channel that must be taken to the first hop. If zero,
any channel may be used.
*/
uint64 outgoing_chan_id = 8;
uint64 outgoing_chan_id = 8 [jstype = JS_STRING];

/**
The pubkey of the last hop of the route. If empty, any hop may be used.
*/
bytes last_hop_pubkey = 14;

/**
An optional maximum total time lock for the route. This should not exceed
Expand All @@ -68,9 +97,23 @@ message SendPaymentRequest {
/**
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
application specific data during the payment attempt.
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.
*/
map<uint64, bytes> dest_tlv = 11;
map<uint64, bytes> dest_custom_records = 11;

/// If set, circular payments to self are permitted.
bool allow_self_payment = 15;

/**
Features assumed to be supported by the final node. All transitive feature
depdencies must also be set properly. For a given feature bit pair, either
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.
*/
repeated lnrpc.FeatureBit dest_features = 16;
}

message TrackPaymentRequest {
Expand Down Expand Up @@ -110,6 +153,11 @@ enum PaymentState {
invalid final cltv delta)
*/
FAILED_INCORRECT_PAYMENT_DETAILS = 5;

/**
Insufficient local balance.
*/
FAILED_INSUFFICIENT_BALANCE = 6;
}


Expand All @@ -126,6 +174,11 @@ message PaymentStatus {
The taken route when state is SUCCEEDED.
*/
lnrpc.Route route = 3;

/**
The HTLCs made in attempt to settle the payment [EXPERIMENTAL].
*/
repeated lnrpc.HTLCAttempt htlcs = 4;
}


Expand Down Expand Up @@ -203,6 +256,7 @@ message Failure {
PERMANENT_NODE_FAILURE = 20;
PERMANENT_CHANNEL_FAILURE = 21;
EXPIRY_TOO_FAR = 22;
MPP_TIMEOUT = 23;

/**
The error source is known, but the failure itself couldn't be decoded.
Expand Down Expand Up @@ -265,7 +319,7 @@ message ChannelUpdate {
/**
The unique description of the funding transaction.
*/
uint64 chan_id = 3;
uint64 chan_id = 3 [jstype = JS_STRING];

/**
A timestamp that allows ordering in the case of multiple announcements.
Expand Down Expand Up @@ -337,49 +391,70 @@ message QueryMissionControlRequest {}

/// QueryMissionControlResponse contains mission control state.
message QueryMissionControlResponse {
/// Node-level mission control state.
repeated NodeHistory nodes = 1 [json_name = "nodes"];
reserved 1;

/// Node pair-level mission control state.
repeated PairHistory pairs = 2 [json_name = "pairs"];
}

/// NodeHistory contains the mission control state for a particular node.
message NodeHistory {
/// Node pubkey
bytes pubkey = 1 [json_name = "pubkey"];
/// PairHistory contains the mission control state for a particular node pair.
message PairHistory {
/// The source node pubkey of the pair.
bytes node_from = 1 [json_name ="node_from"];

/// The destination node pubkey of the pair.
bytes node_to = 2 [json_name="node_to"];

reserved 3, 4, 5, 6;

PairData history = 7 [json_name="history"];
}

/// Time stamp of last failure. Set to zero if no failure happened yet.
int64 last_fail_time = 2 [json_name = "last_fail_time"];
message PairData {
/// Time of last failure.
int64 fail_time = 1 [json_name = "fail_time"];

/**
Estimation of success probability of forwarding towards peers of this node
for which no specific history is available.
**/
float other_success_prob = 3 [json_name = "other_success_prob"];
Lowest amount that failed to forward rounded to whole sats. This may be
set to zero if the failure is independent of amount.
*/
int64 fail_amt_sat = 2 [json_name = "fail_amt_sat"];

/**
Lowest amount that failed to forward in millisats. This may be
set to zero if the failure is independent of amount.
*/
int64 fail_amt_msat = 4 [json_name = "fail_amt_msat"];

reserved 3;

reserved 4;
/// Time of last success.
int64 success_time = 5 [json_name = "success_time"];

/// Highest amount that we could successfully forward rounded to whole sats.
int64 success_amt_sat = 6 [json_name = "success_amt_sat"];

/// Highest amount that we could successfully forward in millisats.
int64 success_amt_msat = 7 [json_name = "success_amt_msat"];
}

/// PairHistory contains the mission control state for a particular node pair.
message PairHistory {
message QueryProbabilityRequest{
/// The source node pubkey of the pair.
bytes node_from = 1 [json_name ="node_from"];
bytes from_node = 1 [json_name = "from_node"];

/// The destination node pubkey of the pair.
bytes node_to = 2 [json_name="node_to"];

/// Time stamp of last result.
int64 timestamp = 3 [json_name = "timestamp"];
bytes to_node = 2 [json_name = "to_node"];

/// Minimum penalization amount (only applies to failed attempts).
int64 min_penalize_amt_sat = 4 [json_name = "min_penalize_amt_sat"];
/// The amount for which to calculate a probability.
int64 amt_msat = 3 [json_name = "amt_msat"];
}

/// Estimation of success probability for this pair.
float success_prob = 5 [json_name = "success_prob"];
message QueryProbabilityResponse{
/// The success probability for the requested pair.
double probability = 1 [json_name = "probability"];

/// Whether the last payment attempt through this pair was successful.
bool last_attempt_successful = 6 [json_name = "last_attempt_successful"];
/// The historical data for the requested pair.
PairData history = 2 [json_name = "history"];
}

message BuildRouteRequest {
Expand All @@ -399,7 +474,7 @@ message BuildRouteRequest {
The channel id of the channel that must be taken to the first hop. If zero,
any channel may be used.
*/
uint64 outgoing_chan_id = 3;
uint64 outgoing_chan_id = 3 [jstype = JS_STRING];

/**
A list of hops that defines the route. This does not include the source hop
Expand Down Expand Up @@ -455,6 +530,12 @@ service Router {
*/
rpc QueryMissionControl(QueryMissionControlRequest) returns (QueryMissionControlResponse);

/**
QueryProbability returns the current success probability estimate for a
given node pair and amount.
*/
rpc QueryProbability(QueryProbabilityRequest) returns (QueryProbabilityResponse);

/**
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
Expand Down
Loading