Error:
This is the expression part of an expression statement
cosnt sendTransaction = async (
I am using ReactJS and following a tutorial, but my code looks the same and can not figure out how to solve this error.
This is my TransactionContext.js
cosnt sendTransaction = async (
metamask = eth,
connectedAccount = currentAccount
) => {
try {
if (!metamask) return alert ('Please install metamsk')
const { addressTo, amount } = formData
const transactionContract = getEthereumContract()
const parsedAmount = ethers.utils.parseEther(amount)
await metamask.request({
method: 'eth_sendTransaction',
params: [
{
from: connectedAccount,
to: addressTo,
gas: '0x7EF40', // 520000 Gwei
value: parsedAmount._hex,
},
],
})