diff --git a/package-lock.json b/package-lock.json index b9f61dd7f..6886398fb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -71,6 +71,7 @@ "vuex": "^4.1.0", "vuex-persist": "^3.1.3", "web3-eth": "^4.2.0", + "web3-eth-accounts": "^4.0.6", "web3-utils": "^4.0.6" }, "devDependencies": { diff --git a/package.json b/package.json index 047d0bba9..9de99f922 100644 --- a/package.json +++ b/package.json @@ -84,6 +84,7 @@ "vuex": "^4.1.0", "vuex-persist": "^3.1.3", "web3-eth": "^4.2.0", + "web3-eth-accounts": "^4.0.6", "web3-utils": "^4.0.6" }, "devDependencies": { diff --git a/src/lib/eth-utils.js b/src/lib/eth-utils.js index f5f9c9696..4ae80a7cb 100644 --- a/src/lib/eth-utils.js +++ b/src/lib/eth-utils.js @@ -1,5 +1,6 @@ import hdkey from 'hdkey' import * as web3Utils from 'web3-utils' +import { privateKeyToAccount } from 'web3-eth-accounts' import BigNumber from 'bignumber.js' import cache from '@/store/cache.js' @@ -33,7 +34,7 @@ export function getAccountFromPassphrase(passphrase, api) { hdkey.fromMasterSeed(seed).derive(HD_KEY_PATH)._privateKey ) // web3Account is for user wallet; We don't need it, when exporting a private key - const web3Account = api ? api.accounts.privateKeyToAccount(privateKey) : undefined + const web3Account = api ? privateKeyToAccount(privateKey) : undefined return { web3Account,