paid-services 8.0.6 → 9.0.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.
Files changed (117) hide show
  1. package/CHANGELOG.md +7 -1
  2. package/index.js +0 -2
  3. package/package.json +37 -15
  4. package/swaps/complete_off_to_on_swap.js +7 -4
  5. package/.gitattributes +0 -1
  6. package/.prettierignore +0 -2
  7. package/.tm_properties +0 -1
  8. package/capacity/accept_capacity_change.js +0 -292
  9. package/capacity/ask_for_change_details.js +0 -619
  10. package/capacity/ask_for_decrease.js +0 -303
  11. package/capacity/ask_to_select_change.js +0 -109
  12. package/capacity/assemble_replacement_tx.js +0 -171
  13. package/capacity/capacity_change_requests.js +0 -87
  14. package/capacity/change_channel_capacity.js +0 -190
  15. package/capacity/describe_capacity_change.js +0 -38
  16. package/capacity/encode_change_request.js +0 -76
  17. package/capacity/encode_sign_capacity_response.js +0 -32
  18. package/capacity/fee_for_replacement.js +0 -104
  19. package/capacity/finalize_capacity_replacement.js +0 -67
  20. package/capacity/get_capacity_change_requests.js +0 -100
  21. package/capacity/get_capacity_replacement.js +0 -439
  22. package/capacity/get_replacement_signature.js +0 -237
  23. package/capacity/index.js +0 -4
  24. package/capacity/initiate_capacity_change.js +0 -521
  25. package/capacity/interim_replacement_psbt.js +0 -59
  26. package/capacity/is_open_witness_script.js +0 -40
  27. package/capacity/parse_accept_request.js +0 -58
  28. package/capacity/parse_accept_response.js +0 -52
  29. package/capacity/parse_capacity_change_request.js +0 -130
  30. package/capacity/parse_sign_capacity_request.js +0 -59
  31. package/capacity/propose_capacity_change.js +0 -498
  32. package/capacity/propose_channel_open.js +0 -54
  33. package/capacity/sign_capacity_replacement.js +0 -119
  34. package/capacity/witness_script_from_close_txs.js +0 -50
  35. package/test/actions/test_execute_email_action.js +0 -71
  36. package/test/actions/test_execute_inbox_action.js +0 -80
  37. package/test/actions/test_execute_sms_action.js +0 -72
  38. package/test/actions/test_inbox_action_arguments.js +0 -83
  39. package/test/actions/test_send_postmark_email.js +0 -81
  40. package/test/actions/test_send_twilio_sms.js +0 -88
  41. package/test/balanced/test_balanced_open_request.js +0 -185
  42. package/test/capacity/test_assemble_replacement_tx.js +0 -53
  43. package/test/capacity/test_capacity_change_requests.js +0 -63
  44. package/test/capacity/test_encode_change_request.js +0 -65
  45. package/test/capacity/test_encode_sign_capacity_response.js +0 -54
  46. package/test/capacity/test_fee_for_replacement.js +0 -47
  47. package/test/capacity/test_finalize_capacity_replacement.js +0 -52
  48. package/test/capacity/test_interim_replacement_psbt.js +0 -54
  49. package/test/capacity/test_is_open_witness_script.js +0 -47
  50. package/test/capacity/test_parse_accept_request.js +0 -49
  51. package/test/capacity/test_parse_capacity_change_request.js +0 -59
  52. package/test/capacity/test_parse_sign_capacity_request.js +0 -44
  53. package/test/capacity/test_witness_script_from_close_txs.js +0 -48
  54. package/test/client/test_arguments_for_schema.js +0 -37
  55. package/test/client/test_byte_limited_string.js +0 -36
  56. package/test/client/test_confirm_service_use.js +0 -70
  57. package/test/client/test_decode_nodes_record.js +0 -49
  58. package/test/client/test_decode_schema_fields.js +0 -103
  59. package/test/client/test_decode_schema_records.js +0 -109
  60. package/test/client/test_decode_urls_record.js +0 -55
  61. package/test/client/test_error_records_as_error.js +0 -64
  62. package/test/client/test_make_service_request.js +0 -88
  63. package/test/client/test_messages_as_response.js +0 -155
  64. package/test/client/test_messages_for_request.js +0 -56
  65. package/test/client/test_wait_for_response.js +0 -64
  66. package/test/config/test_is_activity_enabled.js +0 -50
  67. package/test/config/test_is_connect_enabled.js +0 -45
  68. package/test/config/test_is_email_configured.js +0 -59
  69. package/test/config/test_is_invoice_enabled.js +0 -45
  70. package/test/config/test_is_sms_configured.js +0 -65
  71. package/test/config/test_validate_server_config.js +0 -63
  72. package/test/integration/test_accept_capacity_change.js +0 -201
  73. package/test/integration/test_change_channel_capacity.js +0 -210
  74. package/test/integration/test_decrease_channel_capacity.js +0 -223
  75. package/test/integration/test_fanout.js +0 -222
  76. package/test/integration/test_group.js +0 -174
  77. package/test/integration/test_group_noninteractive.js +0 -129
  78. package/test/integration/test_group_pair.js +0 -143
  79. package/test/integration/test_group_sort.js +0 -201
  80. package/test/integration/test_increase_channel_capacity.js +0 -202
  81. package/test/integration/test_move_channel_capacity.js +0 -230
  82. package/test/integration/test_request_swap_out.js +0 -175
  83. package/test/integration/test_service_peer_requests.js +0 -60
  84. package/test/integration/test_sign_capacity_replacement.js +0 -144
  85. package/test/integration/test_split_channel_capacity.js +0 -243
  86. package/test/integration/test_swap_with_claim_path.js +0 -177
  87. package/test/integration/test_swap_with_refund_path.js +0 -194
  88. package/test/integration.js +0 -18
  89. package/test/p2p/test_encode_peer_request.js +0 -60
  90. package/test/p2p/test_encode_peer_response.js +0 -33
  91. package/test/p2p/test_encode_response_code.js +0 -55
  92. package/test/records/test_request_as_request_records.js +0 -50
  93. package/test/records/test_request_records_as_request.js +0 -112
  94. package/test/respond/test_error_as_error_records.js +0 -47
  95. package/test/respond/test_messages_for_response.js +0 -97
  96. package/test/respond/test_send_service_response.js +0 -112
  97. package/test/respond/test_urls_as_urls_record.js +0 -42
  98. package/test/server/test_get_service_request.js +0 -185
  99. package/test/server/test_invoice_as_request.js +0 -51
  100. package/test/server/test_paid_service_event.js +0 -211
  101. package/test/server/test_process_paywall.js +0 -125
  102. package/test/server/test_process_request.js +0 -172
  103. package/test/services/test_is_service_enabled.js +0 -86
  104. package/test/services/test_registered_services.js +0 -126
  105. package/test/services/test_respond_to_request.js +0 -73
  106. package/test/services/test_response_for_activity.js +0 -107
  107. package/test/services/test_response_for_inbox.js +0 -115
  108. package/test/services/test_response_for_network.js +0 -61
  109. package/test/services/test_response_for_pong.js +0 -20
  110. package/test/services/test_response_for_profile.js +0 -47
  111. package/test/services/test_response_for_schema.js +0 -105
  112. package/test/services/test_response_for_services.js +0 -44
  113. package/test/swaps/test_decode_loop_response.js +0 -52
  114. package/test/trades/test_decode_basic_trade.js +0 -47
  115. package/test/trades/test_decode_open_trade.js +0 -57
  116. package/test/trades/test_encode_open_trade.js +0 -90
  117. package/test/trades/test_encode_trade.js +0 -62
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Versions
2
2
 
3
- ## Version 8.0.6
3
+ ## Version 9.0.0
4
+
5
+ ### Breaking Changes
6
+
7
+ - `changeChannelCapacity`: Remove method to change channel capacity
8
+
9
+ ## Version 8.0.7
4
10
 
5
11
  ### Breaking Changes
6
12
 
package/index.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const {balancedOpenRequest} = require('./balanced');
2
- const {changeChannelCapacity} = require('./capacity');
3
2
  const {confirmServiceUse} = require('./client');
4
3
  const {createAnchoredTrade} = require('./trades');
5
4
  const {createGroupChannel} = require('./groups');
@@ -25,7 +24,6 @@ const serviceIds = schema.types;
25
24
 
26
25
  module.exports = {
27
26
  balancedOpenRequest,
28
- changeChannelCapacity,
29
27
  confirmServiceUse,
30
28
  createAnchoredTrade,
31
29
  createGroupChannel,
package/package.json CHANGED
@@ -1,36 +1,58 @@
1
1
  {
2
+ "allowScripts": {
3
+ "cpu-features@0.0.10": true,
4
+ "protobufjs@7.6.6": true,
5
+ "ssh2@1.17.0": true
6
+ },
2
7
  "author": {
3
8
  "name": "Alex Bosworth",
4
- "url": "https://twitter.com/alexbosworth"
9
+ "url": "https://x.com/alexbosworth"
5
10
  },
6
11
  "bugs": {
7
12
  "url": "https://github.com/alexbosworth/paid-services/issues"
8
13
  },
9
14
  "dependencies": {
10
- "@alexbosworth/blockchain": "4.0.0",
15
+ "@alexbosworth/blockchain": "4.8.0",
11
16
  "@alexbosworth/fiat": "2.0.0",
12
17
  "async": "3.2.6",
13
18
  "asyncjs-util": "1.2.12",
14
- "bech32": "2.0.0",
15
- "bolt01": "3.0.0",
16
- "bolt07": "1.9.5",
19
+ "bolt01": "4.0.0",
20
+ "bolt07": "2.0.0",
17
21
  "ecpair": "2.1.0",
18
- "goldengate": "16.0.5",
19
- "invoices": "6.0.0",
20
- "ln-service": "59.2.4",
21
- "ln-sync": "8.0.4",
22
- "psbt": "5.0.0",
23
- "p2tr": "2.0.0",
22
+ "goldengate": "16.0.7",
23
+ "invoices": "6.2.0",
24
+ "ln-service": "59.7.0",
25
+ "ln-sync": "8.0.6",
26
+ "psbt": "6.0.4",
27
+ "p2tr": "3.0.0",
24
28
  "tiny-secp256k1": "2.2.4"
25
29
  },
26
30
  "description": "Lightning Paid Services library",
27
31
  "devDependencies": {
28
- "ln-docker-daemons": "8.0.2",
32
+ "ln-docker-daemons": "8.0.5",
29
33
  "mock-lnd": "4.0.0"
30
34
  },
31
35
  "engines": {
32
36
  "node": ">=22"
33
37
  },
38
+ "files": [
39
+ "actions/",
40
+ "balanced/",
41
+ "CHANGELOG.md",
42
+ "client/",
43
+ "config/",
44
+ "groups/",
45
+ "index.js",
46
+ "jobs/",
47
+ "p2p/",
48
+ "records/",
49
+ "respond/",
50
+ "server/",
51
+ "service_types.json",
52
+ "services/",
53
+ "swaps/",
54
+ "trades/"
55
+ ],
34
56
  "keywords": [
35
57
  "lightning",
36
58
  "lightning-network"
@@ -40,11 +62,11 @@
40
62
  "name": "paid-services",
41
63
  "repository": {
42
64
  "type": "git",
43
- "url": "https://github.com/alexbosworth/paid-services.git"
65
+ "url": "git+https://github.com/alexbosworth/paid-services.git"
44
66
  },
45
67
  "scripts": {
46
68
  "integration-tests": "node test/integration",
47
- "test": "node --experimental-test-coverage --test test/actions/*.js test/balanced/*.js test/capacity/*.js test/client/*.js test/config/*.js test/p2p/*.js test/records/*.js test/respond/*.js test/server/*.js test/swaps/*.js test/services/*.js test/trades/*.js"
69
+ "test": "node --experimental-test-coverage --test test/actions/*.js test/balanced/*.js test/client/*.js test/config/*.js test/p2p/*.js test/records/*.js test/respond/*.js test/server/*.js test/swaps/*.js test/services/*.js test/trades/*.js"
48
70
  },
49
- "version": "8.0.6"
71
+ "version": "9.0.0"
50
72
  }
@@ -7,7 +7,6 @@ const asyncMapSeries = require('async/mapSeries');
7
7
  const asyncRace = require('async/race');
8
8
  const asyncReflect = require('async/reflect');
9
9
  const asyncTimeout = require('async/timeout');
10
- const {bech32m} = require('bech32');
11
10
  const {beginGroupSigningSession} = require('ln-service');
12
11
  const {broadcastChainTransaction} = require('ln-service');
13
12
  const {cancelSwapOut} = require('goldengate');
@@ -15,6 +14,7 @@ const {confirmationFee} = require('goldengate');
15
14
  const {controlBlock} = require('p2tr');
16
15
  const {createChainAddress} = require('ln-service');
17
16
  const {diffieHellmanComputeSecret} = require('ln-service');
17
+ const {encodeBech32Address} = require('@alexbosworth/blockchain');
18
18
  const {findConfirmedOutput} = require('ln-sync');
19
19
  const {findDeposit} = require('goldengate');
20
20
  const {getChainFeeRate} = require('ln-service');
@@ -61,7 +61,6 @@ const defaultMaxFeeMultiplier = 1000;
61
61
  const defaultMaxPreimagePushFee = 10;
62
62
  const defaultMinSweepBlocks = 20;
63
63
  const defaultWaitForChainFundingMs = 1000 * 60 * 60 * 3;
64
- const encodeAddress = (prefix, data) => bech32m.encode(prefix, data);
65
64
  const externalKeyAsOutputScript = key => `5120${key}`;
66
65
  const family = 805;
67
66
  const {floor} = Math;
@@ -92,7 +91,7 @@ const sweepInputIndex = 0;
92
91
  const times = n => Array(n).fill(null).map((_, i) => i);
93
92
  const tokensForPushPreimage = 1;
94
93
  const uniqBy = (a,b) => a.filter((e,i) => a.findIndex(n => n[b] == e[b]) == i);
95
- const v1AddressWords = key => [].concat(1).concat(bech32m.toWords(key));
94
+ const witnessVersionTaproot = 1;
96
95
 
97
96
  /** Complete the off to on swap
98
97
 
@@ -691,7 +690,11 @@ module.exports = (args, cbk) => {
691
690
  const outputScript = swap.output_script;
692
691
  const prefix = networks[getNetwork.bitcoinjs].bech32;
693
692
 
694
- const address = encodeAddress(prefix, v1AddressWords(key));
693
+ const {address} = encodeBech32Address({
694
+ prefix,
695
+ program: key,
696
+ version: witnessVersionTaproot,
697
+ });
695
698
 
696
699
  args.emitter.emit('update', {
697
700
  waiting_for_chain_funding: address,
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- package-lock.json binary
package/.prettierignore DELETED
@@ -1,2 +0,0 @@
1
- bos
2
- *.js
package/.tm_properties DELETED
@@ -1 +0,0 @@
1
- exclude = '{$exclude,node_modules}'
@@ -1,292 +0,0 @@
1
- const asyncAuto = require('async/auto');
2
- const {getChainTransactions} = require('ln-service');
3
- const {getChannel} = require('ln-service');
4
- const {getChannels} = require('ln-service');
5
- const {returnResult} = require('asyncjs-util');
6
- const {stopAllHtlcs} = require('ln-sync');
7
- const {Transaction} = require('bitcoinjs-lib');
8
-
9
- const encodeSignCapacityResponse = require('./encode_sign_capacity_response');
10
- const getReplacementSignature = require('./get_replacement_signature');
11
- const {makePeerRequest} = require('./../p2p');
12
- const parseAcceptResponse = require('./parse_accept_response');
13
- const parseSignCapacityRequest = require('./parse_sign_capacity_request');
14
- const {servicePeerRequests} = require('./../p2p');
15
- const {serviceTypeAcceptCapacityChange} = require('./../service_types');
16
- const {serviceTypeSignCapacityChange} = require('./../service_types');
17
- const {serviceTypeWaitOnConfirmation} = require('./../service_types');
18
-
19
- const acceptChangeTimeoutMs = 1000 * 45;
20
- const bufferAsHex = buffer => buffer.toString('hex');
21
- const findId = records => (records.find(n => n.type === '0') || {}).value;
22
- const {fromHex} = Transaction;
23
- const idType = '0';
24
- const openTxType = '1';
25
-
26
- /** Accept a request from a peer to change a channel's capacity
27
-
28
- {
29
- channel: <Standard Format Channel Id String>
30
- from: <Accept Request From Public Key Hex String>
31
- id: <Request Id Hex String>
32
- [increase]: <Increase Tokens Number>
33
- lnd: <Authenticated LND API Object>
34
- logger: <Winston Logger Object>
35
- to: <Expect Channel from Public Key Hex String>
36
- }
37
-
38
- @returns via cbk or Promise
39
- {
40
- base_fee_mtokens: <Original Forwarding Base Fee Millitokens String>
41
- cltv_delta: <Original Forwarding CLTV Delta Number>
42
- fee_rate: <Original Forwarding Parts Per Million Fee Rate Number>
43
- transaction_id: <Replacement Channel Transaction Id Hex String>
44
- transaction_vout: <Replacement Channel Transaction Output Index Number>
45
- }
46
- */
47
- module.exports = ({channel, from, id, increase, lnd, logger, to}, cbk) => {
48
- return new Promise((resolve, reject) => {
49
- return asyncAuto({
50
- // Check arguments
51
- validate: cbk => {
52
- if (!channel) {
53
- return cbk([400, 'ExpectedChannelIdToAcceptCapacityChange']);
54
- }
55
-
56
- if (!from) {
57
- return cbk([400, 'ExpectedFromPublicKeyToAcceptCapacityChange']);
58
- }
59
-
60
- if (!id) {
61
- return cbk([400, 'ExpectedRequestIdToAcceptCapacityChange']);
62
- }
63
-
64
- if (!lnd) {
65
- return cbk([400, 'ExpectedAuthenticatedLndToAcceptCapacityChange']);
66
- }
67
-
68
- if (!logger) {
69
- return cbk([400, 'ExpectedLoggerObjectToAcceptCapacityChange']);
70
- }
71
-
72
- if (!to) {
73
- return cbk([400, 'ExpectedToPublicKeyToAcceptCapacityChange']);
74
- }
75
-
76
- return cbk();
77
- },
78
-
79
- // Get the fee policies on the channel to set it back on success
80
- getChannel: ['validate', ({}, cbk) => {
81
- return getChannel({lnd, id: channel}, cbk);
82
- }],
83
-
84
- // Get all channel ids with the peer in order to stop HTLCs on them
85
- getChannels: ['validate', ({}, cbk) => {
86
- return getChannels({lnd, partner_public_key: from}, cbk);
87
- }],
88
-
89
- // Get chain transactions to look for the channel open tx
90
- getChainTxs: ['validate', ({}, cbk) => {
91
- return getChainTransactions({lnd}, cbk);
92
- }],
93
-
94
- // Policy for the channel
95
- policy: ['getChannel', ({getChannel}, cbk) => {
96
- const policy = getChannel.policies.find(n => n.public_key !== from);
97
-
98
- if (!policy.cltv_delta) {
99
- return cbk([404, 'FailedToFindChannelRoutingPolicyDetails']);
100
- }
101
-
102
- return cbk(null, {
103
- base_fee_mtokens: policy.base_fee_mtokens,
104
- cltv_delta: policy.cltv_delta,
105
- fee_rate: policy.fee_rate,
106
- transaction_id: getChannel.transaction_id,
107
- transaction_vout: getChannel.transaction_vout,
108
- });
109
- }],
110
-
111
- // Send the initial proposal acceptance to the peer
112
- acceptChange: [
113
- 'getChainTxs',
114
- 'getChannel',
115
- 'getChannels',
116
- 'policy',
117
- ({getChainTxs, getChannel}, cbk) =>
118
- {
119
- const records = [{type: idType, value: id}];
120
-
121
- const tx = getChainTxs.transactions.find(transaction => {
122
- return transaction.id === getChannel.transaction_id;
123
- });
124
-
125
- const txRecordValue = !!tx && !!tx.transaction ? tx.transaction : null;
126
-
127
- if (!!txRecordValue) {
128
- records.push({type: openTxType, value: txRecordValue});
129
- }
130
-
131
- // Kick off the capacity change
132
- return makePeerRequest({
133
- lnd,
134
- records,
135
- timeout: acceptChangeTimeoutMs,
136
- to: from,
137
- type: serviceTypeAcceptCapacityChange,
138
- },
139
- (err, res) => {
140
- if (!!err) {
141
- return cbk(err);
142
- }
143
-
144
- try {
145
- const {transaction} = parseAcceptResponse({
146
- records: res.records,
147
- transaction_id: getChannel.transaction_id,
148
- });
149
-
150
- if (!transaction && !txRecordValue) {
151
- return cbk([404, 'MissingTransactionOpenRawTxData']);
152
- }
153
-
154
- return cbk(null, {transaction: transaction || txRecordValue});
155
- } catch (err) {
156
- return cbk([503, err.message]);
157
- }
158
- });
159
- }],
160
-
161
- // Stop HTLCs with the peer until the channel is closed
162
- stopHtlcs: ['getChannels', ({getChannels}, cbk) => {
163
- return stopAllHtlcs({
164
- lnd,
165
- id: channel,
166
- ids: getChannels.channels.map(n => n.id),
167
- peer: from,
168
- },
169
- cbk);
170
- }],
171
-
172
- // Lookup the open transaction and get the output script
173
- output: [
174
- 'acceptChange',
175
- 'getChannel',
176
- ({acceptChange, getChannel}, cbk) =>
177
- {
178
- const {outs} = fromHex(acceptChange.transaction);
179
-
180
- const output = outs[getChannel.transaction_vout];
181
-
182
- if (!output) {
183
- return cbk([503, 'ExpectedOpenTxFundingTransactionOutput']);
184
- }
185
-
186
- return cbk(null, bufferAsHex(output.script));
187
- }],
188
-
189
- // Ask to change capacity and return the final signature when needed
190
- changeCapacity: ['output', 'policy', ({output, policy}, cbk) => {
191
- logger.info({starting_capacity_change: true});
192
-
193
- const service = servicePeerRequests({lnd});
194
-
195
- // Listen for close-and-replace signals
196
- service.request({type: serviceTypeSignCapacityChange}, (req, res) => {
197
- // Exit early when the request is from a different peer/change
198
- if (req.from !== from || findId(req.records) !== id) {
199
- return;
200
- }
201
-
202
- const {failure, success} = res;
203
-
204
- const parameters = {
205
- increase,
206
- id: policy.transaction_id,
207
- records: req.records,
208
- vout: policy.transaction_vout,
209
- };
210
-
211
- // Check to make sure that the request records make sense
212
- try {
213
- parseSignCapacityRequest(parameters);
214
- } catch (err) {
215
- logger.error({err: [503, err.message]});
216
-
217
- return failure([503, 'FailedToParseSignChangeRequest']);
218
- }
219
-
220
- logger.info({closing_and_reopening_channel: true});
221
-
222
- // Trigger the replacement flow and sign the unsigned tx
223
- return getReplacementSignature({
224
- channel,
225
- lnd,
226
- output,
227
- to,
228
- id: parameters.id,
229
- unsigned: parseSignCapacityRequest(parameters).unsigned,
230
- vout: parameters.vout,
231
- },
232
- (err, res) => {
233
- if (!!err) {
234
- logger.error({err});
235
-
236
- return failure([503, 'UnexpectedErrorGettingSignature']);
237
- }
238
-
239
- // Stop listening for sign capacity change requests
240
- service.stop({});
241
-
242
- // Encode the signature into records
243
- const {records} = encodeSignCapacityResponse({
244
- id: parameters.id,
245
- signature: res.signature,
246
- });
247
-
248
- // Send the replacement signature for the change request
249
- success({records});
250
-
251
- logger.info({new_channel_transaction_id: res.transaction_id});
252
-
253
- // Return the replacement funding outpoint
254
- return cbk(null, {
255
- transaction_id: res.transaction_id,
256
- transaction_vout: res.transaction_vout,
257
- });
258
- });
259
- });
260
-
261
- // Listen for wait-for-confirmation signals
262
- service.request({type: serviceTypeWaitOnConfirmation}, (req, res) => {
263
- // Exit early when the request is from a different peer/change
264
- if (req.from !== from || findId(req.records) !== id) {
265
- return;
266
- }
267
-
268
- logger.info({peer_is_looking_for_confirmation: new Date()});
269
-
270
- // Return an ack that the waiting signal was heard
271
- return res.success({});
272
- });
273
- }],
274
-
275
- // Accepted the capacity change
276
- accepted: [
277
- 'changeCapacity',
278
- 'policy',
279
- ({changeCapacity, policy}, cbk) =>
280
- {
281
- return cbk(null, {
282
- base_fee_mtokens: policy.base_fee_mtokens,
283
- cltv_delta: policy.cltv_delta,
284
- fee_rate: policy.fee_rate,
285
- transaction_id: changeCapacity.transaction_id,
286
- transaction_vout: changeCapacity.transaction_vout,
287
- });
288
- }],
289
- },
290
- returnResult({reject, resolve, of: 'accepted'}, cbk));
291
- });
292
- };