beignet 0.5.7 → 0.6.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/dist/cli/beignet-node.js +27 -1
- package/dist/cli/beignet-node.js.map +1 -1
- package/dist/cli/openapi.js +13 -1
- package/dist/cli/openapi.js.map +1 -1
- package/dist/lightning/channel/channel.js +122 -23
- package/dist/lightning/channel/channel.js.map +1 -1
- package/dist/lightning/node/lightning-node.js +41 -21
- package/dist/lightning/node/lightning-node.js.map +1 -1
- package/dist/lightning/node/types.js.map +1 -1
- package/dist/types/cli/beignet-node.d.ts +1 -0
- package/dist/types/cli/types.d.ts +3 -0
- package/dist/types/lightning/channel/channel.d.ts +4 -0
- package/dist/types/lightning/node/types.d.ts +3 -0
- package/package.json +1 -1
package/dist/cli/beignet-node.js
CHANGED
|
@@ -673,6 +673,7 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
673
673
|
lightningBalanceSats: lightningBalance,
|
|
674
674
|
pendingCloseBalanceSats: this.getPendingCloseBalanceSats(),
|
|
675
675
|
erroredBalanceSats: this.getErroredBalanceSats(),
|
|
676
|
+
splicingBalanceSats: this.getSplicingBalanceSats(),
|
|
676
677
|
channelCount: info.channelCount,
|
|
677
678
|
peerCount: info.peerCount,
|
|
678
679
|
listening: this.node.isListening()
|
|
@@ -705,7 +706,14 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
705
706
|
const lnBalance = this.node.getBalance();
|
|
706
707
|
const lightning = Number(lnBalance.localBalanceMsat / 1000n);
|
|
707
708
|
const unsettledSats = Number(lnBalance.unsettledBalanceMsat / 1000n);
|
|
708
|
-
|
|
709
|
+
const splicingSats = this.getSplicingBalanceSats();
|
|
710
|
+
return {
|
|
711
|
+
onchain,
|
|
712
|
+
lightning,
|
|
713
|
+
total: onchain + lightning,
|
|
714
|
+
unsettledSats,
|
|
715
|
+
splicingSats
|
|
716
|
+
};
|
|
709
717
|
}
|
|
710
718
|
getPendingCloseBalanceSats() {
|
|
711
719
|
const recovering = new Set([
|
|
@@ -730,6 +738,22 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
730
738
|
}
|
|
731
739
|
return Number(totalMsat / 1000n);
|
|
732
740
|
}
|
|
741
|
+
getSplicingBalanceSats() {
|
|
742
|
+
let totalMsat = 0n;
|
|
743
|
+
for (const ch of this.node.listChannels()) {
|
|
744
|
+
if (ch.payThroughSplice === undefined)
|
|
745
|
+
continue;
|
|
746
|
+
const pending = ch.pendingSpliceLocalBalanceMsat ?? ch.localBalanceMsat;
|
|
747
|
+
if (ch.payThroughSplice) {
|
|
748
|
+
const counted = pending < ch.localBalanceMsat ? pending : ch.localBalanceMsat;
|
|
749
|
+
totalMsat += pending - counted;
|
|
750
|
+
}
|
|
751
|
+
else {
|
|
752
|
+
totalMsat += pending;
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
return Number(totalMsat / 1000n);
|
|
756
|
+
}
|
|
733
757
|
async resolveWalletSweepScript() {
|
|
734
758
|
const bitcoin = require('bitcoinjs-lib');
|
|
735
759
|
try {
|
|
@@ -1504,6 +1528,8 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
1504
1528
|
info.feeratePerKw = ch.feeratePerKw;
|
|
1505
1529
|
if (ch.htlcCount !== undefined)
|
|
1506
1530
|
info.htlcCount = ch.htlcCount;
|
|
1531
|
+
if (ch.pendingSpliceLocalBalanceMsat !== undefined)
|
|
1532
|
+
info.pendingSpliceLocalBalanceSats = Number(ch.pendingSpliceLocalBalanceMsat / 1000n);
|
|
1507
1533
|
if (ch.isPrivate !== undefined)
|
|
1508
1534
|
info.isPrivate = ch.isPrivate;
|
|
1509
1535
|
if (ch.feeBaseMsat !== undefined)
|