@atomiqlabs/sdk 8.6.8 → 8.6.9

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.
@@ -217,7 +217,7 @@ class FromBTCLNWrapper extends IFromBTCLNWrapper_1.IFromBTCLNWrapper {
217
217
  if (decodedPr.timeExpireDate == null)
218
218
  throw new IntermediaryError_1.IntermediaryError("Invalid returned swap invoice, no expiry date field");
219
219
  const amountIn = (BigInt(decodedPr.millisatoshis) + 999n) / 1000n;
220
- const swapFeeBtc = resp.swapFee * amountIn / (resp.total - resp.swapFee);
220
+ const swapFeeBtc = resp.swapFee * amountIn / (resp.total + resp.swapFee);
221
221
  try {
222
222
  this.verifyReturnedData(resp, amountData, lp, _options, decodedPr, paymentHash);
223
223
  const [pricingInfo] = await Promise.all([
@@ -309,7 +309,7 @@ class FromBTCWrapper extends IFromBTCWrapper_1.IFromBTCWrapper {
309
309
  }, undefined, e => e instanceof RequestError_1.RequestError, abortController.signal);
310
310
  const data = new this._swapDataDeserializer(resp.data);
311
311
  data.setClaimer(recipient);
312
- const swapFeeBtc = resp.swapFee * resp.amount / (data.getAmount() - resp.swapFee);
312
+ const swapFeeBtc = resp.swapFee * resp.amount / (data.getAmount() + resp.swapFee);
313
313
  this.verifyReturnedData(recipient, resp, amountData, lp, _options, data, sequence, (await claimerBountyPrefetchPromise), nativeTokenAddress);
314
314
  const [pricingInfo, signatureExpiry] = await Promise.all([
315
315
  //Get intermediary's liquidity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/sdk",
3
- "version": "8.6.8",
3
+ "version": "8.6.9",
4
4
  "description": "atomiq labs SDK for cross-chain swaps between smart chains and bitcoin",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -334,7 +334,7 @@ export class FromBTCLNWrapper<
334
334
  if(decodedPr.timeExpireDate==null) throw new IntermediaryError("Invalid returned swap invoice, no expiry date field");
335
335
  const amountIn = (BigInt(decodedPr.millisatoshis) + 999n) / 1000n;
336
336
 
337
- const swapFeeBtc = resp.swapFee * amountIn / (resp.total - resp.swapFee);
337
+ const swapFeeBtc = resp.swapFee * amountIn / (resp.total + resp.swapFee);
338
338
 
339
339
  try {
340
340
  this.verifyReturnedData(resp, amountData, lp, _options, decodedPr, paymentHash);
@@ -487,7 +487,7 @@ export class FromBTCWrapper<
487
487
  const data: T["Data"] = new this._swapDataDeserializer(resp.data);
488
488
  data.setClaimer(recipient);
489
489
 
490
- const swapFeeBtc = resp.swapFee * resp.amount / (data.getAmount() - resp.swapFee);
490
+ const swapFeeBtc = resp.swapFee * resp.amount / (data.getAmount() + resp.swapFee);
491
491
 
492
492
  this.verifyReturnedData(recipient, resp, amountData, lp, _options, data, sequence, (await claimerBountyPrefetchPromise)!, nativeTokenAddress);
493
493
  const [pricingInfo, signatureExpiry] = await Promise.all([