@exodus/ethereum-lib 5.20.4 → 5.21.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/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
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
|
+
## [5.21.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.21.0...@exodus/ethereum-lib@5.21.1) (2026-02-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix(ethereum-lib): return null instead of NumberUnit ZERO in calculateExtraEth (#7473)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [5.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.20.4...@exodus/ethereum-lib@5.21.0) (2026-01-14)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: EIP delegation status on all monitors (#7193)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
## [5.20.4](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.20.3...@exodus/ethereum-lib@5.20.4) (2026-01-08)
|
|
7
27
|
|
|
8
28
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.21.1",
|
|
4
4
|
"description": "Ethereum utils, such as for cryptography, address encoding/decoding, transaction building, etc.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"type": "git",
|
|
52
52
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "4f64cadacff131de0febb946f1ffc4476eb0e52c"
|
|
55
55
|
}
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
const defaultMultiplier = 1.1
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
// if a wallet has <N> ETH, the deposit needed should be the fee * <multiplier> - <N>
|
|
3
|
+
// Returns the extra amount needed beyond balance to cover fee * multiplier, or ZERO if balance already covers it.
|
|
5
4
|
export default function ({ fee, balance, multiplier = defaultMultiplier }) {
|
|
6
5
|
if (typeof multiplier !== 'number' || multiplier < 1) multiplier = defaultMultiplier
|
|
7
6
|
if (balance.gt(fee)) return balance.unitType.ZERO
|
|
8
7
|
|
|
9
|
-
return fee
|
|
10
|
-
.mul(multiplier)
|
|
11
|
-
.sub(balance)
|
|
12
|
-
.toDefault() // ensure correct unit before `toFixed`
|
|
13
|
-
.toFixed(4, 'ceil')
|
|
14
|
-
.toDefaultString({ unit: true })
|
|
8
|
+
return fee.mul(multiplier).sub(balance)
|
|
15
9
|
}
|