ln-service 57.16.0 → 57.18.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Versions
2
2
 
3
+ ## 57.18.0
4
+
5
+ - `getMinimumRelayFee`: Add method to get the chain backend minimum relay fee
6
+
7
+ ## 57.17.0
8
+
9
+ - `getFeeRates`: Add support for `inbound_base_discount_mtokens`,
10
+ `inbound_rate_discount` for inbound fee policy discounts
11
+
3
12
  ## 57.16.0
4
13
 
5
14
  - `getClosedChannels`: Add support for anchor resolution status via new
package/README.md CHANGED
@@ -2309,6 +2309,8 @@ Requires `offchain:read` permission
2309
2309
  base_fee: <Base Flat Fee Tokens Rounded Up Number>
2310
2310
  base_fee_mtokens: <Base Flat Fee Millitokens String>
2311
2311
  id: <Standard Format Channel Id String>
2312
+ inbound_base_discount_mtokens: <Source Based Base Fee Reduction String>
2313
+ inbound_rate_discount: <Source Based Per Million Rate Reduction Number>
2312
2314
  transaction_id: <Channel Funding Transaction Id Hex String>
2313
2315
  transaction_vout: <Funding Outpoint Output Index Number>
2314
2316
  }]
@@ -2730,6 +2732,25 @@ const allowedMethods = methods.filter(method => {
2730
2732
  });
2731
2733
  ```
2732
2734
 
2735
+ ### getMinimumRelayFee
2736
+
2737
+ Get the current minimum relay fee for the chain backend
2738
+
2739
+ Requires LND built with `walletrpc` tag
2740
+
2741
+ Requires `onchain:read` permission
2742
+
2743
+ This method is not supported on LND 0.18.2 and below
2744
+
2745
+ {
2746
+ lnd: <Authenticated LND API Object>
2747
+ }
2748
+
2749
+ @returns via cbk or Promise
2750
+ {
2751
+ tokens_per_vbyte: <Minimum Relayable Tokens Per Virtual Byte Number>
2752
+ }
2753
+
2733
2754
  ### getNetworkCentrality
2734
2755
 
2735
2756
  Get the graph centrality scores of the nodes on the network
package/index.js CHANGED
@@ -63,6 +63,7 @@ const {getInvoices} = require('lightning');
63
63
  const {getLockedUtxos} = require('lightning');
64
64
  const {getMasterPublicKeys} = require('lightning');
65
65
  const {getMethods} = require('lightning');
66
+ const {getMinimumRelayFee} = require('lightning');
66
67
  const {getNetworkCentrality} = require('lightning');
67
68
  const {getNetworkGraph} = require('lightning');
68
69
  const {getNetworkInfo} = require('lightning');
@@ -228,6 +229,7 @@ module.exports = {
228
229
  getLockedUtxos,
229
230
  getMasterPublicKeys,
230
231
  getMethods,
232
+ getMinimumRelayFee,
231
233
  getNetworkCentrality,
232
234
  getNetworkGraph,
233
235
  getNetworkInfo,
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "dependencies": {
10
10
  "bolt07": "1.9.4",
11
11
  "invoices": "3.0.0",
12
- "lightning": "10.16.0",
12
+ "lightning": "10.18.0",
13
13
  "macaroon": "3.0.4"
14
14
  },
15
15
  "description": "Interaction helper for your Lightning Network daemon",
@@ -24,7 +24,7 @@
24
24
  "bn.js": "5.2.1",
25
25
  "bs58check": "4.0.0",
26
26
  "ecpair": "2.1.0",
27
- "ln-docker-daemons": "6.0.21",
27
+ "ln-docker-daemons": "6.0.22",
28
28
  "p2tr": "2.0.0",
29
29
  "portfinder": "1.0.32",
30
30
  "psbt": "3.0.0",
@@ -74,5 +74,5 @@
74
74
  "integration-test-0.14.4": "DOCKER_LND_VERSION=v0.14.4-beta npm run test",
75
75
  "test": "echo $DOCKER_LND_VERSION && node test/runner"
76
76
  },
77
- "version": "57.16.0"
77
+ "version": "57.18.0"
78
78
  }
@@ -0,0 +1,26 @@
1
+ const {equal} = require('node:assert').strict;
2
+ const test = require('node:test');
3
+
4
+ const {spawnLightningCluster} = require('ln-docker-daemons');
5
+
6
+ const {getMinimumRelayFee} = require('./../../');
7
+
8
+ // Getting the min chain fee rate should return the min fee rate
9
+ test(`Get minimum chain fee rate`, async () => {
10
+ const [{kill, lnd}] = (await spawnLightningCluster({})).nodes;
11
+
12
+ try {
13
+ const feeRate = await getMinimumRelayFee({lnd});
14
+
15
+ await kill({});
16
+
17
+ // LND 0.18.2 and below do not return a minimum relay fee rate
18
+ if (!!feeRate.tokens_per_vbyte) {
19
+ equal(feeRate.tokens_per_vbyte, 1.012, 'Fee rate is returned');
20
+ }
21
+ } catch (err) {
22
+ equal(null, err, 'Expected no error getting relay fee');
23
+ }
24
+
25
+ return;
26
+ });