lightning 6.3.0 → 6.3.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 +5 -1
- package/lnd_methods/info/constants.json +1 -0
- package/lnd_methods/offchain/get_settlement_status.d.ts +30 -0
- package/lnd_methods/offchain/get_settlement_status.js +2 -1
- package/lnd_methods/offchain/index.d.ts +1 -0
- package/lnd_methods/offchain/subscribe_to_forward_requests.js +3 -3
- package/lnd_methods/offchain/subscribe_to_payments.d.ts +1 -1
- package/lnd_methods/offchain/subscribe_to_payments.js +1 -1
- package/lnd_methods/onchain/open_channel.d.ts +2 -2
- package/lnd_methods/onchain/open_channel.js +2 -2
- package/lnd_methods/onchain/open_channels.d.ts +2 -2
- package/lnd_methods/onchain/open_channels.js +2 -2
- package/package.json +5 -5
- package/test/typescript/get_settlement_status.test-d.ts +26 -0
package/CHANGELOG.md
CHANGED
|
@@ -37,6 +37,7 @@
|
|
|
37
37
|
"aff2ed3a6a118d664049835c325a5b69e977172f": "0.15.2-beta",
|
|
38
38
|
"b4e7131bdb47531ad2f00ce345ddcdb58935bba5": "0.15.3-beta",
|
|
39
39
|
"bd0c46b4fcb027af1915bd67a3da70e8ca5c6efe": "0.14.3-beta",
|
|
40
|
+
"c0a09209782b1c62c3393fcea0844e095c25046b": "0.15.5-beta",
|
|
40
41
|
"d176d2d65fc06e6631c4dc9478592be8545a21de": "0.12.0-beta",
|
|
41
42
|
"d233f61383f2f950aa06f5b09da5b0e78e784fae": "0.12.1-beta",
|
|
42
43
|
"d62c575f8499a314eb27f12462d20500b6bda2c7": "0.10.3-beta",
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type GetSettlementStatusArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Standard Format Channel Id String */
|
|
8
|
+
channel: string;
|
|
9
|
+
/** Payment Id Number */
|
|
10
|
+
payment: number;
|
|
11
|
+
}>;
|
|
12
|
+
|
|
13
|
+
export type GetSettlementStatusResult = {
|
|
14
|
+
/** Payment Went to Chain Bool */
|
|
15
|
+
is_onchain: boolean;
|
|
16
|
+
/** Payment Is Settled Into Non-HTLC Balance Bool */
|
|
17
|
+
is_settled: boolean;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Get the settlement status of a received HTLC
|
|
22
|
+
*
|
|
23
|
+
* Note: this method is not supported in LND versions 0.15.5 and below
|
|
24
|
+
*
|
|
25
|
+
* Requires `offchain:read` permissions
|
|
26
|
+
*/
|
|
27
|
+
export const getSettlementStatus: AuthenticatedLightningMethod<
|
|
28
|
+
GetSettlementStatusArgs,
|
|
29
|
+
GetSettlementStatusResult
|
|
30
|
+
>;
|
|
@@ -12,12 +12,13 @@ const type = 'default';
|
|
|
12
12
|
|
|
13
13
|
/** Get the settlement status of a received HTLC
|
|
14
14
|
|
|
15
|
-
Note: this method is not supported in LND versions 0.15.
|
|
15
|
+
Note: this method is not supported in LND versions 0.15.5 and below
|
|
16
16
|
|
|
17
17
|
Requires `offchain:read` permissions
|
|
18
18
|
|
|
19
19
|
{
|
|
20
20
|
channel: <Standard Format Channel Id String>
|
|
21
|
+
lnd: <Authenticated LND API Object>
|
|
21
22
|
payment: <Payment Id Number>
|
|
22
23
|
}
|
|
23
24
|
|
|
@@ -27,6 +27,7 @@ export * from './get_payments';
|
|
|
27
27
|
export * from './get_pending_channels';
|
|
28
28
|
export * from './get_pending_payments';
|
|
29
29
|
export * from './get_route_through_hops';
|
|
30
|
+
export * from './get_settlement_status';
|
|
30
31
|
export * from './is_destination_payable';
|
|
31
32
|
export * from './pay_via_payment_details';
|
|
32
33
|
export * from './pay_via_payment_request';
|
|
@@ -83,7 +83,7 @@ module.exports = ({lnd}) => {
|
|
|
83
83
|
const request = rpcForwardAsForwardRequest(data);
|
|
84
84
|
|
|
85
85
|
return emitter.emit(event, {
|
|
86
|
-
accept: () => sub.write({
|
|
86
|
+
accept: async () => await sub.write({
|
|
87
87
|
action: forwardPaymentActions.accept,
|
|
88
88
|
incoming_circuit_key: data.incoming_circuit_key,
|
|
89
89
|
}),
|
|
@@ -97,11 +97,11 @@ module.exports = ({lnd}) => {
|
|
|
97
97
|
mtokens: request.mtokens,
|
|
98
98
|
onion: request.onion,
|
|
99
99
|
out_channel: request.out_channel,
|
|
100
|
-
reject: () => sub.write({
|
|
100
|
+
reject: async () => await sub.write({
|
|
101
101
|
action: forwardPaymentActions.reject,
|
|
102
102
|
incoming_circuit_key: data.incoming_circuit_key,
|
|
103
103
|
}),
|
|
104
|
-
settle: ({secret}) => sub.write({
|
|
104
|
+
settle: async ({secret}) => await sub.write({
|
|
105
105
|
action: forwardPaymentActions.settle,
|
|
106
106
|
incoming_circuit_key: data.incoming_circuit_key,
|
|
107
107
|
preimage: bufferFromHex(secret),
|
|
@@ -17,6 +17,6 @@ export type SubscribeToPaymentsPaymentEvent =
|
|
|
17
17
|
*
|
|
18
18
|
* Requires `offchain:read` permission
|
|
19
19
|
*
|
|
20
|
-
* Note: Method not supported on LND 0.15.
|
|
20
|
+
* Note: Method not supported on LND 0.15.5 and below
|
|
21
21
|
*/
|
|
22
22
|
export const subscribeToPayments: AuthenticatedLightningSubscription<SubscribeToPaymentsArgs>;
|
|
@@ -50,8 +50,8 @@ export type OpenChannelResult = {
|
|
|
50
50
|
*
|
|
51
51
|
* External funding requires LND compiled with `walletrpc` build tag
|
|
52
52
|
*
|
|
53
|
-
* `base_fee_mtokens` is not supported on LND 0.15.
|
|
54
|
-
* `fee_rate` is not supported on LND 0.15.
|
|
53
|
+
* `base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
54
|
+
* `fee_rate` is not supported on LND 0.15.5 and below
|
|
55
55
|
*/
|
|
56
56
|
export const openChannel: AuthenticatedLightningMethod<
|
|
57
57
|
OpenChannelArgs,
|
|
@@ -20,8 +20,8 @@ const type = 'default';
|
|
|
20
20
|
|
|
21
21
|
External funding requires LND compiled with `walletrpc` build tag
|
|
22
22
|
|
|
23
|
-
`base_fee_mtokens` is not supported on LND 0.15.
|
|
24
|
-
`fee_rate` is not supported on LND 0.15.
|
|
23
|
+
`base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
24
|
+
`fee_rate` is not supported on LND 0.15.5 and below
|
|
25
25
|
|
|
26
26
|
{
|
|
27
27
|
[base_fee_mtokens]: <Routing Base Fee Millitokens Charged String>
|
|
@@ -56,8 +56,8 @@ channel that was not funded.
|
|
|
56
56
|
`--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
|
|
57
57
|
as well as a channel open request listener to accept the trusted funding.
|
|
58
58
|
|
|
59
|
-
* `base_fee_mtokens` is not supported on LND 0.15.
|
|
60
|
-
* `fee_rate` is not supported on LND 0.15.
|
|
59
|
+
* `base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
60
|
+
* `fee_rate` is not supported on LND 0.15.5 and below
|
|
61
61
|
*/
|
|
62
62
|
export const openChannels: AuthenticatedLightningMethod<
|
|
63
63
|
OpenChannelsArgs,
|
|
@@ -37,8 +37,8 @@ const type = 'default';
|
|
|
37
37
|
`--protocol.option-scid-alias` and `--protocol.zero-conf` set on both sides
|
|
38
38
|
as well as a channel open request listener to accept the trusted funding.
|
|
39
39
|
|
|
40
|
-
`base_fee_mtokens` is not supported on LND 0.15.
|
|
41
|
-
`fee_rate` is not supported on LND 0.15.
|
|
40
|
+
`base_fee_mtokens` is not supported on LND 0.15.5 and below
|
|
41
|
+
`fee_rate` is not supported on LND 0.15.5 and below
|
|
42
42
|
|
|
43
43
|
{
|
|
44
44
|
channels: [{
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"@grpc/grpc-js": "1.7.3",
|
|
11
11
|
"@grpc/proto-loader": "0.7.3",
|
|
12
12
|
"@types/express": "4.17.14",
|
|
13
|
-
"@types/node": "18.11.
|
|
13
|
+
"@types/node": "18.11.10",
|
|
14
14
|
"@types/request": "2.48.8",
|
|
15
15
|
"@types/ws": "8.5.3",
|
|
16
16
|
"async": "3.2.4",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
"cbor": "8.1.0",
|
|
24
24
|
"ecpair": "2.1.0",
|
|
25
25
|
"express": "4.18.2",
|
|
26
|
-
"invoices": "2.2.
|
|
26
|
+
"invoices": "2.2.2",
|
|
27
27
|
"psbt": "2.7.1",
|
|
28
28
|
"tiny-secp256k1": "2.2.1",
|
|
29
|
-
"type-fest": "3.
|
|
29
|
+
"type-fest": "3.3.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.11",
|
|
35
|
-
"tsd": "0.
|
|
35
|
+
"tsd": "0.25.0",
|
|
36
36
|
"typescript": "4.9.3",
|
|
37
37
|
"ws": "8.11.0"
|
|
38
38
|
},
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"directory": "test/typescript"
|
|
60
60
|
},
|
|
61
61
|
"types": "index.d.ts",
|
|
62
|
-
"version": "6.3.
|
|
62
|
+
"version": "6.3.2"
|
|
63
63
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {expectError, expectType} from 'tsd';
|
|
2
|
+
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
3
|
+
import {
|
|
4
|
+
getSettlementStatus,
|
|
5
|
+
GetSettlementStatusResult,
|
|
6
|
+
} from '../../lnd_methods';
|
|
7
|
+
|
|
8
|
+
const lnd = {} as AuthenticatedLnd;
|
|
9
|
+
const channel = 'channel id';
|
|
10
|
+
const payment = 0;
|
|
11
|
+
|
|
12
|
+
expectError(getSettlementStatus());
|
|
13
|
+
expectError(getSettlementStatus({}));
|
|
14
|
+
expectError(getSettlementStatus({lnd}));
|
|
15
|
+
expectError(getSettlementStatus({lnd, channel}));
|
|
16
|
+
expectError(getSettlementStatus({lnd, payment}));
|
|
17
|
+
|
|
18
|
+
expectType<GetSettlementStatusResult>(
|
|
19
|
+
await getSettlementStatus({lnd, channel, payment})
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
expectType<void>(
|
|
23
|
+
getSettlementStatus({lnd, channel, payment}, (error, result) => {
|
|
24
|
+
expectType<GetSettlementStatusResult>(result);
|
|
25
|
+
})
|
|
26
|
+
);
|