[Ethereum] How to sign transaction from frontend with metamask and then send that signed data to rest api for submitting the transaction

blockchainethereum-wallet-dappmetamaskweb3jweb3js

I have a front end connected with metamask wallet and a rest API layer.

My requirement is to sign the transaction from metamask and then to send the signed transaction to rest api to submit the transacion.

Best Answer

I think if metamask sign a transaction they broadcast it to the network. You can retrieve data from the transaction with a callback if you want.

If you want to sign a transaction offline, don't use Metamask but a local file with web3js and your private key hardcoded.

Related Topic