Skip to content

Commit

Permalink
update LND gRPC
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Sep 13, 2024
1 parent 63d539b commit 7d4c2f8
Show file tree
Hide file tree
Showing 3 changed files with 112 additions and 1 deletion.
20 changes: 20 additions & 0 deletions LNUnit.LND/Grpc/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -3293,6 +3293,20 @@ message Route {
The total amount in millisatoshis.
*/
int64 total_amt_msat = 6;

/*
The actual on-chain amount that was sent out to the first hop. This value is
only different from the total_amt_msat field if this is a custom channel
payment and the value transported in the HTLC is different from the BTC
amount in the HTLC. If this value is zero, then this is an old payment that
didn't have this value yet and can be ignored.
*/
int64 first_hop_amount_msat = 7;

/*
Custom channel data that might be populated in custom channels.
*/
bytes custom_channel_data = 8;
}

message NodeInfoRequest {
Expand Down Expand Up @@ -4162,6 +4176,12 @@ message Payment {
uint64 payment_index = 15;

PaymentFailureReason failure_reason = 16;

/*
The custom TLV records that were sent to the first hop as part of the HTLC
wire message for this payment.
*/
map<uint64, bytes> first_hop_custom_records = 17;
}

message HTLCAttempt {
Expand Down
91 changes: 91 additions & 0 deletions LNUnit.LND/Grpc/routerrpc/router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,25 @@ service Router {
*/
rpc UpdateChanStatus (UpdateChanStatusRequest)
returns (UpdateChanStatusResponse);

/*
XAddLocalChanAliases is an experimental API that creates a set of new
channel SCID alias mappings. The final total set of aliases in the manager
after the add operation is returned. This is only a locally stored alias,
and will not be communicated to the channel peer via any message. Therefore,
routing over such an alias will only work if the peer also calls this same
RPC on their end. If an alias already exists, an error is returned
*/
rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse);

/*
XDeleteLocalChanAliases is an experimental API that deletes a set of alias
mappings. The final total set of aliases in the manager after the delete
operation is returned. The deletion will not be communicated to the channel
peer via any message.
*/
rpc XDeleteLocalChanAliases (DeleteAliasesRequest)
returns (DeleteAliasesResponse);
}

message SendPaymentRequest {
Expand Down Expand Up @@ -339,6 +358,15 @@ message SendPaymentRequest {
being sent.
*/
bool cancelable = 24;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass 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> first_hop_custom_records = 25;
}

message TrackPaymentRequest {
Expand Down Expand Up @@ -432,6 +460,15 @@ message SendToRouteRequest {
routes, incorrect payment details, or insufficient funds.
*/
bool skip_temp_err = 3;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass 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> first_hop_custom_records = 4;
}

message SendToRouteResponse {
Expand Down Expand Up @@ -707,6 +744,15 @@ message BuildRouteRequest {
This is also called payment secret in specifications (e.g. BOLT 11).
*/
bytes payment_addr = 5;

/*
An optional field that can be used to pass an arbitrary set of TLV records
to the first hop peer of this payment. This can be used to pass 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> first_hop_custom_records = 6;
}

message BuildRouteResponse {
Expand Down Expand Up @@ -963,12 +1009,17 @@ message ForwardHtlcInterceptRequest {
// The block height at which this htlc will be auto-failed to prevent the
// channel from force-closing.
int32 auto_fail_height = 10;

// The custom records of the peer's incoming p2p wire message.
map<uint64, bytes> in_wire_custom_records = 11;
}

/**
ForwardHtlcInterceptResponse enables the caller to resolve a previously hold
forward. The caller can choose either to:
- `Resume`: Execute the default behavior (usually forward).
- `ResumeModified`: Execute the default behavior (usually forward) with HTLC
field modifications.
- `Reject`: Fail the htlc backwards.
- `Settle`: Settle this htlc with a given preimage.
*/
Expand Down Expand Up @@ -999,12 +1050,36 @@ message ForwardHtlcInterceptResponse {
// For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the
// default value for this field.
lnrpc.Failure.FailureCode failure_code = 5;

// The amount that was set on the p2p wire message of the incoming HTLC.
// This field is ignored if the action is not RESUME_MODIFIED or the amount
// is zero.
uint64 in_amount_msat = 6;

// The amount to set on the p2p wire message of the resumed HTLC. This field
// is ignored if the action is not RESUME_MODIFIED or the amount is zero.
uint64 out_amount_msat = 7;

// Any custom records that should be set on the p2p wire message message of
// the resumed HTLC. This field is ignored if the action is not
// RESUME_MODIFIED.
map<uint64, bytes> out_wire_custom_records = 8;
}

enum ResolveHoldForwardAction {
// SETTLE is an action that is used to settle an HTLC instead of forwarding
// it.
SETTLE = 0;

// FAIL is an action that is used to fail an HTLC backwards.
FAIL = 1;

// RESUME is an action that is used to resume a forward HTLC.
RESUME = 2;

// RESUME_MODIFIED is an action that is used to resume a hold forward HTLC
// with modifications specified during interception.
RESUME_MODIFIED = 3;
}

message UpdateChanStatusRequest {
Expand All @@ -1021,3 +1096,19 @@ enum ChanStatusAction {

message UpdateChanStatusResponse {
}

message AddAliasesRequest {
repeated lnrpc.AliasMap alias_maps = 1;
}

message AddAliasesResponse {
repeated lnrpc.AliasMap alias_maps = 1;
}

message DeleteAliasesRequest {
repeated lnrpc.AliasMap alias_maps = 1;
}

message DeleteAliasesResponse {
repeated lnrpc.AliasMap alias_maps = 1;
}
2 changes: 1 addition & 1 deletion LNUnit.LND/LNUnit.LND.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>LNUnit.LND</PackageId>
<Version>1.7.3</Version>
<Version>1.7.4</Version>
<PackageDescription>LNUnit LND Typed Clients</PackageDescription>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12.0</LangVersion>
Expand Down

0 comments on commit 7d4c2f8

Please sign in to comment.