0

I am using following code to unlock an account.

 web3.eth.personal.unlockAccount(address, password);

But I get an error message:

Error: Invalid Arguments length: expected: 3, given: 2

  • 1
    The error message seems pretty clear. Here's the documentation, which seems to agree: web3js.readthedocs.io/en/1.0/…. – user19510 Mar 10 '19 at 19:57
  • Yeah but unlock duration used to be defaulted to 300. Why such a breaking change? – Prashant Prabhakar Singh Mar 10 '19 at 20:01
  • 2
    If you want to know why a change was made in a certain library, I would think you would need to ask the developers who work on that library. – user19510 Mar 10 '19 at 20:04
  • Yeah, probably I no question was needed here. I was just little surprised by that. Thanks BTW :) – Prashant Prabhakar Singh Mar 10 '19 at 20:10
0

try to add the duration

web3.eth.personal.unlockAccount(accts[2],password,0)

if you put 0 it will be unlocked untill the node is restarted

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.