@shapeshiftoss/swapper 9.10.0 → 9.10.1

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.
@@ -65,20 +65,12 @@ async function cowBuildTrade(deps, input) {
65
65
  spenderAddress: constants_1.COW_SWAP_VAULT_RELAYER_ADDRESS,
66
66
  contractAddress: sellAssetErc20Address
67
67
  });
68
- const [feeDataOptions, sellAssetUsdRate] = await Promise.all([
69
- adapter.getFeeData({
70
- to: sellAssetErc20Address,
71
- value: '0',
72
- chainSpecific: { from: receiveAddress, contractData: data }
73
- }),
74
- (0, helpers_2.getUsdRate)(deps, sellAsset)
75
- ]);
68
+ const feeDataOptions = await adapter.getFeeData({
69
+ to: sellAssetErc20Address,
70
+ value: '0',
71
+ chainSpecific: { from: receiveAddress, contractData: data }
72
+ });
76
73
  const feeData = feeDataOptions['fast'];
77
- // calculating trade fee in USD
78
- const tradeFeeFiat = (0, bignumber_1.bnOrZero)(quote.feeAmount)
79
- .div((0, bignumber_1.bn)(10).exponentiatedBy(sellAsset.precision))
80
- .multipliedBy((0, bignumber_1.bnOrZero)(sellAssetUsdRate))
81
- .toString();
82
74
  const trade = {
83
75
  rate,
84
76
  feeData: {
@@ -87,7 +79,7 @@ async function cowBuildTrade(deps, input) {
87
79
  estimatedGas: feeData.chainSpecific.gasLimit,
88
80
  gasPrice: feeData.chainSpecific.gasPrice
89
81
  },
90
- tradeFee: tradeFeeFiat
82
+ tradeFee: '0' // Trade fees for buy Asset are always 0 since trade fees are subtracted from sell asset
91
83
  },
92
84
  sellAmount: normalizedSellAmount,
93
85
  buyAmount: quote.buyAmount,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shapeshiftoss/swapper",
3
- "version": "9.10.0",
3
+ "version": "9.10.1",
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",