lightning 5.3.4 → 5.4.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 +5 -0
- package/lnd_methods/invoices/get_invoices.d.ts +6 -1
- package/lnd_methods/offchain/delete_pending_channel.d.ts +21 -0
- package/lnd_methods/offchain/index.d.ts +1 -0
- package/package.json +1 -1
- package/test/typescript/delete_pending_channel.test-d.ts +43 -0
- package/test/typescript/get_invoices.test-d.ts +14 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,7 +4,12 @@ import {
|
|
|
4
4
|
PaginationArgs,
|
|
5
5
|
} from '../../typescript';
|
|
6
6
|
|
|
7
|
-
export type GetInvoicesArgs = AuthenticatedLightningArgs<
|
|
7
|
+
export type GetInvoicesArgs = AuthenticatedLightningArgs<
|
|
8
|
+
PaginationArgs & {
|
|
9
|
+
/** Omit Canceled and Settled Invoices Bool */
|
|
10
|
+
is_unconfirmed?: boolean;
|
|
11
|
+
}
|
|
12
|
+
>;
|
|
8
13
|
|
|
9
14
|
export type GetInvoicesResult = {
|
|
10
15
|
invoices: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type DeletePendingChannelArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Hex Encoded Conflicting Transaction String */
|
|
8
|
+
confirmed_transaction: string;
|
|
9
|
+
/** Hex Encoded Pending Transaction String */
|
|
10
|
+
pending_transaction: string;
|
|
11
|
+
/** Pending Channel Output Index Number */
|
|
12
|
+
pending_transaction_vout: number;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Delete a pending channel
|
|
17
|
+
*
|
|
18
|
+
* Pass the confirmed conflicting transaction that spends the same input to make sure that no funds are being deleted.
|
|
19
|
+
* This method is not supported on LND 0.13.3 and below
|
|
20
|
+
*/
|
|
21
|
+
export const deletePendingChannel: AuthenticatedLightningMethod<DeletePendingChannelArgs>;
|
|
@@ -5,6 +5,7 @@ export * from './delete_failed_payments';
|
|
|
5
5
|
export * from './delete_forwarding_reputations';
|
|
6
6
|
export * from './delete_payment';
|
|
7
7
|
export * from './delete_payments';
|
|
8
|
+
export * from './delete_pending_channel';
|
|
8
9
|
export * from './disable_channel';
|
|
9
10
|
export * from './disconnect_watchtower';
|
|
10
11
|
export * from './enable_channel';
|
package/package.json
CHANGED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import {expectError, expectType} from 'tsd';
|
|
2
|
+
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
3
|
+
import {deletePendingChannel} from '../../lnd_methods';
|
|
4
|
+
|
|
5
|
+
const lnd = {} as AuthenticatedLnd;
|
|
6
|
+
const confirmed_transaction = 'tx0';
|
|
7
|
+
const pending_transaction = 'tx1';
|
|
8
|
+
const pending_transaction_vout = 1;
|
|
9
|
+
|
|
10
|
+
expectError(deletePendingChannel());
|
|
11
|
+
expectError(deletePendingChannel({}));
|
|
12
|
+
expectError(deletePendingChannel({lnd}));
|
|
13
|
+
expectError(deletePendingChannel({confirmed_transaction}));
|
|
14
|
+
expectError(deletePendingChannel({pending_transaction}));
|
|
15
|
+
expectError(deletePendingChannel({pending_transaction_vout}));
|
|
16
|
+
expectError(deletePendingChannel({lnd, confirmed_transaction}));
|
|
17
|
+
expectError(deletePendingChannel({lnd, pending_transaction}));
|
|
18
|
+
expectError(deletePendingChannel({lnd, pending_transaction_vout}));
|
|
19
|
+
expectError(
|
|
20
|
+
deletePendingChannel({lnd, confirmed_transaction, pending_transaction})
|
|
21
|
+
);
|
|
22
|
+
expectError(
|
|
23
|
+
deletePendingChannel({lnd, confirmed_transaction, pending_transaction_vout})
|
|
24
|
+
);
|
|
25
|
+
expectError(
|
|
26
|
+
deletePendingChannel({lnd, pending_transaction, pending_transaction_vout})
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
expectType<void>(
|
|
30
|
+
await deletePendingChannel({
|
|
31
|
+
lnd,
|
|
32
|
+
confirmed_transaction,
|
|
33
|
+
pending_transaction,
|
|
34
|
+
pending_transaction_vout,
|
|
35
|
+
})
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
expectType<void>(
|
|
39
|
+
deletePendingChannel(
|
|
40
|
+
{lnd, confirmed_transaction, pending_transaction, pending_transaction_vout},
|
|
41
|
+
() => {}
|
|
42
|
+
)
|
|
43
|
+
);
|
|
@@ -5,14 +5,18 @@ import {getInvoices, GetInvoicesResult} from '../../lnd_methods';
|
|
|
5
5
|
const lnd = {} as AuthenticatedLnd;
|
|
6
6
|
const limit = 100;
|
|
7
7
|
const token = 'token';
|
|
8
|
+
const is_unconfirmed = true;
|
|
8
9
|
|
|
9
10
|
expectError(getInvoices());
|
|
10
11
|
expectError(getInvoices({}));
|
|
11
12
|
expectError(getInvoices({lnd, limit, token}));
|
|
13
|
+
expectError(getInvoices({lnd, limit, token, is_unconfirmed}));
|
|
12
14
|
|
|
13
15
|
expectType<GetInvoicesResult>(await getInvoices({lnd}));
|
|
14
16
|
expectType<GetInvoicesResult>(await getInvoices({lnd, limit}));
|
|
17
|
+
expectType<GetInvoicesResult>(await getInvoices({lnd, limit, is_unconfirmed}));
|
|
15
18
|
expectType<GetInvoicesResult>(await getInvoices({lnd, token}));
|
|
19
|
+
expectType<GetInvoicesResult>(await getInvoices({lnd, token, is_unconfirmed}));
|
|
16
20
|
|
|
17
21
|
expectType<void>(
|
|
18
22
|
getInvoices({lnd}, (error, result) => {
|
|
@@ -24,8 +28,18 @@ expectType<void>(
|
|
|
24
28
|
expectType<GetInvoicesResult>(result);
|
|
25
29
|
})
|
|
26
30
|
);
|
|
31
|
+
expectType<void>(
|
|
32
|
+
getInvoices({lnd, limit, is_unconfirmed}, (error, result) => {
|
|
33
|
+
expectType<GetInvoicesResult>(result);
|
|
34
|
+
})
|
|
35
|
+
);
|
|
27
36
|
expectType<void>(
|
|
28
37
|
getInvoices({lnd, token}, (error, result) => {
|
|
29
38
|
expectType<GetInvoicesResult>(result);
|
|
30
39
|
})
|
|
31
40
|
);
|
|
41
|
+
expectType<void>(
|
|
42
|
+
getInvoices({lnd, token, is_unconfirmed}, (error, result) => {
|
|
43
|
+
expectType<GetInvoicesResult>(result);
|
|
44
|
+
})
|
|
45
|
+
);
|