beignet 0.6.3 → 0.6.5
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 +17 -3
- package/dist/cli/beignet-node.js.map +1 -1
- package/dist/cli/cli.js +7 -3
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/daemon.js +2 -2
- package/dist/cli/daemon.js.map +1 -1
- package/dist/cli/openapi.js +11 -1
- package/dist/cli/openapi.js.map +1 -1
- package/dist/lightning/node/lightning-node.js +19 -2
- package/dist/lightning/node/lightning-node.js.map +1 -1
- package/dist/lightning/node/types.js.map +1 -1
- package/dist/lightning/wallet/wallet-funding-provider.js +29 -10
- package/dist/lightning/wallet/wallet-funding-provider.js.map +1 -1
- package/dist/types/cli/beignet-node.d.ts +2 -1
- package/dist/types/cli/types.d.ts +2 -0
- package/dist/types/lightning/node/lightning-node.d.ts +2 -1
- package/dist/types/lightning/node/types.d.ts +1 -1
- package/dist/types/lightning/wallet/wallet-funding-provider.d.ts +6 -1
- package/package.json +1 -1
package/dist/cli/beignet-node.js
CHANGED
|
@@ -1361,10 +1361,10 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
1361
1361
|
updatesApplied: result.updatesApplied
|
|
1362
1362
|
};
|
|
1363
1363
|
}
|
|
1364
|
-
openChannel(pubkey, amountSats, pushSats, satsPerVbyte) {
|
|
1364
|
+
openChannel(pubkey, amountSats, pushSats, satsPerVbyte, max = false) {
|
|
1365
1365
|
const fundingSatoshis = BigInt(amountSats);
|
|
1366
1366
|
const pushMsat = pushSats !== undefined ? BigInt(pushSats) * 1000n : undefined;
|
|
1367
|
-
const channel = this.node.openChannel(pubkey, fundingSatoshis, pushMsat, satsPerVbyte);
|
|
1367
|
+
const channel = this.node.openChannel(pubkey, fundingSatoshis, pushMsat, satsPerVbyte, max);
|
|
1368
1368
|
const state = channel.getFullState();
|
|
1369
1369
|
const balances = channel.getBalances();
|
|
1370
1370
|
const channelId = state.channelId || state.temporaryChannelId;
|
|
@@ -1387,7 +1387,7 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
async connectAndOpenChannel(pubkey, host, port, amountSats, opts) {
|
|
1389
1389
|
await this.connectPeer(pubkey, host, port);
|
|
1390
|
-
return this.openChannel(pubkey, amountSats, opts?.pushSats, opts?.satsPerVbyte);
|
|
1390
|
+
return this.openChannel(pubkey, amountSats, opts?.pushSats, opts?.satsPerVbyte, opts?.max);
|
|
1391
1391
|
}
|
|
1392
1392
|
async ensureMinimumChannels(count, satsPerChannel, _opts) {
|
|
1393
1393
|
const existing = this.getReadyChannels();
|
|
@@ -2849,6 +2849,18 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
2849
2849
|
}
|
|
2850
2850
|
getLiquiditySnapshot() {
|
|
2851
2851
|
const snapshot = this.node.getLiquiditySnapshot();
|
|
2852
|
+
let reserveMsat = 0n;
|
|
2853
|
+
let sendableMsat = 0n;
|
|
2854
|
+
for (const ch of this.node.listChannels()) {
|
|
2855
|
+
if (ch.state !== types_3.ChannelState.NORMAL)
|
|
2856
|
+
continue;
|
|
2857
|
+
const chReserveMsat = ch.localReserveMsat ?? 0n;
|
|
2858
|
+
reserveMsat += chReserveMsat;
|
|
2859
|
+
sendableMsat +=
|
|
2860
|
+
ch.localBalanceMsat > chReserveMsat
|
|
2861
|
+
? ch.localBalanceMsat - chReserveMsat
|
|
2862
|
+
: 0n;
|
|
2863
|
+
}
|
|
2852
2864
|
return {
|
|
2853
2865
|
totalLocalBalanceSats: snapshot.totalLocalBalanceSats,
|
|
2854
2866
|
totalRemoteBalanceSats: snapshot.totalRemoteBalanceSats,
|
|
@@ -2857,6 +2869,8 @@ class BeignetNode extends events_1.EventEmitter {
|
|
|
2857
2869
|
activeChannelCount: snapshot.activeChannelCount,
|
|
2858
2870
|
outboundLiquidityPct: snapshot.outboundLiquidityPct,
|
|
2859
2871
|
inboundLiquidityPct: snapshot.inboundLiquidityPct,
|
|
2872
|
+
reserveSats: Number(reserveMsat / 1000n),
|
|
2873
|
+
sendableSats: Number(sendableMsat / 1000n),
|
|
2860
2874
|
recommendations: snapshot.recommendations
|
|
2861
2875
|
};
|
|
2862
2876
|
}
|