@cowprotocol/sdk-trading 0.2.0 → 0.2.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.
package/dist/index.js CHANGED
@@ -544,7 +544,8 @@ function suggestSlippageBps(params) {
544
544
  slippage: totalSlippageBps
545
545
  });
546
546
  const slippageBps = (0, import_sdk_common8.percentageToBps)(slippagePercent);
547
- return Math.max(Math.min(slippageBps, MAX_SLIPPAGE_BPS), getDefaultSlippageBps(trader.chainId, isEthFlow));
547
+ const lowerCap = isEthFlow ? ETH_FLOW_DEFAULT_SLIPPAGE_BPS[trader.chainId] : 0;
548
+ return Math.max(Math.min(slippageBps, MAX_SLIPPAGE_BPS), lowerCap);
548
549
  }
549
550
 
550
551
  // src/resolveSlippageSuggestion.ts
package/dist/index.mjs CHANGED
@@ -509,7 +509,8 @@ function suggestSlippageBps(params) {
509
509
  slippage: totalSlippageBps
510
510
  });
511
511
  const slippageBps = percentageToBps(slippagePercent);
512
- return Math.max(Math.min(slippageBps, MAX_SLIPPAGE_BPS), getDefaultSlippageBps(trader.chainId, isEthFlow));
512
+ const lowerCap = isEthFlow ? ETH_FLOW_DEFAULT_SLIPPAGE_BPS[trader.chainId] : 0;
513
+ return Math.max(Math.min(slippageBps, MAX_SLIPPAGE_BPS), lowerCap);
513
514
  }
514
515
 
515
516
  // src/resolveSlippageSuggestion.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowprotocol/sdk-trading",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CowProtocol trading",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
@@ -35,11 +35,11 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "deepmerge": "^4.3.1",
38
- "@cowprotocol/sdk-app-data": "4.0.1",
38
+ "@cowprotocol/sdk-common": "0.2.0",
39
39
  "@cowprotocol/sdk-config": "0.1.0",
40
- "@cowprotocol/sdk-order-book": "0.1.1",
41
40
  "@cowprotocol/sdk-order-signing": "0.1.4",
42
- "@cowprotocol/sdk-common": "0.2.0",
41
+ "@cowprotocol/sdk-app-data": "4.0.1",
42
+ "@cowprotocol/sdk-order-book": "0.1.1",
43
43
  "@cowprotocol/sdk-contracts-ts": "0.3.0"
44
44
  },
45
45
  "scripts": {