I am trying to interact with my smart contract for my nextjs app. I cannot interact with the contract because my alchemy provider is not working.
Attempt 1:
const provider = new ethers.providers.AlchemyProvider(
"sepolia",
process.env.ALCHEMY_API_KEY
);
Error: unsupported network (argument="network", value={"name":"sepolia","chainId":11155111}, code=INVALID_ARGUMENT, version=providers/5.7.2) Attempt 2:
const alchemyProvider = new ethers.providers.JsonRpcProvider(process.env.ALCHEMY_URL);
export const contract = new ethers.Contract(
contractAddress,
contractABI,
provider
);
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)
Attempt 1 immediately breaks. Attempt 2 breaks when I try to run a function from the contract. I can console.log() the contract and it is correct. No matter what I put as the parameter it will still initialize the contract.
It is not happening with sepolia mate, try goerli. worked for me