ln-service 57.18.0 → 57.19.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
+ ## 57.19.0
4
+
5
+ - `createInvoice`: add `is_encrypting_routes` to enable blinded paths feature
6
+
7
+ - `pay`, `subscribeToPastPayment`, `subscribeToPayViaDetails`,
8
+ `subscribeToPayViaRequest`, `subscribeToPayments`: Add `is_canceled` for
9
+ when the payment loop was explicitly canceled.
10
+
3
11
  ## 57.18.0
4
12
 
5
13
  - `getMinimumRelayFee`: Add method to get the chain backend minimum relay fee
package/README.md CHANGED
@@ -830,6 +830,7 @@ Requires `address:write`, `invoices:write` permission
830
830
  [description]: <Invoice Description String>
831
831
  [description_hash]: <Hashed Description of Payment Hex String>
832
832
  [expires_at]: <Expires At ISO 8601 Date String>
833
+ [is_encrypting_routes]: <Use Blinded Paths For Inbound Routes Bool>
833
834
  [is_fallback_included]: <Is Fallback Address Included Bool>
834
835
  [is_fallback_nested]: <Is Fallback Address Nested Bool>
835
836
  [is_including_private_channels]: <Invoice Includes Private Channels Bool>
@@ -3792,10 +3793,13 @@ Requires `info:read` permission
3792
3793
  type: <Feature Type String>
3793
3794
  }]
3794
3795
  is_synced_to_chain: <Is Synced To Chain Bool>
3796
+ [is_synced_to_graph]: <Is Synced To Network Graph Bool>
3795
3797
  latest_block_at: <Latest Known Block At Date String>
3796
3798
  peers_count: <Peer Count Number>
3797
3799
  pending_channels_count: <Pending Channels Count Number>
3798
3800
  public_key: <Public Key String>
3801
+ [uris]: [<The URIs of the Node String>]
3802
+ version: <LND Version String>
3799
3803
  }
3800
3804
 
3801
3805
  Example:
@@ -6434,6 +6438,7 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
6434
6438
  @event 'failed'
6435
6439
  {
6436
6440
  id: <Payment Hash Hex String>
6441
+ is_canceled: <Payment Canceled Bool>
6437
6442
  is_insufficient_balance: <Failed Due To Lack of Balance Bool>
6438
6443
  is_invalid_payment: <Failed Due to Invalid Payment Bool>
6439
6444
  is_pathfinding_timeout: <Failed Due to Pathfinding Timeout Bool>
@@ -6589,6 +6594,7 @@ Preferred `confidence` is not supported on LND 0.14.5 and below
6589
6594
  @event 'failed'
6590
6595
  {
6591
6596
  id: <Payment Hash Hex String>
6597
+ is_canceled: <Payment Canceled Bool>
6592
6598
  is_insufficient_balance: <Failed Due To Lack of Balance Bool>
6593
6599
  is_invalid_payment: <Failed Due to Invalid Payment Bool>
6594
6600
  is_pathfinding_timeout: <Failed Due to Pathfinding Timeout Bool>
@@ -6923,6 +6929,7 @@ Note: Method not supported on LND 0.15.5 and below
6923
6929
  @event 'failed'
6924
6930
  {
6925
6931
  id: <Payment Hash Hex String>
6932
+ is_canceled: <Payment Canceled Bool>
6926
6933
  is_insufficient_balance: <Failed Due To Lack of Balance Bool>
6927
6934
  is_invalid_payment: <Failed Due to Payment Rejected At Destination Bool>
6928
6935
  is_pathfinding_timeout: <Failed Due to Pathfinding Timeout Bool>
package/package.json CHANGED
@@ -9,14 +9,14 @@
9
9
  "dependencies": {
10
10
  "bolt07": "1.9.4",
11
11
  "invoices": "3.0.0",
12
- "lightning": "10.18.0",
12
+ "lightning": "10.19.0",
13
13
  "macaroon": "3.0.4"
14
14
  },
15
15
  "description": "Interaction helper for your Lightning Network daemon",
16
16
  "devDependencies": {
17
17
  "@alexbosworth/blockchain": "2.0.0",
18
18
  "@alexbosworth/node-fetch": "2.6.2",
19
- "async": "3.2.5",
19
+ "async": "3.2.6",
20
20
  "asyncjs-util": "1.2.12",
21
21
  "bip32": "4.0.0",
22
22
  "bip66": "2.0.0",
@@ -24,7 +24,7 @@
24
24
  "bn.js": "5.2.1",
25
25
  "bs58check": "4.0.0",
26
26
  "ecpair": "2.1.0",
27
- "ln-docker-daemons": "6.0.22",
27
+ "ln-docker-daemons": "6.0.23",
28
28
  "p2tr": "2.0.0",
29
29
  "portfinder": "1.0.32",
30
30
  "psbt": "3.0.0",
@@ -74,5 +74,5 @@
74
74
  "integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
75
75
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
76
76
  },
77
- "version": "57.18.0"
77
+ "version": "57.19.0"
78
78
  }
@@ -0,0 +1,66 @@
1
+ const asyncRetry = require('async/retry');
2
+ const {strictEqual} = require('node:assert').strict;
3
+ const test = require('node:test');
4
+
5
+ const {setupChannel} = require('ln-docker-daemons');
6
+ const {spawnLightningCluster} = require('ln-docker-daemons');
7
+
8
+ const {addPeer} = require('./../../');
9
+ const {createInvoice} = require('./../../');
10
+ const {decodePaymentRequest} = require('./../../');
11
+ const {getWalletInfo} = require('./../../');
12
+ const {parsePaymentRequest} = require('./../../');
13
+ const {pay} = require('./../../');
14
+
15
+ const count = 100;
16
+ const expiry = () => new Date(Date.now() + (4 * 60 * 60 * 1000)).toISOString();
17
+ const give = 500000;
18
+ const interval = 100;
19
+ const size = 3;
20
+ const times = 10000;
21
+ const tokens = 100;
22
+
23
+ // Paying to an encrypted routes invoice should result in a payment
24
+ test(`Create an invoice`, async () => {
25
+ const {kill, nodes} = await spawnLightningCluster({size});
26
+
27
+ const [{generate, lnd}, target, remote] = nodes;
28
+
29
+ await generate({count});
30
+
31
+ try {
32
+ await setupChannel({generate, lnd, give_tokens: give, to: target});
33
+
34
+ await addPeer({lnd, public_key: remote.id, socket: remote.socket});
35
+
36
+ await setupChannel({
37
+ generate: target.generate,
38
+ give_tokens: give,
39
+ lnd: target.lnd,
40
+ to: remote,
41
+ });
42
+
43
+ await asyncRetry({interval, times}, async () => {
44
+ await generate({});
45
+
46
+ const invoice = await createInvoice({
47
+ lnd,
48
+ tokens,
49
+ expires_at: expiry(),
50
+ is_encrypting_routes: true,
51
+ });
52
+
53
+ await addPeer({lnd, public_key: remote.id, socket: remote.socket});
54
+
55
+ await pay({lnd: remote.lnd, request: invoice.request});
56
+ });
57
+
58
+ await kill({});
59
+ } catch (err) {
60
+ await kill({});
61
+
62
+ strictEqual(err, null, 'Expected no error in create invoice');
63
+ }
64
+
65
+ return;
66
+ });
@@ -114,6 +114,7 @@ test('Get failed payments', async () => {
114
114
  {
115
115
  failed: {
116
116
  id: payment.id,
117
+ is_canceled: false,
117
118
  is_insufficient_balance: false,
118
119
  is_invalid_payment: false,
119
120
  is_pathfinding_timeout: false,
@@ -151,11 +152,13 @@ test('Get failed payments', async () => {
151
152
  deepStrictEqual(payment.safe_tokens, invoice.tokens, 'Safe tokens');
152
153
  deepStrictEqual(payment.tokens, invoice.tokens, 'Failed has tokens');
153
154
  }
155
+
156
+ await kill({});
154
157
  } catch (err) {
158
+ await kill({});
159
+
155
160
  strictEqual(err, null, 'Expected no error');
156
161
  }
157
162
 
158
- await kill({});
159
-
160
163
  return;
161
164
  });