lightning 10.14.0 → 10.14.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
CHANGED
|
@@ -1,13 +1,24 @@
|
|
|
1
|
+
import type {MergeExclusive} from 'type-fest';
|
|
1
2
|
import {
|
|
2
3
|
AuthenticatedLightningArgs,
|
|
3
4
|
AuthenticatedLightningMethod,
|
|
4
5
|
ChannelPolicy,
|
|
5
6
|
} from '../../typescript';
|
|
6
7
|
|
|
7
|
-
export type GetChannelArgs = AuthenticatedLightningArgs<
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
export type GetChannelArgs = AuthenticatedLightningArgs<
|
|
9
|
+
MergeExclusive<
|
|
10
|
+
{
|
|
11
|
+
/** Standard Format Channel Id */
|
|
12
|
+
id: string;
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
/** Funding Outpoint Transaction Id Hex String */
|
|
16
|
+
transaction_id: string;
|
|
17
|
+
/** Funding Outpoint Transaction Output Index Number */
|
|
18
|
+
transaction_vout: number;
|
|
19
|
+
}
|
|
20
|
+
>
|
|
21
|
+
>;
|
|
11
22
|
|
|
12
23
|
export type GetChannelResult = {
|
|
13
24
|
/** Maximum Tokens */
|
|
@@ -27,6 +38,14 @@ export type GetChannelResult = {
|
|
|
27
38
|
* Get graph information about a channel on the network
|
|
28
39
|
*
|
|
29
40
|
* Requires `info:read` permission
|
|
41
|
+
*
|
|
42
|
+
* `inbound_base_discount_mtokens` is not supported on LND 0.17.5 and below
|
|
43
|
+
*
|
|
44
|
+
* `inbound_rate_discount` is not supported on LND 0.17.5 and below
|
|
45
|
+
*
|
|
46
|
+
* `transaction_id` is not supported on LND 0.18.0 and below
|
|
47
|
+
*
|
|
48
|
+
* `transaction_vout` is not supported on LND 0.18.0 and below
|
|
30
49
|
*/
|
|
31
50
|
export const getChannel: AuthenticatedLightningMethod<
|
|
32
51
|
GetChannelArgs,
|
package/package.json
CHANGED
|
@@ -7,22 +7,22 @@
|
|
|
7
7
|
"url": "https://github.com/alexbosworth/lightning/issues"
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"@grpc/grpc-js": "1.10.
|
|
10
|
+
"@grpc/grpc-js": "1.10.9",
|
|
11
11
|
"@grpc/proto-loader": "0.7.13",
|
|
12
12
|
"@types/node": "20.14.2",
|
|
13
13
|
"@types/request": "2.48.12",
|
|
14
14
|
"@types/ws": "8.5.10",
|
|
15
15
|
"async": "3.2.5",
|
|
16
16
|
"asyncjs-util": "1.2.12",
|
|
17
|
-
"bitcoinjs-lib": "6.1.
|
|
17
|
+
"bitcoinjs-lib": "6.1.6",
|
|
18
18
|
"bn.js": "5.2.1",
|
|
19
|
-
"bolt07": "1.9.
|
|
19
|
+
"bolt07": "1.9.4",
|
|
20
20
|
"bolt09": "2.1.0",
|
|
21
21
|
"ecpair": "2.1.0",
|
|
22
22
|
"invoices": "3.0.0",
|
|
23
23
|
"psbt": "3.0.0",
|
|
24
24
|
"tiny-secp256k1": "2.2.3",
|
|
25
|
-
"type-fest": "4.20.
|
|
25
|
+
"type-fest": "4.20.1"
|
|
26
26
|
},
|
|
27
27
|
"description": "Lightning Network client library",
|
|
28
28
|
"devDependencies": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"directory": "test/typescript"
|
|
54
54
|
},
|
|
55
55
|
"types": "index.d.ts",
|
|
56
|
-
"version": "10.14.
|
|
56
|
+
"version": "10.14.2"
|
|
57
57
|
}
|
|
@@ -3,15 +3,23 @@ import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
|
3
3
|
import {getChannel, GetChannelResult} from '../../lnd_methods';
|
|
4
4
|
|
|
5
5
|
const lnd = {} as AuthenticatedLnd;
|
|
6
|
-
const id = '
|
|
6
|
+
const id = 'id';
|
|
7
|
+
const transaction_id = 'tx_id';
|
|
8
|
+
const transaction_vout = 0;
|
|
7
9
|
|
|
8
10
|
expectError(getChannel());
|
|
9
11
|
expectError(getChannel({}));
|
|
10
12
|
|
|
13
|
+
// Expect error because only one of id or transaction_id/transaction_vout is allowed
|
|
14
|
+
expectError(getChannel({lnd, id, transaction_id, transaction_vout}));
|
|
15
|
+
|
|
11
16
|
expectType<GetChannelResult>(await getChannel({lnd, id}));
|
|
17
|
+
expectType<GetChannelResult>(
|
|
18
|
+
await getChannel({lnd, transaction_id, transaction_vout}),
|
|
19
|
+
);
|
|
12
20
|
|
|
13
21
|
expectType<void>(
|
|
14
22
|
getChannel({lnd, id}, (error, result) => {
|
|
15
23
|
expectType<GetChannelResult>(result);
|
|
16
|
-
})
|
|
24
|
+
}),
|
|
17
25
|
);
|