@atomiqlabs/lp-lib 13.0.0-beta.3 → 13.0.0-beta.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.
@@ -82,6 +82,7 @@ class SpvVaultSwap extends SwapHandlerSwap_1.SwapHandlerSwap {
82
82
  return {
83
83
  ...super.serialize(),
84
84
  quoteId: this.quoteId,
85
+ expiry: this.expiry,
85
86
  owner: this.vaultOwner,
86
87
  vaultId: (0, Utils_1.serializeBN)(this.vaultId),
87
88
  vaultAddress: this.vaultAddress,
@@ -51,6 +51,8 @@ class FromBtcLnTrusted extends SwapHandler_1.SwapHandler {
51
51
  const abortController = new AbortController();
52
52
  this.lightning.waitForInvoice(hash, abortController.signal).then(invoice => {
53
53
  this.swapLogger.debug(invoiceData, "subscribeToInvoice(): invoice_updated: ", invoice);
54
+ if (invoice.status !== "held")
55
+ return;
54
56
  this.htlcReceived(invoiceData, invoice).catch(e => console.error(e));
55
57
  this.activeSubscriptions.delete(hash);
56
58
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/lp-lib",
3
- "version": "13.0.0-beta.3",
3
+ "version": "13.0.0-beta.5",
4
4
  "description": "Main functionality implementation for atomiq LP node",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -134,6 +134,7 @@ export class SpvVaultSwap extends SwapHandlerSwap<SpvVaultSwapState> {
134
134
  return {
135
135
  ...super.serialize(),
136
136
  quoteId: this.quoteId,
137
+ expiry: this.expiry,
137
138
  owner: this.vaultOwner,
138
139
  vaultId: serializeBN(this.vaultId),
139
140
  vaultAddress: this.vaultAddress,
@@ -89,6 +89,7 @@ export class FromBtcLnTrusted extends SwapHandler<FromBtcLnTrustedSwap, FromBtcL
89
89
  const abortController = new AbortController();
90
90
  this.lightning.waitForInvoice(hash, abortController.signal).then(invoice => {
91
91
  this.swapLogger.debug(invoiceData, "subscribeToInvoice(): invoice_updated: ", invoice);
92
+ if(invoice.status!=="held") return;
92
93
  this.htlcReceived(invoiceData, invoice).catch(e => console.error(e));
93
94
  this.activeSubscriptions.delete(hash);
94
95
  });