balanceofsatoshis 12.27.0 → 12.28.2

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 CHANGED
@@ -1,5 +1,15 @@
1
1
  # Versions
2
2
 
3
+ ## 12.28.2
4
+
5
+ - `remove-peer`: Set high tolerance for peer max fee when coop closing channel
6
+
7
+ ## 12.28.1
8
+
9
+ - `chart-payments-received`: Optimize reporting speed for short times
10
+ - `chart-payments-received`: Add `--count` to report on count of payments
11
+ - `chart-payments-received`: Add `--for` to filter for a matching description
12
+
3
13
  ## 12.27.0
4
14
 
5
15
  - `rebalance`: `--in-filter`, `--out-filter`: add `INBOUND_FEE_RATE` variable
package/README.md CHANGED
@@ -6,7 +6,7 @@ Commands for working with LND balances.
6
6
 
7
7
  Supported LND versions:
8
8
 
9
- - v0.11.0-beta to v0.15.0-beta
9
+ - v0.12.0-beta to v0.15.1-beta
10
10
 
11
11
  ## Install
12
12
 
package/bos CHANGED
@@ -452,8 +452,10 @@ prog
452
452
  // Chart earnings from payments received
453
453
  .command('chart-payments-received', 'Get a chart of received payments')
454
454
  .help('Show chart for settled invoices from external parties')
455
+ .option('--count', 'Show count of settled instead of amount received')
455
456
  .option('--days <days>', 'Chart over the past number of days', INT)
456
457
  .option('--end <end_date>', 'Final date for chart as YYYY-MM-DD', STRING)
458
+ .option('--for <query>', 'Only consider payments including a specific query')
457
459
  .option('--node <node_name>', 'Get payments from saved node(s)', REPEATABLE)
458
460
  .option('--start <start_date>', 'Start date for chart as YYYY-MM-DD', STRING)
459
461
  .action((args, options, logger) => {
@@ -462,7 +464,9 @@ prog
462
464
  return wallets.getReceivedChart({
463
465
  days: options.days,
464
466
  end_date: options.end,
467
+ is_count: options.count,
465
468
  lnds: (await lnd.getLnds({logger, nodes: options.node})).lnds,
469
+ query: options.for,
466
470
  start_date: options.start,
467
471
  },
468
472
  responses.returnChart({logger, reject, resolve, data: 'data'}));
@@ -21,6 +21,7 @@ const iconDisabled = channel => !channel.is_active ? '💀 ' : '';
21
21
  const iconPending = channel => channel.pending_payments.length ? '💸 ' : ''
22
22
  const {isArray} = Array;
23
23
  const isPublicKey = n => !!n && /^0[2-3][0-9A-F]{64}$/i.test(n);
24
+ const maxFeeRate = (chan, rate) => !!chan.is_active ? rate * 100 : undefined;
24
25
  const maxMempoolSize = 2e6;
25
26
  const regularConf = 72;
26
27
  const slowConf = 144;
@@ -435,6 +436,7 @@ module.exports = (args, cbk) => {
435
436
  address: !isLocked && !!address ? address : undefined,
436
437
  is_force_close: !channel.is_active,
437
438
  lnd: args.lnd,
439
+ max_tokens_per_vbyte: maxFeeRate(channel, feeRate),
438
440
  tokens_per_vbyte: !!channel.is_active ? feeRate : undefined,
439
441
  transaction_id: channel.transaction_id,
440
442
  transaction_vout: channel.transaction_vout,
package/package.json CHANGED
@@ -30,14 +30,14 @@
30
30
  "csv-parse": "5.3.0",
31
31
  "ecpair": "2.0.1",
32
32
  "goldengate": "11.2.3",
33
- "grammy": "1.10.1",
33
+ "grammy": "1.11.0",
34
34
  "hot-formula-parser": "4.0.0",
35
35
  "import-lazy": "4.0.0",
36
36
  "ini": "3.0.1",
37
- "inquirer": "9.1.0",
37
+ "inquirer": "9.1.1",
38
38
  "ln-accounting": "5.0.7",
39
- "ln-service": "53.21.0",
40
- "ln-sync": "3.13.1",
39
+ "ln-service": "53.22.0",
40
+ "ln-sync": "3.14.0",
41
41
  "ln-telegram": "3.22.3",
42
42
  "moment": "2.29.4",
43
43
  "paid-services": "3.20.3",
@@ -53,8 +53,8 @@
53
53
  "description": "Lightning balance CLI",
54
54
  "devDependencies": {
55
55
  "@alexbosworth/tap": "15.0.11",
56
- "invoices": "2.1.0",
57
- "ln-docker-daemons": "2.3.5",
56
+ "invoices": "2.2.0",
57
+ "ln-docker-daemons": "2.3.6",
58
58
  "mock-lnd": "1.4.4",
59
59
  "tiny-secp256k1": "2.2.1"
60
60
  },
@@ -83,5 +83,5 @@
83
83
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
84
84
  "test": "tap --branches=1 --functions=1 --lines=1 --statements=1 -t 60 test/arrays/*.js test/balances/*.js test/chain/*.js test/display/*.js test/encryption/*.js test/lnd/*.js test/network/*.js test/nodes/*.js test/peers/*.js test/responses/*.js test/routing/*.js test/services/*.js test/swaps/*.js test/tags/*.js test/telegram/*.js test/wallets/*.js"
85
85
  },
86
- "version": "12.27.0"
86
+ "version": "12.28.2"
87
87
  }
@@ -32,7 +32,7 @@ const maturityBlocks = 100;
32
32
  const rate = 1;
33
33
  const size = 2;
34
34
  const slow = 100;
35
- const times = 1000;
35
+ const times = 2000;
36
36
  const tokens = 500095;
37
37
 
38
38
  // Opening a balanced channel with a peer should open a balanced channel
@@ -61,7 +61,7 @@ test(`Open balanced channel`, async ({end, equal, strictSame}) => {
61
61
 
62
62
  // Make sure the channel is open and the wallet is sync'ed to chain
63
63
  await asyncEach([lnd, target.lnd], async lnd => {
64
- await asyncRetry(({times}), async () => {
64
+ await asyncRetry(({interval, times}), async () => {
65
65
  await generate({});
66
66
  await target.generate({});
67
67
 
@@ -86,7 +86,7 @@ test(`Open balanced channel`, async ({end, equal, strictSame}) => {
86
86
  });
87
87
 
88
88
  // Make sure that the nodes see each other in the graph to see TLV support
89
- await asyncRetry(({times}), async () => {
89
+ await asyncRetry(({interval, times}), async () => {
90
90
  const graph = await getNetworkGraph({lnd});
91
91
 
92
92
  // Force graph resync in case it gets stuck
@@ -110,10 +110,12 @@ test(`Open balanced channel`, async ({end, equal, strictSame}) => {
110
110
  throw new Error('ExpectedSyncChain');
111
111
  }
112
112
 
113
+ await addPeer({lnd, public_key: target.id, socket: target.socket});
114
+
113
115
  const [channel] = (await getChannels({lnd: target.lnd})).channels;
114
116
 
115
117
  if (!channel.is_active) {
116
- throw new Error('ExpectedActiveChannel');
118
+ throw new Error('ExpectedActiveChannelForSetup');
117
119
  }
118
120
  });
119
121
 
@@ -28,6 +28,7 @@ const parseDate = n => Date.parse(n);
28
28
  [days]: <Received Over Days Count Number>
29
29
  [end_date]: <End Date YYYY-MM-DD String>
30
30
  lnds: [<Authenticated LND API Object>]
31
+ [query]: <Match Description String>
31
32
  [start_date]: <Start Date YYYY-MM-DD String>
32
33
  }
33
34
 
@@ -140,6 +141,7 @@ module.exports = (args, cbk) => {
140
141
  return getAllInvoices({
141
142
  lnd,
142
143
  confirmed_after: start.toISOString(),
144
+ created_after: start.toISOString(),
143
145
  },
144
146
  cbk);
145
147
  },
@@ -149,6 +151,10 @@ module.exports = (args, cbk) => {
149
151
  }
150
152
 
151
153
  const settled = flatten(res.map(n => n.invoices)).filter(invoice => {
154
+ if (!!args.query && !invoice.description.includes(args.query)) {
155
+ return false;
156
+ }
157
+
152
158
  // Exit early when considering all invoices without an end point
153
159
  if (!args.end_date) {
154
160
  return true;
@@ -240,10 +246,16 @@ module.exports = (args, cbk) => {
240
246
 
241
247
  // Total activity
242
248
  data: ['description', 'sum', ({description, sum}, cbk) => {
249
+ const title = [
250
+ !!args.is_count ? 'Received' : 'Payments',
251
+ !!args.query ? `for “${args.query}”` : '',
252
+ !!args.is_count ? 'count' : 'received',
253
+ ];
254
+
243
255
  return cbk(null, {
244
256
  description,
245
257
  data: !args.is_count ? sum.sum : sum.count,
246
- title: !args.is_count ? 'Payments received' : 'Received count',
258
+ title: title.filter(n => !!n).join(' '),
247
259
  });
248
260
  }],
249
261
  },