@exodus/ethereum-api 3.5.0 → 4.0.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/package.json +3 -5
- package/src/gas-estimation.js +1 -1
- package/src/index.js +0 -1
- package/src/key-identifier.js +0 -35
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,12 +15,10 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@exodus/asset-lib": "^3.7.1",
|
|
18
|
-
"@exodus/bip32": "^1.0.0",
|
|
19
18
|
"@exodus/crypto": "^1.0.0-rc.0",
|
|
20
|
-
"@exodus/ethereum-lib": "^2.
|
|
19
|
+
"@exodus/ethereum-lib": "^2.26.0",
|
|
21
20
|
"@exodus/ethereumjs-util": "^7.1.0-exodus.6",
|
|
22
21
|
"@exodus/fetch": "^1.2.1",
|
|
23
|
-
"@exodus/key-utils": "^1.0.0",
|
|
24
22
|
"@exodus/simple-retry": "^0.0.6",
|
|
25
23
|
"@exodus/solidity-contract": "^1.1.3",
|
|
26
24
|
"bn.js": "^5.2.1",
|
|
@@ -38,5 +36,5 @@
|
|
|
38
36
|
"devDependencies": {
|
|
39
37
|
"@exodus/models": "^8.10.4"
|
|
40
38
|
},
|
|
41
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "729674ae988309eccf03feefbf891d8b43947577"
|
|
42
40
|
}
|
package/src/gas-estimation.js
CHANGED
|
@@ -64,7 +64,7 @@ export async function fetchGasLimit({
|
|
|
64
64
|
txInput = ethUtil.bufferToHex(asset.contract.transfer.build(toAddress, amount.toBaseString()))
|
|
65
65
|
amount = asset.baseAsset.currency.ZERO
|
|
66
66
|
toAddress = asset.contract.address
|
|
67
|
-
} else if (!isContract) {
|
|
67
|
+
} else if (!isContract && !['ethereumarbone', 'ethereumarbnova'].includes(asset.name)) {
|
|
68
68
|
if (isContract === undefined)
|
|
69
69
|
isContract = await isContractAddress({ asset, address: toAddress })
|
|
70
70
|
if (!isContract) return defaultGasLimit()
|
package/src/index.js
CHANGED
package/src/key-identifier.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import assert from 'minimalistic-assert'
|
|
2
|
-
import { assertKeyIdentifierParameters, unhardenDerivationIndex } from '@exodus/key-utils'
|
|
3
|
-
|
|
4
|
-
function createGetKeyIdentifier({ bip44, allowMetaMaskCompat = false }) {
|
|
5
|
-
return (partialParams) => {
|
|
6
|
-
const params = {
|
|
7
|
-
purpose: 44,
|
|
8
|
-
chainIndex: 0,
|
|
9
|
-
accountIndex: 0,
|
|
10
|
-
addressIndex: 0,
|
|
11
|
-
...partialParams,
|
|
12
|
-
}
|
|
13
|
-
assertKeyIdentifierParameters(params)
|
|
14
|
-
|
|
15
|
-
const { accountIndex, compatibilityMode, addressIndex } = params
|
|
16
|
-
const unhardenedBip44 = unhardenDerivationIndex(bip44)
|
|
17
|
-
const isMetaMask = allowMetaMaskCompat && compatibilityMode === 'metamask'
|
|
18
|
-
|
|
19
|
-
if (isMetaMask) {
|
|
20
|
-
assert(addressIndex === 0, 'MetaMask compatibility does not support setting an addressIndex')
|
|
21
|
-
}
|
|
22
|
-
// MetaMasks bumps addressIndex instead of accountIndex
|
|
23
|
-
const pathMetaMask = `m/44'/${unhardenedBip44}'/0'/0/${accountIndex}`
|
|
24
|
-
const pathExodus = `m/44'/${unhardenedBip44}'/${accountIndex}'/0/${addressIndex}`
|
|
25
|
-
const derivationPath = isMetaMask ? pathMetaMask : pathExodus
|
|
26
|
-
|
|
27
|
-
return {
|
|
28
|
-
derivationAlgorithm: 'BIP32',
|
|
29
|
-
derivationPath,
|
|
30
|
-
keyType: 'secp256k1',
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export default createGetKeyIdentifier
|