lightning 10.22.1 → 10.22.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Versions
2
2
 
3
- ## 10.22.1
3
+ ## 10.22.2
4
4
 
5
5
  - `createFundedPsbt`: Add support for `change_format` for change address type
6
6
 
@@ -204,10 +204,10 @@ message LookupInvoiceMsg {
204
204
 
205
205
  // CircuitKey is a unique identifier for an HTLC.
206
206
  message CircuitKey {
207
- /// The id of the channel that the is part of this circuit.
207
+ // The id of the channel that the is part of this circuit.
208
208
  uint64 chan_id = 1;
209
209
 
210
- /// The index of the incoming htlc in the incoming channel.
210
+ // The index of the incoming htlc in the incoming channel.
211
211
  uint64 htlc_id = 2;
212
212
  }
213
213
 
@@ -240,6 +240,12 @@ message HtlcModifyResponse {
240
240
  // The modified amount in milli-satoshi that the exit HTLC is paying. This
241
241
  // value can be different from the actual on-chain HTLC amount, in case the
242
242
  // HTLC carries other valuable items, as can be the case with custom channel
243
- // types. In order to not modify this value, the client should set it zero.
244
- uint64 amt_paid = 2;
243
+ // types.
244
+ optional uint64 amt_paid = 2;
245
+
246
+ // This flag indicates whether the HTLCs associated with the invoices should
247
+ // be cancelled. The interceptor client may set this field if some
248
+ // unexpected behavior is encountered. Setting this will ignore the amt_paid
249
+ // field.
250
+ bool cancel_set = 3;
245
251
  }
@@ -1388,8 +1388,14 @@ enum CommitmentType {
1388
1388
  A channel that uses musig2 for the funding output, and the new tapscript
1389
1389
  features where relevant.
1390
1390
  */
1391
- // TODO(roasbeef): need script enforce mirror type for the above as well?
1392
1391
  SIMPLE_TAPROOT = 5;
1392
+
1393
+ /*
1394
+ Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
1395
+ This channel type also commits to additional meta data in the tapscript
1396
+ leaves for the scripts in a channel.
1397
+ */
1398
+ SIMPLE_TAPROOT_OVERLAY = 6;
1393
1399
  }
1394
1400
 
1395
1401
  message ChannelConstraints {
@@ -1592,6 +1598,11 @@ message Channel {
1592
1598
  the channel's operation.
1593
1599
  */
1594
1600
  string memo = 36;
1601
+
1602
+ /*
1603
+ Custom channel data that might be populated in custom channels.
1604
+ */
1605
+ bytes custom_channel_data = 37;
1595
1606
  }
1596
1607
 
1597
1608
  message ListChannelsRequest {
@@ -2028,10 +2039,38 @@ message ChannelOpenUpdate {
2028
2039
  ChannelPoint channel_point = 1;
2029
2040
  }
2030
2041
 
2042
+ message CloseOutput {
2043
+ // The amount in satoshi of this close output. This amount is the final
2044
+ // commitment balance of the channel and the actual amount paid out on chain
2045
+ // might be smaller due to subtracted fees.
2046
+ int64 amount_sat = 1;
2047
+
2048
+ // The pkScript of the close output.
2049
+ bytes pk_script = 2;
2050
+
2051
+ // Whether this output is for the local or remote node.
2052
+ bool is_local = 3;
2053
+
2054
+ // The TLV encoded custom channel data records for this output, which might
2055
+ // be set for custom channels.
2056
+ bytes custom_channel_data = 4;
2057
+ }
2058
+
2031
2059
  message ChannelCloseUpdate {
2032
2060
  bytes closing_txid = 1;
2033
2061
 
2034
2062
  bool success = 2;
2063
+
2064
+ // The local channel close output. If the local channel balance was dust to
2065
+ // begin with, this output will not be set.
2066
+ CloseOutput local_close_output = 3;
2067
+
2068
+ // The remote channel close output. If the remote channel balance was dust
2069
+ // to begin with, this output will not be set.
2070
+ CloseOutput remote_close_output = 4;
2071
+
2072
+ // Any additional outputs that might be added for custom channel types.
2073
+ repeated CloseOutput additional_outputs = 5;
2035
2074
  }
2036
2075
 
2037
2076
  message CloseChannelRequest {
@@ -2709,6 +2748,11 @@ message PendingChannelsResponse {
2709
2748
  impacts the channel's operation.
2710
2749
  */
2711
2750
  string memo = 13;
2751
+
2752
+ /*
2753
+ Custom channel data that might be populated in custom channels.
2754
+ */
2755
+ bytes custom_channel_data = 34;
2712
2756
  }
2713
2757
 
2714
2758
  message PendingOpenChannel {
@@ -2968,6 +3012,12 @@ message ChannelBalanceResponse {
2968
3012
 
2969
3013
  // Sum of channels pending remote balances.
2970
3014
  Amount pending_open_remote_balance = 8;
3015
+
3016
+ /*
3017
+ Custom channel data that might be populated if there are custom channels
3018
+ present.
3019
+ */
3020
+ bytes custom_channel_data = 9;
2971
3021
  }
2972
3022
 
2973
3023
  message QueryRoutesRequest {
@@ -3293,6 +3343,20 @@ message Route {
3293
3343
  The total amount in millisatoshis.
3294
3344
  */
3295
3345
  int64 total_amt_msat = 6;
3346
+
3347
+ /*
3348
+ The actual on-chain amount that was sent out to the first hop. This value is
3349
+ only different from the total_amt_msat field if this is a custom channel
3350
+ payment and the value transported in the HTLC is different from the BTC
3351
+ amount in the HTLC. If this value is zero, then this is an old payment that
3352
+ didn't have this value yet and can be ignored.
3353
+ */
3354
+ int64 first_hop_amount_msat = 7;
3355
+
3356
+ /*
3357
+ Custom channel data that might be populated in custom channels.
3358
+ */
3359
+ bytes custom_channel_data = 8;
3296
3360
  }
3297
3361
 
3298
3362
  message NodeInfoRequest {
@@ -3922,6 +3986,11 @@ message InvoiceHTLC {
3922
3986
 
3923
3987
  // Details relevant to AMP HTLCs, only populated if this is an AMP HTLC.
3924
3988
  AMP amp = 11;
3989
+
3990
+ /*
3991
+ Custom channel data that might be populated in custom channels.
3992
+ */
3993
+ bytes custom_channel_data = 12;
3925
3994
  }
3926
3995
 
3927
3996
  // Details specific to AMP HTLCs.
@@ -4162,6 +4231,12 @@ message Payment {
4162
4231
  uint64 payment_index = 15;
4163
4232
 
4164
4233
  PaymentFailureReason failure_reason = 16;
4234
+
4235
+ /*
4236
+ The custom TLV records that were sent to the first hop as part of the HTLC
4237
+ wire message for this payment.
4238
+ */
4239
+ map<uint64, bytes> first_hop_custom_records = 17;
4165
4240
  }
4166
4241
 
4167
4242
  message HTLCAttempt {
@@ -176,6 +176,25 @@ service Router {
176
176
  */
177
177
  rpc UpdateChanStatus (UpdateChanStatusRequest)
178
178
  returns (UpdateChanStatusResponse);
179
+
180
+ /*
181
+ XAddLocalChanAliases is an experimental API that creates a set of new
182
+ channel SCID alias mappings. The final total set of aliases in the manager
183
+ after the add operation is returned. This is only a locally stored alias,
184
+ and will not be communicated to the channel peer via any message. Therefore,
185
+ routing over such an alias will only work if the peer also calls this same
186
+ RPC on their end. If an alias already exists, an error is returned
187
+ */
188
+ rpc XAddLocalChanAliases (AddAliasesRequest) returns (AddAliasesResponse);
189
+
190
+ /*
191
+ XDeleteLocalChanAliases is an experimental API that deletes a set of alias
192
+ mappings. The final total set of aliases in the manager after the delete
193
+ operation is returned. The deletion will not be communicated to the channel
194
+ peer via any message.
195
+ */
196
+ rpc XDeleteLocalChanAliases (DeleteAliasesRequest)
197
+ returns (DeleteAliasesResponse);
179
198
  }
180
199
 
181
200
  message SendPaymentRequest {
@@ -339,6 +358,15 @@ message SendPaymentRequest {
339
358
  being sent.
340
359
  */
341
360
  bool cancelable = 24;
361
+
362
+ /*
363
+ An optional field that can be used to pass an arbitrary set of TLV records
364
+ to the first hop peer of this payment. This can be used to pass application
365
+ specific data during the payment attempt. Record types are required to be in
366
+ the custom range >= 65536. When using REST, the values must be encoded as
367
+ base64.
368
+ */
369
+ map<uint64, bytes> first_hop_custom_records = 25;
342
370
  }
343
371
 
344
372
  message TrackPaymentRequest {
@@ -432,6 +460,15 @@ message SendToRouteRequest {
432
460
  routes, incorrect payment details, or insufficient funds.
433
461
  */
434
462
  bool skip_temp_err = 3;
463
+
464
+ /*
465
+ An optional field that can be used to pass an arbitrary set of TLV records
466
+ to the first hop peer of this payment. This can be used to pass application
467
+ specific data during the payment attempt. Record types are required to be in
468
+ the custom range >= 65536. When using REST, the values must be encoded as
469
+ base64.
470
+ */
471
+ map<uint64, bytes> first_hop_custom_records = 4;
435
472
  }
436
473
 
437
474
  message SendToRouteResponse {
@@ -707,6 +744,15 @@ message BuildRouteRequest {
707
744
  This is also called payment secret in specifications (e.g. BOLT 11).
708
745
  */
709
746
  bytes payment_addr = 5;
747
+
748
+ /*
749
+ An optional field that can be used to pass an arbitrary set of TLV records
750
+ to the first hop peer of this payment. This can be used to pass application
751
+ specific data during the payment attempt. Record types are required to be in
752
+ the custom range >= 65536. When using REST, the values must be encoded as
753
+ base64.
754
+ */
755
+ map<uint64, bytes> first_hop_custom_records = 6;
710
756
  }
711
757
 
712
758
  message BuildRouteResponse {
@@ -963,12 +1009,17 @@ message ForwardHtlcInterceptRequest {
963
1009
  // The block height at which this htlc will be auto-failed to prevent the
964
1010
  // channel from force-closing.
965
1011
  int32 auto_fail_height = 10;
1012
+
1013
+ // The custom records of the peer's incoming p2p wire message.
1014
+ map<uint64, bytes> in_wire_custom_records = 11;
966
1015
  }
967
1016
 
968
1017
  /**
969
1018
  ForwardHtlcInterceptResponse enables the caller to resolve a previously hold
970
1019
  forward. The caller can choose either to:
971
1020
  - `Resume`: Execute the default behavior (usually forward).
1021
+ - `ResumeModified`: Execute the default behavior (usually forward) with HTLC
1022
+ field modifications.
972
1023
  - `Reject`: Fail the htlc backwards.
973
1024
  - `Settle`: Settle this htlc with a given preimage.
974
1025
  */
@@ -999,12 +1050,44 @@ message ForwardHtlcInterceptResponse {
999
1050
  // For backwards-compatibility reasons, TEMPORARY_CHANNEL_FAILURE is the
1000
1051
  // default value for this field.
1001
1052
  lnrpc.Failure.FailureCode failure_code = 5;
1053
+
1054
+ // The amount that was set on the p2p wire message of the incoming HTLC.
1055
+ // This field is ignored if the action is not RESUME_MODIFIED or the amount
1056
+ // is zero.
1057
+ uint64 in_amount_msat = 6;
1058
+
1059
+ // The amount to set on the p2p wire message of the resumed HTLC. This field
1060
+ // is ignored if the action is not RESUME_MODIFIED or the amount is zero.
1061
+ uint64 out_amount_msat = 7;
1062
+
1063
+ // Any custom records that should be set on the p2p wire message message of
1064
+ // the resumed HTLC. This field is ignored if the action is not
1065
+ // RESUME_MODIFIED.
1066
+ //
1067
+ // If this map is populated, it will overwrite any of the wire custom
1068
+ // records set by LND. It is the caller's responsibility to copy any desired
1069
+ // records across. If the map is empty, no action will be taken and existing
1070
+ // custom records will be propagated.
1071
+ //
1072
+ // The API does not currently support deleting custom records, unless they
1073
+ // are overwritten by a new set.
1074
+ map<uint64, bytes> out_wire_custom_records = 8;
1002
1075
  }
1003
1076
 
1004
1077
  enum ResolveHoldForwardAction {
1078
+ // SETTLE is an action that is used to settle an HTLC instead of forwarding
1079
+ // it.
1005
1080
  SETTLE = 0;
1081
+
1082
+ // FAIL is an action that is used to fail an HTLC backwards.
1006
1083
  FAIL = 1;
1084
+
1085
+ // RESUME is an action that is used to resume a forward HTLC.
1007
1086
  RESUME = 2;
1087
+
1088
+ // RESUME_MODIFIED is an action that is used to resume a hold forward HTLC
1089
+ // with modifications specified during interception.
1090
+ RESUME_MODIFIED = 3;
1008
1091
  }
1009
1092
 
1010
1093
  message UpdateChanStatusRequest {
@@ -1020,4 +1103,20 @@ enum ChanStatusAction {
1020
1103
  }
1021
1104
 
1022
1105
  message UpdateChanStatusResponse {
1106
+ }
1107
+
1108
+ message AddAliasesRequest {
1109
+ repeated lnrpc.AliasMap alias_maps = 1;
1110
+ }
1111
+
1112
+ message AddAliasesResponse {
1113
+ repeated lnrpc.AliasMap alias_maps = 1;
1114
+ }
1115
+
1116
+ message DeleteAliasesRequest {
1117
+ repeated lnrpc.AliasMap alias_maps = 1;
1118
+ }
1119
+
1120
+ message DeleteAliasesResponse {
1121
+ repeated lnrpc.AliasMap alias_maps = 1;
1023
1122
  }
@@ -222,14 +222,14 @@ service WalletKit {
222
222
  */
223
223
  rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);
224
224
 
225
- /*
225
+ /* lncli: `wallet estimatefeerate`
226
226
  EstimateFee attempts to query the internal fee estimator of the wallet to
227
227
  determine the fee (in sat/kw) to attach to a transaction in order to
228
228
  achieve the confirmation target.
229
229
  */
230
230
  rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);
231
231
 
232
- /* lncli: `pendingsweeps`
232
+ /* lncli: `wallet pendingsweeps`
233
233
  PendingSweeps returns lists of on-chain outputs that lnd is currently
234
234
  attempting to sweep within its central batching engine. Outputs with similar
235
235
  fee rates are batched together in order to sweep them within a single
@@ -273,6 +273,13 @@ service WalletKit {
273
273
  */
274
274
  rpc BumpFee (BumpFeeRequest) returns (BumpFeeResponse);
275
275
 
276
+ /* lncli: `wallet bumpforceclosefee`
277
+ BumpForceCloseFee is an endpoint that allows users to bump the fee of a
278
+ channel force close. This only works for channels with option_anchors.
279
+ */
280
+ rpc BumpForceCloseFee (BumpForceCloseFeeRequest)
281
+ returns (BumpForceCloseFeeResponse);
282
+
276
283
  /* lncli: `wallet listsweeps`
277
284
  ListSweeps returns a list of the sweep transactions our node has produced.
278
285
  Note that these sweeps may not be confirmed yet, as we record sweeps on
@@ -1226,6 +1233,46 @@ message BumpFeeResponse {
1226
1233
  string status = 1;
1227
1234
  }
1228
1235
 
1236
+ message BumpForceCloseFeeRequest {
1237
+ // The channel point which force close transaction we are attempting to
1238
+ // bump the fee rate for.
1239
+ lnrpc.ChannelPoint chan_point = 1;
1240
+
1241
+ // Optional. The deadline delta in number of blocks that the anchor output
1242
+ // should be spent within to bump the closing transaction.
1243
+ uint32 deadline_delta = 2;
1244
+
1245
+ /*
1246
+ Optional. The starting fee rate, expressed in sat/vbyte. This value will be
1247
+ used by the sweeper's fee function as its starting fee rate. When not set,
1248
+ the sweeper will use the estimated fee rate using the target_conf as the
1249
+ starting fee rate.
1250
+ */
1251
+ uint64 starting_feerate = 3;
1252
+
1253
+ /*
1254
+ Optional. Whether this cpfp transaction will be triggered immediately. When
1255
+ set to true, the sweeper will consider all currently registered sweeps and
1256
+ trigger new batch transactions including the sweeping of the anchor output
1257
+ related to the selected force close transaction.
1258
+ */
1259
+ bool immediate = 4;
1260
+
1261
+ /*
1262
+ Optional. The max amount in sats that can be used as the fees. For already
1263
+ registered anchor outputs if not set explicitly the old value will be used.
1264
+ For channel force closes which have no HTLCs in their commitment transaction
1265
+ this value has to be set to an appropriate amount to pay for the cpfp
1266
+ transaction of the force closed channel otherwise the fee bumping will fail.
1267
+ */
1268
+ uint64 budget = 5;
1269
+ }
1270
+
1271
+ message BumpForceCloseFeeResponse {
1272
+ // The status of the force close fee bump operation.
1273
+ string status = 1;
1274
+ }
1275
+
1229
1276
  message ListSweepsRequest {
1230
1277
  /*
1231
1278
  Retrieve the full sweep transaction details. If false, only the sweep txids
@@ -46,10 +46,14 @@ export type PayViaRoutesArgs = AuthenticatedLightningArgs<{
46
46
  }[];
47
47
  /** Total Millitokens To Pay */
48
48
  mtokens: string;
49
+ /** Payment Identifier Hex */
50
+ payment?: string;
49
51
  /** Expiration Block Height */
50
52
  timeout: number;
51
53
  /** Total Tokens To Pay */
52
54
  tokens: number;
55
+ /** Total Millitokens */
56
+ total_mtokens?: string;
53
57
  }[];
54
58
  }>;
55
59
 
package/package.json CHANGED
@@ -9,9 +9,9 @@
9
9
  "dependencies": {
10
10
  "@grpc/grpc-js": "1.12.2",
11
11
  "@grpc/proto-loader": "0.7.13",
12
- "@types/node": "22.7.5",
12
+ "@types/node": "22.9.1",
13
13
  "@types/request": "2.48.12",
14
- "@types/ws": "8.5.12",
14
+ "@types/ws": "8.5.13",
15
15
  "async": "3.2.6",
16
16
  "asyncjs-util": "1.2.12",
17
17
  "bitcoinjs-lib": "6.1.6",
@@ -22,7 +22,7 @@
22
22
  "invoices": "3.0.0",
23
23
  "psbt": "3.0.0",
24
24
  "tiny-secp256k1": "2.2.3",
25
- "type-fest": "4.26.1"
25
+ "type-fest": "4.27.0"
26
26
  },
27
27
  "description": "Lightning Network client library",
28
28
  "devDependencies": {
@@ -53,5 +53,5 @@
53
53
  "directory": "test/typescript"
54
54
  },
55
55
  "types": "index.d.ts",
56
- "version": "10.22.1"
56
+ "version": "10.22.2"
57
57
  }