balanceofsatoshis 19.0.0 → 19.0.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,9 @@
1
1
  # Versions
2
2
 
3
+ ## 19.0.2
4
+
5
+ - `offer-channel-open`: Correct PPM fee pricing for custom lifetime lengths
6
+
3
7
  ## 19.0.0
4
8
 
5
9
  - `install-completion`: Add command to install shell tab autocompletion
package/README.md CHANGED
@@ -7,7 +7,7 @@ Commands for working with LND balances.
7
7
 
8
8
  Supported LND versions:
9
9
 
10
- - v0.18.0-beta
10
+ - v0.18.0-beta to v0.18.1-beta
11
11
  - v0.17.0-beta to v0.17.5-beta
12
12
  - v0.16.0-beta to v0.16.4-beta
13
13
  - v0.15.2-beta to v0.15.5-beta
@@ -23,8 +23,9 @@ const {versionJsonRpc} = require('./lsps1_protocol');
23
23
 
24
24
  const blocksAsMs = blocks => blocks * 10 * 60 * 1000;
25
25
  const blocksPerYear = 144 * 365;
26
- const capacityFee = (rate, capacity) => Math.floor(rate * capacity / 1e6 / 4);
26
+ const capacityFee = (rate, capacity) => Math.floor(rate * capacity / 1e6);
27
27
  const decodeMessage = n => Buffer.from(n, 'hex').toString();
28
+ const describeBlocks = blocks => `${(blocks / 144).toFixed(2)} days`;
28
29
  const encodeMessage = n => Buffer.from(n, 'utf8').toString('hex');
29
30
  const expiryDate = ms => new Date(Date.now() + ms).toISOString();
30
31
  const {floor} = Math;
@@ -337,7 +338,17 @@ module.exports = (args, cbk) => {
337
338
 
338
339
  const capacityFees = capacityFee(ppmFees, getMessage.capacity);
339
340
 
340
- const ppmTotalFee = floor(time * capacityFees);
341
+ const ppmTotalFee = Math.ceil(time * capacityFees);
342
+
343
+ args.logger.info({
344
+ request: {
345
+ capacity: tokensAsBigUnit(getMessage.capacity),
346
+ lifetime: describeBlocks(getMessage.params.channel_expiry_blocks),
347
+ ppm_fee: tokensAsBigUnit(ppmTotalFee),
348
+ base_fee: tokensAsBigUnit(baseFee),
349
+ chain_fee: tokensAsBigUnit(estimatedChainFee),
350
+ },
351
+ });
341
352
 
342
353
  return cbk(null, {
343
354
  capacity: getMessage.capacity,
package/package.json CHANGED
@@ -31,13 +31,13 @@
31
31
  "csv-parse": "5.5.6",
32
32
  "ecpair": "2.1.0",
33
33
  "goldengate": "14.0.7",
34
- "grammy": "1.26.0",
34
+ "grammy": "1.26.1",
35
35
  "hot-formula-parser": "4.0.0",
36
36
  "import-lazy": "4.0.0",
37
37
  "ini": "4.1.3",
38
- "inquirer": "9.3.2",
38
+ "inquirer": "9.3.4",
39
39
  "ln-accounting": "8.0.3",
40
- "ln-service": "57.14.3",
40
+ "ln-service": "57.14.4",
41
41
  "ln-sync": "6.0.4",
42
42
  "ln-telegram": "6.1.6",
43
43
  "minimist": "1.2.8",
@@ -56,7 +56,7 @@
56
56
  "description": "Lightning balance CLI",
57
57
  "devDependencies": {
58
58
  "invoices": "3.0.0",
59
- "ln-docker-daemons": "6.0.19",
59
+ "ln-docker-daemons": "6.0.20",
60
60
  "mock-lnd": "1.4.4"
61
61
  },
62
62
  "engines": {
@@ -84,5 +84,5 @@
84
84
  "postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis -t alexbosworth/balanceofsatoshis:$npm_package_version --push .",
85
85
  "test": "npx nyc@15.1.0 node --experimental-test-coverage --test 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"
86
86
  },
87
- "version": "19.0.0"
87
+ "version": "19.0.2"
88
88
  }