I am using geth
via third party application. I want to verify that specific Ethereum accounts are already unlocked or not, since unlocking an account can be timeout.
personal.unlockAccount(eth.accounts[0], "password");
[Q] Is there any way to verify that specific Ethereum accounts are already unlocked?
Please note that following script:
var Personal = require('web3-eth-personal');
Web3 = require("web3");
web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545"));
if(!web3.isConnected()){
console.log("notconnected");
process.exit();
}
console.log(web3.personal
Returns, which does not have personal.listWallets
:
Personal {
_requestManager:
RequestManager {
provider:
HttpProvider {
host: 'http://localhost:8545',
timeout: 0,
user: undefined,
password: undefined,
headers: undefined },
polls: {},
timeout: null },
newAccount: { [Function: send] request: [Function: bound ], call: 'personal_newAccount' },
importRawKey: { [Function: send] request: [Function: bound ], call: 'personal_importRawKey' },
unlockAccount: { [Function: send] request: [Function: bound ], call: 'personal_unlockAccount' },
ecRecover: { [Function: send] request: [Function: bound ], call: 'personal_ecRecover' },
sign: { [Function: send] request: [Function: bound ], call: 'personal_sign' },
sendTransaction:
{ [Function: send]
request: [Function: bound ],
call: 'personal_sendTransaction' },
lockAccount: { [Function: send] request: [Function: bound ], call: 'personal_lockAccount' },
listAccounts: [Getter],
getListAccounts: { [Function: get] request: [Function: bound ] } }
personal.unlockAccount(eth.accounts[0], "password");
@LauriPeltonen