@exodus/ethereum-lib 5.11.0 → 5.12.0-patch.0
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,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
|
+
## [5.12.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.11.0...@exodus/ethereum-lib@5.12.0) (2025-06-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: ethereum api use balances and nonces data (#5727)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [5.11.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-lib@5.10.2...@exodus/ethereum-lib@5.11.0) (2025-05-29)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.12.0-patch.0",
|
|
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",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@exodus/currency": "^6.0.1",
|
|
27
27
|
"@exodus/ethereumjs": "^1.5.0",
|
|
28
28
|
"@exodus/key-utils": "^3.7.0",
|
|
29
|
-
"@exodus/models": "^12.0
|
|
29
|
+
"@exodus/models": "^12.13.0",
|
|
30
30
|
"@exodus/solidity-contract": "^1.1.3",
|
|
31
31
|
"base-x": "^3.0.2",
|
|
32
32
|
"lodash": "^4.17.15",
|
|
@@ -49,6 +49,5 @@
|
|
|
49
49
|
"repository": {
|
|
50
50
|
"type": "git",
|
|
51
51
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
52
|
-
}
|
|
53
|
-
"gitHead": "45be970be70f9211b8a6489566c352f4caeb82dc"
|
|
52
|
+
}
|
|
54
53
|
}
|
|
@@ -183,11 +183,36 @@ const calculateBumpedGasPriceEip1559 = ({
|
|
|
183
183
|
})
|
|
184
184
|
}
|
|
185
185
|
|
|
186
|
+
// During transaction acceleration, our goal is to land the
|
|
187
|
+
// transaction in the next available block. However, this
|
|
188
|
+
// cannot be guaranteed if we're only applying the `BUMP_RATE`
|
|
189
|
+
// to an initially small `tipGasPrice` that's insufficient for
|
|
190
|
+
// current levels of congestion (even after multiplication).
|
|
191
|
+
//
|
|
192
|
+
// Therefore, if the `currentMaxPriorityFeePerGas` is known
|
|
193
|
+
// and it is greater than our evaluated `bumpedTipGasPrice`,
|
|
194
|
+
// we'll short-circuit to use that one instead.
|
|
195
|
+
const ensureSaneBumpedGasPriceEip1559 = ({
|
|
196
|
+
currentMaxPriorityFeePerGas,
|
|
197
|
+
eip1559BumpedGasPrice,
|
|
198
|
+
}) => {
|
|
199
|
+
assert(currentMaxPriorityFeePerGas, 'expected currentMaxPriorityFeePerGas')
|
|
200
|
+
|
|
201
|
+
const { bumpedGasPrice, bumpedTipGasPrice } = eip1559BumpedGasPrice
|
|
202
|
+
if (currentMaxPriorityFeePerGas.lte(bumpedTipGasPrice)) return eip1559BumpedGasPrice
|
|
203
|
+
|
|
204
|
+
return {
|
|
205
|
+
bumpedTipGasPrice: currentMaxPriorityFeePerGas,
|
|
206
|
+
bumpedGasPrice: bumpedGasPrice.sub(bumpedTipGasPrice).add(currentMaxPriorityFeePerGas),
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
186
210
|
export const calculateBumpedGasPrice = ({
|
|
187
211
|
baseAsset,
|
|
188
212
|
tx,
|
|
189
213
|
currentBaseFee,
|
|
190
214
|
currentGasPrice,
|
|
215
|
+
currentTipGasPrice,
|
|
191
216
|
eip1559Enabled,
|
|
192
217
|
}) => {
|
|
193
218
|
// Determine the transaction we intend to override's
|
|
@@ -210,12 +235,19 @@ export const calculateBumpedGasPrice = ({
|
|
|
210
235
|
? baseAsset.currency.baseUnit(tx.data.tipGasPrice)
|
|
211
236
|
: null
|
|
212
237
|
|
|
213
|
-
|
|
238
|
+
const eip1559BumpedGasPrice = calculateBumpedGasPriceEip1559({
|
|
214
239
|
baseAsset,
|
|
215
240
|
currentBaseFeePerGas: currentBaseFee,
|
|
216
241
|
prevMaxPriorityFeePerGas,
|
|
217
242
|
prevMaxFeePerGas,
|
|
218
243
|
})
|
|
244
|
+
|
|
245
|
+
if (!currentTipGasPrice) return eip1559BumpedGasPrice
|
|
246
|
+
|
|
247
|
+
return ensureSaneBumpedGasPriceEip1559({
|
|
248
|
+
currentMaxPriorityFeePerGas: currentTipGasPrice,
|
|
249
|
+
eip1559BumpedGasPrice,
|
|
250
|
+
})
|
|
219
251
|
}
|
|
220
252
|
|
|
221
253
|
export const canAccelerateTx = ({
|
|
@@ -251,6 +283,7 @@ export const canAccelerateTx = ({
|
|
|
251
283
|
gasPrice: currentGasPrice,
|
|
252
284
|
eip1559Enabled,
|
|
253
285
|
baseFeePerGas: currentBaseFee,
|
|
286
|
+
tipGasPrice: currentTipGasPrice,
|
|
254
287
|
} = getFeeData(assetName)
|
|
255
288
|
|
|
256
289
|
const { bumpedGasPrice: gasPriceToUse } = calculateBumpedGasPrice({
|
|
@@ -259,6 +292,7 @@ export const canAccelerateTx = ({
|
|
|
259
292
|
currentGasPrice,
|
|
260
293
|
currentBaseFee,
|
|
261
294
|
eip1559Enabled,
|
|
295
|
+
currentTipGasPrice,
|
|
262
296
|
})
|
|
263
297
|
const replacementFee = gasPriceToUse.mul(tx.data.gasLimit)
|
|
264
298
|
|