lightning 5.16.4 → 5.16.5
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 +4 -0
- package/README.md +9 -0
- package/lnd_methods/invoices/subscribe_to_invoices.js +6 -1
- package/lnd_methods/offchain/get_channels.d.ts +1 -1
- package/lnd_methods/offchain/get_channels.js +1 -1
- package/package.json +8 -8
- package/test/lnd_methods/invoices/test_subscribe_to_invoices.js +2 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -18,6 +18,7 @@ Methods for working with the Lightning Network
|
|
|
18
18
|
https://github.com/ibz/lightning-shell
|
|
19
19
|
- [LNMarkets](https://twitter.com/lnmarkets) -
|
|
20
20
|
https://github.com/lnmarkets/umbrel
|
|
21
|
+
- [mempool.space](https://mempool.space/) - https://github.com/mempool/mempool
|
|
21
22
|
- [p2plnbot](https://telegram.me/lnp2pbot) - https://github.com/grunch/p2plnbot
|
|
22
23
|
- [rekr](https://rekr.app/) - https://github.com/ryan-lingle/rekr
|
|
23
24
|
- [stackernews](https://stacker.news/) -
|
|
@@ -64,6 +65,14 @@ const {lnd} = authenticatedLndGrpc({
|
|
|
64
65
|
To access unauthenticated methods like the wallet unlocker, use
|
|
65
66
|
`unauthenticatedLndGrpc` instead.
|
|
66
67
|
|
|
68
|
+
## Debugging
|
|
69
|
+
|
|
70
|
+
If you encounter any issues connecting and wish to view detailed information
|
|
71
|
+
about the underlying grpc calls, you can run Node with these environment
|
|
72
|
+
variables set:
|
|
73
|
+
|
|
74
|
+
GRPC_VERBOSITY=DEBUG GRPC_TRACE=all node YOURSCRIPTNAME.js
|
|
75
|
+
|
|
67
76
|
## Methods
|
|
68
77
|
|
|
69
78
|
- [addExternalSocket](https://github.com/alexbosworth/ln-service#addexternalsocket):
|
|
@@ -2,10 +2,12 @@ const EventEmitter = require('events');
|
|
|
2
2
|
|
|
3
3
|
const asyncDoUntil = require('async/doUntil');
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const {handleRemoveListener} = require('./../../grpc');
|
|
6
6
|
const {isLnd} = require('./../../lnd_requests');
|
|
7
|
+
const {rpcInvoiceAsInvoice} = require('./../../lnd_responses');
|
|
7
8
|
|
|
8
9
|
const connectionFailureMessage = 'failed to connect to all addresses';
|
|
10
|
+
const events = ['end', 'error', 'invoice_updated', 'status'];
|
|
9
11
|
const msPerSec = 1e3;
|
|
10
12
|
const restartSubscriptionMs = 1000 * 30;
|
|
11
13
|
const updateEvent = 'invoice_updated';
|
|
@@ -94,6 +96,9 @@ module.exports = args => {
|
|
|
94
96
|
settle_index: !!confirmedAfter ? confirmedAfter.toString() : undefined,
|
|
95
97
|
});
|
|
96
98
|
|
|
99
|
+
// Terminate subscription when all listeners are removed
|
|
100
|
+
handleRemoveListener({subscription, events, emitter: eventEmitter});
|
|
101
|
+
|
|
97
102
|
// Subscription finished callback
|
|
98
103
|
const finished = err => {
|
|
99
104
|
if (!!eventEmitter.listenerCount('error')) {
|
|
@@ -44,7 +44,7 @@ export type GetChannelsResult = {
|
|
|
44
44
|
local_balance: number;
|
|
45
45
|
/** Local CSV Blocks Delay */
|
|
46
46
|
local_csv?: number;
|
|
47
|
-
/**
|
|
47
|
+
/** Local Non-Enforceable Amount Tokens */
|
|
48
48
|
local_dust?: number;
|
|
49
49
|
/** Local Initially Pushed Tokens */
|
|
50
50
|
local_given?: number;
|
|
@@ -40,7 +40,7 @@ const type = 'default';
|
|
|
40
40
|
is_private: <Channel Is Private Bool>
|
|
41
41
|
local_balance: <Local Balance Tokens Number>
|
|
42
42
|
[local_csv]: <Local CSV Blocks Delay Number>
|
|
43
|
-
[local_dust]: <
|
|
43
|
+
[local_dust]: <Local Non-Enforceable Amount Tokens Number>
|
|
44
44
|
[local_given]: <Local Initially Pushed Tokens Number>
|
|
45
45
|
[local_max_htlcs]: <Local Maximum Attached HTLCs Number>
|
|
46
46
|
[local_max_pending_mtokens]: <Local Maximum Pending Millitokens String>
|
package/package.json
CHANGED
|
@@ -7,15 +7,15 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.6.
|
|
11
|
-
"@grpc/proto-loader": "0.
|
|
10
|
+
"@grpc/grpc-js": "1.6.8",
|
|
11
|
+
"@grpc/proto-loader": "0.7.0",
|
|
12
12
|
"@types/express": "4.17.13",
|
|
13
|
-
"@types/node": "18.
|
|
13
|
+
"@types/node": "18.6.2",
|
|
14
14
|
"@types/request": "2.48.8",
|
|
15
15
|
"@types/ws": "8.5.3",
|
|
16
16
|
"async": "3.2.4",
|
|
17
17
|
"asyncjs-util": "1.2.10",
|
|
18
|
-
"bitcoinjs-lib": "6.0.
|
|
18
|
+
"bitcoinjs-lib": "6.0.2",
|
|
19
19
|
"bn.js": "5.2.1",
|
|
20
20
|
"body-parser": "1.20.0",
|
|
21
21
|
"bolt07": "1.8.2",
|
|
@@ -24,9 +24,9 @@
|
|
|
24
24
|
"ecpair": "2.0.1",
|
|
25
25
|
"express": "4.18.1",
|
|
26
26
|
"invoices": "2.1.0",
|
|
27
|
-
"psbt": "2.
|
|
27
|
+
"psbt": "2.7.1",
|
|
28
28
|
"tiny-secp256k1": "2.2.1",
|
|
29
|
-
"type-fest": "2.
|
|
29
|
+
"type-fest": "2.18.0"
|
|
30
30
|
},
|
|
31
31
|
"description": "Lightning Network client library",
|
|
32
32
|
"devDependencies": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@alexbosworth/tap": "15.0.11",
|
|
35
35
|
"tsd": "0.22.0",
|
|
36
36
|
"typescript": "4.7.4",
|
|
37
|
-
"ws": "8.8.
|
|
37
|
+
"ws": "8.8.1"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=12.20"
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"directory": "test/typescript"
|
|
60
60
|
},
|
|
61
61
|
"types": "index.d.ts",
|
|
62
|
-
"version": "5.16.
|
|
62
|
+
"version": "5.16.5"
|
|
63
63
|
}
|