I want to send a request for signing a message on MetaMask. the method i assumed should do it is the signer.SignMessage(msg) however this is returning the signature without asking for approval on MetaMask.
const contract = require( "../artifacts/contracts/token.sol/token.json" );
const keys = require( "../keys.json" );
const alchemyProvider = new ethers.providers.AlchemyProvider( network = "ropsten", keys.ALCHEMY_API_KEY );
const signer = new ethers.Wallet( keys.ROPSTEN_PRIVATE_KEY, alchemyProvider );
const token = new ethers.Contract( keys.TOKEN_ADDRESS, contract.abi, signer );
async function main ()
{
msg = "Hallo Welt";
let signature = await signer.signMessage( msg );
console.log( signature );
}
main();
the console is returning the signature hash already. Should I use a different Method?