@exodus/ethereum-api 0.2.8 → 0.2.10
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 +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.10",
|
|
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": "^0.2.
|
|
13
|
+
"@exodus/ethereum-lib": "^0.2.10",
|
|
14
14
|
"fetchival": "0.3.3",
|
|
15
15
|
"lodash": "^4.17.11",
|
|
16
16
|
"make-concurrent": "4.0.0",
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"url-join": "4.0.0",
|
|
20
20
|
"ws": "6.1.0"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "13e2cc907ccda7585b96ae34d8745874406185bc"
|
|
23
23
|
}
|
package/src/gas-estimation.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import BN from 'bn.js'
|
|
2
2
|
import * as ethUtil from 'ethereumjs-util'
|
|
3
3
|
import { currency2buffer, isEthereumToken, getBaseAsset } from '@exodus/ethereum-lib'
|
|
4
|
-
import { estimateGas } from './with-fallback'
|
|
4
|
+
import { estimateGas, isContract as _isContract } from './with-fallback'
|
|
5
5
|
|
|
6
6
|
const EXTRA_PERCENTAGE = 20
|
|
7
7
|
|
|
8
|
-
async function estimateGasLimit(
|
|
8
|
+
export async function estimateGasLimit(
|
|
9
9
|
asset: Object,
|
|
10
10
|
fromAddress: string,
|
|
11
11
|
toAddress: string,
|
|
@@ -57,7 +57,7 @@ export async function fetchGasLimit({
|
|
|
57
57
|
amount = getBaseAsset(asset).currency.ZERO
|
|
58
58
|
toAddress = asset.contract.addresses.current
|
|
59
59
|
} else if (!isContract) {
|
|
60
|
-
if (isContract === undefined) isContract = await asset.
|
|
60
|
+
if (isContract === undefined) isContract = await _isContract(asset.name, toAddress)
|
|
61
61
|
if (!isContract) return asset.gasLimit
|
|
62
62
|
}
|
|
63
63
|
|