lightning 9.11.3 → 9.13.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
+ ## 9.13.0
4
+
5
+ - `openChannels`: Add `is_simplified_taproot` to make a simplified taproot chan
6
+
7
+ ## 9.12.0
8
+
9
+ - `openChannel`: Add `is_simplified_taproot` to make a simplified taproot chan
10
+
3
11
  ## 9.11.3
4
12
 
5
13
  - `openChannel`: Add `inputs` to select inputs for channel open funding
@@ -1352,6 +1352,13 @@ enum CommitmentType {
1352
1352
  channel before its maturity date.
1353
1353
  */
1354
1354
  SCRIPT_ENFORCED_LEASE = 4;
1355
+
1356
+ /*
1357
+ A channel that uses musig2 for the funding output, and the new tapscript
1358
+ features where relevant.
1359
+ */
1360
+ // TODO(roasbeef): need script enforce mirror type for the above as well?
1361
+ SIMPLE_TAPROOT = 5;
1355
1362
  }
1356
1363
 
1357
1364
  message ChannelConstraints {
@@ -2828,6 +2835,9 @@ message WalletAccountBalance {
2828
2835
  }
2829
2836
 
2830
2837
  message WalletBalanceRequest {
2838
+ // The wallet account the balance is shown for.
2839
+ // If this is not specified, the balance of the "default" account is shown.
2840
+ string account = 1;
2831
2841
  }
2832
2842
 
2833
2843
  message WalletBalanceResponse {
@@ -28,6 +28,8 @@ export type ChannelOpenOptions = {
28
28
  is_max_funding?: boolean;
29
29
  /** Channel is Private */
30
30
  is_private?: boolean;
31
+ /** Create Simplified Taproot Type Channel */
32
+ is_simplified_taproot?: boolean;
31
33
  /** Peer Should Avoid Waiting For Confirmation */
32
34
  is_trusted_funding?: boolean;
33
35
  /** Local Tokens */
@@ -11,6 +11,7 @@ const errMemoLength = /^provided memo \(.*\) is of length \d*, exceeds (\d*)$/;
11
11
  const {isArray} = Array;
12
12
  const minChannelTokens = 20000;
13
13
  const method = 'openChannel';
14
+ const simplifiedTaprootChannelType = 'SIMPLE_TAPROOT';
14
15
  const type = 'default';
15
16
 
16
17
  /** Open a new channel.
@@ -36,6 +37,9 @@ const type = 'default';
36
37
 
37
38
  `inputs` is not supported on LND 0.16.4 and below
38
39
 
40
+ `is_simplified_taproot` is not supported on LND 0.16.4 and below and requires
41
+ `--protocol.simple-taproot-chans` set on both sides.
42
+
39
43
  {
40
44
  [base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
41
45
  [chain_fee_tokens_per_vbyte]: <Chain Fee Tokens Per VByte Number>
@@ -49,6 +53,7 @@ const type = 'default';
49
53
  }]
50
54
  [is_max_funding]: <Use Maximal Chain Funds For Local Funding Bool>
51
55
  [is_private]: <Channel is Private Bool> // Defaults to false
56
+ [is_simplified_taproot]: <Channel is Simplified Taproot Type Bool>
52
57
  [is_trusted_funding]: <Accept Funding as Trusted Bool>
53
58
  lnd: <Authenticated LND API Object>
54
59
  [local_tokens]: <Total Channel Capacity Tokens Number>
@@ -171,6 +176,10 @@ module.exports = (args, cbk) => {
171
176
  options.push_sat = args.give_tokens;
172
177
  }
173
178
 
179
+ if (!!args.is_simplified_taproot) {
180
+ options.commitment_type = simplifiedTaprootChannelType;
181
+ }
182
+
174
183
  const channelOpen = args.lnd.default.openChannel(options);
175
184
 
176
185
  channelOpen.on('data', chan => {
@@ -18,6 +18,7 @@ const isPublicKey = n => /^[0-9A-F]{66}$/i.test(n);
18
18
  const makeId = () => randomBytes(32);
19
19
  const method = 'openChannel';
20
20
  const notEnoughOutputs = 'not enough witness outputs to create funding';
21
+ const taproot = 'SIMPLE_TAPROOT';
21
22
  const type = 'default';
22
23
 
23
24
  /** Open one or more channels
@@ -42,6 +43,9 @@ const type = 'default';
42
43
 
43
44
  `description` is not supported on LND 0.16.4 and below
44
45
 
46
+ `is_simplified_taproot` is not supported on LND 0.16.4 and below and requires
47
+ `--protocol.simple-taproot-chans` set on both sides.
48
+
45
49
  {
46
50
  channels: [{
47
51
  [base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
@@ -51,6 +55,7 @@ const type = 'default';
51
55
  [fee_rate]: <Routing Fee Rate In Millitokens Per Million Number>
52
56
  [give_tokens]: <Tokens to Gift To Partner Number> // Defaults to zero
53
57
  [is_private]: <Channel is Private Bool> // Defaults to false
58
+ [is_simplified_taproot]: <Channel is Simplified Taproot Type Bool>
54
59
  [is_trusted_funding]: <Peer Should Avoid Waiting For Confirmation Bool>
55
60
  [min_htlc_mtokens]: <Minimum HTLC Millitokens String>
56
61
  [partner_csv_delay]: <Peer Output CSV Delay Number>
@@ -108,6 +113,7 @@ module.exports = (args, cbk) => {
108
113
  cooperative_close_address: channel.cooperative_close_address,
109
114
  give_tokens: channel.give_tokens,
110
115
  is_private: channel.is_private,
116
+ is_simplified_taproot: channel.is_simplified_taproot,
111
117
  is_trusted_funding: channel.is_trusted_funding,
112
118
  min_htlc_mtokens: channel.min_htlc_mtokens,
113
119
  partner_public_key: channel.partner_public_key,
@@ -120,13 +126,16 @@ module.exports = (args, cbk) => {
120
126
  const [lastChannel] = toOpen.map(n => n.id).reverse();
121
127
 
122
128
  return asyncMap(toOpen, (channel, cbk) => {
129
+ const baseType = !!channel.is_trusted_funding ? anchors : undefined;
123
130
  let isDone = false;
124
131
  const isSelfPublish = !!args.is_avoiding_broadcast;
125
132
 
133
+ const commit = !!channel.is_simplified_taproot ? taproot : baseType;
134
+
126
135
  const channelOpen = args.lnd[type][method]({
127
136
  base_fee: channel.base_fee_mtokens || undefined,
128
137
  close_address: channel.cooperative_close_address || undefined,
129
- commitment_type: channel.is_trusted_funding ? anchors : undefined,
138
+ commitment_type: commit,
130
139
  fee_rate: channel.fee_rate,
131
140
  funding_shim: {
132
141
  psbt_shim: {
@@ -18,10 +18,12 @@
18
18
  "ANCHORS": "anchor",
19
19
  "LEGACY": "original",
20
20
  "SCRIPT_ENFORCED_LEASE": "anchor_with_lease_constraint",
21
+ "SIMPLE_TAPROOT": "simplified_taproot",
21
22
  "STATIC_REMOTE_KEY": "original_with_static_to_remote"
22
23
  },
23
24
  "commitmentTypes": {
24
25
  "anchor": "ANCHORS",
26
+ "simplified_taproot": "SIMPLE_TAPROOT",
25
27
  "static_remote_key": "STATIC_REMOTE_KEY",
26
28
  "variable_remote_key": "LEGACY"
27
29
  },
package/package.json CHANGED
@@ -8,9 +8,9 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@grpc/grpc-js": "1.9.1",
11
- "@grpc/proto-loader": "0.7.8",
11
+ "@grpc/proto-loader": "0.7.9",
12
12
  "@types/express": "4.17.17",
13
- "@types/node": "20.5.3",
13
+ "@types/node": "20.5.7",
14
14
  "@types/request": "2.48.8",
15
15
  "@types/ws": "8.5.5",
16
16
  "async": "3.2.4",
@@ -26,13 +26,13 @@
26
26
  "invoices": "3.0.0",
27
27
  "psbt": "3.0.0",
28
28
  "tiny-secp256k1": "2.2.3",
29
- "type-fest": "4.2.0"
29
+ "type-fest": "4.3.1"
30
30
  },
31
31
  "description": "Lightning Network client library",
32
32
  "devDependencies": {
33
33
  "@alexbosworth/node-fetch": "2.6.2",
34
- "tsd": "0.28.1",
35
- "typescript": "5.1.6",
34
+ "tsd": "0.29.0",
35
+ "typescript": "5.2.2",
36
36
  "ws": "8.13.0"
37
37
  },
38
38
  "engines": {
@@ -59,5 +59,5 @@
59
59
  "directory": "test/typescript"
60
60
  },
61
61
  "types": "index.d.ts",
62
- "version": "9.11.3"
62
+ "version": "9.13.0"
63
63
  }