lightning 10.26.2 → 10.27.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,6 +1,11 @@
1
1
  # Versions
2
2
 
3
- ## 10.26.2
3
+ ## 10.27.0
4
+
5
+ - `getPendingChannels`: Add support for `opening_funding_height`,
6
+ `opening_waiting_blocks`
7
+
8
+ ## 10.26.3
4
9
 
5
10
  - Add support for LND 0.19.3
6
11
 
@@ -341,6 +341,13 @@ service Lightning {
341
341
  */
342
342
  rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice);
343
343
 
344
+ /* lncli: `deletecanceledinvoice`
345
+ DeleteCanceledInvoice removes a canceled invoice from the database. If the
346
+ invoice is not in the canceled state, an error will be returned.
347
+ */
348
+ rpc DeleteCanceledInvoice (DelCanceledInvoiceReq)
349
+ returns (DelCanceledInvoiceResp);
350
+
344
351
  /* lncli: `decodepayreq`
345
352
  DecodePayReq takes an encoded payment request string and attempts to decode
346
353
  it, returning a full description of the conditions encoded within the
@@ -548,9 +555,10 @@ service Lightning {
548
555
  returns (ListPermissionsResponse);
549
556
 
550
557
  /*
551
- CheckMacaroonPermissions checks whether a request follows the constraints
552
- imposed on the macaroon and that the macaroon is authorized to follow the
553
- provided permissions.
558
+ CheckMacaroonPermissions checks whether the provided macaroon contains all
559
+ the provided permissions. If the macaroon is valid (e.g. all caveats are
560
+ satisfied), and all permissions provided in the request are met, then
561
+ this RPC returns true.
554
562
  */
555
563
  rpc CheckMacaroonPermissions (CheckMacPermRequest)
556
564
  returns (CheckMacPermResponse);
@@ -2840,6 +2848,25 @@ message PendingChannelsResponse {
2840
2848
  // very likely canceled the funding and the channel will never become
2841
2849
  // fully operational.
2842
2850
  int32 funding_expiry_blocks = 3;
2851
+
2852
+ // The number of blocks remaining until the channel status changes from
2853
+ // pending to active. A value of 0 indicates that the channel is now
2854
+ // active.
2855
+ //
2856
+ // "Active" here means both channel peers have the channel marked OPEN
2857
+ // and can immediately start using it. For public channels, this does
2858
+ // not imply a channel_announcement has been gossiped. It only becomes
2859
+ // public on the network after 6 on‐chain confirmations.
2860
+ // See BOLT07 "Routing Gossip":
2861
+ // https://github.com/lightning/bolts/blob/master/07-routing-gossip.md
2862
+ //
2863
+ // ZeroConf channels bypass the pending state entirely: they are marked
2864
+ // active immediately upon creation, so they never show up as "pending".
2865
+ uint32 confirmations_until_active = 7;
2866
+
2867
+ // The confirmation height records the block height at which the funding
2868
+ // transaction was first confirmed.
2869
+ uint32 confirmation_height = 8;
2843
2870
  }
2844
2871
 
2845
2872
  message WaitingCloseChannel {
@@ -4233,6 +4260,16 @@ message InvoiceSubscription {
4233
4260
  uint64 settle_index = 2;
4234
4261
  }
4235
4262
 
4263
+ message DelCanceledInvoiceReq {
4264
+ // Invoice payment hash to delete.
4265
+ string invoice_hash = 1;
4266
+ }
4267
+
4268
+ message DelCanceledInvoiceResp {
4269
+ // The status of the delete operation.
4270
+ string status = 1;
4271
+ }
4272
+
4236
4273
  enum PaymentFailureReason {
4237
4274
  /*
4238
4275
  Payment isn't failed (yet).
@@ -5107,9 +5144,37 @@ message Op {
5107
5144
  }
5108
5145
 
5109
5146
  message CheckMacPermRequest {
5147
+ // The macaroon to check permissions for, serialized in binary format. For
5148
+ // a macaroon to be valid, it must have been issued by lnd, must succeed all
5149
+ // caveat conditions, and must contain all of the permissions specified in
5150
+ // the permissions field.
5110
5151
  bytes macaroon = 1;
5152
+
5153
+ // The list of permissions the macaroon should be checked against. Only if
5154
+ // the macaroon contains all of these permissions, it is considered valid.
5155
+ // If the list of permissions given is empty, then the macaroon is
5156
+ // considered valid only based on issuance authority and caveat validity.
5157
+ // An empty list of permissions is therefore equivalent to saying "skip
5158
+ // checking permissions" (unless check_default_perms_from_full_method is
5159
+ // specified).
5111
5160
  repeated MacaroonPermission permissions = 2;
5161
+
5162
+ // The RPC method to check the macaroon against. This is only used if there
5163
+ // are custom `uri:<rpcpackage>.<ServiceName>/<MethodName>` permissions in
5164
+ // the permission list above. To check a macaroon against the list of
5165
+ // permissions of a certain RPC method, query the `ListPermissions` RPC
5166
+ // first, extract the permissions for the method, and then pass them in the
5167
+ // `permissions` field above.
5112
5168
  string fullMethod = 3;
5169
+
5170
+ // If this field is set to true, then the permissions list above MUST be
5171
+ // empty. The default permissions for the provided fullMethod will be used
5172
+ // to check the macaroon. This is equivalent to looking up the permissions
5173
+ // for a method in the `ListPermissions` RPC and then calling this RPC with
5174
+ // the permission list returned from that call. Without this flag, the list
5175
+ // of permissions must be non-empty for the check to actually perform a
5176
+ // permission check.
5177
+ bool check_default_perms_from_full_method = 4;
5113
5178
  }
5114
5179
 
5115
5180
  message CheckMacPermResponse {
@@ -25,6 +25,10 @@ const type = 'default';
25
25
 
26
26
  `close_transaction` is not supported in LND 0.17.5 or before
27
27
 
28
+ `opening_funding_height` is not supported in LND 0.19.3 or before
29
+
30
+ `opening_waiting_blocks` is not supported in LND 0.19.3 or before
31
+
28
32
  {
29
33
  lnd: <Authenticated LND API Object>
30
34
  }
@@ -45,6 +49,8 @@ const type = 'default';
45
49
  is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
46
50
  local_balance: <Channel Local Tokens Balance Number>
47
51
  local_reserve: <Channel Local Reserved Tokens Number>
52
+ [opening_funding_height]: <Funding Seen At Best Block Height Number>
53
+ [opening_waiting_blocks]: <Open Activation Waiting Blocks Count Number>
48
54
  partner_public_key: <Channel Peer Public Key String>
49
55
  [pending_balance]: <Tokens Pending Recovery Number>
50
56
  [pending_payments]: [{
@@ -41,6 +41,8 @@ const outpointSeparator = ':';
41
41
  capacity: <Channel Capacity Tokens Count String>
42
42
  channel_point: <Channel Outpoint String>
43
43
  commitment_type: <Type of Channel String>
44
+ confirmation_height: <Best Chain Block Height Funding Seen Number>
45
+ confirmations_until_active: <Blocks Remaining to Channel Active Number>
44
46
  initiator: <Channel Creator Status String>
45
47
  local_balance: <Local Balance Tokens String>
46
48
  local_chan_reserve_sat: <Local Side Channel Reserve Tokens String>
@@ -97,6 +99,8 @@ const outpointSeparator = ':';
97
99
  is_timelocked: <Channel Local Funds Constrained by Timelock Script Bool>
98
100
  local_balance: <Channel Local Tokens Balance Number>
99
101
  local_reserve: <Channel Local Reserved Tokens Number>
102
+ [opening_funding_height]: <Funding Seen At Best Block Height Number>
103
+ [opening_waiting_blocks]: <Open Activation Waiting Blocks Count Number>
100
104
  partner_public_key: <Channel Peer Public Key String>
101
105
  [pending_balance]: <Tokens Pending Recovery Number>
102
106
  [pending_payments]: [{
@@ -247,6 +251,8 @@ module.exports = args => {
247
251
 
248
252
  sum[pending.channel.channel_point] = {
249
253
  funding_expiry: Number(pending.funding_expiry_blocks) || undefined,
254
+ open_blocks: Number(pending.confirmations_until_active) || undefined,
255
+ open_height: Number(pending.confirmation_height) || undefined,
250
256
  transaction_fee: Number(pending.commit_fee),
251
257
  transaction_weight: Number(pending.commit_weight),
252
258
  };
@@ -311,6 +317,8 @@ module.exports = args => {
311
317
  is_timelocked: forced.timelock_blocks !== undefined,
312
318
  local_balance: Number(channel.local_balance),
313
319
  local_reserve: Number(channel.local_chan_reserve_sat),
320
+ opening_funding_height: !chanOpen ? undefined : chanOpen.open_height,
321
+ opening_waiting_blocks: !chanOpen ? undefined : chanOpen.open_blocks,
314
322
  partner_public_key: channel.remote_node_pub,
315
323
  pending_balance: pendingTokens || undefined,
316
324
  pending_payments: forced.pending_payments || undefined,
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.13.4",
10
+ "@grpc/grpc-js": "1.14.0",
11
11
  "@grpc/proto-loader": "0.8.0",
12
- "@types/node": "24.3.0",
12
+ "@types/node": "24.5.2",
13
13
  "@types/request": "2.48.13",
14
14
  "@types/ws": "8.18.1",
15
15
  "async": "3.2.6",
@@ -22,7 +22,7 @@
22
22
  "invoices": "4.0.0",
23
23
  "psbt": "4.0.0",
24
24
  "tiny-secp256k1": "2.2.4",
25
- "type-fest": "4.41.0"
25
+ "type-fest": "5.0.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.26.2"
56
+ "version": "10.27.0"
57
57
  }
@@ -57,7 +57,8 @@ const makePendingForceClosingChannel = overrides => {
57
57
  const makePendingOpenChannel = overrides => {
58
58
  const res = {
59
59
  channel: makeChannel({}),
60
- confirmation_height: 1,
60
+ confirmation_height: 0,
61
+ confirmations_until_active: 0,
61
62
  commit_fee: '1',
62
63
  commit_weight: '1',
63
64
  fee_per_kw: '1',
@@ -114,6 +115,8 @@ const makeExpectedPending = overrides => {
114
115
  is_timelocked: true,
115
116
  local_balance: 1,
116
117
  local_reserve: 1,
118
+ opening_funding_height: undefined,
119
+ opening_waiting_blocks: undefined,
117
120
  partner_public_key: Buffer.alloc(33).toString('hex'),
118
121
  pending_balance: 1,
119
122
  pending_payments: [{
@@ -438,6 +441,36 @@ const tests = [
438
441
  ],
439
442
  }),
440
443
  },
444
+ {
445
+ args: makeArgs({
446
+ pending_force_closing_channels: [],
447
+ pending_open_channels: [
448
+ makePendingOpenChannel({
449
+ confirmation_height: 1,
450
+ confirmations_until_active: 3,
451
+ }),
452
+ ],
453
+ waiting_close_channels: [],
454
+ }),
455
+ description: 'Pending open channels are mapped',
456
+ expected: makeExpected({
457
+ pending_channels: [
458
+ makeExpectedPending({
459
+ close_transaction_id: undefined,
460
+ is_closing: false,
461
+ is_opening: true,
462
+ is_timelocked: false,
463
+ opening_funding_height: 1,
464
+ opening_waiting_blocks: 3,
465
+ pending_balance: undefined,
466
+ pending_payments: undefined,
467
+ recovered_tokens: undefined,
468
+ timelock_blocks: undefined,
469
+ timelock_expiration: undefined,
470
+ }),
471
+ ],
472
+ }),
473
+ },
441
474
  ];
442
475
 
443
476
  tests.forEach(({args, description, error, expected}) => {