@exodus/ethereum-api 8.59.0 → 8.59.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 +10 -0
- package/package.json +2 -2
- package/src/staking/ethereum/service.js +11 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.59.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.59.0...@exodus/ethereum-api@8.59.1) (2025-11-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* Fix: add "send all" pathway to ethereum staking (#6667)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [8.59.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.57.0...@exodus/ethereum-api@8.59.0) (2025-11-10)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.59.
|
|
3
|
+
"version": "8.59.1",
|
|
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",
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"type": "git",
|
|
68
68
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "ec8e542519bed6a27d746a9cb8c305d45d3a5a3c"
|
|
71
71
|
}
|
|
@@ -60,7 +60,7 @@ export function createEthereumStakingService({
|
|
|
60
60
|
return { delegatorAddress, feeData }
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
async function delegate({ walletAccount, amount, feeData } = Object.create(null)) {
|
|
63
|
+
async function delegate({ walletAccount, amount, feeData, isDelegateAll } = Object.create(null)) {
|
|
64
64
|
const asset = await getAsset(assetName)
|
|
65
65
|
const staking = getStakingApi(asset)
|
|
66
66
|
amount = amountToCurrency({ asset, amount })
|
|
@@ -76,7 +76,7 @@ export function createEthereumStakingService({
|
|
|
76
76
|
})}`
|
|
77
77
|
)
|
|
78
78
|
|
|
79
|
-
const { gasPrice, gasLimit, tipGasPrice } = await estimateTxFee({
|
|
79
|
+
const { gasPrice, gasLimit, tipGasPrice, fee } = await estimateTxFee({
|
|
80
80
|
from: delegatorAddress,
|
|
81
81
|
to,
|
|
82
82
|
amount,
|
|
@@ -84,6 +84,15 @@ export function createEthereumStakingService({
|
|
|
84
84
|
feeData,
|
|
85
85
|
})
|
|
86
86
|
|
|
87
|
+
// If we are delegating all, we need to subtract the estimated ETH cost from the amount
|
|
88
|
+
// Better to do it here than from the mobile app where fees can change before the transaction is sent
|
|
89
|
+
if (isDelegateAll) {
|
|
90
|
+
const minAmount = getMinAmount(asset)
|
|
91
|
+
amount = amount.sub(fee)
|
|
92
|
+
// Re-validate that the amount after fee subtraction is still above the minimum
|
|
93
|
+
assert(amount.gte(minAmount), `Min Amount ${minAmount}`)
|
|
94
|
+
}
|
|
95
|
+
|
|
87
96
|
const txId = await prepareAndSendTx({
|
|
88
97
|
asset,
|
|
89
98
|
walletAccount,
|