@exodus/ethereum-api 2.4.2 → 2.4.4
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 +3 -3
- package/src/gas-estimation.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.4",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"author": "Exodus Movement, Inc.",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"access": "restricted"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@exodus/ethereum-lib": "^2.7.
|
|
13
|
+
"@exodus/ethereum-lib": "^2.7.3",
|
|
14
14
|
"@exodus/simple-retry": "^0.0.6",
|
|
15
15
|
"fetchival": "0.3.3",
|
|
16
16
|
"lodash": "^4.17.11",
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
"url-join": "4.0.0",
|
|
21
21
|
"ws": "6.1.0"
|
|
22
22
|
},
|
|
23
|
-
"gitHead": "
|
|
23
|
+
"gitHead": "c9ae40c620c5f8378550977516ffd4f4d03663a8"
|
|
24
24
|
}
|
package/src/gas-estimation.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import BN from 'bn.js'
|
|
2
2
|
import * as ethUtil from 'ethereumjs-util'
|
|
3
|
-
import { currency2buffer,
|
|
3
|
+
import { currency2buffer, isToken } from '@exodus/ethereum-lib'
|
|
4
4
|
import { estimateGas, isContractAddress } from './eth-like-util'
|
|
5
5
|
|
|
6
6
|
const EXTRA_PERCENTAGE = 20
|
|
@@ -48,8 +48,8 @@ export async function fetchGasLimit({
|
|
|
48
48
|
if (!amount) amount = asset.currency.ZERO
|
|
49
49
|
if (!feeData.gasPrice) feeData.gasPrice = asset.baseAsset.currency.ZERO
|
|
50
50
|
|
|
51
|
-
const
|
|
52
|
-
if (
|
|
51
|
+
const _isToken = isToken(asset)
|
|
52
|
+
if (_isToken) {
|
|
53
53
|
txInput = ethUtil.bufferToHex(
|
|
54
54
|
asset.contract.transfer.build(toAddress, amount.toBase().toNumberString())
|
|
55
55
|
)
|
|
@@ -91,7 +91,7 @@ export async function fetchGasLimit({
|
|
|
91
91
|
console.log('fetchGasLimit error', err)
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
-
return
|
|
94
|
+
return _isToken ? asset.gasLimit : asset.contractGasLimit
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
function normalizeAmount(amount) {
|