@exodus/ethereum-api 8.34.6 → 8.34.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/ethereum-api",
3
- "version": "8.34.6",
3
+ "version": "8.34.8",
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",
@@ -49,7 +49,7 @@
49
49
  "ws": "^6.1.0"
50
50
  },
51
51
  "devDependencies": {
52
- "@exodus/assets-testing": "^1.0.0",
52
+ "@exodus/assets-testing": "workspace:^",
53
53
  "@exodus/bsc-meta": "^2.1.2",
54
54
  "@exodus/ethereumarbone-meta": "^2.0.3",
55
55
  "@exodus/ethereumgoerli-meta": "^2.0.1",
@@ -63,6 +63,5 @@
63
63
  "repository": {
64
64
  "type": "git",
65
65
  "url": "git+https://github.com/ExodusMovement/assets.git"
66
- },
67
- "gitHead": "ceed6b4fb7e39c2e16fed0b01814dc6060a49fc8"
66
+ }
68
67
  }
@@ -11,6 +11,15 @@ const GAS_PER_NON_ZERO_BYTE = 16
11
11
 
12
12
  export const DEFAULT_CONTRACT_GAS_LIMIT = 1e6
13
13
 
14
+ const hardcodedGasLimits = new Map([
15
+ ['amp', 151_000],
16
+ ['tetherusd', 70_000],
17
+ ['usdcoin', 70_000],
18
+ ['snx', 220_000],
19
+ ['geminidollar', 75_000],
20
+ ['aave', 250_000],
21
+ ])
22
+
14
23
  // Starting with geth v1.9.14, if gasPrice is set for eth_estimateGas call, the call allowance will
15
24
  // be calculated with account's balance divided by gasPrice. If user's balance is too low,
16
25
  // the gasEstimation will fail. If gasPrice is set to '0x0', the account's balance is not
@@ -24,6 +33,11 @@ export async function estimateGasLimit(
24
33
  gasPrice = '0x',
25
34
  extraPercentage = EXTRA_PERCENTAGE
26
35
  ) {
36
+ // move this to remote config
37
+ if (hardcodedGasLimits.has(asset.name)) {
38
+ return hardcodedGasLimits.get(asset.name)
39
+ }
40
+
27
41
  const opts = {
28
42
  from: fromAddress,
29
43
  to: toAddress,