What I am trying to do is I am trying to send transactions with web3js. At first I used sign transaction then send signed transaction get the same error after a little bit of research and tryed them. Wouldn't find anything useful finally came here to ask what to do, what is the process of sending transactions and one of the things I get across because of I use public node I cant use the methods it doesnt support. I totaly get that but dont understand why. So first thing is where to find a node that supports the things I ll do or how can I achieve what I want to achieve down there.
const {Web3} = require("web3");
require("dotenv").config();
const contractBuild = require("./build/contracts/Logitech.json");
async function main() {
const web3 = new Web3(process.env.SEPOLIA_API_KEY);
web3.eth.wallet.add(process.env.SENDER_PRIVATE_KEY);
const contract = new web3.eth.Contract(
contractBuild.abi,
contractBuild.networks[11155111].address
);
const transaction = await contract.methods
.transfer(process.env.RECEIVER_PUBLIC_KEY, 123)
.send({from: process.env.SENDER_PUBLIC_KEY});
console.log(transaction.transactionHash);
}
main().catch((error) => console.log(error));