balanceofsatoshis 11.60.2 → 11.61.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,13 @@
1
1
  # Versions
2
2
 
3
+ ## 11.61.2
4
+
5
+ - `chart-fees-paid`: Check HTLC attempts to confirm only counting paid fees
6
+
7
+ ## 11.61.0
8
+
9
+ - `telegram`: add `--use-small-units` to avoid showing leading zeros on amounts
10
+
3
11
  ## 11.60.2
4
12
 
5
13
  - `trade-secret`: Fix listing of open trades that have dynamic fiat prices
package/README.md CHANGED
@@ -705,5 +705,5 @@ bos inbound-channel-rules "capacity < 2*m"
705
705
  [docker-install-guide]: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
706
706
  [nodejs-install-guide]: https://gist.github.com/alexbosworth/8fad3d51f9e1ff67995713edf2d20126
707
707
  [raspiblitz-install-guide]: https://gist.github.com/openoms/823f99d1ab6e1d53285e489f7ba38602
708
- [raspibolt-install-guide]: https://raspibolt.org/bonus/lightning/balance-of-satoshis.html
708
+ [raspibolt-install-guide]: https://raspibolt.org/guide/bonus/lightning/balance-of-satoshis.html
709
709
  [umbrel-install-guide]: https://plebnet.wiki/wiki/Umbrel_-_Installing_BoS
package/bos CHANGED
@@ -1670,6 +1670,7 @@ prog
1670
1670
  .option('--node <node_name>', 'Node to connect to Telegram', REPEATABLE)
1671
1671
  .option('--reset-api-key', 'Reset the Telegram API key')
1672
1672
  .option('--use-proxy <path>', 'Proxy agent to connect to Telegram')
1673
+ .option('--use-small-units', 'Avoid showing leading zeros on amounts')
1673
1674
  .action((args, options, logger) => {
1674
1675
  return new Promise(async (resolve, reject) => {
1675
1676
  try {
@@ -1683,6 +1684,7 @@ prog
1683
1684
  makeDirectory: mkdir,
1684
1685
  },
1685
1686
  id: options.connect,
1687
+ is_small_units: options.useSmallUnits || undefined,
1686
1688
  min_forward_tokens: options.ignoreForwardsBelow || undefined,
1687
1689
  nodes: flatten([options.node].filter(n => !!n)),
1688
1690
  payments: {limit: options.budget},
package/package.json CHANGED
@@ -37,9 +37,9 @@
37
37
  "ln-accounting": "5.0.5",
38
38
  "ln-service": "53.9.3",
39
39
  "ln-sync": "3.11.0",
40
- "ln-telegram": "3.19.2",
40
+ "ln-telegram": "3.20.0",
41
41
  "moment": "2.29.1",
42
- "paid-services": "3.14.2",
42
+ "paid-services": "3.14.4",
43
43
  "probing": "2.0.3",
44
44
  "psbt": "2.0.0",
45
45
  "qrcode-terminal": "0.12.0",
@@ -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/telegram/*.js test/wallets/*.js"
83
83
  },
84
- "version": "11.60.2"
84
+ "version": "11.61.2"
85
85
  }
@@ -146,8 +146,13 @@ module.exports = (args, cbk) => {
146
146
  .filter(payment => payment.is_confirmed !== false)
147
147
  .filter(payment => payment.confirmed_at > start.toISOString())
148
148
  .map(payment => {
149
- const attempts = payment.attempts.filter(({route}) => {
150
- const keys = route.hops.map(n => n.public_key);
149
+ const attempts = payment.attempts.filter(attempt => {
150
+ // Only consider attempts that confirmed
151
+ if (attempt.is_confirmed === false) {
152
+ return false;
153
+ }
154
+
155
+ const keys = attempt.route.hops.map(n => n.public_key);
151
156
 
152
157
  const [outHop] = keys;
153
158
 
@@ -12,6 +12,7 @@ const runTelegramBot = require('./run_telegram_bot');
12
12
  const defaultPaymentsBudget = 0;
13
13
  const isNumber = n => !isNaN(n);
14
14
  const restartDelayMs = 1000 * 60 * 3;
15
+ const smallUnitsType = 'full';
15
16
 
16
17
  /** Connect nodes to Telegram
17
18
 
@@ -23,6 +24,7 @@ const restartDelayMs = 1000 * 60 * 3;
23
24
  writeFile: <Write File Function>
24
25
  }
25
26
  [id]: <Authorized User Id Number>
27
+ is_small_units: <Formatting Should Use Small Units Bool>
26
28
  logger: <Winston Logger Object>
27
29
  [min_forward_tokens]: <Minimum Forward Tokens Number>
28
30
  [nodes]: [<Node Name String>]
@@ -93,8 +95,20 @@ module.exports = (args, cbk) => {
93
95
  return getTelegramBot({fs: args.fs, proxy: args.proxy}, cbk);
94
96
  }],
95
97
 
98
+ // Set the units formatting
99
+ setUnits: ['validate', ({}, cbk) => {
100
+ // Exit early when using default units formatting
101
+ if (!args.is_small_units) {
102
+ return cbk();
103
+ }
104
+
105
+ process.env.PREFERRED_TOKENS_TYPE = smallUnitsType;
106
+
107
+ return cbk();
108
+ }],
109
+
96
110
  // Start bot
97
- start: ['getBot', 'getNodes', ({getBot, getNodes}, cbk) => {
111
+ start: ['getBot', 'getNodes', 'setUnits', ({getBot, getNodes}, cbk) => {
98
112
  let {limit} = args.payments;
99
113
  let online = getNodes.map(n => n.id);
100
114
 
@@ -203,17 +203,14 @@ module.exports = (args, cbk) => {
203
203
  });
204
204
 
205
205
  // Handle command to get notified on the next block
206
- args.bot.command('blocknotify', async ctx => {
207
- try {
208
- await handleBlocknotifyCommand({
209
- from: ctx.message.from.id,
210
- id: connectedId,
211
- reply: n => ctx.reply(n, markdown),
212
- request: args.request,
213
- });
214
- } catch (err) {
215
- args.logger.error({err});
216
- }
206
+ args.bot.command('blocknotify', ctx => {
207
+ handleBlocknotifyCommand({
208
+ from: ctx.message.from.id,
209
+ id: connectedId,
210
+ reply: n => ctx.reply(n, markdown),
211
+ request: args.request,
212
+ },
213
+ err => !!err ? logger.error({err}) : null);
217
214
  });
218
215
 
219
216
  // Handle command to get the connect id