Hi,
I didn’t find any solutions regarding my question neither in the docs.
I am using Ethers.js, and I am trying to deploy a contract from the frontend to the backend.
For security reasons, the deployment will be internal on the server triggered by a button from the frontend.
For the deployment I am getting the userAddress translated to a signer using the provider.
this is the response I am receiving : Error: processing response error (body="{\"jsonrpc\":\"2.0\",\"id\":47,\"error\":{\"code\":-32601,\"message\":\"The method eth_sendTransaction does not exist/is not available\"}}", error={"code":-32601}, requestBody="{\"method\":\"eth_sendTransaction\",\"params\"
and the code
// Deploy the contract
const myContract = await contractFactory.deploy(...req.args);
// Prompt the user to connect their wallet and approve the transaction
const transaction = myContract.deployTransaction;
const transactionData = {
from: transaction.from,
to: transaction.to,
value: transaction.value.toHexString(),
data: transaction.data,
gasLimit: ethers.utils.hexlify(5000000),
maxPriorityFeePerGas: ethers.utils.parseUnits("5", "gwei"),
maxFeePerGas: ethers.utils.parseUnits("20", "gwei"),
nonce: await provider.getTransactionCount(transaction.from, "latest"),
type: 2,
chainId: chainId,
};
// // Sign the transaction using a signer
const signedTransaction = await signer
.signTransaction(transactionData)
.then(ethers.utils.serializeTransaction(transaction));
I would like some help to make it work using ethers.js
Thanks