0

I don't understand the differents between these methods

web3.eth.signTransaction and web3.eth.accounts.signTransaction

And when I have to use. If I try to use web3.eth.signTransaction with ganache or infura I get this error

Method eth_signTransaction not supported / The method eth_signTransaction does not exist/is not available

0

the function parameters are what differentiates them for the first one(web3.eth.signTransaction), you have to pass the private key of the account you want to use, while for the other(web3.eth.accounts.signTransaction) you have to ensure the account is unlocked before you call it

  • Thanks, But when I have to use eth.sign insted accounts.sign ? And Why I get that error ? thanks – monkeyUser Dec 22 '18 at 12:25
  • unfortunately i don't have enough information to tell you why that happens you should maybe paste your code. – coderwithattitude Dec 22 '18 at 12:42
  • the same of documentation – monkeyUser Dec 22 '18 at 13:30
  • it should be "signTransaction" and not "eth_signTransaction" you should remove the underscore between eth and signTransaction – coderwithattitude Dec 22 '18 at 14:23

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.