@exodus/ethereum-api 8.35.0 → 8.35.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/gas-estimation.js +14 -0
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.35.1](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.35.0...@exodus/ethereum-api@8.35.1) (2025-06-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* fix: hardcode gasLimit in client (#5815)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [8.35.0](https://github.com/ExodusMovement/assets/compare/@exodus/ethereum-api@8.34.4...@exodus/ethereum-api@8.35.0) (2025-05-28)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "8.35.
|
|
3
|
+
"version": "8.35.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",
|
|
@@ -64,5 +64,5 @@
|
|
|
64
64
|
"type": "git",
|
|
65
65
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
66
66
|
},
|
|
67
|
-
"gitHead": "
|
|
67
|
+
"gitHead": "00ad163ba6670ea2c820f80e0ec3a9314aff48e3"
|
|
68
68
|
}
|
package/src/gas-estimation.js
CHANGED
|
@@ -15,6 +15,15 @@ export const DEFAULT_CONTRACT_GAS_LIMIT = 1e6
|
|
|
15
15
|
export const scaleGasLimitEstimate = ({ estimatedGasLimit, extraPercentage = EXTRA_PERCENTAGE }) =>
|
|
16
16
|
Number((BigInt(estimatedGasLimit) * BigInt(100 + extraPercentage)) / BigInt(100))
|
|
17
17
|
|
|
18
|
+
const hardcodedGasLimits = new Map([
|
|
19
|
+
['amp', 151_000],
|
|
20
|
+
['tetherusd', 70_000],
|
|
21
|
+
['usdcoin', 70_000],
|
|
22
|
+
['snx', 220_000],
|
|
23
|
+
['geminidollar', 75_000],
|
|
24
|
+
['aave', 250_000],
|
|
25
|
+
])
|
|
26
|
+
|
|
18
27
|
// Starting with geth v1.9.14, if gasPrice is set for eth_estimateGas call, the call allowance will
|
|
19
28
|
// be calculated with account's balance divided by gasPrice. If user's balance is too low,
|
|
20
29
|
// the gasEstimation will fail. If gasPrice is set to '0x0', the account's balance is not
|
|
@@ -28,6 +37,11 @@ export async function estimateGasLimit(
|
|
|
28
37
|
gasPrice = '0x',
|
|
29
38
|
extraPercentage
|
|
30
39
|
) {
|
|
40
|
+
// move this to remote config
|
|
41
|
+
if (hardcodedGasLimits.has(asset.name)) {
|
|
42
|
+
return hardcodedGasLimits.get(asset.name)
|
|
43
|
+
}
|
|
44
|
+
|
|
31
45
|
const opts = {
|
|
32
46
|
from: fromAddress,
|
|
33
47
|
to: toAddress,
|