lightning 10.4.0 → 10.5.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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 10.5.0
4
+
5
+ - `getSweepTransactions`: Add `after` to scope sweep result set
6
+
3
7
  ## 10.4.0
4
8
 
5
9
  - `getConnectedWatchtowers`: Add `is_taproot` to get P2TR channels
@@ -1,10 +1,10 @@
1
1
  syntax = "proto3";
2
2
 
3
+ package walletrpc;
4
+
3
5
  import "lightning.proto";
4
6
  import "signer.proto";
5
7
 
6
- package walletrpc;
7
-
8
8
  option go_package = "github.com/lightningnetwork/lnd/lnrpc/walletrpc";
9
9
 
10
10
  /*
@@ -976,6 +976,91 @@ enum WitnessType {
976
976
  to an output which is under complete control of the backing wallet.
977
977
  */
978
978
  TAPROOT_PUB_KEY_SPEND = 22;
979
+
980
+ /*
981
+ A witness type that allows us to spend our settled local commitment after a
982
+ CSV delay when we force close the channel.
983
+ */
984
+ TAPROOT_LOCAL_COMMIT_SPEND = 23;
985
+
986
+ /*
987
+ A witness type that allows us to spend our settled local commitment after
988
+ a CSV delay when the remote party has force closed the channel.
989
+ */
990
+ TAPROOT_REMOTE_COMMIT_SPEND = 24;
991
+
992
+ /*
993
+ A witness type that we'll use for spending our own anchor output.
994
+ */
995
+ TAPROOT_ANCHOR_SWEEP_SPEND = 25;
996
+
997
+ /*
998
+ A witness that allows us to timeout an HTLC we offered to the remote party
999
+ on our commitment transaction. We use this when we need to go on chain to
1000
+ time out an HTLC.
1001
+ */
1002
+ TAPROOT_HTLC_OFFERED_TIMEOUT_SECOND_LEVEL = 26;
1003
+
1004
+ /*
1005
+ A witness type that allows us to sweep an HTLC we accepted on our commitment
1006
+ transaction after we go to the second level on chain.
1007
+ */
1008
+ TAPROOT_HTLC_ACCEPTED_SUCCESS_SECOND_LEVEL = 27;
1009
+
1010
+ /*
1011
+ A witness that allows us to sweep an HTLC on the revoked transaction of the
1012
+ remote party that goes to the second level.
1013
+ */
1014
+ TAPROOT_HTLC_SECOND_LEVEL_REVOKE = 28;
1015
+
1016
+ /*
1017
+ A witness that allows us to sweep an HTLC sent to us by the remote party
1018
+ in the event that they broadcast a revoked state.
1019
+ */
1020
+ TAPROOT_HTLC_ACCEPTED_REVOKE = 29;
1021
+
1022
+ /*
1023
+ A witness that allows us to sweep an HTLC we offered to the remote party if
1024
+ they broadcast a revoked commitment.
1025
+ */
1026
+ TAPROOT_HTLC_OFFERED_REVOKE = 30;
1027
+
1028
+ /*
1029
+ A witness that allows us to sweep an HTLC we offered to the remote party
1030
+ that lies on the commitment transaction for the remote party. We can spend
1031
+ this output after the absolute CLTV timeout of the HTLC as passed.
1032
+ */
1033
+ TAPROOT_HTLC_OFFERED_REMOTE_TIMEOUT = 31;
1034
+
1035
+ /*
1036
+ A witness type that allows us to sign the second level HTLC timeout
1037
+ transaction when spending from an HTLC residing on our local commitment
1038
+ transaction.
1039
+ This is used by the sweeper to re-sign inputs if it needs to aggregate
1040
+ several second level HTLCs.
1041
+ */
1042
+ TAPROOT_HTLC_LOCAL_OFFERED_TIMEOUT = 32;
1043
+
1044
+ /*
1045
+ A witness that allows us to sweep an HTLC that was offered to us by the
1046
+ remote party for a taproot channels. We use this witness in the case that
1047
+ the remote party goes to chain, and we know the pre-image to the HTLC. We
1048
+ can sweep this without any additional timeout.
1049
+ */
1050
+ TAPROOT_HTLC_ACCEPTED_REMOTE_SUCCESS = 33;
1051
+
1052
+ /*
1053
+ A witness type that allows us to sweep the HTLC offered to us on our local
1054
+ commitment transaction. We'll use this when we need to go on chain to sweep
1055
+ the HTLC. In this case, this is the second level HTLC success transaction.
1056
+ */
1057
+ TAPROOT_HTLC_ACCEPTED_LOCAL_SUCCESS = 34;
1058
+
1059
+ /*
1060
+ A witness that allows us to sweep the settled output of a malicious
1061
+ counterparty's who broadcasts a revoked taproot commitment transaction.
1062
+ */
1063
+ TAPROOT_COMMITMENT_REVOKE = 35;
979
1064
  }
980
1065
 
981
1066
  message PendingSweep {
@@ -1078,6 +1163,13 @@ message ListSweepsRequest {
1078
1163
  replaced-by-fee, so will not be included in this output.
1079
1164
  */
1080
1165
  bool verbose = 1;
1166
+
1167
+ /*
1168
+ The start height to use when fetching sweeps. If not specified (0), the
1169
+ result will start from the earliest sweep. If set to -1 the result will
1170
+ only include unconfirmed sweeps (at the time of the call).
1171
+ */
1172
+ int32 start_height = 2;
1081
1173
  }
1082
1174
 
1083
1175
  message ListSweepsResponse {
@@ -22,7 +22,7 @@ export type GetConfigurationResult = {
22
22
  * Requires `info:read`, `offchain:read`, `onchain:read`, `peers:read`
23
23
  permissions
24
24
  *
25
- * This method is not supported on LND 0.17.3 and below
25
+ * This method is not supported on LND 0.17.4 and below
26
26
  */
27
27
  export const getConfiguration: AuthenticatedLightningMethod<
28
28
  GetConfigurationArgs,
@@ -17,7 +17,7 @@ const {values} = Object;
17
17
  Requires `info:read`, `offchain:read`, `onchain:read`, `peers:read`
18
18
  permissions
19
19
 
20
- This method is not supported on LND 0.17.3 and below
20
+ This method is not supported on LND 0.17.4 and below
21
21
 
22
22
  {
23
23
  lnd: <Authenticated LND API Object>
@@ -56,7 +56,7 @@ export type GetConnectedWatchTowersResult = {
56
56
  *
57
57
  * `is_anchor` flag is not supported on LND 0.11.1 and below
58
58
  *
59
- * `is_taproot` flag is not supported on LND 0.17.3 and below
59
+ * `is_taproot` flag is not supported on LND 0.17.4 and below
60
60
  */
61
61
  export const getConnectedWatchtowers: AuthenticatedLightningMethod<
62
62
  GetConnectedWatchTowersArgs,
@@ -18,7 +18,7 @@ const unimplementedError = '12 UNIMPLEMENTED: unknown service wtclientrpc.Watcht
18
18
 
19
19
  `is_anchor` flag is not supported on LND 0.11.1 and below
20
20
 
21
- `is_taproot` flag is not supported on LND 0.17.3 and below
21
+ `is_taproot` flag is not supported on LND 0.17.4 and below
22
22
 
23
23
  {
24
24
  [is_anchor]: <Get Anchor Type Tower Info Bool>
@@ -14,6 +14,6 @@ export type DeleteChainTransactionArgs = AuthenticatedLightningArgs<{
14
14
  *
15
15
  * Requires `onchain:write` permission
16
16
  *
17
- * This method is not supported on LND 0.17.3 and below
17
+ * This method is not supported on LND 0.17.4 and below
18
18
  */
19
19
  export const deleteChainTransaction: AuthenticatedLightningMethod<DeleteChainTransactionArgs>;
@@ -13,7 +13,7 @@ const type = 'wallet';
13
13
 
14
14
  Requires `onchain:write` permission
15
15
 
16
- This method is not supported on LND 0.17.3 and below
16
+ This method is not supported on LND 0.17.4 and below
17
17
 
18
18
  {
19
19
  id: <Transaction Id Hex String>
@@ -16,7 +16,7 @@ export type GetChainTransactionResult = ChainTransaction;
16
16
  *
17
17
  * Requires `onchain:read` permission
18
18
  *
19
- * This method is not supported on LND 0.17.3 and below
19
+ * This method is not supported on LND 0.17.4 and below
20
20
  */
21
21
  export const getChainTransaction: AuthenticatedLightningMethod<
22
22
  GetChainTransactionArgs,
@@ -13,7 +13,7 @@ const type = 'wallet';
13
13
 
14
14
  Requires `onchain:read` permission
15
15
 
16
- This method is not supported on LND 0.17.3 and below
16
+ This method is not supported on LND 0.17.4 and below
17
17
 
18
18
  {
19
19
  id: <Transaction Id Hex String>
@@ -3,7 +3,10 @@ import {
3
3
  AuthenticatedLightningMethod,
4
4
  } from '../../typescript';
5
5
 
6
- export type GetSweepTransactionArgs = AuthenticatedLightningArgs;
6
+ export type GetSweepTransactionArgs = AuthenticatedLightningArgs<{
7
+ /** Confirmed After Block Height */
8
+ after?: number;
9
+ }>;
7
10
 
8
11
  export type GetSweepTransactionsResult = {
9
12
  transactions: {
@@ -44,6 +47,10 @@ export type GetSweepTransactionsResult = {
44
47
  * Get self-transfer spend transactions related to channel closes
45
48
  *
46
49
  * Requires `onchain:read` permission
50
+ *
51
+ * Requires LND built with `walletrpc` build tag
52
+ *
53
+ * `after` is not supported in LND 0.17.3 or below
47
54
  */
48
55
  export const getSweepTransactions: AuthenticatedLightningMethod<
49
56
  GetSweepTransactionArgs,
@@ -17,7 +17,10 @@ const type = 'wallet';
17
17
 
18
18
  Requires LND built with `walletrpc` build tag
19
19
 
20
+ `after` is not supported in LND 0.17.3 or below
21
+
20
22
  {
23
+ [after]: <Confirmed After Block Height Number>
21
24
  lnd: <Authenticated LND API Object>
22
25
  }
23
26
 
@@ -43,7 +46,7 @@ const type = 'wallet';
43
46
  }]
44
47
  }
45
48
  */
46
- module.exports = ({lnd}, cbk) => {
49
+ module.exports = ({after, lnd}, cbk) => {
47
50
  return new Promise((resolve, reject) => {
48
51
  return asyncAuto({
49
52
  // Check arguments
@@ -57,7 +60,7 @@ module.exports = ({lnd}, cbk) => {
57
60
 
58
61
  // Get sweep transaction ids
59
62
  getSweeps: ['validate', ({}, cbk) => {
60
- return lnd[type][method]({}, (err, res) => {
63
+ return lnd[type][method]({start_height: after}, (err, res) => {
61
64
  if (!!err && err.details === notSupportedError) {
62
65
  return cbk([501, 'BackingLndDoesNotSupportListingSweeps']);
63
66
  }
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.9.14",
10
+ "@grpc/grpc-js": "1.10.0",
11
11
  "@grpc/proto-loader": "0.7.10",
12
- "@types/node": "20.11.5",
12
+ "@types/node": "20.11.16",
13
13
  "@types/request": "2.48.12",
14
14
  "@types/ws": "8.5.10",
15
15
  "async": "3.2.5",
@@ -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.10.0"
25
+ "type-fest": "4.10.2"
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.4.0"
56
+ "version": "10.5.0"
57
57
  }