@exodus/ethereum-api 7.3.1 → 7.3.2

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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/src/get-fee.js +4 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "7.3.1",
3
+ "version": "7.3.2",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -57,5 +57,5 @@
57
57
  "cross-fetch": "^3.1.5",
58
58
  "delay": "4.0.1"
59
59
  },
60
- "gitHead": "c09304326cb0fa6a3acd22d87c38553e05e43569"
60
+ "gitHead": "06a32175d0e18e2fca6c74e55313b68ce0c2b402"
61
61
  }
package/src/get-fee.js CHANGED
@@ -5,7 +5,7 @@ const taxes = {
5
5
  paxgold: 0.0002,
6
6
  }
7
7
 
8
- const getGasPriceMultiplier = ({ asset, feeData, isExchange, isSendAll }) => {
8
+ const getGasPriceMultiplier = ({ asset, feeData, isExchange, isSendAll, isRbfAllowed }) => {
9
9
  // exchanges quotes expire, do not risk having a stuck tx
10
10
  if (isExchange) return 1
11
11
 
@@ -14,7 +14,7 @@ const getGasPriceMultiplier = ({ asset, feeData, isExchange, isSendAll }) => {
14
14
  if (isSendAll && isEthereumLike(asset) && feeData.eip1559Enabled) return 1
15
15
 
16
16
  // do not risk having a stuck tx if we're not able to accelerate it
17
- if (!feeData.rbfEnabled) return 1
17
+ if (!isRbfAllowed || !feeData.rbfEnabled) return 1
18
18
 
19
19
  return feeData.gasPriceEconomicalRate
20
20
  }
@@ -43,12 +43,14 @@ export const getFeeFactory =
43
43
  isExchange,
44
44
  isSendAll,
45
45
  amount,
46
+ isRbfAllowed = true, // Destkop, isRbfAllowed=true when advanced panel is on
46
47
  calculateEffectiveFee, // BE
47
48
  customFee: customGasPrice, // BE
48
49
  }) => {
49
50
  const { gasPrice, eip1559Enabled, baseFeePerGas, tipGasPrice } = feeData
50
51
  const gasPriceMultiplier = getGasPriceMultiplier({
51
52
  asset,
53
+ isRbfAllowed,
52
54
  feeData,
53
55
  isExchange,
54
56
  isSendAll,