I tried to send some data to a smart contract hosted on infura, but I'm getting back this error Returned error: The method eth_sendTransaction does not exist/is not available.
below is the code I wrote for the transaction.
code to get the instances
const getFundraiserDetails = async (address) => {
try {
const instance = new web3.eth.Contract(
FundraiserContract.abi,
address
);
setFactoryContract(instance)
}catch(error){
console.log(error)
}
code to submit the fund
const submitFunds = async () => {
try {
await factoryContract?.methods.donate().send({
from: account,
value: donation,
gas: 650000
})
}catch(error) {
console.log("submit Donation error", error);
}
}
I get back Returned error: The method eth_sendTransaction does not exist/is not available. below is the code I wrote for the transaction. whenever I call the submitFunds() function. Note I'm using Metamask wallet get the account, but it does not pop up to confirm the transaction when I call the submitFunds() function.