This does not explain how to then make calls. Calls like this do not work:
try {
const transactionHash = await ethereum.request({
method: 'eth_sendTransaction',
params: [
{
to: '0x...',
'from': '0x...',
value: '0x...',
// And so on...
},
],
});
// Handle the result
console.log(transactionHash);
} catch (error) {
console.error(error);
}
As referenced by the metamask docs.
https://docs.metamask.io/guide/provider-migration.html#replacing-window-web3