I am kind of new to web3js. I am not sure which functions should I use and which is the correct flow to achieve this. I don't have the user's private keys and I need to send a transaction (filling the data field with a certificate's hash) from their account. So, Metamask (or similar addons) are necessary. I can't use eth.sendTransaction cause I dont have the private key. I should use 'eth.sendSignedTransaction' but, how do I get the private key from Metamask to sign it? can I delegate the signing to Metamask?
Edit
When I use the eth.sendTransaction method on Infura, I get the error:
The method eth_sendTransaction does not exist/is not available
eth.sendTransactionwith Metamask a popup will appear and ask the user if they want to confirm the transaction. The private key is not needed. – Ismael Mar 23 '21 at 01:39sendTransactionreturns errormethod eth_sendTransaction does not exist/is not available– Alejandro Veintimilla Mar 23 '21 at 18:09