@shapeshiftoss/swapper 17.6.2 → 17.6.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.
@@ -66,6 +66,7 @@ async function getCowSwapTradeQuote(deps, input) {
66
66
  */
67
67
  const quoteResponse = await cowService_1.cowService.post(`${deps.apiUrl}/v1/quote/`, apiInput);
68
68
  const { data: { quote: { buyAmount: buyAmountCryptoBaseUnit, sellAmount: sellAmountCryptoBaseUnit, feeAmount: feeAmountInSellTokenCryptoBaseUnit, }, }, } = quoteResponse;
69
+ const quoteSellAmountPlusFeesCryptoBaseUnit = (0, bignumber_1.bnOrZero)(sellAmountCryptoBaseUnit).plus(feeAmountInSellTokenCryptoBaseUnit);
69
70
  const buyCryptoAmount = (0, bignumber_1.bn)(buyAmountCryptoBaseUnit).div((0, bignumber_1.bn)(10).exponentiatedBy(buyAsset.precision));
70
71
  const sellCryptoAmount = (0, bignumber_1.bn)(sellAmountCryptoBaseUnit).div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision));
71
72
  const rate = buyCryptoAmount.div(sellCryptoAmount).toString();
@@ -87,7 +88,7 @@ async function getCowSwapTradeQuote(deps, input) {
87
88
  .multipliedBy((0, bignumber_1.bnOrZero)(sellAssetUsdRate))
88
89
  .toString();
89
90
  const feeData = feeDataOptions['fast'];
90
- const isQuoteSellAmountBelowMinimum = (0, bignumber_1.bnOrZero)(sellAmountCryptoBaseUnit).lt(minQuoteSellAmount);
91
+ const isQuoteSellAmountBelowMinimum = (0, bignumber_1.bnOrZero)(quoteSellAmountPlusFeesCryptoBaseUnit).lt(minQuoteSellAmount);
91
92
  // If isQuoteSellAmountBelowMinimum we don't want to replace it with normalizedSellAmount
92
93
  // The purpose of this was to get a quote from CowSwap even with small amounts
93
94
  const quoteSellAmountCryptoBaseUnit = isQuoteSellAmountBelowMinimum
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "17.6.2",
3
+ "version": "17.6.3",
4
4
  "description": "An interface and implementations to trade coins via various protocols",
5
5
  "repository": "https://github.com/shapeshift/lib",
6
6
  "license": "MIT",