ln-service 53.9.3 → 53.11.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,16 @@
1
1
  # Versions
2
2
 
3
- ## 53.9.3
3
+ ## 53.11.0
4
+
5
+ - Use TLV for all hops when sending HTLCs along routes
6
+ - `signTransaction`: Add `spending` attribute for specifying external inputs
7
+
8
+ ## 53.10.0
9
+
10
+ - `createChainAddress`: Add support for creating P2TR addresses
11
+ - `getUtxos`: Add support for showing P2TR address types
12
+
13
+ ## 53.9.4
4
14
 
5
15
  - `getPendingPayments`: Add method to get payments in flight
6
16
 
package/README.md CHANGED
@@ -514,12 +514,19 @@ Create a new receive address.
514
514
 
515
515
  Requires `address:write` permission
516
516
 
517
+ LND 0.14.3 and below do not support p2tr addresses
518
+
517
519
  {
518
- [format]: <Receive Address Type String> // "np2wpkh" || "p2wpkh"
520
+ [format]: <Receive Address Type String> // "np2wpkh" || "p2tr" || "p2wpkh"
519
521
  [is_unused]: <Get As-Yet Unused Address Bool>
520
522
  lnd: <Authenticated LND API Object>
521
523
  }
522
524
 
525
+ @returns via cbk or Promise
526
+ {
527
+ address: <Chain Address String>
528
+ }
529
+
523
530
  Example:
524
531
 
525
532
  ```node
@@ -3530,7 +3537,7 @@ Requires `onchain:write` permission
3530
3537
 
3531
3538
  Requires LND built with `walletrpc` tag
3532
3539
 
3533
- This method is not supported in LND 0.14.2 and below
3540
+ This method is not supported in LND 0.14.3 and below
3534
3541
 
3535
3542
  {
3536
3543
  lnd: <Authenticated LND API Object>
@@ -3685,7 +3692,7 @@ Requires `offchain:write` permission
3685
3692
  [outgoing_channels]: [<Pay Out of Outgoing Channel Ids String>]
3686
3693
  [pathfinding_timeout]: <Time to Spend Finding a Route Milliseconds Number>
3687
3694
  [payment]: <Payment Identifier Hex String>
3688
- routes: [[{
3695
+ [routes]: [[{
3689
3696
  [base_fee_mtokens]: <Base Routing Fee In Millitokens String>
3690
3697
  [channel]: <Standard Format Channel Id String>
3691
3698
  [cltv_delta]: <CLTV Blocks Delta Number>
@@ -4614,10 +4621,14 @@ const {transaction} = await signPsbt({lnd, psbt});
4614
4621
 
4615
4622
  Sign transaction
4616
4623
 
4617
- Requires LND built with `signerrpc` build tag
4624
+ `spending` is required for non-internal inputs for a Taproot signature
4625
+
4626
+ Requires LND built with `signrpc` build tag
4618
4627
 
4619
4628
  Requires `signer:generate` permission
4620
4629
 
4630
+ `spending` is not supported in LND 0.14.3 and below
4631
+
4621
4632
  {
4622
4633
  inputs: [{
4623
4634
  key_family: <Key Family Number>
@@ -4629,14 +4640,13 @@ Requires `signer:generate` permission
4629
4640
  witness_script: <Witness Script Hex String>
4630
4641
  }]
4631
4642
  lnd: <Authenticated LND API Object>
4643
+ [spending]: [{
4644
+ output_script: <Non-Internal Spend Output Script Hex String>
4645
+ output_tokens: <Non-Internal Spend Output Tokens Number>
4646
+ }]
4632
4647
  transaction: <Unsigned Transaction Hex String>
4633
4648
  }
4634
4649
 
4635
- @returns via cbk or Promise
4636
- {
4637
- signatures: [<Signature Hex String>]
4638
- }
4639
-
4640
4650
  Example:
4641
4651
 
4642
4652
  ```node
@@ -4783,10 +4793,15 @@ Subscribe to confirmations of a spend
4783
4793
 
4784
4794
  A chain address or raw output script is required
4785
4795
 
4796
+ When specifying a P2TR output script, `transaction_id` and `transaction_vout`
4797
+ are required.
4798
+
4786
4799
  Requires LND built with `chainrpc` build tag
4787
4800
 
4788
4801
  Requires `onchain:read` permission
4789
4802
 
4803
+ Subscribing to P2TR outputs is not supported in LND 0.14.3 and below
4804
+
4790
4805
  {
4791
4806
  [bech32_address]: <Bech32 P2WPKH or P2WSH Address String>
4792
4807
  lnd: <Authenticated LND API Object>
package/package.json CHANGED
@@ -7,31 +7,31 @@
7
7
  "url": "https://github.com/alexbosworth/ln-service/issues"
8
8
  },
9
9
  "dependencies": {
10
- "bolt07": "1.8.0",
10
+ "bolt07": "1.8.1",
11
11
  "cors": "2.8.5",
12
12
  "express": "4.17.3",
13
- "invoices": "2.0.4",
14
- "lightning": "5.8.2",
13
+ "invoices": "2.0.5",
14
+ "lightning": "5.10.1",
15
15
  "macaroon": "3.0.4",
16
16
  "morgan": "1.10.0",
17
17
  "ws": "8.5.0"
18
18
  },
19
19
  "description": "Interaction helper for your Lightning Network daemon",
20
20
  "devDependencies": {
21
- "@alexbosworth/tap": "15.0.10",
21
+ "@alexbosworth/tap": "15.0.11",
22
22
  "@alexbosworth/node-fetch": "2.6.2",
23
23
  "async": "3.2.3",
24
- "asyncjs-util": "1.2.8",
24
+ "asyncjs-util": "1.2.9",
25
25
  "bip32": "3.0.1",
26
26
  "bip66": "1.1.5",
27
27
  "bitcoinjs-lib": "6.0.1",
28
28
  "bn.js": "5.2.0",
29
29
  "bs58check": "2.1.2",
30
30
  "ecpair": "2.0.1",
31
- "ln-docker-daemons": "2.2.4",
32
- "p2tr": "1.3.0",
31
+ "ln-docker-daemons": "2.2.7",
32
+ "p2tr": "1.3.1",
33
33
  "portfinder": "1.0.28",
34
- "psbt": "2.0.0",
34
+ "psbt": "2.0.1",
35
35
  "rimraf": "3.0.2",
36
36
  "secp256k1": "4.0.3",
37
37
  "tiny-secp256k1": "2.2.1",
@@ -69,5 +69,5 @@
69
69
  "integration-test-0.12.0": "DOCKER_LND_VERSION=v0.12.0-beta npm run test",
70
70
  "test": "echo $DOCKER_LND_VERSION && tap -j 2 --branches=1 --functions=1 --lines=1 --statements=1 -t 200 test/autopilotrpc-integration/*.js test/chainrpc-integration/*.js test/integration/*.js test/invoicesrpc-integration/*.js test/routerrpc-integration/*.js test/signerrpc-integration/*.js test/tower_clientrpc-integration/*.js test/tower_serverrpc-integration/*.js test/walletrpc-integration/*.js"
71
71
  },
72
- "version": "53.9.3"
72
+ "version": "53.11.0"
73
73
  }
@@ -10,7 +10,6 @@ const {delay} = require('./../macros');
10
10
  const {generateBlocks} = require('./../macros');
11
11
  const {getHeight} = require('./../../');
12
12
  const {getChainBalance} = require('./../../');
13
- const {spawnLnd} = require('./../macros');
14
13
  const {subscribeToBlocks} = require('./../../');
15
14
  const {waitForTermination} = require('./../macros');
16
15
 
@@ -11,7 +11,6 @@ const {getChainTransactions} = require('./../../');
11
11
  const {getHeight} = require('./../../');
12
12
  const {mineTransaction} = require('./../macros');
13
13
  const {sendToChainAddress} = require('./../../');
14
- const {spawnLnd} = require('./../macros');
15
14
  const {subscribeToChainAddress} = require('./../../');
16
15
  const {waitForTermination} = require('./../macros');
17
16
 
@@ -7,6 +7,7 @@ const {createChainAddress} = require('./../../');
7
7
  const formats = ['np2wpkh', 'p2wpkh'];
8
8
  const p2shAddressVersion = 196;
9
9
  const pkHashByteLength = 20;
10
+ const prefixForV1 = 'bcrt1p';
10
11
  const regtestBech32AddressHrp = 'bcrt';
11
12
 
12
13
  // Creating addresses should result in addresses
@@ -34,6 +35,14 @@ test(`Create address results in address creation`, async ({end, equal}) => {
34
35
  equal(np2wpkh.address, unusedNp2wpkh.address, 'Nested is reused');
35
36
  equal(p2wpkh.address, unusedP2wpkh.address, 'Native is reused');
36
37
 
38
+ try {
39
+ const {address} = await createChainAddress({lnd, format: 'p2tr'});
40
+
41
+ equal(address.startsWith(prefixForV1), true, 'A taproot address is made');
42
+ } catch (err) {
43
+ // LND 0.14.3 and below do not support TR addresses
44
+ }
45
+
37
46
  await kill({});
38
47
 
39
48
  return end();
@@ -178,7 +178,7 @@ test(`Get pending channels`, async ({end, equal}) => {
178
178
  equal(forceClose.received, 0, 'No receive amount');
179
179
  equal(forceClose.recovered_tokens, undefined, 'No recovered amount');
180
180
 
181
- // LND 0.14.2 and below do not support remote balance info
181
+ // LND 0.14.3 and below do not support remote balance info
182
182
  if (!!forceClose.remote_balance) {
183
183
  equal(forceClose.remote_balance, giftTokens, 'Got gift remote balance');
184
184
  } else {