lightning 10.6.0 → 10.7.0

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,5 +1,13 @@
1
1
  # Versions
2
2
 
3
+ ## 10.7.0
4
+
5
+ - `getPendingChannels`: Add support for `close_transaction` to return raw tx
6
+
7
+ ## 10.6.1
8
+
9
+ - `addAdvertisedFeature`: Add typescript definitions
10
+
3
11
  ## 10.6.0
4
12
 
5
13
  - `addAdvertisedFeature`: Add method to advertise a feature bit support
@@ -348,13 +348,13 @@ service Lightning {
348
348
  */
349
349
  rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse);
350
350
 
351
- /*
351
+ /* lncli: `deletepayments`
352
352
  DeletePayment deletes an outgoing payment from DB. Note that it will not
353
353
  attempt to delete an In-Flight payment, since that would be unsafe.
354
354
  */
355
355
  rpc DeletePayment (DeletePaymentRequest) returns (DeletePaymentResponse);
356
356
 
357
- /*
357
+ /* lncli: `deletepayments --all`
358
358
  DeleteAllPayments deletes all outgoing payments from DB. Note that it will
359
359
  not attempt to delete In-Flight payments, since that would be unsafe.
360
360
  */
@@ -486,7 +486,7 @@ service Lightning {
486
486
  rpc ExportAllChannelBackups (ChanBackupExportRequest)
487
487
  returns (ChanBackupSnapshot);
488
488
 
489
- /*
489
+ /* lncli: `verifychanbackup`
490
490
  VerifyChanBackup allows a caller to verify the integrity of a channel backup
491
491
  snapshot. This method will accept either a packed Single or a packed Multi.
492
492
  Specifying both will result in an error.
@@ -884,7 +884,8 @@ message SendRequest {
884
884
  repeated FeatureBit dest_features = 15;
885
885
 
886
886
  /*
887
- The payment address of the generated invoice.
887
+ The payment address of the generated invoice. This is also called
888
+ payment secret in specifications (e.g. BOLT 11).
888
889
  */
889
890
  bytes payment_addr = 16;
890
891
  }
@@ -1933,13 +1934,16 @@ message GetInfoResponse {
1933
1934
  /*
1934
1935
  Whether the current node is connected to testnet. This field is
1935
1936
  deprecated and the network field should be used instead
1936
- **/
1937
+ */
1937
1938
  bool testnet = 10 [deprecated = true];
1938
1939
 
1939
1940
  reserved 11;
1940
1941
 
1941
- // A list of active chains the node is connected to
1942
- repeated Chain chains = 16;
1942
+ /*
1943
+ Deprecated. The only active chain is bitcoin.
1944
+ A list of active chains the node is connected to
1945
+ */
1946
+ repeated Chain chains = 16 [deprecated = true];
1943
1947
 
1944
1948
  // The URIs of the current node.
1945
1949
  repeated string uris = 12;
@@ -1981,8 +1985,9 @@ message GetRecoveryInfoResponse {
1981
1985
  }
1982
1986
 
1983
1987
  message Chain {
1984
- // The blockchain the node is on (eg bitcoin, litecoin)
1985
- string chain = 1;
1988
+ // Deprecated. The chain is now always assumed to be bitcoin.
1989
+ // The blockchain the node is on (must be bitcoin)
1990
+ string chain = 1 [deprecated = true];
1986
1991
 
1987
1992
  // The network the node is on (eg regtest, testnet, mainnet)
1988
1993
  string network = 2;
@@ -2042,12 +2047,18 @@ message CloseChannelRequest {
2042
2047
  //
2043
2048
  // NOTE: This field is only respected if we're the initiator of the channel.
2044
2049
  uint64 max_fee_per_vbyte = 7;
2050
+
2051
+ // If true, then the rpc call will not block while it awaits a closing txid.
2052
+ // Consequently this RPC call will not return a closing txid if this value
2053
+ // is set.
2054
+ bool no_wait = 8;
2045
2055
  }
2046
2056
 
2047
2057
  message CloseStatusUpdate {
2048
2058
  oneof update {
2049
2059
  PendingUpdate close_pending = 1;
2050
2060
  ChannelCloseUpdate chan_close = 3;
2061
+ InstantUpdate close_instant = 4;
2051
2062
  }
2052
2063
  }
2053
2064
 
@@ -2056,6 +2067,9 @@ message PendingUpdate {
2056
2067
  uint32 output_index = 2;
2057
2068
  }
2058
2069
 
2070
+ message InstantUpdate {
2071
+ }
2072
+
2059
2073
  message ReadyForPsbtFunding {
2060
2074
  /*
2061
2075
  The P2WSH address of the channel funding multisig address that the below
@@ -2623,6 +2637,9 @@ message PendingHTLC {
2623
2637
  }
2624
2638
 
2625
2639
  message PendingChannelsRequest {
2640
+ // Indicates whether to include the raw transaction hex for
2641
+ // waiting_close_channels.
2642
+ bool include_raw_tx = 1;
2626
2643
  }
2627
2644
  message PendingChannelsResponse {
2628
2645
  message PendingChannel {
@@ -2720,6 +2737,10 @@ message PendingChannelsResponse {
2720
2737
 
2721
2738
  // The transaction id of the closing transaction
2722
2739
  string closing_txid = 4;
2740
+
2741
+ // The raw hex encoded bytes of the closing transaction. Included if
2742
+ // include_raw_tx in the request is true.
2743
+ string closing_tx_hex = 5;
2723
2744
  }
2724
2745
 
2725
2746
  message Commitments {
@@ -2858,6 +2879,11 @@ message WalletBalanceRequest {
2858
2879
  // The wallet account the balance is shown for.
2859
2880
  // If this is not specified, the balance of the "default" account is shown.
2860
2881
  string account = 1;
2882
+
2883
+ // The minimum number of confirmations each one of your outputs used for the
2884
+ // funding transaction must satisfy. If this is not specified, the default
2885
+ // value of 1 is used.
2886
+ int32 min_confs = 2;
2861
2887
  }
2862
2888
 
2863
2889
  message WalletBalanceResponse {
@@ -2943,6 +2969,9 @@ message QueryRoutesRequest {
2943
2969
  not add any additional block padding on top of final_ctlv_delta. This
2944
2970
  padding of a few blocks needs to be added manually or otherwise failures may
2945
2971
  happen when a block comes in while the payment is in flight.
2972
+
2973
+ Note: must not be set if making a payment to a blinded path (delta is
2974
+ set by the aggregate parameters provided by blinded_payment_paths)
2946
2975
  */
2947
2976
  int32 final_cltv_delta = 4;
2948
2977
 
@@ -3016,12 +3045,21 @@ message QueryRoutesRequest {
3016
3045
  */
3017
3046
  repeated lnrpc.RouteHint route_hints = 16;
3018
3047
 
3048
+ /*
3049
+ An optional blinded path(s) to reach the destination. Note that the
3050
+ introduction node must be provided as the first hop in the route.
3051
+ */
3052
+ repeated BlindedPaymentPath blinded_payment_paths = 19;
3053
+
3019
3054
  /*
3020
3055
  Features assumed to be supported by the final node. All transitive feature
3021
3056
  dependencies must also be set properly. For a given feature bit pair, either
3022
3057
  optional or remote may be set, but not both. If this field is nil or empty,
3023
3058
  the router will try to load destination features from the graph as a
3024
3059
  fallback.
3060
+
3061
+ Note: must not be set if making a payment to a blinded route (features
3062
+ are provided in blinded_payment_paths).
3025
3063
  */
3026
3064
  repeated lnrpc.FeatureBit dest_features = 17;
3027
3065
 
@@ -3127,6 +3165,32 @@ message Hop {
3127
3165
 
3128
3166
  // The payment metadata to send along with the payment to the payee.
3129
3167
  bytes metadata = 13;
3168
+
3169
+ /*
3170
+ Blinding point is an optional blinding point included for introduction
3171
+ nodes in blinded paths. This field is mandatory for hops that represents
3172
+ the introduction point in a blinded path.
3173
+ */
3174
+ bytes blinding_point = 14;
3175
+
3176
+ /*
3177
+ Encrypted data is a receiver-produced blob of data that provides hops
3178
+ in a blinded route with forwarding data. As this data is encrypted by
3179
+ the recipient, we will not be able to parse it - it is essentially an
3180
+ arbitrary blob of data from our node's perspective. This field is
3181
+ mandatory for all hops in a blinded path, including the introduction
3182
+ node.
3183
+ */
3184
+ bytes encrypted_data = 15;
3185
+
3186
+ /*
3187
+ The total amount that is sent to the recipient (possibly across multiple
3188
+ HTLCs), as specified by the sender when making a payment to a blinded path.
3189
+ This value is only set in the final hop payload of a blinded payment. This
3190
+ value is analogous to the MPPRecord that is used for regular (non-blinded)
3191
+ MPP payments.
3192
+ */
3193
+ uint64 total_amt_msat = 16;
3130
3194
  }
3131
3195
 
3132
3196
  message MPPRecord {
@@ -3134,7 +3198,8 @@ message MPPRecord {
3134
3198
  A unique, random identifier used to authenticate the sender as the intended
3135
3199
  payer of a multi-path payment. The payment_addr must be the same for all
3136
3200
  subpayments, and match the payment_addr provided in the receiver's invoice.
3137
- The same payment_addr must be used on all subpayments.
3201
+ The same payment_addr must be used on all subpayments. This is also called
3202
+ payment secret in specifications (e.g. BOLT 11).
3138
3203
  */
3139
3204
  bytes payment_addr = 11;
3140
3205
 
@@ -3472,6 +3537,61 @@ message RouteHint {
3472
3537
  repeated HopHint hop_hints = 1;
3473
3538
  }
3474
3539
 
3540
+ message BlindedPaymentPath {
3541
+ // The blinded path to send the payment to.
3542
+ BlindedPath blinded_path = 1;
3543
+
3544
+ // The base fee for the blinded path provided, expressed in msat.
3545
+ uint64 base_fee_msat = 2;
3546
+
3547
+ // The proportional fee for the blinded path provided, expressed in msat.
3548
+ uint64 proportional_fee_msat = 3;
3549
+
3550
+ /*
3551
+ The total CLTV delta for the blinded path provided, including the
3552
+ final CLTV delta for the receiving node.
3553
+ */
3554
+ uint32 total_cltv_delta = 4;
3555
+
3556
+ /*
3557
+ The minimum hltc size that may be sent over the blinded path, expressed
3558
+ in msat.
3559
+ */
3560
+ uint64 htlc_min_msat = 5;
3561
+
3562
+ /*
3563
+ The maximum htlc size that may be sent over the blinded path, expressed
3564
+ in msat.
3565
+ */
3566
+ uint64 htlc_max_msat = 6;
3567
+
3568
+ // The feature bits for the route.
3569
+ repeated FeatureBit features = 7;
3570
+ }
3571
+
3572
+ message BlindedPath {
3573
+ // The unblinded pubkey of the introduction node for the route.
3574
+ bytes introduction_node = 1;
3575
+
3576
+ // The ephemeral pubkey used by nodes in the blinded route.
3577
+ bytes blinding_point = 2;
3578
+
3579
+ /*
3580
+ A set of blinded node keys and data blobs for the blinded portion of the
3581
+ route. Note that the first hop is expected to be the introduction node,
3582
+ so the route is always expected to have at least one hop.
3583
+ */
3584
+ repeated BlindedHop blinded_hops = 3;
3585
+ }
3586
+
3587
+ message BlindedHop {
3588
+ // The blinded public key of the node.
3589
+ bytes blinded_node = 1;
3590
+
3591
+ // An encrypted blob of data provided to the blinded node.
3592
+ bytes encrypted_data = 2;
3593
+ }
3594
+
3475
3595
  message AMPInvoiceState {
3476
3596
  // The state the HTLCs associated with this setID are in.
3477
3597
  InvoiceHTLCState state = 1;
@@ -3658,9 +3778,10 @@ message Invoice {
3658
3778
  bool is_keysend = 25;
3659
3779
 
3660
3780
  /*
3661
- The payment address of this invoice. This value will be used in MPP
3662
- payments, and also for newer invoices that always require the MPP payload
3663
- for added end-to-end security.
3781
+ The payment address of this invoice. This is also called payment secret in
3782
+ specifications (e.g. BOLT 11). This value will be used in MPP payments, and
3783
+ also for newer invoices that always require the MPP payload for added
3784
+ end-to-end security.
3664
3785
  Note: Output only, don't specify for creating an invoice.
3665
3786
  */
3666
3787
  bytes payment_addr = 26;
@@ -3765,9 +3886,9 @@ message AddInvoiceResponse {
3765
3886
  uint64 add_index = 16;
3766
3887
 
3767
3888
  /*
3768
- The payment address of the generated invoice. This value should be used
3769
- in all payments for this invoice as we require it for end to end
3770
- security.
3889
+ The payment address of the generated invoice. This is also called
3890
+ payment secret in specifications (e.g. BOLT 11). This value should be used
3891
+ in all payments for this invoice as we require it for end to end security.
3771
3892
  */
3772
3893
  bytes payment_addr = 17;
3773
3894
  }
@@ -3918,10 +4039,20 @@ message Payment {
3918
4039
  string payment_request = 9;
3919
4040
 
3920
4041
  enum PaymentStatus {
3921
- UNKNOWN = 0;
4042
+ // Deprecated. This status will never be returned.
4043
+ UNKNOWN = 0 [deprecated = true];
4044
+
4045
+ // Payment has inflight HTLCs.
3922
4046
  IN_FLIGHT = 1;
4047
+
4048
+ // Payment is settled.
3923
4049
  SUCCEEDED = 2;
4050
+
4051
+ // Payment is failed.
3924
4052
  FAILED = 3;
4053
+
4054
+ // Payment is created and has not attempted any HTLCs.
4055
+ INITIATED = 4;
3925
4056
  }
3926
4057
 
3927
4058
  // The status of the payment.
@@ -4017,11 +4148,11 @@ message ListPaymentsRequest {
4017
4148
  */
4018
4149
  bool count_total_payments = 5;
4019
4150
 
4020
- // If set, returns all invoices with a creation date greater than or equal
4151
+ // If set, returns all payments with a creation date greater than or equal
4021
4152
  // to it. Measured in seconds since the unix epoch.
4022
4153
  uint64 creation_date_start = 6;
4023
4154
 
4024
- // If set, returns all invoices with a creation date less than or equal to
4155
+ // If set, returns all payments with a creation date less than or equal to
4025
4156
  // it. Measured in seconds since the unix epoch.
4026
4157
  uint64 creation_date_end = 7;
4027
4158
  }
@@ -7,6 +7,8 @@ export type GetPendingChannelsResult = {
7
7
  blocks_until_expiry?: number;
8
8
  /** Channel Capacity Tokens */
9
9
  capacity: number;
10
+ /** Channel Closing Transaction */
11
+ close_transaction?: string;
10
12
  /** Channel Closing Transaction Id */
11
13
  close_transaction_id?: string;
12
14
  /** Channel Description */
@@ -23,6 +23,8 @@ const type = 'default';
23
23
 
24
24
  `blocks_until_expiry` is not supported in LND 0.16.4 or before
25
25
 
26
+ `close_transaction` is not supported in LND 0.17.4 or before
27
+
26
28
  {
27
29
  lnd: <Authenticated LND API Object>
28
30
  }
@@ -32,6 +34,7 @@ const type = 'default';
32
34
  pending_channels: [{
33
35
  [blocks_until_expiry]: <Blocks Until Open Channel Expires Number>
34
36
  capacity: <Channel Capacity Tokens Number>
37
+ [close_transaction]: <Channel Closing Raw Transaction Hex String>
35
38
  [close_transaction_id]: <Channel Closing Transaction Id String>
36
39
  [description]: <Channel Description String>
37
40
  is_active: <Channel Is Active Bool>
@@ -80,7 +83,7 @@ module.exports = ({lnd}, cbk) => {
80
83
 
81
84
  // Get pending channels
82
85
  getPending: ['validate', ({}, cbk) => {
83
- return lnd[type][method]({}, (err, res) => {
86
+ return lnd[type][method]({include_raw_tx: true}, (err, res) => {
84
87
  if (!!err) {
85
88
  return cbk([503, 'UnexpectedPendingChannelsErr', {err}]);
86
89
  }
@@ -0,0 +1,20 @@
1
+ import {
2
+ AuthenticatedLightningArgs,
3
+ AuthenticatedLightningMethod,
4
+ } from '../../typescript/shared';
5
+
6
+ export type AddAdvertisedFeature = AuthenticatedLightningArgs<{
7
+ /** BOLT 09 Feature Bit Number */
8
+ feature: number;
9
+ }>;
10
+
11
+ /**
12
+ * Add an advertised feature to the graph node announcement
13
+ *
14
+ * Note: this method is not supported in LND versions 0.14.5 and below
15
+ *
16
+ * Requires LND built with `peersrpc` build tag
17
+ *
18
+ * Requires `peers:write` permissions
19
+ */
20
+ export const addAdvertisedFeature: AuthenticatedLightningMethod<AddAdvertisedFeature>;
@@ -1,3 +1,4 @@
1
+ export * from './add_advertised_feature';
1
2
  export * from './add_external_socket';
2
3
  export * from './add_peer';
3
4
  export * from './get_peers';
@@ -22,6 +22,7 @@ const outpointSeparator = ':';
22
22
  remote_chan_reserve_sat: <Remote Side Channel Reserve Tokens String>
23
23
  remote_node_pub: <Remote Node Public Key Hex String>
24
24
  }
25
+ closing_tx_hex: <Closing Raw Transaction Hex String>
25
26
  closing_txid: <Closing Transaction Id Hex String>
26
27
  limbo_balance: <Tokens Waiting For Resolution String>
27
28
  maturity_height: <Timelock Height Number>
@@ -86,6 +87,7 @@ const outpointSeparator = ':';
86
87
  pending_channels: [{
87
88
  [blocks_until_expiry]: <Blocks Until Open Channel Expires Number>
88
89
  capacity: <Channel Capacity Tokens Number>
90
+ [close_transaction]: <Channel Closing Raw Transaction Hex String>
89
91
  [close_transaction_id]: <Channel Closing Transaction Id String>
90
92
  [description]: <Channel Description String>
91
93
  is_active: <Channel Is Active Bool>
@@ -271,6 +273,7 @@ module.exports = args => {
271
273
  }
272
274
 
273
275
  sum[pending.channel.channel_point] = {
276
+ close_transaction: pending.closing_tx_hex,
274
277
  close_transaction_id: pending.closing_txid,
275
278
  pending_balance: Number(pending.limbo_balance),
276
279
  };
@@ -297,6 +300,7 @@ module.exports = args => {
297
300
  return {
298
301
  blocks_until_expiry: !!chanOpen ? chanOpen.funding_expiry : undefined,
299
302
  capacity: Number(channel.capacity),
303
+ close_transaction: wait.close_transaction || undefined,
300
304
  close_transaction_id: endTx || undefined,
301
305
  description: channel.memo || undefined,
302
306
  is_active: false,
package/package.json CHANGED
@@ -7,9 +7,9 @@
7
7
  "url": "https://github.com/alexbosworth/lightning/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@grpc/grpc-js": "1.10.1",
10
+ "@grpc/grpc-js": "1.10.2",
11
11
  "@grpc/proto-loader": "0.7.10",
12
- "@types/node": "20.11.19",
12
+ "@types/node": "20.11.25",
13
13
  "@types/request": "2.48.12",
14
14
  "@types/ws": "8.5.10",
15
15
  "async": "3.2.5",
@@ -22,12 +22,12 @@
22
22
  "invoices": "3.0.0",
23
23
  "psbt": "3.0.0",
24
24
  "tiny-secp256k1": "2.2.3",
25
- "type-fest": "4.10.2"
25
+ "type-fest": "4.12.0"
26
26
  },
27
27
  "description": "Lightning Network client library",
28
28
  "devDependencies": {
29
- "tsd": "0.30.4",
30
- "typescript": "5.3.3"
29
+ "tsd": "0.30.7",
30
+ "typescript": "5.4.2"
31
31
  },
32
32
  "engines": {
33
33
  "node": ">=18"
@@ -53,5 +53,5 @@
53
53
  "directory": "test/typescript"
54
54
  },
55
55
  "types": "index.d.ts",
56
- "version": "10.6.0"
56
+ "version": "10.7.0"
57
57
  }
@@ -103,6 +103,7 @@ const makeExpectedPending = overrides => {
103
103
  const res = {
104
104
  blocks_until_expiry: undefined,
105
105
  capacity: 1,
106
+ close_transaction: undefined,
106
107
  close_transaction_id: Buffer.alloc(32).toString('hex'),
107
108
  description: undefined,
108
109
  is_active: false,