balanceofsatoshis 11.64.2 → 12.0.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 +13 -0
- package/README.md +2 -0
- package/bos +4 -6
- package/network/get_peers.js +1 -6
- package/network/remove_peer.js +1 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Versions
|
|
2
2
|
|
|
3
|
+
## 12.0.0
|
|
4
|
+
|
|
5
|
+
- `peers`: Add `capacity` as a variable for the `--filter` option
|
|
6
|
+
- `remove-peer`: Add `capacity` as a variable for the `--filter` option
|
|
7
|
+
- `remove-peer`: Add `--filter` option to filter the type of peer to remove
|
|
8
|
+
|
|
9
|
+
### Breaking Changes
|
|
10
|
+
|
|
11
|
+
For `peers` and `remove-peer` commands:
|
|
12
|
+
|
|
13
|
+
- `--inbound-below`: Removed option. Use `--filter "inbound_liquidity < X"`
|
|
14
|
+
- `--outbound-below`: Removed option. Use `--filter "outbound_liquidity < X"`
|
|
15
|
+
|
|
3
16
|
## 11.64.2
|
|
4
17
|
|
|
5
18
|
- `trade-secret`: Fix connecting when not already peered with seller
|
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ Or use a platform-specific guide:
|
|
|
22
22
|
- [RaspiBlitz install guide][raspiblitz-install-guide]
|
|
23
23
|
- [RaspiBolt/Debian guide][raspibolt-install-guide]
|
|
24
24
|
- [Umbrel install guide][umbrel-install-guide]
|
|
25
|
+
- [Voltage install guide][voltage-install-guide]
|
|
25
26
|
|
|
26
27
|
If you want to try out any command without npm install, you can also do `npx
|
|
27
28
|
balanceofsatoshis` to run a command directly.
|
|
@@ -707,3 +708,4 @@ bos inbound-channel-rules "capacity < 2*m"
|
|
|
707
708
|
[raspiblitz-install-guide]: https://gist.github.com/openoms/823f99d1ab6e1d53285e489f7ba38602
|
|
708
709
|
[raspibolt-install-guide]: https://raspibolt.org/guide/bonus/lightning/balance-of-satoshis.html
|
|
709
710
|
[umbrel-install-guide]: https://plebnet.wiki/wiki/Umbrel_-_Installing_BoS
|
|
711
|
+
[voltage-install-guide]: https://docs.voltage.cloud/balance-of-satoshis-guides/balance-of-satoshis
|
package/bos
CHANGED
|
@@ -1222,6 +1222,7 @@ prog
|
|
|
1222
1222
|
.help('Icons: 🦐 limited max htlc')
|
|
1223
1223
|
.help('Filters can take formula expressions to limit results')
|
|
1224
1224
|
.help('Filter variable AGE: "age > 144 * 7" for peers older than a week')
|
|
1225
|
+
.help('Filter variable CAPACITY: "capacity > 8*m"')
|
|
1225
1226
|
.help('Filter variable DISK_USAGE_MB: "disk_usage_mb > 9" for disk estimate')
|
|
1226
1227
|
.help('Filter variable INBOUND_LIQUIDITY: "inbound_liquidity > 1*m"')
|
|
1227
1228
|
.help('Filter variable OUTBOUND_LIQUIDITY: "outbound_liquidity > 1*m"')
|
|
@@ -1230,12 +1231,10 @@ prog
|
|
|
1230
1231
|
.option('--fee-days <past_days>', 'Include fees earned over n days', INT)
|
|
1231
1232
|
.option('--filter <formula>', 'Filter formula to apply', REPEATABLE)
|
|
1232
1233
|
.option('--idle-days <days>', 'No receives or routes for n days', INT)
|
|
1233
|
-
.option('--inbound-below <amount>', 'Inbound liquidity below amount', INT)
|
|
1234
1234
|
.option('--no-color', 'Mute all colors')
|
|
1235
1235
|
.option('--node <node_name>', 'Node to get peers for')
|
|
1236
1236
|
.option('--offline', 'Only offline peer channels')
|
|
1237
1237
|
.option('--omit <key>', 'Omit peer with public key', REPEATABLE)
|
|
1238
|
-
.option('--outbound-below <amount>', 'Outbound liquidity below amount', INT)
|
|
1239
1238
|
.option('--private', 'Only private channels')
|
|
1240
1239
|
.option('--public', 'Only peers with public channels')
|
|
1241
1240
|
.option('--sort <by>', 'Sort results by peer attribute', peerSortOptions)
|
|
@@ -1250,7 +1249,6 @@ prog
|
|
|
1250
1249
|
filters: flatten([options.filter].filter(n => !!n)),
|
|
1251
1250
|
fs: {getFile: readFile},
|
|
1252
1251
|
idle_days: options.idleDays || undefined,
|
|
1253
|
-
inbound_liquidity_below: options.inboundBelow,
|
|
1254
1252
|
is_active: !!options.active,
|
|
1255
1253
|
is_monochrome: !!options.noColor,
|
|
1256
1254
|
is_offline: !!options.offline,
|
|
@@ -1259,7 +1257,6 @@ prog
|
|
|
1259
1257
|
is_table: !options.complete,
|
|
1260
1258
|
lnd: (await lnd.authenticatedLnd({logger, node: options.node})).lnd,
|
|
1261
1259
|
omit: flatten([options.omit].filter(n => !!n)),
|
|
1262
|
-
outbound_liquidity_below: options.outboundBelow,
|
|
1263
1260
|
sort_by: options.sort,
|
|
1264
1261
|
tags: flatten([options.tag].filter(n => !!n)),
|
|
1265
1262
|
},
|
|
@@ -1432,19 +1429,19 @@ prog
|
|
|
1432
1429
|
|
|
1433
1430
|
// Remove a peer
|
|
1434
1431
|
.command('remove-peer', 'Close out with a channel-connected peer')
|
|
1432
|
+
.help('--filter command uses same filters as peers command')
|
|
1435
1433
|
.argument('[public_key]', 'Choose a specific peer to close with')
|
|
1436
1434
|
.option('--active', 'Make sure the peer is online')
|
|
1437
1435
|
.option('--address <address>', 'Address to close out funds to')
|
|
1438
1436
|
.option('--dryrun', 'Avoid actually closing channels with peer')
|
|
1439
1437
|
.option('--fee-rate <rate>', 'Fee rate per vbyte to close out with', FLOAT)
|
|
1438
|
+
.option('--filter <formula>', 'Filter formula to apply', REPEATABLE)
|
|
1440
1439
|
.option('--force', 'Force close channels if they cannot be coop closed')
|
|
1441
1440
|
.option('--idle-days <days>', 'No receives or routes for n days', INT)
|
|
1442
|
-
.option('--inbound-below <amount>', 'Peer inbound is below amount', INT)
|
|
1443
1441
|
.option('--no-color', 'Mute all colors')
|
|
1444
1442
|
.option('--node <node_name>', 'Node to remove peer on')
|
|
1445
1443
|
.option('--offline', 'Make sure the peer is offline')
|
|
1446
1444
|
.option('--omit <key>', 'Avoid closing peer with public key', REPEATABLE)
|
|
1447
|
-
.option('--outbound-below <amount>', 'Peer outbound is below amount', INT)
|
|
1448
1445
|
.option('--outpoint', 'Only remove specific channel with funding txid:vout')
|
|
1449
1446
|
.option('--private', 'Peer is privately connected')
|
|
1450
1447
|
.option('--public', 'Peer is publicly connected')
|
|
@@ -1460,6 +1457,7 @@ prog
|
|
|
1460
1457
|
address: options.address,
|
|
1461
1458
|
ask: (n, cbk) => inquirer.prompt([n]).then(n => cbk(n)),
|
|
1462
1459
|
chain_fee_rate: options.feeRate || undefined,
|
|
1460
|
+
filters: flatten([options.filter].filter(n => !!n)),
|
|
1463
1461
|
fs: {getFile: readFile},
|
|
1464
1462
|
idle_days: options.idleDays,
|
|
1465
1463
|
inbound_liquidity_below: options.inboundBelow,
|
package/network/get_peers.js
CHANGED
|
@@ -58,7 +58,6 @@ const maxPaySize = 4294967;
|
|
|
58
58
|
getFile: <Read File Contents Function> (path, cbk) => {}
|
|
59
59
|
}
|
|
60
60
|
[idle_days]: <Not Active For Days Number>
|
|
61
|
-
[inbound_liquidity_below]: <Inbound Liquidity Below Tokens Number>
|
|
62
61
|
[is_active]: <Active Channels Only Bool>
|
|
63
62
|
[is_monochrome]: <Mute Colors Bool>
|
|
64
63
|
[is_offline]: <Offline Channels Only Bool>
|
|
@@ -67,7 +66,6 @@ const maxPaySize = 4294967;
|
|
|
67
66
|
[is_table]: <Peers As Table Bool>
|
|
68
67
|
lnd: <Authenticated LND gRPC API Object>
|
|
69
68
|
omit: [<Omit Peer With Public Key Hex String>]
|
|
70
|
-
[outbound_liquidity_below]: <Outbound Liquidity Below Tokens Number>
|
|
71
69
|
[sort_by]: <Sort Results By Attribute String>
|
|
72
70
|
[tags]: [<Tag Identifier String>]
|
|
73
71
|
}
|
|
@@ -415,8 +413,6 @@ module.exports = (args, cbk) => {
|
|
|
415
413
|
},
|
|
416
414
|
{});
|
|
417
415
|
|
|
418
|
-
const maxInbound = args.inbound_liquidity_below;
|
|
419
|
-
const maxOutbound = args.outbound_liquidity_below;
|
|
420
416
|
const {network} = getNetwork.value || {};
|
|
421
417
|
const peerKeys = getChannels.channels.map(n => n.partner_public_key);
|
|
422
418
|
const wallet = await getHeight({lnd: args.lnd});
|
|
@@ -507,6 +503,7 @@ module.exports = (args, cbk) => {
|
|
|
507
503
|
filters: args.filters || [],
|
|
508
504
|
variables: {
|
|
509
505
|
age: blocks,
|
|
506
|
+
capacity: totalCapacity,
|
|
510
507
|
disk_usage_mb: estimateDiskFootprint(pastStates),
|
|
511
508
|
fee_earnings: mtokensAsTokens(feeMtokens),
|
|
512
509
|
inbound_fee_rate: feeRate,
|
|
@@ -565,8 +562,6 @@ module.exports = (args, cbk) => {
|
|
|
565
562
|
return {
|
|
566
563
|
peers: sortBy({array: peers, attribute: args.sort_by || defaultSort})
|
|
567
564
|
.sorted
|
|
568
|
-
.filter(n => !maxInbound || n.inbound_liquidity < maxInbound)
|
|
569
|
-
.filter(n => !maxOutbound || n.outbound_liquidity < maxOutbound)
|
|
570
565
|
.filter(n => args.omit.indexOf(n.public_key) === notFoundIndex)
|
|
571
566
|
.filter(n => {
|
|
572
567
|
// Always return peer when no idle days are specified
|
package/network/remove_peer.js
CHANGED
|
@@ -36,7 +36,6 @@ const tokensAsBigUnit = tokens => (tokens / 1e8).toFixed(8);
|
|
|
36
36
|
getFile: <Read File Contents Function> (path, cbk) => {}
|
|
37
37
|
}
|
|
38
38
|
[idle_days]: <No Activity From Peer For Days Number>
|
|
39
|
-
[inbound_liquidity_below]: <Peer Has Inbound Liquidity Below Tokens Number>
|
|
40
39
|
[is_active]: <Peer Is Actively Connected Bool>
|
|
41
40
|
[is_dry_run]: <Avoid Actually Closing Channel Bool>
|
|
42
41
|
[is_forced]: <Force Close When Cooperative Close Is Impossible Bool>
|
|
@@ -47,7 +46,6 @@ const tokensAsBigUnit = tokens => (tokens / 1e8).toFixed(8);
|
|
|
47
46
|
lnd: <Authenticated LND API Object>
|
|
48
47
|
logger: <Winston Logger Object>
|
|
49
48
|
[omit]: [<Avoid Peer With Public Key String>]
|
|
50
|
-
[outbound_liquidity_below]: <Has Outbound Liquidity Below Tokens Number>
|
|
51
49
|
outpoints: [<Only Remove Specific Channel Funding Outpoint String>]
|
|
52
50
|
[public_key]: <Public Key Hex String>
|
|
53
51
|
request: <Request Function>
|
|
@@ -131,9 +129,9 @@ module.exports = (args, cbk) => {
|
|
|
131
129
|
getPeers: ['validate', ({}, cbk) => {
|
|
132
130
|
return getPeers({
|
|
133
131
|
earnings_days: args.idle_days || defaultDays,
|
|
132
|
+
filters: args.filters,
|
|
134
133
|
fs: args.fs,
|
|
135
134
|
idle_days: args.idle_days || Number(),
|
|
136
|
-
inbound_liquidity_below: args.inbound_liquidity_below,
|
|
137
135
|
is_active: args.is_active,
|
|
138
136
|
is_offline: args.is_offline,
|
|
139
137
|
is_private: args.is_private,
|
|
@@ -141,7 +139,6 @@ module.exports = (args, cbk) => {
|
|
|
141
139
|
is_showing_last_received: true,
|
|
142
140
|
lnd: args.lnd,
|
|
143
141
|
omit: args.omit || [],
|
|
144
|
-
outbound_liquidity_below: args.outbound_liquidity_below,
|
|
145
142
|
sort_by: 'last_activity',
|
|
146
143
|
},
|
|
147
144
|
cbk);
|
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"crypto-js": "4.1.1",
|
|
30
30
|
"csv-parse": "5.0.4",
|
|
31
31
|
"goldengate": "11.1.1",
|
|
32
|
-
"grammy": "1.7.
|
|
32
|
+
"grammy": "1.7.3",
|
|
33
33
|
"hot-formula-parser": "4.0.0",
|
|
34
34
|
"import-lazy": "4.0.0",
|
|
35
35
|
"ini": "3.0.0",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"postpublish": "docker buildx build --platform linux/amd64,linux/arm64,linux/arm/v7 -t alexbosworth/balanceofsatoshis --push .",
|
|
83
83
|
"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"
|
|
84
84
|
},
|
|
85
|
-
"version": "
|
|
85
|
+
"version": "12.0.0"
|
|
86
86
|
}
|