lightning 5.2.1 → 5.3.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
package/README.md
CHANGED
|
@@ -15,6 +15,7 @@ Methods for working with the Lightning Network
|
|
|
15
15
|
- [Thunderhub](https://www.thunderhub.io/) - https://github.com/apotdevin/thunderhub
|
|
16
16
|
- [Lightning Roulette](https://lightning-roulette.com/) - https://github.com/igreshev/lightning-roulette
|
|
17
17
|
- [Lightning Poker](https://lightning-poker.com/) - https://github.com/igreshev/lightning-poker
|
|
18
|
+
- [p2plnbot](https://telegram.me/lnp2pbot) - https://github.com/grunch/p2plnbot
|
|
18
19
|
- [rekr](https://rekr.app/) - https://github.com/ryan-lingle/rekr
|
|
19
20
|
- [Suredbits API](https://suredbits.com/) - https://github.com/Suredbits/sb-api-lnd
|
|
20
21
|
|
|
@@ -28,6 +28,7 @@ const type = 'default';
|
|
|
28
28
|
Invoice `payment` is not supported on LND 0.11.1 and below
|
|
29
29
|
|
|
30
30
|
{
|
|
31
|
+
[is_unconfirmed]: <Omit Canceled and Settled Invoices Bool>
|
|
31
32
|
[limit]: <Page Result Limit Number>
|
|
32
33
|
lnd: <Authenticated LND API Object>
|
|
33
34
|
[token]: <Opaque Paging Token String>
|
|
@@ -87,16 +88,16 @@ const type = 'default';
|
|
|
87
88
|
[next]: <Next Opaque Paging Token String>
|
|
88
89
|
}
|
|
89
90
|
*/
|
|
90
|
-
module.exports = (
|
|
91
|
+
module.exports = (args, cbk) => {
|
|
91
92
|
return new Promise((resolve, reject) => {
|
|
92
93
|
return asyncAuto({
|
|
93
94
|
// Validate arguments
|
|
94
95
|
validate: cbk => {
|
|
95
|
-
if (!!limit && !!token) {
|
|
96
|
+
if (!!args.limit && !!args.token) {
|
|
96
97
|
return cbk([400, 'UnexpectedLimitWhenPagingInvoicesWithToken']);
|
|
97
98
|
}
|
|
98
99
|
|
|
99
|
-
if (!isLnd({
|
|
100
|
+
if (!isLnd({method, type, lnd: args.lnd})) {
|
|
100
101
|
return cbk([400, 'ExpectedLndForInvoiceListing']);
|
|
101
102
|
}
|
|
102
103
|
|
|
@@ -106,12 +107,12 @@ module.exports = ({limit, lnd, token}, cbk) => {
|
|
|
106
107
|
// Get the list of invoices
|
|
107
108
|
listInvoices: ['validate', ({}, cbk) => {
|
|
108
109
|
let offset;
|
|
109
|
-
let resultsLimit = limit || defaultLimit;
|
|
110
|
+
let resultsLimit = args.limit || defaultLimit;
|
|
110
111
|
|
|
111
112
|
// When there is a token, parse it out into an offset and a limit
|
|
112
|
-
if (!!token) {
|
|
113
|
+
if (!!args.token) {
|
|
113
114
|
try {
|
|
114
|
-
const pagingToken = parse(token);
|
|
115
|
+
const pagingToken = parse(args.token);
|
|
115
116
|
|
|
116
117
|
offset = pagingToken.offset;
|
|
117
118
|
resultsLimit = pagingToken.limit;
|
|
@@ -121,9 +122,10 @@ module.exports = ({limit, lnd, token}, cbk) => {
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
return asyncRetry({}, cbk => {
|
|
124
|
-
return lnd[type][method]({
|
|
125
|
+
return args.lnd[type][method]({
|
|
125
126
|
index_offset: offset || Number(),
|
|
126
127
|
num_max_invoices: resultsLimit,
|
|
128
|
+
pending_only: args.is_unconfirmed === true || undefined,
|
|
127
129
|
reversed: true,
|
|
128
130
|
},
|
|
129
131
|
(err, res) => {
|
|
@@ -19,8 +19,6 @@ export type OpenChannelsArgs = AuthenticatedLightningArgs<{
|
|
|
19
19
|
partner_public_key: string;
|
|
20
20
|
/** Peer Output CSV Delay */
|
|
21
21
|
partner_csv_delay?: number;
|
|
22
|
-
/** Peer Connection Host:Port */
|
|
23
|
-
partner_socket?: string;
|
|
24
22
|
}[];
|
|
25
23
|
/** Do not broadcast any channel funding transactions */
|
|
26
24
|
is_avoiding_broadcast?: boolean;
|
|
@@ -41,7 +41,6 @@ const type = 'default';
|
|
|
41
41
|
[min_htlc_mtokens]: <Minimum HTLC Millitokens String>
|
|
42
42
|
[partner_csv_delay]: <Peer Output CSV Delay Number>
|
|
43
43
|
partner_public_key: <Public Key Hex String>
|
|
44
|
-
[partner_socket]: <Peer Connection Host:Port String>
|
|
45
44
|
}]
|
|
46
45
|
[is_avoiding_broadcast]: <Avoid Broadcast of All Channels Bool>
|
|
47
46
|
lnd: <Authenticated LND API Object>
|
|
@@ -95,7 +94,6 @@ module.exports = (args, cbk) => {
|
|
|
95
94
|
min_htlc_mtokens: channel.min_htlc_mtokens,
|
|
96
95
|
partner_public_key: channel.partner_public_key,
|
|
97
96
|
partner_csv_delay: channel.partner_csv_delay,
|
|
98
|
-
partner_socket: channel.partner_socket,
|
|
99
97
|
})));
|
|
100
98
|
}],
|
|
101
99
|
|
package/package.json
CHANGED
|
@@ -7,32 +7,32 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.
|
|
11
|
-
"@grpc/proto-loader": "0.6.
|
|
10
|
+
"@grpc/grpc-js": "1.5.0",
|
|
11
|
+
"@grpc/proto-loader": "0.6.9",
|
|
12
12
|
"@types/express": "4.17.13",
|
|
13
|
-
"@types/node": "
|
|
14
|
-
"@types/request": "2.48.
|
|
13
|
+
"@types/node": "17.0.8",
|
|
14
|
+
"@types/request": "2.48.8",
|
|
15
15
|
"@types/ws": "8.2.2",
|
|
16
|
-
"async": "3.2.
|
|
16
|
+
"async": "3.2.3",
|
|
17
17
|
"asyncjs-util": "1.2.7",
|
|
18
18
|
"bitcoinjs-lib": "6.0.1",
|
|
19
19
|
"bn.js": "5.2.0",
|
|
20
|
-
"body-parser": "1.19.
|
|
21
|
-
"bolt07": "1.
|
|
20
|
+
"body-parser": "1.19.1",
|
|
21
|
+
"bolt07": "1.8.0",
|
|
22
22
|
"bolt09": "0.2.0",
|
|
23
23
|
"cbor": "8.1.0",
|
|
24
|
-
"express": "4.17.
|
|
24
|
+
"express": "4.17.2",
|
|
25
25
|
"invoices": "2.0.2",
|
|
26
26
|
"psbt": "1.1.10",
|
|
27
|
-
"type-fest": "2.
|
|
27
|
+
"type-fest": "2.9.0"
|
|
28
28
|
},
|
|
29
29
|
"description": "Lightning Network client library",
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
32
32
|
"@alexbosworth/tap": "15.0.10",
|
|
33
|
-
"tsd": "0.19.
|
|
34
|
-
"typescript": "4.5.
|
|
35
|
-
"ws": "8.
|
|
33
|
+
"tsd": "0.19.1",
|
|
34
|
+
"typescript": "4.5.4",
|
|
35
|
+
"ws": "8.4.0"
|
|
36
36
|
},
|
|
37
37
|
"engines": {
|
|
38
38
|
"node": ">=12.20"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"directory": "test/typescript"
|
|
58
58
|
},
|
|
59
59
|
"types": "index.d.ts",
|
|
60
|
-
"version": "5.
|
|
60
|
+
"version": "5.3.0"
|
|
61
61
|
}
|