@exodus/ethereum-api 7.5.0 → 7.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "7.5.0",
3
+ "version": "7.5.1",
4
4
  "description": "Ethereum Api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -25,7 +25,7 @@
25
25
  "@exodus/bip44-constants": "^195.0.0",
26
26
  "@exodus/crypto": "^1.0.0-rc.0",
27
27
  "@exodus/currency": "^2.1.3",
28
- "@exodus/ethereum-lib": "^4.2.7",
28
+ "@exodus/ethereum-lib": "^4.8.1",
29
29
  "@exodus/ethereum-meta": "^1.2.0",
30
30
  "@exodus/ethereumholesky-meta": "^1.0.1",
31
31
  "@exodus/ethereumjs-util": "^7.1.0-exodus.7",
@@ -57,5 +57,5 @@
57
57
  "cross-fetch": "^3.1.5",
58
58
  "delay": "4.0.1"
59
59
  },
60
- "gitHead": "8066c2fd98a9065156d93108e42aa01f40aecf57"
60
+ "gitHead": "220c00b21c6bf4d250aea7a40d37ceebb1716979"
61
61
  }
@@ -32,7 +32,6 @@ const txSendFactory = ({ assetClientInterface }) => {
32
32
  const baseAsset = asset.baseAsset
33
33
  const feeOpts = { ...feeOpts_ }
34
34
  const assets = await assetClientInterface.getAssetsForNetwork({ baseAssetName: baseAsset.name })
35
- let eip1559Enabled = baseAsset.name === 'ethereum' // TODO: temp override, clean up use of eip1559Enabled flag and default to always true
36
35
 
37
36
  // Using a default zero value to not break code relying on the `tx.feeAmount` property.
38
37
  // For example, some exchange providers don't supply this.
@@ -47,6 +46,12 @@ const txSendFactory = ({ assetClientInterface }) => {
47
46
 
48
47
  let nonceParam = _nonce
49
48
 
49
+ const feeData = await assetClientInterface.getFeeData({
50
+ assetName: baseAsset.name,
51
+ })
52
+
53
+ let eip1559Enabled = feeData.eip1559Enabled
54
+
50
55
  // `replacedTx` is always an ETH/ETC transaction (not a token)
51
56
  let replacedTx, replacedTokenTx
52
57
  if (bumpTxId) {
@@ -74,19 +79,17 @@ const txSendFactory = ({ assetClientInterface }) => {
74
79
  address = (replacedTokenTx || replacedTx).to
75
80
  amount = (replacedTokenTx || replacedTx).coinAmount.negate()
76
81
  feeOpts.gasLimit = replacedTx.data.gasLimit
77
- const { gasPrice: currentGasPrice, eip1559Enabled: _eip1559Enabled } =
78
- await assetClientInterface.getFeeData({
79
- assetName,
80
- })
82
+
83
+ const { gasPrice: currentGasPrice } = feeData
81
84
  const { bumpedGasPrice, bumpedTipGasPrice } = calculateBumpedGasPrice({
82
85
  baseAsset,
83
86
  tx: replacedTx,
84
87
  currentGasPrice,
85
- eip1559Enabled: _eip1559Enabled,
88
+ eip1559Enabled,
86
89
  })
87
90
  feeOpts.gasPrice = bumpedGasPrice
88
91
  feeOpts.tipGasPrice = bumpedTipGasPrice
89
- eip1559Enabled = _eip1559Enabled && feeOpts.tipGasPrice
92
+ eip1559Enabled = feeData.eip1559Enabled && feeOpts.tipGasPrice
90
93
  nonceParam = replacedTx.data.nonce
91
94
  txInput = replacedTokenTx ? null : replacedTx.data.data || '0x'
92
95
  feeAmount = feeOpts.gasPrice.mul(feeOpts.gasLimit)