lightning 5.7.1 → 5.8.2
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 +6 -0
- package/lnd_methods/offchain/subscribe_to_past_payments.d.ts +2 -0
- package/lnd_methods/offchain/subscribe_to_past_payments.js +7 -0
- package/lnd_methods/onchain/get_master_public_keys.d.ts +28 -0
- package/lnd_methods/onchain/index.d.ts +1 -0
- package/lnd_methods/peers/subscribe_to_peers.js +0 -2
- package/package.json +10 -10
- package/test/typescript/get_master_public_keys.test-d.ts +19 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ Methods for working with the Lightning Network
|
|
|
6
6
|
|
|
7
7
|
## Selected Projects using Lightning
|
|
8
8
|
|
|
9
|
+
- [bitpay.com crypto-rpc](https://bitpay.com/) -
|
|
10
|
+
https://github.com/bitpay/crypto-rpc
|
|
9
11
|
- [coinos.io](https://coinos.io/) - https://github.com/coinos/coinos-server
|
|
10
12
|
- [Lightning Shell](https://lightningshell.app/) -
|
|
11
13
|
https://github.com/ibz/lightning-shell
|
|
@@ -27,6 +29,8 @@ Methods for working with the Lightning Network
|
|
|
27
29
|
- [rekr](https://rekr.app/) - https://github.com/ryan-lingle/rekr
|
|
28
30
|
- [Suredbits API](https://suredbits.com/) -
|
|
29
31
|
https://github.com/Suredbits/sb-api-lnd
|
|
32
|
+
- [Synonym demo server](https://synonym.to) -
|
|
33
|
+
https://github.com/synonymdev/slash-pay-demo-server
|
|
30
34
|
|
|
31
35
|
## LND Authentication
|
|
32
36
|
|
|
@@ -157,6 +161,8 @@ To access unauthenticated methods like the wallet unlocker, use
|
|
|
157
161
|
open invoices and received payments.
|
|
158
162
|
- [getLockedUtxos](https://github.com/alexbosworth/ln-service#getlockedutxos): List the UTXOs
|
|
159
163
|
that are currently reserved and unavailable to coin selection.
|
|
164
|
+
- [getMasterPublicKeys](https://github.com/alexbosworth/ln-service#getmasterpublickeys):
|
|
165
|
+
List out master seed derived extended public keys and derivation paths.
|
|
160
166
|
- [getMethods](https://github.com/alexbosworth/ln-service#getmethods): List RPC methods and
|
|
161
167
|
permissions required to use them.
|
|
162
168
|
- [getNetworkCentrality](https://github.com/alexbosworth/ln-service#getnetworkcentrality):
|
|
@@ -67,6 +67,8 @@ export type SubscribeToPastPaymentsPaymentEvent = {
|
|
|
67
67
|
/**
|
|
68
68
|
* Subscribe to successful outgoing payments
|
|
69
69
|
*
|
|
70
|
+
* Payments may be omitted if LND does not finalize the payment record
|
|
71
|
+
*
|
|
70
72
|
* Requires `offchain:read` permission
|
|
71
73
|
*
|
|
72
74
|
* Note: Method not supported on LND 0.13.4 and below
|
|
@@ -21,6 +21,8 @@ const unknownFailureMessage = '2 UNKNOWN: unknown failure detail type: <nil>';
|
|
|
21
21
|
|
|
22
22
|
/** Subscribe to successful outgoing payments
|
|
23
23
|
|
|
24
|
+
Payments may be omitted if LND does not finalize the payment record
|
|
25
|
+
|
|
24
26
|
Requires `offchain:read` permission
|
|
25
27
|
|
|
26
28
|
Note: Method not supported on LND 0.13.4 and below
|
|
@@ -96,6 +98,11 @@ module.exports = ({lnd}) => {
|
|
|
96
98
|
return;
|
|
97
99
|
}
|
|
98
100
|
|
|
101
|
+
// Exit early when there is no payment
|
|
102
|
+
if (!res.payment) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
|
|
99
106
|
// Emit payment details
|
|
100
107
|
return emitter.emit(event, res.payment);
|
|
101
108
|
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type GetMasterPublicKeysArgs = AuthenticatedLightningArgs;
|
|
7
|
+
|
|
8
|
+
export type GetMasterPublicKeysResult = {
|
|
9
|
+
keys: {
|
|
10
|
+
/** Key Derivation Path String> */
|
|
11
|
+
derivation_path: string;
|
|
12
|
+
/** Base58 Encoded Master Public Key String> */
|
|
13
|
+
extended_public_key: string;
|
|
14
|
+
/** Used External Keys Count Number> */
|
|
15
|
+
external_key_count: number;
|
|
16
|
+
/** Used Internal Keys Count Number> */
|
|
17
|
+
internal_key_count: number;
|
|
18
|
+
/** Node has Master Private Key Bool> */
|
|
19
|
+
is_watch_only: boolean;
|
|
20
|
+
/** Account Name String> */
|
|
21
|
+
named: string;
|
|
22
|
+
}[];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const getMasterPublicKeys: AuthenticatedLightningMethod<
|
|
26
|
+
GetMasterPublicKeysArgs,
|
|
27
|
+
GetMasterPublicKeysResult
|
|
28
|
+
>;
|
|
@@ -8,6 +8,7 @@ export * from './get_chain_fee_estimate';
|
|
|
8
8
|
export * from './get_chain_fee_rate';
|
|
9
9
|
export * from './get_chain_transactions';
|
|
10
10
|
export * from './get_locked_utxos';
|
|
11
|
+
export * from './get_master_public_keys';
|
|
11
12
|
export * from './get_pending_chain_balance';
|
|
12
13
|
export * from './get_sweep_transactions';
|
|
13
14
|
export * from './get_utxos';
|
package/package.json
CHANGED
|
@@ -7,33 +7,33 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.5.
|
|
10
|
+
"@grpc/grpc-js": "1.5.7",
|
|
11
11
|
"@grpc/proto-loader": "0.6.9",
|
|
12
12
|
"@types/express": "4.17.13",
|
|
13
|
-
"@types/node": "17.0.
|
|
13
|
+
"@types/node": "17.0.21",
|
|
14
14
|
"@types/request": "2.48.8",
|
|
15
|
-
"@types/ws": "8.
|
|
15
|
+
"@types/ws": "8.5.2",
|
|
16
16
|
"async": "3.2.3",
|
|
17
17
|
"asyncjs-util": "1.2.8",
|
|
18
18
|
"bitcoinjs-lib": "6.0.1",
|
|
19
19
|
"bn.js": "5.2.0",
|
|
20
|
-
"body-parser": "1.19.
|
|
20
|
+
"body-parser": "1.19.2",
|
|
21
21
|
"bolt07": "1.8.0",
|
|
22
|
-
"bolt09": "0.2.
|
|
22
|
+
"bolt09": "0.2.2",
|
|
23
23
|
"cbor": "8.1.0",
|
|
24
24
|
"ecpair": "2.0.1",
|
|
25
|
-
"express": "4.17.
|
|
25
|
+
"express": "4.17.3",
|
|
26
26
|
"invoices": "2.0.4",
|
|
27
27
|
"psbt": "2.0.0",
|
|
28
|
-
"tiny-secp256k1": "2.2.
|
|
29
|
-
"type-fest": "2.
|
|
28
|
+
"tiny-secp256k1": "2.2.1",
|
|
29
|
+
"type-fest": "2.12.0"
|
|
30
30
|
},
|
|
31
31
|
"description": "Lightning Network client library",
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@alexbosworth/node-fetch": "2.6.2",
|
|
34
34
|
"@alexbosworth/tap": "15.0.10",
|
|
35
35
|
"tsd": "0.19.1",
|
|
36
|
-
"typescript": "4.
|
|
36
|
+
"typescript": "4.6.2",
|
|
37
37
|
"ws": "8.5.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"directory": "test/typescript"
|
|
60
60
|
},
|
|
61
61
|
"types": "index.d.ts",
|
|
62
|
-
"version": "5.
|
|
62
|
+
"version": "5.8.2"
|
|
63
63
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {expectError, expectType} from 'tsd';
|
|
2
|
+
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
3
|
+
import {
|
|
4
|
+
getMasterPublicKeys,
|
|
5
|
+
GetMasterPublicKeysResult,
|
|
6
|
+
} from '../../lnd_methods';
|
|
7
|
+
|
|
8
|
+
const lnd = {} as AuthenticatedLnd;
|
|
9
|
+
|
|
10
|
+
expectError(getMasterPublicKeys());
|
|
11
|
+
expectError(getMasterPublicKeys({}));
|
|
12
|
+
|
|
13
|
+
expectType<GetMasterPublicKeysResult>(await getMasterPublicKeys({lnd}));
|
|
14
|
+
|
|
15
|
+
expectType<void>(
|
|
16
|
+
getMasterPublicKeys({lnd}, (error, result) => {
|
|
17
|
+
expectType<GetMasterPublicKeysResult>(result);
|
|
18
|
+
})
|
|
19
|
+
);
|