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

1 Answer 1


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
    Commented Dec 22, 2018 at 12:25
  • unfortunately i don't have enough information to tell you why that happens you should maybe paste your code. Commented Dec 22, 2018 at 12:42
  • the same of documentation
    – monkeyUser
    Commented Dec 22, 2018 at 13:30
  • it should be "signTransaction" and not "eth_signTransaction" you should remove the underscore between eth and signTransaction Commented Dec 22, 2018 at 14:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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