beignet 0.21.3 → 0.21.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.
@@ -1381,7 +1381,7 @@ class BeignetNode extends events_1.EventEmitter {
1381
1381
  this.emit(evt, jsonSafeEvent(data));
1382
1382
  });
1383
1383
  }
1384
- this.node.on('ffor:state', (channelId, state, record) => {
1384
+ this.node.on('ffor:state', ({ channelId, state, record }) => {
1385
1385
  const hex = channelId.toString('hex');
1386
1386
  this.emit('ffor:state', {
1387
1387
  channelId: hex,
@@ -1389,7 +1389,7 @@ class BeignetNode extends events_1.EventEmitter {
1389
1389
  epoch: this.fforEpochView(hex, record)
1390
1390
  });
1391
1391
  });
1392
- this.node.on('ffor:enforce', (channelId, record) => {
1392
+ this.node.on('ffor:enforce', ({ channelId, record }) => {
1393
1393
  const hex = channelId.toString('hex');
1394
1394
  this.emit('ffor:enforce', {
1395
1395
  channelId: hex,
@@ -3696,6 +3696,7 @@ class BeignetNode extends events_1.EventEmitter {
3696
3696
  fforEpochView(channelIdHex, f) {
3697
3697
  const K = f.params.maxPayments;
3698
3698
  const settledBit = (k) => f.settledBitmap !== null && (0, messages_1.bitmapGet)(f.settledBitmap, k);
3699
+ const invoices = f.role === 'R' ? this.node.fforSlotInvoices(channelIdHex) : [];
3699
3700
  const slots = Array.from({ length: K }, (_, i) => {
3700
3701
  const k = i + 1;
3701
3702
  let state;
@@ -3719,11 +3720,13 @@ class BeignetNode extends events_1.EventEmitter {
3719
3720
  else {
3720
3721
  state = 'unissued';
3721
3722
  }
3723
+ const bolt11 = invoices[i] ?? null;
3722
3724
  return {
3723
3725
  k,
3724
3726
  amountMsat: f.params.voucherAmountsMsat[i].toString(),
3725
3727
  paymentHash: f.paymentHashes[i]?.toString('hex') ?? null,
3726
- state
3728
+ state,
3729
+ ...(bolt11 ? { bolt11 } : {})
3727
3730
  };
3728
3731
  });
3729
3732
  return {