lightning 6.2.4 → 6.2.6

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
+ ## 6.2.6
4
+
5
+ - `getWalletInfo`: Add support for LND 0.15.4
6
+
7
+ ## 6.2.5
8
+
9
+ - Fix errors with LND API changes to HTLC events
10
+
3
11
  ## 6.2.4
4
12
 
5
13
  - `getWalletInfo`: Add support for LND 0.15.3
@@ -618,6 +618,8 @@ message HtlcEvent {
618
618
  ForwardFailEvent forward_fail_event = 8;
619
619
  SettleEvent settle_event = 9;
620
620
  LinkFailEvent link_fail_event = 10;
621
+ SubscribedEvent subscribed_event = 11;
622
+ FinalHtlcEvent final_htlc_event = 12;
621
623
  }
622
624
  }
623
625
 
@@ -648,6 +650,14 @@ message SettleEvent {
648
650
  bytes preimage = 1;
649
651
  }
650
652
 
653
+ message FinalHtlcEvent {
654
+ bool settled = 1;
655
+ bool offchain = 2;
656
+ }
657
+
658
+ message SubscribedEvent {
659
+ }
660
+
651
661
  message LinkFailEvent {
652
662
  // Info contains details about the htlc that we failed.
653
663
  HtlcInfo info = 1;
@@ -792,6 +802,10 @@ message ForwardHtlcInterceptRequest {
792
802
 
793
803
  // The onion blob for the next hop
794
804
  bytes onion_blob = 9;
805
+
806
+ // The block height at which this htlc will be auto-failed to prevent the
807
+ // channel from force-closing.
808
+ int32 auto_fail_height = 10;
795
809
  }
796
810
 
797
811
  /**
@@ -32,6 +32,7 @@
32
32
  "7f34774529fa0964d47fc418d4d2965435cbfdc0": "0.11.1-beta",
33
33
  "86d3dec7b939b21bb10f2cd1ff56970c392a1c69": "0.13.2-beta",
34
34
  "86114c575c2dff9dff1e1bb4df961c64aea9fc1c": "0.10.4-beta",
35
+ "96fe51e2e5c2ee0c97909499e0e96a3d3755757e": "0.15.4-beta",
35
36
  "aff2ed3a6a118d664049835c325a5b69e977172f": "0.15.2-beta",
36
37
  "b4e7131bdb47531ad2f00ce345ddcdb58935bba5": "0.15.3-beta",
37
38
  "bd0c46b4fcb027af1915bd67a3da70e8ca5c6efe": "0.14.3-beta",
@@ -3,6 +3,7 @@ const {returnResult} = require('asyncjs-util');
3
3
 
4
4
  const {isLnd} = require('./../../lnd_requests');
5
5
 
6
+ const errorMessageNotFound = 'tower not found';
6
7
  const hexAsBuffer = hex => Buffer.from(hex, 'hex');
7
8
  const method = 'removeTower';
8
9
  const type = 'tower_client';
@@ -47,6 +48,11 @@ module.exports = (args, cbk) => {
47
48
  return cbk([501, 'ExpectedLndWithWtclientrpcTagToDisconnect']);
48
49
  }
49
50
 
51
+ // Exit early when the tower is already not present
52
+ if (!!err && err.details === errorMessageNotFound) {
53
+ return cbk();
54
+ }
55
+
50
56
  if (!!err) {
51
57
  return cbk([503, 'UnexpectedErrDisconnectingWatchtower', {err}]);
52
58
  }
@@ -71,6 +71,15 @@ module.exports = ({lnd}) => {
71
71
  const sub = lnd[type][method]({});
72
72
 
73
73
  sub.on('data', data => {
74
+ // Exit early on subscribed events
75
+ if (!!data && !!data.subscribed_event) {
76
+ return;
77
+ }
78
+
79
+ if (!!data && !!data.final_htlc_event) {
80
+ return;
81
+ }
82
+
74
83
  try {
75
84
  emitter.emit(event, forwardFromHtlcEvent(data));
76
85
  } catch (err) {
@@ -81,6 +81,15 @@ module.exports = ({lnd}) => {
81
81
  const emitErr = emitSubscriptionError({emitter, subscription: sub});
82
82
 
83
83
  sub.on('data', data => {
84
+ // Exit early on subscribed events
85
+ if (!!data && !!data.subscribed_event) {
86
+ return;
87
+ }
88
+
89
+ if (!!data && !!data.final_htlc_event) {
90
+ return;
91
+ }
92
+
84
93
  try {
85
94
  const htlc = forwardFromHtlcEvent(data);
86
95
 
@@ -17,6 +17,6 @@ export type SubscribeToPaymentsPaymentEvent =
17
17
  *
18
18
  * Requires `offchain:read` permission
19
19
  *
20
- * Note: Method not supported on LND 0.15.3 and below
20
+ * Note: Method not supported on LND 0.15.4 and below
21
21
  */
22
22
  export const subscribeToPayments: AuthenticatedLightningSubscription<SubscribeToPaymentsArgs>;
@@ -13,7 +13,7 @@ const type = 'router';
13
13
 
14
14
  Requires `offchain:read` permission
15
15
 
16
- Note: Method not supported on LND 0.15.3 and below
16
+ Note: Method not supported on LND 0.15.4 and below
17
17
 
18
18
  {
19
19
  lnd: <Authenticated LND API Object>
@@ -50,8 +50,8 @@ export type OpenChannelResult = {
50
50
  *
51
51
  * External funding requires LND compiled with `walletrpc` build tag
52
52
  *
53
- * `base_fee_mtokens` is not supported on LND 0.15.3 and below
54
- * `fee_rate` is not supported on LND 0.15.3 and below
53
+ * `base_fee_mtokens` is not supported on LND 0.15.4 and below
54
+ * `fee_rate` is not supported on LND 0.15.4 and below
55
55
  */
56
56
  export const openChannel: AuthenticatedLightningMethod<
57
57
  OpenChannelArgs,
@@ -20,8 +20,8 @@ const type = 'default';
20
20
 
21
21
  External funding requires LND compiled with `walletrpc` build tag
22
22
 
23
- `base_fee_mtokens` is not supported on LND 0.15.3 and below
24
- `fee_rate` is not supported on LND 0.15.3 and below
23
+ `base_fee_mtokens` is not supported on LND 0.15.4 and below
24
+ `fee_rate` is not supported on LND 0.15.4 and below
25
25
 
26
26
  {
27
27
  [base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
@@ -56,8 +56,8 @@ channel that was not funded.
56
56
  `--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
57
57
  as well as a channel open request listener to accept the trusted funding.
58
58
 
59
- * `base_fee_mtokens` is not supported on LND 0.15.3 and below
60
- * `fee_rate` is not supported on LND 0.15.3 and below
59
+ * `base_fee_mtokens` is not supported on LND 0.15.4 and below
60
+ * `fee_rate` is not supported on LND 0.15.4 and below
61
61
  */
62
62
  export const openChannels: AuthenticatedLightningMethod<
63
63
  OpenChannelsArgs,
@@ -37,8 +37,8 @@ const type = 'default';
37
37
  `--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
38
38
  as well as a channel open request listener to accept the trusted funding.
39
39
 
40
- `base_fee_mtokens` is not supported on LND 0.15.3 and below
41
- `fee_rate` is not supported on LND 0.15.3 and below
40
+ `base_fee_mtokens` is not supported on LND 0.15.4 and below
41
+ `fee_rate` is not supported on LND 0.15.4 and below
42
42
 
43
43
  {
44
44
  channels: [{
package/package.json CHANGED
@@ -7,10 +7,10 @@
7
7
  "url": "https://github.com/alexbosworth/lightning/issues"
8
8
  },
9
9
  "dependencies": {
10
- "@grpc/grpc-js": "1.7.2",
10
+ "@grpc/grpc-js": "1.7.3",
11
11
  "@grpc/proto-loader": "0.7.3",
12
12
  "@types/express": "4.17.14",
13
- "@types/node": "18.11.2",
13
+ "@types/node": "18.11.9",
14
14
  "@types/request": "2.48.8",
15
15
  "@types/ws": "8.5.3",
16
16
  "async": "3.2.4",
@@ -19,7 +19,7 @@
19
19
  "bn.js": "5.2.1",
20
20
  "body-parser": "1.20.1",
21
21
  "bolt07": "1.8.2",
22
- "bolt09": "0.2.3",
22
+ "bolt09": "0.2.4",
23
23
  "cbor": "8.1.0",
24
24
  "ecpair": "2.1.0",
25
25
  "express": "4.18.2",
@@ -34,7 +34,7 @@
34
34
  "@alexbosworth/tap": "15.0.11",
35
35
  "tsd": "0.24.1",
36
36
  "typescript": "4.8.4",
37
- "ws": "8.9.0"
37
+ "ws": "8.10.0"
38
38
  },
39
39
  "engines": {
40
40
  "node": ">=14"
@@ -59,5 +59,5 @@
59
59
  "directory": "test/typescript"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "6.2.4"
62
+ "version": "6.2.6"
63
63
  }