balanceofsatoshis 19.0.2 → 19.0.3
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 +1 -1
- package/README.md +1 -1
- package/lsp/lsps1_client.js +4 -0
- package/package.json +6 -6
- package/swaps/rebalance.js +9 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/lsp/lsps1_client.js
CHANGED
|
@@ -145,6 +145,10 @@ module.exports = (args, cbk) => {
|
|
|
145
145
|
return cbk([404, 'NoServicesOfferingChannelsFound']);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
+
args.logger.info({
|
|
149
|
+
services: services.map(n => `${n.alias} ${n.public_key}`.trim()),
|
|
150
|
+
});
|
|
151
|
+
|
|
148
152
|
return args.ask({
|
|
149
153
|
choices: services.map(node => ({
|
|
150
154
|
name: `${node.alias} ${node.public_key}`,
|
package/package.json
CHANGED
|
@@ -31,19 +31,19 @@
|
|
|
31
31
|
"csv-parse": "5.5.6",
|
|
32
32
|
"ecpair": "2.1.0",
|
|
33
33
|
"goldengate": "14.0.7",
|
|
34
|
-
"grammy": "1.
|
|
34
|
+
"grammy": "1.27.0",
|
|
35
35
|
"hot-formula-parser": "4.0.0",
|
|
36
36
|
"import-lazy": "4.0.0",
|
|
37
37
|
"ini": "4.1.3",
|
|
38
|
-
"inquirer": "
|
|
38
|
+
"inquirer": "10.0.1",
|
|
39
39
|
"ln-accounting": "8.0.3",
|
|
40
|
-
"ln-service": "57.
|
|
40
|
+
"ln-service": "57.15.0",
|
|
41
41
|
"ln-sync": "6.0.4",
|
|
42
42
|
"ln-telegram": "6.1.6",
|
|
43
43
|
"minimist": "1.2.8",
|
|
44
44
|
"moment": "2.30.1",
|
|
45
45
|
"paid-services": "6.1.4",
|
|
46
|
-
"probing": "5.0.
|
|
46
|
+
"probing": "5.0.3",
|
|
47
47
|
"psbt": "3.0.0",
|
|
48
48
|
"qrcode-terminal": "0.12.0",
|
|
49
49
|
"sanitize-filename": "1.6.3",
|
|
@@ -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.
|
|
59
|
+
"ln-docker-daemons": "6.0.21",
|
|
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.
|
|
87
|
+
"version": "19.0.3"
|
|
88
88
|
}
|
package/swaps/rebalance.js
CHANGED
|
@@ -808,13 +808,21 @@ module.exports = (args, cbk) => {
|
|
|
808
808
|
|
|
809
809
|
const dif = BigInt(route.fee_mtokens) - BigInt(discounted.fee_mtokens);
|
|
810
810
|
|
|
811
|
+
// Exit early when the inbound incluive fee rate is actually higher
|
|
812
|
+
if (BigInt(discounted.fee_mtokens) > BigInt(route.fee_mtokens)) {
|
|
813
|
+
return cbk(null, {route});
|
|
814
|
+
}
|
|
815
|
+
|
|
811
816
|
return cbk(null, {
|
|
812
817
|
lowered: tokAsBigTok(Number(dif / mtokensPerToken)),
|
|
818
|
+
route: discounted,
|
|
813
819
|
});
|
|
814
820
|
}],
|
|
815
821
|
|
|
816
822
|
// Execute the rebalance
|
|
817
|
-
pay: ['
|
|
823
|
+
pay: ['discount', 'invoice', 'lnd', ({discount, invoice, lnd}, cbk) => {
|
|
824
|
+
const routes = [discount.route];
|
|
825
|
+
|
|
818
826
|
return payViaRoutes({lnd, routes, id: invoice.id}, (err, res) => {
|
|
819
827
|
if (!!err) {
|
|
820
828
|
return cbk([503, 'UnexpectedErrExecutingRebalance', {err}]);
|