lightning 10.19.0 → 10.20.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/create_invoice.d.ts +2 -0
- package/lnd_methods/offchain/finished_payment.d.ts +4 -0
- package/lnd_methods/offchain/finished_payment.js +2 -0
- package/lnd_methods/offchain/pay_via_payment_request.js +1 -0
- package/lnd_methods/offchain/subscribe_to_past_payment.d.ts +2 -0
- package/lnd_methods/offchain/subscribe_to_pay.d.ts +3 -1
- package/lnd_methods/offchain/subscribe_to_pay_via_request.js +2 -0
- package/lnd_methods/offchain/subscribe_to_payments.d.ts +138 -3
- package/lnd_responses/confirmed_from_payment.d.ts +2 -0
- package/lnd_responses/confirmed_from_payment.js +2 -0
- package/lnd_responses/pending_from_payment.js +2 -0
- package/package.json +4 -4
- package/test/lnd_methods/offchain/test_finished_payment.js +2 -0
- package/test/lnd_methods/offchain/test_get_payment.js +1 -0
- package/test/lnd_methods/offchain/test_subscribe_to_past_payments.js +1 -0
- package/test/lnd_methods/offchain/test_subscribe_to_payments.js +1 -0
- package/test/lnd_responses/test_confirmed_from_payment.js +1 -0
- package/test/lnd_responses/test_pending_from_payment.js +1 -0
- package/test/typescript/finished_payment.test-d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -13,6 +13,8 @@ export type CreateInvoiceArgs = AuthenticatedLightningArgs<{
|
|
|
13
13
|
description_hash?: string;
|
|
14
14
|
/** Expires At ISO 8601 Date */
|
|
15
15
|
expires_at?: string;
|
|
16
|
+
/** Use Blinded Paths For Inbound Routes */
|
|
17
|
+
is_encrypting_routes?: boolean;
|
|
16
18
|
/** Is Fallback Address Included */
|
|
17
19
|
is_fallback_included?: boolean;
|
|
18
20
|
/** Is Fallback Address Nested */
|
|
@@ -27,6 +27,8 @@ export type FinishedPaymentArgs = AuthenticatedLightningArgs<{
|
|
|
27
27
|
}[];
|
|
28
28
|
/** Payment Hash Hex String */
|
|
29
29
|
id: string;
|
|
30
|
+
/** Payment Index String */
|
|
31
|
+
index: string;
|
|
30
32
|
/** Total Millitokens Paid String */
|
|
31
33
|
mtokens: string;
|
|
32
34
|
paths: {
|
|
@@ -129,6 +131,8 @@ export type FinishedPaymentResult = {
|
|
|
129
131
|
}[];
|
|
130
132
|
/** Payment Hash Hex String */
|
|
131
133
|
id?: string;
|
|
134
|
+
/** Payment Index String */
|
|
135
|
+
index: string;
|
|
132
136
|
/** Total Millitokens Paid String */
|
|
133
137
|
mtokens: string;
|
|
134
138
|
paths: {
|
|
@@ -80,6 +80,7 @@ const {returnResult} = require('asyncjs-util');
|
|
|
80
80
|
timeout: <Timeout Block Height Number>
|
|
81
81
|
}]
|
|
82
82
|
[id]: <Payment Hash Hex String>
|
|
83
|
+
index: <Payment Index Offset Number String>
|
|
83
84
|
mtokens: <Total Millitokens Paid String>
|
|
84
85
|
paths: [{
|
|
85
86
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
@@ -146,6 +147,7 @@ module.exports = ({confirmed, failed}, cbk) => {
|
|
|
146
147
|
fee_mtokens: confirmed.fee_mtokens,
|
|
147
148
|
hops: confirmed.hops,
|
|
148
149
|
id: confirmed.id,
|
|
150
|
+
index: confirmed.index,
|
|
149
151
|
mtokens: confirmed.mtokens,
|
|
150
152
|
paths: confirmed.paths,
|
|
151
153
|
secret: confirmed.secret,
|
|
@@ -52,6 +52,7 @@ const type = 'router';
|
|
|
52
52
|
timeout: <First Route Timeout Block Height Number>
|
|
53
53
|
}]
|
|
54
54
|
id: <Payment Hash Hex String>
|
|
55
|
+
index: <Payment Index Offset Number String>
|
|
55
56
|
mtokens: <Total Millitokens Paid String>
|
|
56
57
|
paths: [{
|
|
57
58
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
@@ -58,6 +58,8 @@ export type SubscribeToPastPaymentConfirmedEvent = {
|
|
|
58
58
|
export type SubscribeToPastPaymentFailedEvent = {
|
|
59
59
|
/** Payment Hash Hex */
|
|
60
60
|
id: string;
|
|
61
|
+
/** Payment Canceled */
|
|
62
|
+
is_canceled: boolean;
|
|
61
63
|
/** Failed Due To Lack of Balance */
|
|
62
64
|
is_insufficient_balance: boolean;
|
|
63
65
|
/** Failed Due to Payment Rejected At Destination */
|
|
@@ -140,7 +140,9 @@ export type SubscribeToPayConfirmedEvent = {
|
|
|
140
140
|
export type SubscribeToPayFailedEvent = {
|
|
141
141
|
/** Payment Hash Hex */
|
|
142
142
|
id: string;
|
|
143
|
-
/**
|
|
143
|
+
/** Payment Canceled */
|
|
144
|
+
is_canceled: boolean;
|
|
145
|
+
/** Failed Due To Lack of Balance */
|
|
144
146
|
is_insufficient_balance: boolean;
|
|
145
147
|
/** Failed Due to Invalid Payment Bool> */
|
|
146
148
|
is_invalid_payment: boolean;
|
|
@@ -54,6 +54,7 @@ const type = 'router';
|
|
|
54
54
|
timeout: <First Route Timeout Block Height Number>
|
|
55
55
|
}]
|
|
56
56
|
id: <Payment Hash Hex String>
|
|
57
|
+
index: <Payment Index Offset Number String>
|
|
57
58
|
mtokens: <Total Millitokens Paid String>
|
|
58
59
|
paths: [{
|
|
59
60
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
@@ -109,6 +110,7 @@ const type = 'router';
|
|
|
109
110
|
created_at: <Payment Created At ISO 8601 Date String>
|
|
110
111
|
destination: <Payment Destination Hex String>
|
|
111
112
|
id: <Payment Hash Hex String>
|
|
113
|
+
index: <Payment Index Offset Number String>
|
|
112
114
|
mtokens: <Total Millitokens Pending String>
|
|
113
115
|
paths: [{
|
|
114
116
|
fee: <Total Fee Tokens Pending Number>
|
|
@@ -7,10 +7,145 @@ import type {SubscribeToPastPaymentsPaymentEvent} from './subscribe_to_past_paym
|
|
|
7
7
|
|
|
8
8
|
export type SubscribeToPaymentsArgs = AuthenticatedLightningArgs;
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
/** A confirmed payment event
|
|
11
|
+
* @event 'confirmed'
|
|
12
|
+
*/
|
|
13
|
+
export interface SubscribeToPaymentsConfirmedEvent {
|
|
14
|
+
/** Payment Confirmed At ISO 8601 Date String */
|
|
15
|
+
confirmed_at: string;
|
|
16
|
+
/** Payment Created At ISO 8601 Date String */
|
|
17
|
+
created_at: string;
|
|
18
|
+
/** Payment Destination Hex String */
|
|
19
|
+
destination: string;
|
|
20
|
+
/** Total Fee Tokens Paid Rounded Down Number */
|
|
21
|
+
fee: number;
|
|
22
|
+
/** Total Fee Millitokens Paid String */
|
|
23
|
+
fee_mtokens: string;
|
|
24
|
+
/** Payment Hash Hex String */
|
|
25
|
+
id: string;
|
|
26
|
+
/** Total Millitokens Paid String */
|
|
27
|
+
mtokens: string;
|
|
28
|
+
/** Payment paths */
|
|
29
|
+
paths?: Array<{
|
|
30
|
+
/** Total Fee Tokens Paid Number */
|
|
31
|
+
fee: number;
|
|
32
|
+
/** Total Fee Millitokens Paid String */
|
|
33
|
+
fee_mtokens: string;
|
|
34
|
+
/** Hops in the path */
|
|
35
|
+
hops: Array<{
|
|
36
|
+
/** Standard Format Channel Id String */
|
|
37
|
+
channel: string;
|
|
38
|
+
/** Channel Capacity Tokens Number */
|
|
39
|
+
channel_capacity: number;
|
|
40
|
+
/** Fee Tokens Rounded Down Number */
|
|
41
|
+
fee: number;
|
|
42
|
+
/** Fee Millitokens String */
|
|
43
|
+
fee_mtokens: string;
|
|
44
|
+
/** Forward Tokens Number */
|
|
45
|
+
forward: number;
|
|
46
|
+
/** Forward Millitokens String */
|
|
47
|
+
forward_mtokens: string;
|
|
48
|
+
/** Public Key Hex String */
|
|
49
|
+
public_key: string;
|
|
50
|
+
/** Timeout Block Height Number */
|
|
51
|
+
timeout: number;
|
|
52
|
+
}>;
|
|
53
|
+
/** Total Millitokens Paid String */
|
|
54
|
+
mtokens: string;
|
|
55
|
+
/** Total Fee Tokens Paid Rounded Up Number */
|
|
56
|
+
safe_fee: number;
|
|
57
|
+
/** Total Tokens Paid, Rounded Up Number */
|
|
58
|
+
safe_tokens: number;
|
|
59
|
+
/** Expiration Block Height Number */
|
|
60
|
+
timeout: number;
|
|
61
|
+
}>;
|
|
62
|
+
/** BOLT 11 Encoded Payment Request String */
|
|
63
|
+
request?: string;
|
|
64
|
+
/** Total Fee Tokens Paid Rounded Up Number */
|
|
65
|
+
safe_fee: number;
|
|
66
|
+
/** Total Tokens Paid, Rounded Up Number */
|
|
67
|
+
safe_tokens: number;
|
|
68
|
+
/** Payment Preimage Hex String */
|
|
69
|
+
secret: string;
|
|
70
|
+
/** Expiration Block Height Number */
|
|
71
|
+
timeout: number;
|
|
72
|
+
/** Total Tokens Paid Rounded Down Number */
|
|
73
|
+
tokens: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A failed payment event
|
|
77
|
+
* @event 'failed'
|
|
78
|
+
*/
|
|
79
|
+
export interface SubscribeToPaymentsFailedEvent {
|
|
80
|
+
/** Payment Hash Hex String */
|
|
81
|
+
id: string;
|
|
82
|
+
/** Payment Canceled Bool */
|
|
83
|
+
is_canceled: boolean;
|
|
84
|
+
/** Failed Due To Lack of Balance Bool */
|
|
85
|
+
is_insufficient_balance: boolean;
|
|
86
|
+
/** Failed Due to Payment Rejected At Destination Bool */
|
|
87
|
+
is_invalid_payment: boolean;
|
|
88
|
+
/** Failed Due to Pathfinding Timeout Bool */
|
|
89
|
+
is_pathfinding_timeout: boolean;
|
|
90
|
+
/** Failed Due to Absence of Path Through Graph Bool */
|
|
91
|
+
is_route_not_found: boolean;
|
|
92
|
+
}
|
|
11
93
|
|
|
12
|
-
|
|
13
|
-
|
|
94
|
+
/** A paying (in-progress) payment event
|
|
95
|
+
* @event 'paying'
|
|
96
|
+
*/
|
|
97
|
+
export interface SubscribeToPaymentsPayingEvent {
|
|
98
|
+
/** Payment Created At ISO 8601 Date String */
|
|
99
|
+
created_at: string;
|
|
100
|
+
/** Payment Destination Hex String */
|
|
101
|
+
destination: string;
|
|
102
|
+
/** Payment Hash Hex String */
|
|
103
|
+
id: string;
|
|
104
|
+
/** Total Millitokens Pending String */
|
|
105
|
+
mtokens: string;
|
|
106
|
+
/** Payment paths */
|
|
107
|
+
paths?: Array<{
|
|
108
|
+
/** Total Fee Tokens Pending Number */
|
|
109
|
+
fee: number;
|
|
110
|
+
/** Total Fee Millitokens Pending String */
|
|
111
|
+
fee_mtokens: string;
|
|
112
|
+
/** Hops in the path */
|
|
113
|
+
hops: Array<{
|
|
114
|
+
/** Standard Format Channel Id String */
|
|
115
|
+
channel: string;
|
|
116
|
+
/** Channel Capacity Tokens Number */
|
|
117
|
+
channel_capacity: number;
|
|
118
|
+
/** Fee Tokens Rounded Down Number */
|
|
119
|
+
fee: number;
|
|
120
|
+
/** Fee Millitokens String */
|
|
121
|
+
fee_mtokens: string;
|
|
122
|
+
/** Forward Tokens Number */
|
|
123
|
+
forward: number;
|
|
124
|
+
/** Forward Millitokens String */
|
|
125
|
+
forward_mtokens: string;
|
|
126
|
+
/** Public Key Hex String */
|
|
127
|
+
public_key: string;
|
|
128
|
+
/** Timeout Block Height Number */
|
|
129
|
+
timeout: number;
|
|
130
|
+
}>;
|
|
131
|
+
/** Total Millitokens Pending String */
|
|
132
|
+
mtokens: string;
|
|
133
|
+
/** Total Fee Tokens Pending Rounded Up Number */
|
|
134
|
+
safe_fee: number;
|
|
135
|
+
/** Total Tokens Pending, Rounded Up Number */
|
|
136
|
+
safe_tokens: number;
|
|
137
|
+
/** Expiration Block Height Number */
|
|
138
|
+
timeout: number;
|
|
139
|
+
}>;
|
|
140
|
+
/** BOLT 11 Encoded Payment Request String */
|
|
141
|
+
request?: string;
|
|
142
|
+
/** Total Tokens Pending, Rounded Up Number */
|
|
143
|
+
safe_tokens: number;
|
|
144
|
+
/** Expiration Block Height Number */
|
|
145
|
+
timeout?: number;
|
|
146
|
+
/** Total Tokens Pending Rounded Down Number */
|
|
147
|
+
tokens: number;
|
|
148
|
+
}
|
|
14
149
|
|
|
15
150
|
/**
|
|
16
151
|
* Subscribe to outgoing payments
|
|
@@ -81,6 +81,7 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
81
81
|
timeout: <First Path Timeout Block Height Number>
|
|
82
82
|
}]
|
|
83
83
|
id: <Payment Hash Hex String>
|
|
84
|
+
index: <Payment Index Offset Number String>
|
|
84
85
|
mtokens: <Total Millitokens Paid String>
|
|
85
86
|
paths: [{
|
|
86
87
|
fee: <Total Fee Tokens Paid Number>
|
|
@@ -159,6 +160,7 @@ module.exports = payment => {
|
|
|
159
160
|
fee_mtokens: payment.fee_msat,
|
|
160
161
|
hops: success.route.hops,
|
|
161
162
|
id: payment.payment_hash,
|
|
163
|
+
index: payment.payment_index,
|
|
162
164
|
mtokens: mtokens.toString(),
|
|
163
165
|
paths: successes.map(n => n.route),
|
|
164
166
|
request: payment.payment_request || undefined,
|
|
@@ -67,6 +67,7 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
67
67
|
created_at: <Payment Created At ISO 8601 Date String>
|
|
68
68
|
destination: <Payment Destination Public Key Hex String>
|
|
69
69
|
id: <Payment Hash Hex String>
|
|
70
|
+
index: <Payment Index Offset Number String>
|
|
70
71
|
mtokens: <Total Millitokens Pending String>
|
|
71
72
|
paths: [{
|
|
72
73
|
fee: <Total Fee Tokens Pending Number>
|
|
@@ -134,6 +135,7 @@ module.exports = payment => {
|
|
|
134
135
|
destination,
|
|
135
136
|
created_at: nsAsDate(payment.creation_time_ns).toISOString(),
|
|
136
137
|
id: payment.payment_hash,
|
|
138
|
+
index: payment.payment_index,
|
|
137
139
|
mtokens: mtokens.toString(),
|
|
138
140
|
paths: pending.map(n => n.route),
|
|
139
141
|
request: payment.payment_request || undefined,
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@grpc/grpc-js": "1.11.1",
|
|
11
11
|
"@grpc/proto-loader": "0.7.13",
|
|
12
|
-
"@types/node": "22.5.
|
|
12
|
+
"@types/node": "22.5.4",
|
|
13
13
|
"@types/request": "2.48.12",
|
|
14
14
|
"@types/ws": "8.5.12",
|
|
15
15
|
"async": "3.2.6",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"invoices": "3.0.0",
|
|
23
23
|
"psbt": "3.0.0",
|
|
24
24
|
"tiny-secp256k1": "2.2.3",
|
|
25
|
-
"type-fest": "4.
|
|
25
|
+
"type-fest": "4.26.0"
|
|
26
26
|
},
|
|
27
27
|
"description": "Lightning Network client library",
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"tsd": "0.31.
|
|
29
|
+
"tsd": "0.31.2",
|
|
30
30
|
"typescript": "5.5.4"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"directory": "test/typescript"
|
|
54
54
|
},
|
|
55
55
|
"types": "index.d.ts",
|
|
56
|
-
"version": "10.
|
|
56
|
+
"version": "10.20.0"
|
|
57
57
|
}
|
|
@@ -20,6 +20,7 @@ const makeArgs = overrides => {
|
|
|
20
20
|
timeout: 1,
|
|
21
21
|
}],
|
|
22
22
|
id: Buffer.alloc(32).toString('hex'),
|
|
23
|
+
index: '1',
|
|
23
24
|
mtokens: '1000',
|
|
24
25
|
paths: [{
|
|
25
26
|
fee_mtokens: '1000',
|
|
@@ -107,6 +108,7 @@ const tests = [
|
|
|
107
108
|
timeout: 1,
|
|
108
109
|
}],
|
|
109
110
|
id: '0000000000000000000000000000000000000000000000000000000000000000',
|
|
111
|
+
index: '1',
|
|
110
112
|
mtokens: '1000',
|
|
111
113
|
paths: [{
|
|
112
114
|
fee_mtokens: '1000',
|