I would like to sign a transaction using the metamask provider so that the transaction can be sent later as a raw transaction. Is there any way to implement this in code? I believe that a metamask pop up would appear for the user to confirm signing the transactionenter image description here

1 Answer 1


You can construct the transaction object and pass in the data to Metamask for signature via eth_sign. You can refer docs for more info.

  • Would provider.signTransaction work with ethers? Also web3?. I have some difficulty differentiating with eth_sign and the provider.signTransaction these would do the same thing?
    – qubitz
    Commented Mar 5, 2022 at 18:12

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.