lightning 10.11.0 → 10.11.1
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 +1 -1
- package/lnd_methods/info/get_channel.d.ts +2 -18
- package/lnd_methods/info/get_network_graph.d.ts +12 -26
- package/lnd_methods/info/get_node.d.ts +9 -25
- package/lnd_methods/onchain/get_pending_sweeps.d.ts +47 -0
- package/lnd_methods/onchain/index.d.ts +2 -0
- package/lnd_methods/onchain/request_batched_fee_increase.d.ts +26 -0
- package/package.json +2 -2
- package/typescript/shared.d.ts +41 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AuthenticatedLightningArgs,
|
|
3
3
|
AuthenticatedLightningMethod,
|
|
4
|
+
ChannelPolicy,
|
|
4
5
|
} from '../../typescript';
|
|
5
6
|
|
|
6
7
|
export type GetChannelArgs = AuthenticatedLightningArgs<{
|
|
@@ -13,24 +14,7 @@ export type GetChannelResult = {
|
|
|
13
14
|
capacity: number;
|
|
14
15
|
/** Standard Format Channel Id */
|
|
15
16
|
id: string;
|
|
16
|
-
policies:
|
|
17
|
-
/** Base Fee Millitokens */
|
|
18
|
-
base_fee_mtokens?: string;
|
|
19
|
-
/** Locktime Delta */
|
|
20
|
-
cltv_delta?: number;
|
|
21
|
-
/** Fees Charged Per Million Millitokens */
|
|
22
|
-
fee_rate?: number;
|
|
23
|
-
/** Channel Is Disabled */
|
|
24
|
-
is_disabled?: boolean;
|
|
25
|
-
/** Maximum HTLC Millitokens Value */
|
|
26
|
-
max_htlc_mtokens?: string;
|
|
27
|
-
/** Minimum HTLC Millitokens Value */
|
|
28
|
-
min_htlc_mtokens?: string;
|
|
29
|
-
/** Node Public Key */
|
|
30
|
-
public_key: string;
|
|
31
|
-
/** Policy Last Updated At ISO 8601 Date */
|
|
32
|
-
updated_at?: string;
|
|
33
|
-
}[];
|
|
17
|
+
policies: ChannelPolicy[];
|
|
34
18
|
/** Transaction Id Hex */
|
|
35
19
|
transaction_id: string;
|
|
36
20
|
/** Transaction Output Index */
|
|
@@ -1,43 +1,29 @@
|
|
|
1
|
-
import {AuthenticatedLnd} from '../../lnd_grpc';
|
|
2
|
-
import {
|
|
1
|
+
import type {AuthenticatedLnd} from '../../lnd_grpc';
|
|
2
|
+
import type {
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
ChannelPolicy,
|
|
5
|
+
} from '../../typescript';
|
|
3
6
|
|
|
4
7
|
export type GetNetworkGraphResult = {
|
|
5
|
-
channels: {
|
|
8
|
+
channels: Array<{
|
|
6
9
|
/** Channel Capacity Tokens */
|
|
7
10
|
capacity: number;
|
|
8
11
|
/** Standard Format Channel Id */
|
|
9
12
|
id: string;
|
|
10
|
-
policies:
|
|
11
|
-
/** Base Fee Millitokens */
|
|
12
|
-
base_fee_mtokens?: string;
|
|
13
|
-
/** CLTV Height Delta */
|
|
14
|
-
cltv_delta?: number;
|
|
15
|
-
/** Fee Rate In Millitokens Per Million */
|
|
16
|
-
fee_rate?: number;
|
|
17
|
-
/** Edge is Disabled */
|
|
18
|
-
is_disabled?: boolean;
|
|
19
|
-
/** Maximum HTLC Millitokens */
|
|
20
|
-
max_htlc_mtokens?: string;
|
|
21
|
-
/** Minimum HTLC Millitokens */
|
|
22
|
-
min_htlc_mtokens?: string;
|
|
23
|
-
/** Public Key */
|
|
24
|
-
public_key: string;
|
|
25
|
-
/** Last Update Epoch ISO 8601 Date */
|
|
26
|
-
updated_at?: string;
|
|
27
|
-
}[];
|
|
13
|
+
policies: ChannelPolicy[];
|
|
28
14
|
/** Funding Transaction Id */
|
|
29
15
|
transaction_id: string;
|
|
30
16
|
/** Funding Transaction Output Index */
|
|
31
17
|
transaction_vout: number;
|
|
32
18
|
/** Last Update Epoch ISO 8601 Date */
|
|
33
19
|
updated_at?: string;
|
|
34
|
-
}
|
|
35
|
-
nodes: {
|
|
20
|
+
}>;
|
|
21
|
+
nodes: Array<{
|
|
36
22
|
/** Name */
|
|
37
23
|
alias: string;
|
|
38
24
|
/** Hex Encoded Color */
|
|
39
25
|
color: string;
|
|
40
|
-
features: {
|
|
26
|
+
features: Array<{
|
|
41
27
|
/** BOLT 09 Feature Bit */
|
|
42
28
|
bit: number;
|
|
43
29
|
/** Feature is Known */
|
|
@@ -46,14 +32,14 @@ export type GetNetworkGraphResult = {
|
|
|
46
32
|
is_required: boolean;
|
|
47
33
|
/** Feature Type */
|
|
48
34
|
type: string;
|
|
49
|
-
}
|
|
35
|
+
}>;
|
|
50
36
|
/** Node Public Key */
|
|
51
37
|
public_key: string;
|
|
52
38
|
/** Network Addresses and Ports */
|
|
53
39
|
sockets: string[];
|
|
54
40
|
/** Last Updated ISO 8601 Date */
|
|
55
41
|
updated_at: string;
|
|
56
|
-
}
|
|
42
|
+
}>;
|
|
57
43
|
};
|
|
58
44
|
|
|
59
45
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
AuthenticatedLightningArgs,
|
|
3
3
|
AuthenticatedLightningMethod,
|
|
4
|
+
ChannelPolicy,
|
|
4
5
|
} from '../../typescript';
|
|
5
6
|
|
|
6
7
|
export type GetNodeArgs = AuthenticatedLightningArgs<{
|
|
@@ -17,39 +18,22 @@ export type GetNodeResult = {
|
|
|
17
18
|
capacity: number;
|
|
18
19
|
/** Known Node Channels */
|
|
19
20
|
channel_count: number;
|
|
20
|
-
channels?: {
|
|
21
|
+
channels?: Array<{
|
|
21
22
|
/** Maximum Tokens */
|
|
22
23
|
capacity: number;
|
|
23
24
|
/** Standard Format Channel Id */
|
|
24
25
|
id: string;
|
|
25
|
-
policies:
|
|
26
|
-
/** Base Fee Millitokens */
|
|
27
|
-
base_fee_mtokens?: string;
|
|
28
|
-
/** Locktime Delta */
|
|
29
|
-
cltv_delta?: number;
|
|
30
|
-
/** Fees Charged Per Million Millitokens */
|
|
31
|
-
fee_rate?: number;
|
|
32
|
-
/** Channel Is Disabled */
|
|
33
|
-
is_disabled?: boolean;
|
|
34
|
-
/** Maximum HTLC Millitokens Value */
|
|
35
|
-
max_htlc_mtokens?: string;
|
|
36
|
-
/** Minimum HTLC Millitokens Value */
|
|
37
|
-
min_htlc_mtokens?: string;
|
|
38
|
-
/** Node Public Key */
|
|
39
|
-
public_key: string;
|
|
40
|
-
/** Policy Last Updated At ISO 8601 Date */
|
|
41
|
-
updated_at?: string;
|
|
42
|
-
}[];
|
|
26
|
+
policies: ChannelPolicy[];
|
|
43
27
|
/** Transaction Id Hex */
|
|
44
28
|
transaction_id: string;
|
|
45
29
|
/** Transaction Output Index */
|
|
46
30
|
transaction_vout: number;
|
|
47
31
|
/** Channel Last Updated At ISO 8601 Date */
|
|
48
32
|
updated_at?: string;
|
|
49
|
-
}
|
|
33
|
+
}>;
|
|
50
34
|
/** RGB Hex Color */
|
|
51
35
|
color: string;
|
|
52
|
-
features: {
|
|
36
|
+
features: Array<{
|
|
53
37
|
/** BOLT 09 Feature Bit */
|
|
54
38
|
bit: number;
|
|
55
39
|
/** Feature is Known */
|
|
@@ -58,13 +42,13 @@ export type GetNodeResult = {
|
|
|
58
42
|
is_required: boolean;
|
|
59
43
|
/** Feature Type */
|
|
60
44
|
type: string;
|
|
61
|
-
}
|
|
62
|
-
sockets: {
|
|
45
|
+
}>;
|
|
46
|
+
sockets: Array<{
|
|
63
47
|
/** Host and Port */
|
|
64
48
|
socket: string;
|
|
65
49
|
/** Socket Type */
|
|
66
50
|
type: string;
|
|
67
|
-
}
|
|
51
|
+
}>;
|
|
68
52
|
/** Last Known Update ISO 8601 Date */
|
|
69
53
|
updated_at?: string;
|
|
70
54
|
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type GetPendingSweepsArgs = AuthenticatedLightningArgs;
|
|
7
|
+
|
|
8
|
+
export interface Sweep {
|
|
9
|
+
/** Total Sweep Broadcast Attempts Count Number */
|
|
10
|
+
broadcasts_count: number;
|
|
11
|
+
/** Current Chain Fee Rate Tokens Per VByte Number */
|
|
12
|
+
current_fee_rate?: number;
|
|
13
|
+
/** Requested Chain Fee Rate Tokens per VByte Number */
|
|
14
|
+
initial_fee_rate?: number;
|
|
15
|
+
/** Requested Waiting For Batching Bool */
|
|
16
|
+
is_batching: boolean;
|
|
17
|
+
/** Maximum Total Fee Tokens Allowed Number */
|
|
18
|
+
max_fee?: number;
|
|
19
|
+
/** Targeted Maximum Confirmation Height Number */
|
|
20
|
+
max_height?: number;
|
|
21
|
+
/** Sweep Outpoint Tokens Value Number */
|
|
22
|
+
tokens: number;
|
|
23
|
+
/** Sweeping Outpoint Transaction Id Hex String */
|
|
24
|
+
transaction_id: string;
|
|
25
|
+
/** Sweeping Outpoint Transaction Output Index Number */
|
|
26
|
+
transaction_vout: number;
|
|
27
|
+
/** Outpoint Constraint Script Type String */
|
|
28
|
+
type: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface GetPendingSweepsResult {
|
|
32
|
+
sweeps: Sweep[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get pending self-transfer spends
|
|
37
|
+
*
|
|
38
|
+
* Requires `onchain:read` permission
|
|
39
|
+
*
|
|
40
|
+
* Requires LND built with `walletrpc` build tag
|
|
41
|
+
*
|
|
42
|
+
* This method is not supported in LND 0.17.5 or below
|
|
43
|
+
*/
|
|
44
|
+
export const getPendingSweeps: AuthenticatedLightningMethod<
|
|
45
|
+
GetPendingSweepsArgs,
|
|
46
|
+
GetPendingSweepsResult
|
|
47
|
+
>;
|
|
@@ -15,6 +15,7 @@ export * from './get_chain_transactions';
|
|
|
15
15
|
export * from './get_locked_utxos';
|
|
16
16
|
export * from './get_master_public_keys';
|
|
17
17
|
export * from './get_pending_chain_balance';
|
|
18
|
+
export * from './get_pending_sweeps';
|
|
18
19
|
export * from './get_sweep_transactions';
|
|
19
20
|
export * from './get_utxos';
|
|
20
21
|
export * from './lock_utxo';
|
|
@@ -23,6 +24,7 @@ export * from './open_channels';
|
|
|
23
24
|
export * from './partially_sign_psbt';
|
|
24
25
|
export * from './prepare_for_channel_proposal';
|
|
25
26
|
export * from './propose_channel';
|
|
27
|
+
export * from './request_batched_fee_increase';
|
|
26
28
|
export * from './request_chain_fee_increase';
|
|
27
29
|
export * from './send_to_chain_address';
|
|
28
30
|
export * from './send_to_chain_addresses';
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AuthenticatedLightningArgs,
|
|
3
|
+
AuthenticatedLightningMethod,
|
|
4
|
+
} from '../../typescript';
|
|
5
|
+
|
|
6
|
+
export type RequestBatchedFeeIncreaseArgs = AuthenticatedLightningArgs<{
|
|
7
|
+
/** Maximum Tokens to Pay Into Chain Fees Number */
|
|
8
|
+
max_fee?: number;
|
|
9
|
+
/** Maximum Height To Reach a Confirmation Number */
|
|
10
|
+
max_height?: number;
|
|
11
|
+
/** Unconfirmed UTXO Transaction Id Hex String */
|
|
12
|
+
transaction_id: string;
|
|
13
|
+
/** Unconfirmed UTXO Transaction Index Number */
|
|
14
|
+
transaction_vout: number;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Request batched CPFP fee bumping of an unconfirmed outpoint on a deadline
|
|
19
|
+
*
|
|
20
|
+
* Requires `onchain:write` permission
|
|
21
|
+
*
|
|
22
|
+
* Requires LND built with `walletrpc` build tag
|
|
23
|
+
*
|
|
24
|
+
* This method is unsupported on LND 0.17.5 and below
|
|
25
|
+
*/
|
|
26
|
+
export const requestBatchedFeeIncrease: AuthenticatedLightningMethod<RequestBatchedFeeIncreaseArgs>;
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@grpc/grpc-js": "1.10.7",
|
|
11
11
|
"@grpc/proto-loader": "0.7.13",
|
|
12
|
-
"@types/node": "20.12.
|
|
12
|
+
"@types/node": "20.12.11",
|
|
13
13
|
"@types/request": "2.48.12",
|
|
14
14
|
"@types/ws": "8.5.10",
|
|
15
15
|
"async": "3.2.5",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"directory": "test/typescript"
|
|
54
54
|
},
|
|
55
55
|
"types": "index.d.ts",
|
|
56
|
-
"version": "10.11.
|
|
56
|
+
"version": "10.11.1"
|
|
57
57
|
}
|
package/typescript/shared.d.ts
CHANGED
|
@@ -19,13 +19,13 @@ export type LightningError<TError = {err: Error}> = TError extends undefined
|
|
|
19
19
|
|
|
20
20
|
export type LightningCallback<TResult = void, TErrorDetails = any> = (
|
|
21
21
|
error: LightningError<TErrorDetails> | undefined | null,
|
|
22
|
-
result: TResult extends void ? undefined : TResult
|
|
22
|
+
result: TResult extends void ? undefined : TResult,
|
|
23
23
|
) => void;
|
|
24
24
|
|
|
25
25
|
export type LightningMethod<
|
|
26
26
|
TArgs = EmptyObject,
|
|
27
27
|
TResult = void,
|
|
28
|
-
TErrorDetails = any
|
|
28
|
+
TErrorDetails = any,
|
|
29
29
|
> = {
|
|
30
30
|
(args: TArgs): Promise<TResult>;
|
|
31
31
|
(args: TArgs, callback: LightningCallback<TResult, TErrorDetails>): void;
|
|
@@ -34,21 +34,21 @@ export type LightningMethod<
|
|
|
34
34
|
export type AuthenticatedLightningMethod<
|
|
35
35
|
TArgs extends {lnd: AuthenticatedLnd} = {lnd: AuthenticatedLnd},
|
|
36
36
|
TResult = void,
|
|
37
|
-
TErrorDetails = any
|
|
37
|
+
TErrorDetails = any,
|
|
38
38
|
> = LightningMethod<TArgs, TResult, TErrorDetails>;
|
|
39
39
|
|
|
40
40
|
export type UnauthenticatedLightningMethod<
|
|
41
41
|
TArgs extends {lnd: UnauthenticatedLnd} = {lnd: UnauthenticatedLnd},
|
|
42
42
|
TResult = void,
|
|
43
|
-
TErrorDetails = any
|
|
43
|
+
TErrorDetails = any,
|
|
44
44
|
> = LightningMethod<TArgs, TResult, TErrorDetails>;
|
|
45
45
|
|
|
46
46
|
export type AuthenticatedLightningSubscription<
|
|
47
|
-
TArgs extends {lnd: AuthenticatedLnd} = {lnd: AuthenticatedLnd}
|
|
47
|
+
TArgs extends {lnd: AuthenticatedLnd} = {lnd: AuthenticatedLnd},
|
|
48
48
|
> = (args: TArgs) => events.EventEmitter;
|
|
49
49
|
|
|
50
50
|
export type UnauthenticatedLightningSubscription<
|
|
51
|
-
TArgs extends {lnd: UnauthenticatedLnd} = {lnd: UnauthenticatedLnd}
|
|
51
|
+
TArgs extends {lnd: UnauthenticatedLnd} = {lnd: UnauthenticatedLnd},
|
|
52
52
|
> = (args: TArgs) => events.EventEmitter;
|
|
53
53
|
|
|
54
54
|
type CommonStatus = 'IN_FLIGHT' | 'SUCCEEDED' | 'FAILED';
|
|
@@ -113,10 +113,41 @@ export type RouteNode = {
|
|
|
113
113
|
fee_rate?: number;
|
|
114
114
|
/** Forward Edge Public Key Hex */
|
|
115
115
|
public_key: string;
|
|
116
|
-
}
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type Route = RouteNode[];
|
|
117
119
|
|
|
118
|
-
export type
|
|
120
|
+
export type Routes = Route[];
|
|
119
121
|
|
|
120
|
-
export type
|
|
122
|
+
export type UtxoSelection = 'largest' | 'random';
|
|
121
123
|
|
|
122
|
-
export
|
|
124
|
+
export interface ChannelPolicy {
|
|
125
|
+
/** Base Fee Millitokens */
|
|
126
|
+
base_fee_mtokens?: string;
|
|
127
|
+
/** Locktime Delta */
|
|
128
|
+
cltv_delta?: number;
|
|
129
|
+
/** Fees Charged Per Million Millitokens */
|
|
130
|
+
fee_rate?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Source Based Base Fee Reduction String
|
|
133
|
+
*
|
|
134
|
+
* Not supported on LND 0.17.5 and below
|
|
135
|
+
*/
|
|
136
|
+
inbound_base_discount_mtokens?: string;
|
|
137
|
+
/**
|
|
138
|
+
* Source Based Per Million Rate Reduction Number
|
|
139
|
+
*
|
|
140
|
+
* Not supported on LND 0.17.5 and below
|
|
141
|
+
*/
|
|
142
|
+
inbound_rate_discount?: number;
|
|
143
|
+
/** Channel Is Disabled */
|
|
144
|
+
is_disabled?: boolean;
|
|
145
|
+
/** Maximum HTLC Millitokens Value */
|
|
146
|
+
max_htlc_mtokens?: string;
|
|
147
|
+
/** Minimum HTLC Millitokens Value */
|
|
148
|
+
min_htlc_mtokens?: string;
|
|
149
|
+
/** Node Public Key */
|
|
150
|
+
public_key: string;
|
|
151
|
+
/** Policy Last Updated At ISO 8601 Date */
|
|
152
|
+
updated_at?: string;
|
|
153
|
+
}
|