@exodus/ethereum-api 8.33.5 → 8.33.6
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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/gas-estimation.js +1 -1
- package/src/get-balances.js +4 -4
- package/src/get-fee-async.js +0 -4
- package/src/get-fee.js +13 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [8.33.6](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.33.5...@exodus/ethereum-api@8.33.6) (2025-04-01)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: [ETH] Estimate using the correct `tipGasPrice` for transactions that use a `customFee`. (#5351)
|
|
13
|
+
|
|
14
|
+
* fix: remove unused isSendAll param (#5310)
|
|
15
|
+
|
|
16
|
+
* fix: return the delegatedBalance in getStaked and subtract the activeStakedBalance from getStaking (#5363)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## [8.33.5](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.33.4...@exodus/ethereum-api@8.33.5) (2025-03-19)
|
|
7
21
|
|
|
8
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.33.
|
|
3
|
+
"version": "8.33.6",
|
|
4
4
|
"description": "Transaction monitors, fee monitors, RPC with the blockchain node, and other networking code for Ethereum and EVM-based blockchains",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "323d88c01416cafbc90022d336d9062315f9322b"
|
|
68
68
|
}
|
package/src/gas-estimation.js
CHANGED
|
@@ -4,7 +4,7 @@ import BN from 'bn.js'
|
|
|
4
4
|
|
|
5
5
|
import { estimateGas, isContractAddressCached } from './eth-like-util.js'
|
|
6
6
|
|
|
7
|
-
export const EXTRA_PERCENTAGE =
|
|
7
|
+
export const EXTRA_PERCENTAGE = 29
|
|
8
8
|
|
|
9
9
|
// 16 gas per non-zero byte (4 gas per zero byte) of "transaction input data"
|
|
10
10
|
const GAS_PER_NON_ZERO_BYTE = 16
|
package/src/get-balances.js
CHANGED
|
@@ -8,13 +8,13 @@ import { isRpcBalanceAsset } from '@exodus/ethereum-lib'
|
|
|
8
8
|
import assert from 'minimalistic-assert'
|
|
9
9
|
|
|
10
10
|
const getStaked = ({ accountState, asset }) => {
|
|
11
|
-
return accountState?.staking?.[asset.name]?.
|
|
11
|
+
return accountState?.staking?.[asset.name]?.delegatedBalance || asset.currency.ZERO
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
const getStaking = ({ accountState, asset }) => {
|
|
15
|
-
|
|
16
|
-
accountState?.staking?.[asset.name]?.
|
|
17
|
-
)
|
|
15
|
+
const activeStakedBalance =
|
|
16
|
+
accountState?.staking?.[asset.name]?.activeStakedBalance || asset.currency.ZERO
|
|
17
|
+
return getStaked({ accountState, asset }).sub(activeStakedBalance)
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const getUnclaimedUndelegatedBalance = ({ accountState, asset }) => {
|
package/src/get-fee-async.js
CHANGED
|
@@ -66,9 +66,7 @@ const getFeeAsyncFactory = ({
|
|
|
66
66
|
isExchange,
|
|
67
67
|
customFee,
|
|
68
68
|
calculateEffectiveFee,
|
|
69
|
-
isSendAll,
|
|
70
69
|
gasLimit: providedGasLimit,
|
|
71
|
-
isRbfAllowed = true, // Destkop, isRbfAllowed=true when advanced panel is on
|
|
72
70
|
}) => {
|
|
73
71
|
const fromAddress = providedFromAddress || ARBITRARY_ADDRESS // sending from a random address
|
|
74
72
|
const toAddress = providedToAddress || ARBITRARY_ADDRESS // sending to a random address,
|
|
@@ -109,9 +107,7 @@ const getFeeAsyncFactory = ({
|
|
|
109
107
|
feeData,
|
|
110
108
|
gasLimit,
|
|
111
109
|
isExchange,
|
|
112
|
-
isSendAll,
|
|
113
110
|
amount,
|
|
114
|
-
isRbfAllowed,
|
|
115
111
|
calculateEffectiveFee,
|
|
116
112
|
customFee,
|
|
117
113
|
})
|
package/src/get-fee.js
CHANGED
|
@@ -29,12 +29,22 @@ export const getFeeFactory =
|
|
|
29
29
|
customFee,
|
|
30
30
|
gasLimit: providedGasLimit,
|
|
31
31
|
isExchange,
|
|
32
|
-
isSendAll,
|
|
33
32
|
amount,
|
|
34
|
-
isRbfAllowed = true, // Destkop, isRbfAllowed=true when advanced panel is on
|
|
35
33
|
calculateEffectiveFee,
|
|
36
34
|
}) => {
|
|
37
|
-
const { eip1559Enabled
|
|
35
|
+
const { eip1559Enabled } = feeData
|
|
36
|
+
|
|
37
|
+
// HACK: For EIP-1559 transactions, we forcibly coerce the
|
|
38
|
+
// tipGasPrice to be the `customFee`, where defined:
|
|
39
|
+
// https://github.com/ExodusMovement/assets/blob/b805d1de0e67013ece2a1460389fb4328445eac1/ethereum/ethereum-api/src/tx-send/tx-send.js#L302C5-L311C6
|
|
40
|
+
//
|
|
41
|
+
// Therefore to compute the true fee at send time, we
|
|
42
|
+
// must also enforce the relationship here!
|
|
43
|
+
if (eip1559Enabled && customFee) {
|
|
44
|
+
feeData = { ...feeData, tipGasPrice: customFee }
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const { baseFeePerGas, tipGasPrice, useBaseGasPrice } = feeData
|
|
38
48
|
|
|
39
49
|
let gasPrice = customFee || resolveGasPrice({ feeData })
|
|
40
50
|
|