balanceofsatoshis 11.45.1 → 11.47.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,21 @@
1
1
  # Versions
2
2
 
3
+ ## 11.47.2
4
+
5
+ - `telegram`: Correct open and close channel messages not posting
6
+
7
+ ## 11.47.1
8
+
9
+ - `send`: Correct `max-fee-rate` parsing
10
+
11
+ ## 11.47.0
12
+
13
+ - `telegram`: Add `/graph <node public key or peer alias>` to lookup node info
14
+
15
+ ## 11.46.0
16
+
17
+ - `telegram`: Add `/stop` command to terminate the running bot
18
+
3
19
  ## 11.45.1
4
20
 
5
21
  - `increase-inbound-liquidity`: Add support for formulas in `--amount`
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.14.1-beta
9
+ - v0.11.0-beta to v0.14.2-beta
10
10
 
11
11
  ## Install
12
12
 
@@ -352,8 +352,8 @@ module.exports = (args, cbk) => {
352
352
  const {tokens} = parseAmount({variables, amount: args.amount});
353
353
 
354
354
  // Exit early when there is no max fee rate to compute max fee for
355
- if (!!args.max_fee_rate === undefined) {
356
- return cbk(null, {tokens, max_fee: args.mage_fee});
355
+ if (args.max_fee_rate === undefined) {
356
+ return cbk(null, {tokens, max_fee: args.max_fee});
357
357
  }
358
358
 
359
359
  // Compute the max potential fee given the max fee rate constraint
package/package.json CHANGED
@@ -35,9 +35,9 @@
35
35
  "inquirer": "8.2.0",
36
36
  "invoices": "2.0.3",
37
37
  "ln-accounting": "5.0.5",
38
- "ln-service": "53.6.0",
38
+ "ln-service": "53.7.1",
39
39
  "ln-sync": "3.9.0",
40
- "ln-telegram": "3.12.1",
40
+ "ln-telegram": "3.14.1",
41
41
  "moment": "2.29.1",
42
42
  "paid-services": "3.11.0",
43
43
  "probing": "2.0.2",
@@ -81,5 +81,5 @@
81
81
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
82
82
  "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/wallets/*.js"
83
83
  },
84
- "version": "11.45.1"
84
+ "version": "11.47.2"
85
85
  }
@@ -19,12 +19,14 @@ const {handleConnectCommand} = require('ln-telegram');
19
19
  const {handleCostsCommand} = require('ln-telegram');
20
20
  const {handleEarningsCommand} = require('ln-telegram');
21
21
  const {handleEditedMessage} = require('ln-telegram');
22
+ const {handleGraphCommand} = require('ln-telegram');
22
23
  const {handleInvoiceCommand} = require('ln-telegram');
23
24
  const {handleLiquidityCommand} = require('ln-telegram');
24
25
  const {handleMempoolCommand} = require('ln-telegram');
25
26
  const {handlePayCommand} = require('ln-telegram');
26
27
  const {handlePendingCommand} = require('ln-telegram');
27
28
  const {handleStartCommand} = require('ln-telegram');
29
+ const {handleStopCommand} = require('ln-telegram');
28
30
  const {handleVersionCommand} = require('ln-telegram');
29
31
  const {InputFile} = require('grammy');
30
32
  const inquirer = require('inquirer');
@@ -266,12 +268,14 @@ module.exports = (args, cbk) => {
266
268
  {command: 'connect', description: 'Get connect code for the bot'},
267
269
  {command: 'costs', description: 'Show costs over the week'},
268
270
  {command: 'earnings', description: 'Show earnings over the week'},
271
+ {command: 'graph', description: 'Show info about a node'},
269
272
  {command: 'help', description: 'Show the list of commands'},
270
273
  {command: 'invoice', description: 'Create an invoice'},
271
274
  {command: 'liquidity', description: 'Get liquidity [with-peer]'},
272
275
  {command: 'mempool', description: 'Get info about the mempool'},
273
276
  {command: 'pay', description: 'Pay a payment request'},
274
277
  {command: 'pending', description: 'Get pending forwards, channels'},
278
+ {command: 'stop', description: 'Stop the bot'},
275
279
  {command: 'version', description: 'View current bot version'},
276
280
  ]);
277
281
 
@@ -355,6 +359,22 @@ module.exports = (args, cbk) => {
355
359
  return;
356
360
  });
357
361
 
362
+ bot.command('graph', async ctx => {
363
+ try {
364
+ await handleGraphCommand({
365
+ from: ctx.message.from.id,
366
+ id: connectedId,
367
+ nodes: allNodes,
368
+ remove: () => ctx.deleteMessage(),
369
+ reply: (message, options) => ctx.reply(message, options),
370
+ text: ctx.message.text,
371
+ working: () => ctx.replyWithChatAction('typing'),
372
+ });
373
+ } catch (err) {
374
+ logger.error({err});
375
+ }
376
+ });
377
+
358
378
  // Handle creation of an invoice
359
379
  bot.command('invoice', async ctx => {
360
380
  try {
@@ -457,6 +477,22 @@ module.exports = (args, cbk) => {
457
477
  });
458
478
  });
459
479
 
480
+ // Terminate the running bot
481
+ bot.command('stop', async ctx => {
482
+ try {
483
+ await handleStopCommand({
484
+ from: ctx.message.from.id,
485
+ id: connectedId,
486
+ quit: () => bot.stop(),
487
+ reply: (msg, mode) => ctx.reply(msg, mode),
488
+ });
489
+
490
+ process.exit();
491
+ } catch (err) {
492
+ logger.error({err});
493
+ }
494
+ });
495
+
460
496
  bot.command('version', async ctx => {
461
497
  try {
462
498
  await handleVersionCommand({
@@ -476,11 +512,13 @@ module.exports = (args, cbk) => {
476
512
  '/connect - Connect bot',
477
513
  '/costs - View costs over the past week',
478
514
  '/earnings - View earnings over the past week',
515
+ '/graph [pubkey or peer alias] - Show info about a node',
479
516
  '/invoice [amount] [memo] - Make an invoice',
480
517
  '/liquidity [with] - View node liquidity',
481
518
  '/mempool - BTC mempool report',
482
519
  '/pay - Pay an invoice',
483
520
  '/pending - View pending channels, probes, and forwards',
521
+ '/stop - Stop bot',
484
522
  '/version - View the current bot version',
485
523
  ];
486
524
 
@@ -606,7 +644,7 @@ module.exports = (args, cbk) => {
606
644
  is_local_force_close: update.is_local_force_close,
607
645
  is_remote_force_close: update.is_remote_force_close,
608
646
  partner_public_key: update.partner_public_key,
609
- send: (id, message) => bot.api.sendMessage(id, message, markdown),
647
+ send: (id, msg, opt) => bot.api.sendMessage(id, msg, opt),
610
648
  },
611
649
  err => !!err ? logger.error({node: from, closed_err: err}) : null);
612
650
  });
@@ -620,7 +658,7 @@ module.exports = (args, cbk) => {
620
658
  is_partner_initiated: update.is_partner_initiated,
621
659
  is_private: update.is_private,
622
660
  partner_public_key: update.partner_public_key,
623
- send: (id, message) => bot.api.sendMessage(id, message, markdown),
661
+ send: (id, msg, opt) => bot.api.sendMessage(id, msg, opt),
624
662
  },
625
663
  err => !!err ? logger.error({open_err: err}) : null);
626
664
  });