beignet 0.7.2 → 0.7.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.
@@ -1385,10 +1385,10 @@ class BeignetNode extends events_1.EventEmitter {
1385
1385
  updatesApplied: result.updatesApplied
1386
1386
  };
1387
1387
  }
1388
- openChannel(pubkey, amountSats, pushSats, satsPerVbyte, max = false) {
1388
+ openChannel(pubkey, amountSats, pushSats, satsPerVbyte, max = false, trusted = false) {
1389
1389
  const fundingSatoshis = BigInt(amountSats);
1390
1390
  const pushMsat = pushSats !== undefined ? BigInt(pushSats) * 1000n : undefined;
1391
- const channel = this.node.openChannel(pubkey, fundingSatoshis, pushMsat, satsPerVbyte, max);
1391
+ const channel = this.node.openChannel(pubkey, fundingSatoshis, pushMsat, satsPerVbyte, max, trusted);
1392
1392
  const state = channel.getFullState();
1393
1393
  const balances = channel.getBalances();
1394
1394
  const channelId = state.channelId || state.temporaryChannelId;
@@ -1411,7 +1411,10 @@ class BeignetNode extends events_1.EventEmitter {
1411
1411
  }
1412
1412
  async connectAndOpenChannel(pubkey, host, port, amountSats, opts) {
1413
1413
  await this.connectPeer(pubkey, host, port);
1414
- return this.openChannel(pubkey, amountSats, opts?.pushSats, opts?.satsPerVbyte, opts?.max);
1414
+ if (opts?.trusted) {
1415
+ this.node.addTrustedPeer(pubkey);
1416
+ }
1417
+ return this.openChannel(pubkey, amountSats, opts?.pushSats, opts?.satsPerVbyte, opts?.max, opts?.trusted ?? false);
1415
1418
  }
1416
1419
  async ensureMinimumChannels(count, satsPerChannel, _opts) {
1417
1420
  const existing = this.getReadyChannels();