beignet 0.8.1 → 0.8.2

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.
@@ -314,6 +314,7 @@ class BeignetNode extends events_1.EventEmitter {
314
314
  servers: electrumServer
315
315
  },
316
316
  disableMessagesOnCreate: true,
317
+ onMessage: (key, data) => this.onWalletMessage(key, data),
317
318
  ...(this.logger ? { logger: this.logger } : {}),
318
319
  rbf: true,
319
320
  storage: (0, wallet_storage_1.createWalletStorage)(this.storage)
@@ -1280,6 +1281,33 @@ class BeignetNode extends events_1.EventEmitter {
1280
1281
  throw new errors_1.BeignetError('REFRESH_FAILED', result.error.message);
1281
1282
  }
1282
1283
  }
1284
+ onWalletMessage(key, data) {
1285
+ const relayed = {
1286
+ transactionReceived: {
1287
+ event: 'transaction:received',
1288
+ label: 'Transaction received'
1289
+ },
1290
+ transactionSent: {
1291
+ event: 'transaction:sent',
1292
+ label: 'Transaction sent'
1293
+ },
1294
+ transactionConfirmed: {
1295
+ event: 'transaction:confirmed',
1296
+ label: 'Transaction confirmed'
1297
+ }
1298
+ };
1299
+ if (!(key in relayed))
1300
+ return;
1301
+ const { event, label } = relayed[key];
1302
+ const { transaction } = data;
1303
+ const info = this.toOnchainTxInfo(transaction);
1304
+ this.log('info', label, {
1305
+ txid: info.txid,
1306
+ type: info.type,
1307
+ valueSats: info.valueSats
1308
+ });
1309
+ this.emit(event, info);
1310
+ }
1283
1311
  toOnchainTxInfo(tx) {
1284
1312
  return {
1285
1313
  txid: tx.txid,
@@ -1630,6 +1658,11 @@ class BeignetNode extends events_1.EventEmitter {
1630
1658
  capacitySats: Number(ch.fundingSatoshis),
1631
1659
  isAnchor: (0, types_3.isAnchorChannel)(ch.channelType ?? null)
1632
1660
  };
1661
+ if (peerPubkey) {
1662
+ const splice = this.node.peerSupportsSplicing(peerPubkey);
1663
+ if (splice !== null)
1664
+ info.peerSupportsSplicing = splice;
1665
+ }
1633
1666
  if (ch.fundingTxid)
1634
1667
  info.fundingTxid = ch.fundingTxid;
1635
1668
  if (ch.shortChannelId)