lightning 11.1.0 → 12.0.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 +8 -0
- package/grpc/protos/lightning.proto +137 -2
- package/grpc/protos/router.proto +69 -3
- package/grpc/protos/signer.proto +60 -0
- package/grpc/protos/walletkit.proto +67 -1
- package/lnd_messages/pay_via_route_request.js +0 -2
- package/lnd_methods/info/get_configuration.js +1 -1
- package/lnd_methods/info/get_route_to_destination.d.ts +0 -4
- package/lnd_methods/info/get_route_to_destination.js +4 -6
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.d.ts +0 -2
- package/lnd_methods/macaroon/subscribe_to_rpc_requests.js +0 -1
- package/lnd_methods/offchain/attempt_route.d.ts +0 -2
- package/lnd_methods/offchain/attempt_route.js +0 -1
- package/lnd_methods/offchain/finished_payment.d.ts +0 -10
- package/lnd_methods/offchain/finished_payment.js +0 -5
- package/lnd_methods/offchain/get_failed_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_failed_payments.js +0 -1
- package/lnd_methods/offchain/get_payment.d.ts +0 -6
- package/lnd_methods/offchain/get_payment.js +0 -3
- package/lnd_methods/offchain/get_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_payments.js +0 -1
- package/lnd_methods/offchain/get_pending_payments.d.ts +0 -2
- package/lnd_methods/offchain/get_pending_payments.js +0 -1
- package/lnd_methods/offchain/get_route_through_hops.d.ts +0 -2
- package/lnd_methods/offchain/get_route_through_hops.js +0 -1
- package/lnd_methods/offchain/list_payments.js +0 -1
- package/lnd_methods/offchain/pay.d.ts +0 -4
- package/lnd_methods/offchain/pay.js +0 -3
- package/lnd_methods/offchain/pay_via_payment_details.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_payment_details.js +0 -2
- package/lnd_methods/offchain/pay_via_payment_request.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_payment_request.js +0 -2
- package/lnd_methods/offchain/pay_via_routes.d.ts +0 -4
- package/lnd_methods/offchain/pay_via_routes.js +0 -3
- package/lnd_methods/offchain/probe_for_route.d.ts +0 -2
- package/lnd_methods/offchain/probe_for_route.js +0 -2
- package/lnd_methods/offchain/subscribe_to_channels.js +1 -1
- package/lnd_methods/offchain/subscribe_to_past_payment.d.ts +0 -4
- package/lnd_methods/offchain/subscribe_to_past_payment.js +0 -2
- package/lnd_methods/offchain/subscribe_to_past_payments.d.ts +0 -2
- package/lnd_methods/offchain/subscribe_to_past_payments.js +0 -1
- package/lnd_methods/offchain/subscribe_to_pay.d.ts +0 -10
- package/lnd_methods/offchain/subscribe_to_pay.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_details.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_request.js +0 -5
- package/lnd_methods/offchain/subscribe_to_pay_via_routes.d.ts +0 -10
- package/lnd_methods/offchain/subscribe_to_pay_via_routes.js +0 -5
- package/lnd_methods/offchain/subscribe_to_payments.d.ts +0 -4
- package/lnd_methods/offchain/subscribe_to_payments.js +0 -2
- package/lnd_methods/offchain/subscribe_to_probe_for_route.d.ts +0 -8
- package/lnd_methods/offchain/subscribe_to_probe_for_route.js +0 -4
- package/lnd_requests/rpc_hop_from_hop.js +0 -7
- package/lnd_requests/rpc_route_from_route.js +0 -2
- package/lnd_responses/confirmed_from_payment.d.ts +0 -6
- package/lnd_responses/confirmed_from_payment.js +0 -3
- package/lnd_responses/confirmed_from_payment_status.js +0 -5
- package/lnd_responses/pending_from_payment.js +0 -2
- package/lnd_responses/routes_from_query_routes.js +0 -3
- package/lnd_responses/routing_failure_from_htlc.js +0 -2
- package/lnd_responses/rpc_attempt_htlc_as_attempt.js +0 -2
- package/lnd_responses/rpc_hop_as_hop.js +0 -7
- package/lnd_responses/rpc_payment_as_payment.js +0 -2
- package/lnd_responses/rpc_route_as_route.js +0 -2
- package/package.json +4 -4
- package/test/lnd_messages/test_pay_via_route_request.js +0 -2
- package/test/lnd_methods/fixtures/query_routes_response.json +0 -1
- package/test/lnd_methods/info/test_get_route_to_destination.js +0 -3
- package/test/lnd_methods/macaroon/test_handle_rpc_request_update.js +0 -2
- package/test/lnd_methods/offchain/test_finished_payment.js +0 -4
- package/test/lnd_methods/offchain/test_get_payment.js +0 -5
- package/test/lnd_methods/offchain/test_get_payments.js +0 -2
- package/test/lnd_methods/offchain/test_get_route_through_hops.js +0 -4
- package/test/lnd_methods/offchain/test_is_destination_payable.js +0 -3
- package/test/lnd_methods/offchain/test_pay.js +0 -3
- package/test/lnd_methods/offchain/test_pay_via_payment_details.js +0 -4
- package/test/lnd_methods/offchain/test_pay_via_payment_request.js +0 -4
- package/test/lnd_methods/offchain/test_pay_via_routes.js +0 -9
- package/test/lnd_methods/offchain/test_subscribe_to_channels.js +0 -20
- package/test/lnd_methods/offchain/test_subscribe_to_past_payments.js +0 -3
- package/test/lnd_methods/offchain/test_subscribe_to_pay_via_routes.js +0 -7
- package/test/lnd_methods/offchain/test_subscribe_to_payments.js +0 -3
- package/test/lnd_methods/offchain/test_subscribe_to_probe_for_route.js +0 -1
- package/test/lnd_requests/test_rpc_hop_from_hop.js +1 -10
- package/test/lnd_requests/test_rpc_route_from_route.js +0 -4
- package/test/lnd_responses/test_confirmed_from_payment.js +0 -3
- package/test/lnd_responses/test_confirmed_from_payment_status.js +0 -4
- package/test/lnd_responses/test_pending_from_payment.js +0 -2
- package/test/lnd_responses/test_routes_from_query_routes.js +0 -2
- package/test/lnd_responses/test_routing_failure_from_htlc.js +0 -2
- package/test/lnd_responses/test_rpc_attempt_htlc_as_attempt.js +0 -2
- package/test/lnd_responses/test_rpc_hop_as_hop.js +0 -7
- package/test/lnd_responses/test_rpc_payment_as_payment.js +0 -6
- package/test/lnd_responses/test_rpc_route_as_route.js +0 -2
- package/test-typescript/typescript/attempt_route.test-d.ts +0 -1
- package/test-typescript/typescript/confirmed_from_payment.test-d.ts +0 -1
- package/test-typescript/typescript/finished_payment.test-d.ts +0 -2
- package/test-typescript/typescript/pay.test-d.ts +0 -1
- package/test-typescript/typescript/pay_via_routes.test-d.ts +0 -1
- package/test-typescript/typescript/subscribe_to_pay_via_routes.test-d.ts +0 -1
|
@@ -16,8 +16,6 @@ export type SubscribeToPayViaRoutesArgs = AuthenticatedLightningArgs<{
|
|
|
16
16
|
hops: {
|
|
17
17
|
/** Standard Format Channel Id */
|
|
18
18
|
channel: string;
|
|
19
|
-
/** Channel Capacity Tokens */
|
|
20
|
-
channel_capacity: number;
|
|
21
19
|
/** Fee */
|
|
22
20
|
fee: number;
|
|
23
21
|
/** Fee Millitokens */
|
|
@@ -98,8 +96,6 @@ export type SubscribeToPayViaRoutesPayingEvent = {
|
|
|
98
96
|
hops: {
|
|
99
97
|
/** Standard Format Channel Id */
|
|
100
98
|
channel: string;
|
|
101
|
-
/** Channel Capacity Tokens */
|
|
102
|
-
channel_capacity: number;
|
|
103
99
|
/** Fee */
|
|
104
100
|
fee: number;
|
|
105
101
|
/** Fee Millitokens */
|
|
@@ -155,8 +151,6 @@ export type SubscribeToPayViaRoutesRoutingFailureEvent = {
|
|
|
155
151
|
hops: {
|
|
156
152
|
/** Standard Format Channel Id */
|
|
157
153
|
channel: string;
|
|
158
|
-
/** Channel Capacity Tokens */
|
|
159
|
-
channel_capacity: number;
|
|
160
154
|
/** Fee */
|
|
161
155
|
fee: number;
|
|
162
156
|
/** Fee Millitokens */
|
|
@@ -205,8 +199,6 @@ export type SubscribeToPayViaRoutesSuccessEvent = {
|
|
|
205
199
|
hops: {
|
|
206
200
|
/** Standard Format Channel Id */
|
|
207
201
|
channel: string;
|
|
208
|
-
/** Hop Channel Capacity Tokens */
|
|
209
|
-
channel_capacity: number;
|
|
210
202
|
/** Hop Forward Fee Millitokens */
|
|
211
203
|
fee_mtokens: string;
|
|
212
204
|
/** Hop Forwarded Millitokens */
|
|
@@ -230,8 +222,6 @@ export type SubscribeToPayViaRoutesSuccessEvent = {
|
|
|
230
222
|
hops: {
|
|
231
223
|
/** Standard Format Channel Id */
|
|
232
224
|
channel: string;
|
|
233
|
-
/** Channel Capacity Tokens */
|
|
234
|
-
channel_capacity: number;
|
|
235
225
|
/** Fee */
|
|
236
226
|
fee: number;
|
|
237
227
|
/** Fee Millitokens */
|
|
@@ -38,7 +38,6 @@ const unknownWireError = 'unknown wire error';
|
|
|
38
38
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
39
39
|
hops: [{
|
|
40
40
|
channel: <Standard Format Channel Id String>
|
|
41
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
42
41
|
fee: <Fee Number>
|
|
43
42
|
fee_mtokens: <Fee Millitokens String>
|
|
44
43
|
forward: <Forward Tokens Number>
|
|
@@ -104,7 +103,6 @@ const unknownWireError = 'unknown wire error';
|
|
|
104
103
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
105
104
|
hops: [{
|
|
106
105
|
channel: <Standard Format Channel Id String>
|
|
107
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
108
106
|
fee: <Fee Number>
|
|
109
107
|
fee_mtokens: <Fee Millitokens String>
|
|
110
108
|
forward: <Forward Tokens Number>
|
|
@@ -139,7 +137,6 @@ const unknownWireError = 'unknown wire error';
|
|
|
139
137
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
140
138
|
hops: [{
|
|
141
139
|
channel: <Standard Format Channel Id String>
|
|
142
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
143
140
|
fee: <Fee Number>
|
|
144
141
|
fee_mtokens: <Fee Millitokens String>
|
|
145
142
|
forward: <Forward Tokens Number>
|
|
@@ -169,7 +166,6 @@ const unknownWireError = 'unknown wire error';
|
|
|
169
166
|
fee_mtokens: <Fee Paid Millitokens String>
|
|
170
167
|
hops: [{
|
|
171
168
|
channel: <Standard Format Channel Id String>
|
|
172
|
-
channel_capacity: <Hop Channel Capacity Tokens Number>
|
|
173
169
|
fee_mtokens: <Hop Forward Fee Millitokens String>
|
|
174
170
|
forward_mtokens: <Hop Forwarded Millitokens String>
|
|
175
171
|
timeout: <Hop CLTV Expiry Block Height Number>
|
|
@@ -183,7 +179,6 @@ const unknownWireError = 'unknown wire error';
|
|
|
183
179
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
184
180
|
hops: [{
|
|
185
181
|
channel: <Standard Format Channel Id String>
|
|
186
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
187
182
|
fee: <Fee Number>
|
|
188
183
|
fee_mtokens: <Fee Millitokens String>
|
|
189
184
|
forward: <Forward Tokens Number>
|
|
@@ -35,8 +35,6 @@ export interface SubscribeToPaymentsConfirmedEvent {
|
|
|
35
35
|
hops: Array<{
|
|
36
36
|
/** Standard Format Channel Id String */
|
|
37
37
|
channel: string;
|
|
38
|
-
/** Channel Capacity Tokens Number */
|
|
39
|
-
channel_capacity: number;
|
|
40
38
|
/** Fee Tokens Rounded Down Number */
|
|
41
39
|
fee: number;
|
|
42
40
|
/** Fee Millitokens String */
|
|
@@ -113,8 +111,6 @@ export interface SubscribeToPaymentsPayingEvent {
|
|
|
113
111
|
hops: Array<{
|
|
114
112
|
/** Standard Format Channel Id String */
|
|
115
113
|
channel: string;
|
|
116
|
-
/** Channel Capacity Tokens Number */
|
|
117
|
-
channel_capacity: number;
|
|
118
114
|
/** Fee Tokens Rounded Down Number */
|
|
119
115
|
fee: number;
|
|
120
116
|
/** Fee Millitokens String */
|
|
@@ -40,7 +40,6 @@ const type = 'router';
|
|
|
40
40
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
41
41
|
hops: [{
|
|
42
42
|
channel: <Standard Format Channel Id String>
|
|
43
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
44
43
|
fee: <Fee Tokens Rounded Down Number>
|
|
45
44
|
fee_mtokens: <Fee Millitokens String>
|
|
46
45
|
forward: <Forward Tokens Number>
|
|
@@ -82,7 +81,6 @@ const type = 'router';
|
|
|
82
81
|
fee_mtokens: <Total Fee Millitokens Pending String>
|
|
83
82
|
hops: [{
|
|
84
83
|
channel: <Standard Format Channel Id String>
|
|
85
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
86
84
|
fee: <Fee Tokens Rounded Down Number>
|
|
87
85
|
fee_mtokens: <Fee Millitokens String>
|
|
88
86
|
forward: <Forward Tokens Number>
|
|
@@ -46,8 +46,6 @@ export type SubscribeToProbeForRouteArgs = AuthenticatedLightningArgs<{
|
|
|
46
46
|
routes?: {
|
|
47
47
|
/** Base Routing Fee In Millitokens */
|
|
48
48
|
base_fee_mtokens?: string;
|
|
49
|
-
/** Channel Capacity Tokens */
|
|
50
|
-
channel_capacity?: number;
|
|
51
49
|
/** Standard Format Channel Id */
|
|
52
50
|
channel?: string;
|
|
53
51
|
/** CLTV Blocks Delta */
|
|
@@ -76,8 +74,6 @@ export type SubscribeToProbeForRouteProbeSuccessEvent = {
|
|
|
76
74
|
hops: {
|
|
77
75
|
/** Standard Format Channel Id */
|
|
78
76
|
channel: string;
|
|
79
|
-
/** Channel Capacity Tokens */
|
|
80
|
-
channel_capacity: number;
|
|
81
77
|
/** Fee */
|
|
82
78
|
fee: number;
|
|
83
79
|
/** Fee Millitokens */
|
|
@@ -125,8 +121,6 @@ export type SubscribeToProbeForRouteProbingEvent = {
|
|
|
125
121
|
hops: {
|
|
126
122
|
/** Standard Format Channel Id */
|
|
127
123
|
channel: string;
|
|
128
|
-
/** Channel Capacity Tokens */
|
|
129
|
-
channel_capacity: number;
|
|
130
124
|
/** Fee */
|
|
131
125
|
fee: number;
|
|
132
126
|
/** Fee Millitokens */
|
|
@@ -196,8 +190,6 @@ export type SubscribeToProbeForRouteRoutingFailureEvent = {
|
|
|
196
190
|
hops: {
|
|
197
191
|
/** Standard Format Channel Id */
|
|
198
192
|
channel: string;
|
|
199
|
-
/** Channel Capacity Tokens */
|
|
200
|
-
channel_capacity: number;
|
|
201
193
|
/** Fee */
|
|
202
194
|
fee: number;
|
|
203
195
|
/** Fee Millitokens */
|
|
@@ -49,7 +49,6 @@ const {nextTick} = process;
|
|
|
49
49
|
[probe_timeout_ms]: <Fail Entire Probe After Milliseconds Number>
|
|
50
50
|
[routes]: [[{
|
|
51
51
|
[base_fee_mtokens]: <Base Routing Fee In Millitokens String>
|
|
52
|
-
[channel_capacity]: <Channel Capacity Tokens Number>
|
|
53
52
|
[channel]: <Standard Format Channel Id String>
|
|
54
53
|
[cltv_delta]: <CLTV Blocks Delta Number>
|
|
55
54
|
[fee_rate]: <Fee Rate In Millitokens Per Million Number>
|
|
@@ -73,7 +72,6 @@ const {nextTick} = process;
|
|
|
73
72
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
74
73
|
hops: [{
|
|
75
74
|
channel: <Standard Format Channel Id String>
|
|
76
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
77
75
|
fee: <Fee Number>
|
|
78
76
|
fee_mtokens: <Fee Millitokens String>
|
|
79
77
|
forward: <Forward Tokens Number>
|
|
@@ -103,7 +101,6 @@ const {nextTick} = process;
|
|
|
103
101
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
104
102
|
hops: [{
|
|
105
103
|
channel: <Standard Format Channel Id String>
|
|
106
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
107
104
|
fee: <Fee Number>
|
|
108
105
|
fee_mtokens: <Fee Millitokens String>
|
|
109
106
|
forward: <Forward Tokens Number>
|
|
@@ -148,7 +145,6 @@ const {nextTick} = process;
|
|
|
148
145
|
fee_mtokens: <Total Fee Millitokens To Pay String>
|
|
149
146
|
hops: [{
|
|
150
147
|
channel: <Standard Format Channel Id String>
|
|
151
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
152
148
|
fee: <Fee Number>
|
|
153
149
|
fee_mtokens: <Fee Millitokens String>
|
|
154
150
|
forward: <Forward Tokens Number>
|
|
@@ -8,7 +8,6 @@ const millitokensAsTokens = n => Number(BigInt(n) / BigInt(1e3));
|
|
|
8
8
|
|
|
9
9
|
{
|
|
10
10
|
channel: <Standard Format Channel Id String>
|
|
11
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
12
11
|
fee: <Fee Number>
|
|
13
12
|
fee_mtokens: <Fee Millitokens String>
|
|
14
13
|
forward: <Forward Tokens Number>
|
|
@@ -29,7 +28,6 @@ const millitokensAsTokens = n => Number(BigInt(n) / BigInt(1e3));
|
|
|
29
28
|
amt_to_forward: <Tokens to Forward String>
|
|
30
29
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
31
30
|
chan_id: <Numeric Format Channel Id String>
|
|
32
|
-
chan_capacity: <Channel Capacity Number>
|
|
33
31
|
[custom_records]: {<TLV Type Number String>: <TLV Value Buffer Object>}
|
|
34
32
|
expiry: <Timeout Chain Height Number>
|
|
35
33
|
fee: <Fee in Tokens Number>
|
|
@@ -39,10 +37,6 @@ const millitokensAsTokens = n => Number(BigInt(n) / BigInt(1e3));
|
|
|
39
37
|
}
|
|
40
38
|
*/
|
|
41
39
|
module.exports = args => {
|
|
42
|
-
if (!isNumber(args.channel_capacity)) {
|
|
43
|
-
throw new Error('ExpectedNumericChannelCapacityToMapRpcHopFromHop');
|
|
44
|
-
}
|
|
45
|
-
|
|
46
40
|
if (!args.forward_mtokens) {
|
|
47
41
|
throw new Error('ExpectedForwardMillitokensToMapRpcHopFromHop');
|
|
48
42
|
}
|
|
@@ -55,7 +49,6 @@ module.exports = args => {
|
|
|
55
49
|
amt_to_forward: millitokensAsTokens(args.forward_mtokens).toString(),
|
|
56
50
|
amt_to_forward_msat: args.forward_mtokens,
|
|
57
51
|
chan_id: chanNumber({channel: args.channel}).number,
|
|
58
|
-
chan_capacity: args.channel_capacity.toString(),
|
|
59
52
|
expiry: args.timeout,
|
|
60
53
|
fee: millitokensAsTokens(args.fee_mtokens).toString(),
|
|
61
54
|
fee_msat: args.fee_mtokens,
|
|
@@ -9,7 +9,6 @@ const isNumber = n => !isNaN(n);
|
|
|
9
9
|
fee_mtokens: <Route Fee Millitokens String>
|
|
10
10
|
hops: [{
|
|
11
11
|
channel: <Standard Format Channel Id String>
|
|
12
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
13
12
|
fee: <Fee Number>
|
|
14
13
|
fee_mtokens: <Fee Millitokens String>
|
|
15
14
|
forward: <Forward Tokens Number>
|
|
@@ -41,7 +40,6 @@ const isNumber = n => !isNaN(n);
|
|
|
41
40
|
amt_to_forward: <Tokens to Forward String>
|
|
42
41
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
43
42
|
chan_id: <Numeric Format Channel Id String>
|
|
44
|
-
chan_capacity: <Channel Capacity Number>
|
|
45
43
|
[custom_records]: {<TLV Type Number String>: <TLV Value Buffer Object>}
|
|
46
44
|
expiry: <Timeout Chain Height Number>
|
|
47
45
|
fee: <Fee in Tokens Number>
|
|
@@ -24,8 +24,6 @@ export type ConfirmedFromPaymentArgs = {
|
|
|
24
24
|
amt_to_forward_msat: string;
|
|
25
25
|
/** Numeric Format Channel Id String */
|
|
26
26
|
chan_id: string;
|
|
27
|
-
/** Channel Capacity String */
|
|
28
|
-
chan_capacity: string;
|
|
29
27
|
custom_records: {
|
|
30
28
|
[key: string]: Buffer;
|
|
31
29
|
};
|
|
@@ -88,8 +86,6 @@ export type ConfirmedFromPaymentResult = {
|
|
|
88
86
|
hops: {
|
|
89
87
|
/** First Path Standard Format Channel Id String */
|
|
90
88
|
channel: string;
|
|
91
|
-
/** First Path Channel Capacity Tokens Number */
|
|
92
|
-
channel_capacity: number;
|
|
93
89
|
/** First Route Fee Path Rounded Down Number */
|
|
94
90
|
fee: number;
|
|
95
91
|
/** First Path Fee Millitokens String */
|
|
@@ -117,8 +113,6 @@ export type ConfirmedFromPaymentResult = {
|
|
|
117
113
|
hops: {
|
|
118
114
|
/** Standard Format Channel Id String */
|
|
119
115
|
channel: string;
|
|
120
|
-
/** Channel Capacity Tokens Number */
|
|
121
|
-
channel_capacity: number;
|
|
122
116
|
/** Fee Tokens Rounded Down Number */
|
|
123
117
|
fee: number;
|
|
124
118
|
/** Fee Millitokens String */
|
|
@@ -27,7 +27,6 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
27
27
|
amt_to_forward: <Tokens to Forward String>
|
|
28
28
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
29
29
|
chan_id: <Numeric Format Channel Id String>
|
|
30
|
-
chan_capacity: <Channel Capacity Tokens String>
|
|
31
30
|
custom_records: {
|
|
32
31
|
<UInt64 String>: <Record Data Buffer>
|
|
33
32
|
}
|
|
@@ -72,7 +71,6 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
72
71
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
73
72
|
hops: [{
|
|
74
73
|
channel: <First Path Standard Format Channel Id String>
|
|
75
|
-
channel_capacity: <First Path Channel Capacity Tokens Number>
|
|
76
74
|
fee: <First Route Fee Path Rounded Down Number>
|
|
77
75
|
fee_mtokens: <First Path Fee Millitokens String>
|
|
78
76
|
forward: <First Path Forward Tokens Number>
|
|
@@ -88,7 +86,6 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
88
86
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
89
87
|
hops: [{
|
|
90
88
|
channel: <Standard Format Channel Id String>
|
|
91
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
92
89
|
fee: <Fee Tokens Rounded Down Number>
|
|
93
90
|
fee_mtokens: <Fee Millitokens String>
|
|
94
91
|
forward: <Forward Tokens Number>
|
|
@@ -22,7 +22,6 @@ const sum = arr => arr.reduce((sum, n) => sum + BigInt(n), BigInt(Number()));
|
|
|
22
22
|
route: [{
|
|
23
23
|
hops: [{
|
|
24
24
|
amt_to_forward_msat: <Forward Amount Millitokens String>
|
|
25
|
-
chan_capacity: <Channel Capacity Tokens String>
|
|
26
25
|
chan_id: <Numeric Format Channel Id String>
|
|
27
26
|
custom_records: {
|
|
28
27
|
<Record Type String>: <Record Value Buffer>
|
|
@@ -46,7 +45,6 @@ const sum = arr => arr.reduce((sum, n) => sum + BigInt(n), BigInt(Number()));
|
|
|
46
45
|
[route]: {
|
|
47
46
|
hops: [{
|
|
48
47
|
amt_to_forward_msat: <Forward Amount Millitokens String>
|
|
49
|
-
chan_capacity: <Channel Capacity Tokens String>
|
|
50
48
|
chan_id: <Numeric Format Channel Id String>
|
|
51
49
|
custom_records: {
|
|
52
50
|
<Record Type String>: <Record Value Buffer>
|
|
@@ -75,7 +73,6 @@ const sum = arr => arr.reduce((sum, n) => sum + BigInt(n), BigInt(Number()));
|
|
|
75
73
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
76
74
|
hops: [{
|
|
77
75
|
channel: <First Route Standard Format Channel Id String>
|
|
78
|
-
channel_capacity: <First Route Channel Capacity Tokens Number>
|
|
79
76
|
fee: <First Route Fee Tokens Rounded Down Number>
|
|
80
77
|
fee_mtokens: <First Route Fee Millitokens String>
|
|
81
78
|
forward: <First Route Forward Tokens Number>
|
|
@@ -88,7 +85,6 @@ const sum = arr => arr.reduce((sum, n) => sum + BigInt(n), BigInt(Number()));
|
|
|
88
85
|
fee_mtokens: <Total Fee Millitokens Paid String>
|
|
89
86
|
hops: [{
|
|
90
87
|
channel: <Standard Format Channel Id String>
|
|
91
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
92
88
|
fee: <Fee Tokens Rounded Down Number>
|
|
93
89
|
fee_mtokens: <Fee Millitokens String>
|
|
94
90
|
forward: <Forward Tokens Number>
|
|
@@ -139,7 +135,6 @@ module.exports = ({htlcs, preimage, route}) => {
|
|
|
139
135
|
fee_mtokens: route.total_fees_msat,
|
|
140
136
|
hops: route.hops.map(hop => ({
|
|
141
137
|
channel: chanFormat({number: hop.chan_id}).channel,
|
|
142
|
-
channel_capacity: Number(hop.chan_capacity),
|
|
143
138
|
fee: safeTokens({mtokens: hop.fee_msat}).tokens,
|
|
144
139
|
fee_mtokens: hop.fee_msat,
|
|
145
140
|
forward: safeTokens({mtokens: hop.amt_to_forward_msat}).tokens,
|
|
@@ -27,7 +27,6 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
27
27
|
amt_to_forward: <Tokens to Forward String>
|
|
28
28
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
29
29
|
chan_id: <Numeric Format Channel Id String>
|
|
30
|
-
chan_capacity: <Channel Capacity Tokens String>
|
|
31
30
|
custom_records: {
|
|
32
31
|
<UInt64 String>: <Record Data Buffer>
|
|
33
32
|
}
|
|
@@ -74,7 +73,6 @@ const nsAsDate = ns => new Date(Number(BigInt(ns) / BigInt(1e6)));
|
|
|
74
73
|
fee_mtokens: <Total Fee Millitokens Pending String>
|
|
75
74
|
hops: [{
|
|
76
75
|
channel: <Standard Format Channel Id String>
|
|
77
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
78
76
|
fee: <Fee Tokens Rounded Down Number>
|
|
79
77
|
fee_mtokens: <Fee Millitokens String>
|
|
80
78
|
forward: <Forward Tokens Number>
|
|
@@ -16,7 +16,6 @@ const successDenominator = 1e6;
|
|
|
16
16
|
routes: [{
|
|
17
17
|
hops: [{
|
|
18
18
|
amt_to_forward_msat: <Amount to Forward Millitokens String>
|
|
19
|
-
chan_capacity: <Channel Capacity Tokens String>
|
|
20
19
|
chan_id: <Numeric Format Channel Id String>
|
|
21
20
|
custom_records: {
|
|
22
21
|
<Record Type String>: <Record Value Buffer>
|
|
@@ -46,7 +45,6 @@ const successDenominator = 1e6;
|
|
|
46
45
|
fee_mtokens: <Route Fee Millitokens String>
|
|
47
46
|
hops: [{
|
|
48
47
|
channel: <Standard Format Channel Id String>
|
|
49
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
50
48
|
fee: <Fee Number>
|
|
51
49
|
fee_mtokens: <Fee Millitokens String>
|
|
52
50
|
forward: <Forward Tokens Number>
|
|
@@ -124,7 +122,6 @@ module.exports = ({response}) => {
|
|
|
124
122
|
hops: route.hops.map(h => {
|
|
125
123
|
return {
|
|
126
124
|
channel: chanFormat({number: h.chan_id}).channel,
|
|
127
|
-
channel_capacity: Number(h.chan_capacity),
|
|
128
125
|
fee: safeTokens({mtokens: h.fee_msat}).tokens,
|
|
129
126
|
fee_mtokens: h.fee_msat,
|
|
130
127
|
forward: safeTokens({mtokens: h.amt_to_forward_msat}).tokens,
|
|
@@ -31,7 +31,6 @@ const rpcRouteAsRoute = require('./rpc_route_as_route');
|
|
|
31
31
|
amt_to_forward: <Tokens to Forward String>
|
|
32
32
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
33
33
|
chan_id: <Numeric Format Channel Id String>
|
|
34
|
-
chan_capacity: <Channel Capacity Number>
|
|
35
34
|
expiry: <Timeout Chain Height Number>
|
|
36
35
|
fee: <Fee in Tokens Number>
|
|
37
36
|
fee_msat: <Fee in Millitokens Number>
|
|
@@ -66,7 +65,6 @@ const rpcRouteAsRoute = require('./rpc_route_as_route');
|
|
|
66
65
|
fee_mtokens: <Total Route Fee Millitokens To Pay String>
|
|
67
66
|
hops: [{
|
|
68
67
|
channel: <Standard Format Channel Id String>
|
|
69
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
70
68
|
fee: <Fee Number>
|
|
71
69
|
fee_mtokens: <Fee Millitokens String>
|
|
72
70
|
forward: <Forward Tokens Number>
|
|
@@ -34,7 +34,6 @@ const nsAsMs = ns => Number(BigInt(ns) / BigInt(1e6));
|
|
|
34
34
|
hops: [{
|
|
35
35
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
36
36
|
chan_id: <Numeric Format Channel Id String>
|
|
37
|
-
chan_capacity: <Channel Capacity Number>
|
|
38
37
|
custom_records: {
|
|
39
38
|
<UInt64 String>: <Record Data Buffer>
|
|
40
39
|
}
|
|
@@ -72,7 +71,6 @@ const nsAsMs = ns => Number(BigInt(ns) / BigInt(1e6));
|
|
|
72
71
|
fee_mtokens: <Route Fee Millitokens String>
|
|
73
72
|
hops: [{
|
|
74
73
|
channel: <Standard Format Channel Id String>
|
|
75
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
76
74
|
fee: <Fee Number>
|
|
77
75
|
fee_mtokens: <Fee Millitokens String>
|
|
78
76
|
forward: <Forward Tokens Number>
|
|
@@ -7,7 +7,6 @@ const millitokensPerToken = BigInt(1e3);
|
|
|
7
7
|
{
|
|
8
8
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
9
9
|
chan_id: <Numeric Format Channel Id String>
|
|
10
|
-
chan_capacity: <Channel Capacity Number>
|
|
11
10
|
custom_records: {
|
|
12
11
|
<UInt64 String>: <Record Data Buffer>
|
|
13
12
|
}
|
|
@@ -27,7 +26,6 @@ const millitokensPerToken = BigInt(1e3);
|
|
|
27
26
|
@returns
|
|
28
27
|
{
|
|
29
28
|
channel: <Standard Format Channel Id String>
|
|
30
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
31
29
|
fee: <Fee Number>
|
|
32
30
|
fee_mtokens: <Fee Millitokens String>
|
|
33
31
|
forward: <Forward Tokens Number>
|
|
@@ -53,10 +51,6 @@ module.exports = hop => {
|
|
|
53
51
|
throw new Error('ExpectedNumericChannelIdInRpcHopDetails');
|
|
54
52
|
}
|
|
55
53
|
|
|
56
|
-
if (hop.chan_capacity === undefined) {
|
|
57
|
-
throw new Error('ExpectedChannelCapacityTokensNumberInRpcHopDetails');
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
if (!hop.fee_msat) {
|
|
61
55
|
throw new Error('ExpectedHtlcForwardingMillitokensFeeInRpcHopDetails');
|
|
62
56
|
}
|
|
@@ -79,7 +73,6 @@ module.exports = hop => {
|
|
|
79
73
|
|
|
80
74
|
return {
|
|
81
75
|
channel: chanFormat({number: hop.chan_id}).channel,
|
|
82
|
-
channel_capacity: Number(hop.chan_capacity),
|
|
83
76
|
fee: Number(BigInt(hop.fee_msat) / millitokensPerToken),
|
|
84
77
|
fee_mtokens: hop.fee_msat,
|
|
85
78
|
forward: Number(BigInt(hop.amt_to_forward_msat) / millitokensPerToken),
|
|
@@ -45,7 +45,6 @@ const routePublicKeys = route => route.hops.map(n => n.public_key);
|
|
|
45
45
|
amt_to_forward: <Tokens to Forward String>
|
|
46
46
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
47
47
|
chan_id: <Numeric Format Channel Id String>
|
|
48
|
-
chan_capacity: <Channel Capacity Number>
|
|
49
48
|
expiry: <Timeout Chain Height Number>
|
|
50
49
|
fee: <Fee in Tokens Number>
|
|
51
50
|
fee_msat: <Fee in Millitokens Number>
|
|
@@ -121,7 +120,6 @@ const routePublicKeys = route => route.hops.map(n => n.public_key);
|
|
|
121
120
|
fee_mtokens: <Route Fee Millitokens String>
|
|
122
121
|
hops: [{
|
|
123
122
|
channel: <Standard Format Channel Id String>
|
|
124
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
125
123
|
fee: <Fee Number>
|
|
126
124
|
fee_mtokens: <Fee Millitokens String>
|
|
127
125
|
forward: <Forward Tokens Number>
|
|
@@ -9,7 +9,6 @@ const millitokensPerToken = BigInt(1e3);
|
|
|
9
9
|
hops: [{
|
|
10
10
|
amt_to_forward_msat: <Millitokens to Forward String>
|
|
11
11
|
chan_id: <Numeric Format Channel Id String>
|
|
12
|
-
chan_capacity: <Channel Capacity Number>
|
|
13
12
|
custom_records: {
|
|
14
13
|
<UInt64 String>: <Record Data Buffer>
|
|
15
14
|
}
|
|
@@ -36,7 +35,6 @@ const millitokensPerToken = BigInt(1e3);
|
|
|
36
35
|
fee_mtokens: <Route Fee Millitokens String>
|
|
37
36
|
hops: [{
|
|
38
37
|
channel: <Standard Format Channel Id String>
|
|
39
|
-
channel_capacity: <Channel Capacity Tokens Number>
|
|
40
38
|
fee: <Fee Tokens Number>
|
|
41
39
|
fee_mtokens: <Fee Millitokens String>
|
|
42
40
|
forward: <Forward Tokens Number>
|
package/package.json
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"@alexbosworth/blockchain": "3.2.0",
|
|
11
11
|
"@grpc/grpc-js": "1.14.3",
|
|
12
|
-
"@grpc/proto-loader": "0.8.
|
|
13
|
-
"@types/node": "25.
|
|
12
|
+
"@grpc/proto-loader": "0.8.1",
|
|
13
|
+
"@types/node": "25.7.0",
|
|
14
14
|
"@types/request": "2.48.13",
|
|
15
15
|
"@types/ws": "8.18.1",
|
|
16
16
|
"async": "3.2.6",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"typescript": "6.0.3"
|
|
29
29
|
},
|
|
30
30
|
"engines": {
|
|
31
|
-
"node": ">=
|
|
31
|
+
"node": ">=22"
|
|
32
32
|
},
|
|
33
33
|
"keywords": [
|
|
34
34
|
"grpc",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"directory": "test-typescript/typescript"
|
|
52
52
|
},
|
|
53
53
|
"types": "index.d.ts",
|
|
54
|
-
"version": "
|
|
54
|
+
"version": "12.0.1"
|
|
55
55
|
}
|
|
@@ -11,7 +11,6 @@ const makeArgs = overrides => {
|
|
|
11
11
|
hops: [{
|
|
12
12
|
amt_to_forward_msat: '1',
|
|
13
13
|
chan_id: '1',
|
|
14
|
-
chan_capacity: 1,
|
|
15
14
|
custom_records: {},
|
|
16
15
|
expiry: 1,
|
|
17
16
|
pub_key: Buffer.alloc(33, 3).toString('hex'),
|
|
@@ -37,7 +36,6 @@ const makeExpected = overrides => {
|
|
|
37
36
|
fee_mtokens: '1',
|
|
38
37
|
hops: [{
|
|
39
38
|
channel: '0x0x1',
|
|
40
|
-
channel_capacity: 1,
|
|
41
39
|
fee: 0,
|
|
42
40
|
fee_mtokens: '1',
|
|
43
41
|
forward: 0,
|
|
@@ -15,7 +15,6 @@ const makeLnd = ({custom, err, res}) => {
|
|
|
15
15
|
routes: [{
|
|
16
16
|
hops: [{
|
|
17
17
|
amt_to_forward_msat: '1',
|
|
18
|
-
chan_capacity: '1',
|
|
19
18
|
chan_id: '1',
|
|
20
19
|
custom_records: custom || customRecords,
|
|
21
20
|
expiry: 1,
|
|
@@ -173,7 +172,6 @@ const tests = [
|
|
|
173
172
|
fee_mtokens: '1',
|
|
174
173
|
hops: [{
|
|
175
174
|
channel: '0x0x1',
|
|
176
|
-
channel_capacity: 1,
|
|
177
175
|
fee: 0,
|
|
178
176
|
fee_mtokens: '1',
|
|
179
177
|
forward: 0,
|
|
@@ -202,7 +200,6 @@ const tests = [
|
|
|
202
200
|
fee_mtokens: '1',
|
|
203
201
|
hops: [{
|
|
204
202
|
channel: '0x0x1',
|
|
205
|
-
channel_capacity: 1,
|
|
206
203
|
fee: 0,
|
|
207
204
|
fee_mtokens: '1',
|
|
208
205
|
forward: 0,
|
|
@@ -134,7 +134,6 @@ const tests = [
|
|
|
134
134
|
hops: [{
|
|
135
135
|
amt_to_forward_msat: '1',
|
|
136
136
|
chan_id: '1',
|
|
137
|
-
chan_capacity: 1,
|
|
138
137
|
custom_records: {},
|
|
139
138
|
expiry: 1,
|
|
140
139
|
pub_key: Buffer.alloc(33, 3).toString('hex'),
|
|
@@ -176,7 +175,6 @@ const tests = [
|
|
|
176
175
|
fee_mtokens: '1',
|
|
177
176
|
hops: [{
|
|
178
177
|
channel: '0x0x1',
|
|
179
|
-
channel_capacity: 1,
|
|
180
178
|
fee: 0,
|
|
181
179
|
fee_mtokens: '1',
|
|
182
180
|
forward: 0,
|
|
@@ -12,7 +12,6 @@ const makeArgs = overrides => {
|
|
|
12
12
|
fee_mtokens: '1000',
|
|
13
13
|
hops: [{
|
|
14
14
|
channel: '0x0x1',
|
|
15
|
-
channel_capacity: 1,
|
|
16
15
|
fee: 1,
|
|
17
16
|
fee_mtokens: '1000',
|
|
18
17
|
forward_mtokens: '1000',
|
|
@@ -26,7 +25,6 @@ const makeArgs = overrides => {
|
|
|
26
25
|
fee_mtokens: '1000',
|
|
27
26
|
hops: [{
|
|
28
27
|
channel: '0x0x1',
|
|
29
|
-
channel_capacity: 1,
|
|
30
28
|
fee: 1,
|
|
31
29
|
fee_mtokens: '1000',
|
|
32
30
|
forward_mtokens: '1000',
|
|
@@ -100,7 +98,6 @@ const tests = [
|
|
|
100
98
|
fee_mtokens: '1000',
|
|
101
99
|
hops: [{
|
|
102
100
|
channel: '0x0x1',
|
|
103
|
-
channel_capacity: 1,
|
|
104
101
|
fee: 1,
|
|
105
102
|
fee_mtokens: '1000',
|
|
106
103
|
forward_mtokens: '1000',
|
|
@@ -114,7 +111,6 @@ const tests = [
|
|
|
114
111
|
fee_mtokens: '1000',
|
|
115
112
|
hops: [{
|
|
116
113
|
channel: '0x0x1',
|
|
117
|
-
channel_capacity: 1,
|
|
118
114
|
fee: 1,
|
|
119
115
|
fee_mtokens: '1000',
|
|
120
116
|
forward_mtokens: '1000',
|
|
@@ -24,7 +24,6 @@ const makeLnd = args => {
|
|
|
24
24
|
hops: [{
|
|
25
25
|
amt_to_forward: '1',
|
|
26
26
|
amt_to_forward_msat: '1000',
|
|
27
|
-
chan_capacity: '1',
|
|
28
27
|
chan_id: '1',
|
|
29
28
|
custom_records: {'1': Buffer.alloc(1)},
|
|
30
29
|
expiry: 1,
|
|
@@ -91,7 +90,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
91
90
|
fee_mtokens: '1',
|
|
92
91
|
hops: [{
|
|
93
92
|
channel: '0x0x1',
|
|
94
|
-
channel_capacity: 1,
|
|
95
93
|
fee: 0,
|
|
96
94
|
fee_mtokens: '1',
|
|
97
95
|
forward: 0,
|
|
@@ -105,7 +103,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
105
103
|
fee_mtokens: '1',
|
|
106
104
|
hops: [{
|
|
107
105
|
channel: '0x0x1',
|
|
108
|
-
channel_capacity: 1,
|
|
109
106
|
fee: 0,
|
|
110
107
|
fee_mtokens: '1',
|
|
111
108
|
forward: 0,
|
|
@@ -136,7 +133,6 @@ const makeLegacyConfirmed = ({}) => {
|
|
|
136
133
|
route: {
|
|
137
134
|
hops: [{
|
|
138
135
|
amt_to_forward_msat: '1',
|
|
139
|
-
chan_capacity: '1',
|
|
140
136
|
chan_id: '1',
|
|
141
137
|
expiry: 1,
|
|
142
138
|
fee_msat: '1',
|
|
@@ -201,7 +197,6 @@ const tests = [
|
|
|
201
197
|
fee_mtokens: '1000',
|
|
202
198
|
hops: [{
|
|
203
199
|
channel: '0x0x1',
|
|
204
|
-
channel_capacity: 1,
|
|
205
200
|
fee: 1,
|
|
206
201
|
fee_mtokens: '1000',
|
|
207
202
|
forward: 1,
|
|
@@ -23,7 +23,6 @@ const makeLnd = args => {
|
|
|
23
23
|
amt_to_forward: '1',
|
|
24
24
|
amt_to_forward_msat: '1000',
|
|
25
25
|
chan_id: '1',
|
|
26
|
-
chan_capacity: 1,
|
|
27
26
|
expiry: 1,
|
|
28
27
|
fee: 1,
|
|
29
28
|
fee_msat: '1000',
|
|
@@ -77,7 +76,6 @@ const makeExpectedPayment = ({}) => {
|
|
|
77
76
|
fee_mtokens: '1000',
|
|
78
77
|
hops: [{
|
|
79
78
|
channel: '0x0x1',
|
|
80
|
-
channel_capacity: 1,
|
|
81
79
|
fee: 1,
|
|
82
80
|
fee_mtokens: '1000',
|
|
83
81
|
forward: 1,
|