@shapeshiftoss/swapper 9.2.2 → 9.2.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.
@@ -75,6 +75,11 @@ async function getCowSwapTradeQuote(deps, input) {
75
75
  .div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision))
76
76
  .multipliedBy((0, bignumber_1.bnOrZero)(sellAssetUsdRate))
77
77
  .toString();
78
+ // If original sellAmount is < minQuoteSellAmount, we don't want to replace it with normalizedSellAmount
79
+ // The purpose of this was to get a quote from CowSwap even with small amounts
80
+ const quoteSellAmount = (0, bignumber_1.bnOrZero)(sellAmount).lt(minQuoteSellAmount)
81
+ ? sellAmount
82
+ : normalizedSellAmount;
78
83
  return {
79
84
  rate,
80
85
  minimum,
@@ -90,7 +95,7 @@ async function getCowSwapTradeQuote(deps, input) {
90
95
  },
91
96
  tradeFee: tradeFeeFiat
92
97
  },
93
- sellAmount: normalizedSellAmount,
98
+ sellAmount: quoteSellAmount,
94
99
  buyAmount: quote.buyAmount,
95
100
  sources: constants_1.DEFAULT_SOURCE,
96
101
  allowanceContract: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "9.2.2",
3
+ "version": "9.2.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",