@exodus/ethereum-api 8.58.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 +28 -0
- package/package.json +2 -2
- package/src/staking/ethereum/service.js +11 -2
- package/src/tx-send/tx-send.js +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,34 @@
|
|
|
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
|
+
|
|
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)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
* feat: enable implicit transaction bumps (#6798)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
* fix: correct response to insufficient evm nonce during txSend (#6901)
|
|
29
|
+
|
|
30
|
+
* fix: enable replacement transaction underpriced errors to satisfy evm transaction existence checks (#6900)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
6
34
|
## [8.58.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.57.0...@exodus/ethereum-api@8.58.0) (2025-11-10)
|
|
7
35
|
|
|
8
36
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.
|
|
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,
|
package/src/tx-send/tx-send.js
CHANGED
|
@@ -59,11 +59,19 @@ const txSendFactory = ({ assetClientInterface, createTx }) => {
|
|
|
59
59
|
try {
|
|
60
60
|
await baseAsset.api.broadcastTx(rawTx.toString('hex'))
|
|
61
61
|
} catch (err) {
|
|
62
|
+
const transactionUnderpricedErr = err.message.match(/transaction underpriced/i)
|
|
62
63
|
const nonceTooLowErr = err.message.match(/nonce (is |)too low/i)
|
|
63
64
|
const insufficientFundsErr = err.message.match(/insufficient funds/i)
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
|
|
66
|
+
// NOTE: We've found that `geth` can return the following errors
|
|
67
|
+
// for transactions which may be already known. In this
|
|
68
|
+
// case, we validate that the transaction is known to the
|
|
69
|
+
// network.
|
|
70
|
+
const txAlreadyExists =
|
|
71
|
+
nonceTooLowErr || transactionUnderpricedErr
|
|
72
|
+
? await transactionExists({ asset, txId })
|
|
73
|
+
: err.message.match(/already known/i) ||
|
|
74
|
+
err.message.match(/transaction already imported/i)
|
|
67
75
|
|
|
68
76
|
if (txAlreadyExists) {
|
|
69
77
|
console.info('tx already broadcast') // inject logger factory from platform
|