I have a simple Dapp and I want to sign a transaction but I don't have the private key as a string.
The user is using a MetaMask wallet. After they grant web3 access to their account, how can I access the private key to sign a transaction?
const signPromise = web3.eth.accounts.signTransaction(tx, PRIVATE_KEY);
// PRIVATE_KEY is what I'm trying to get.