I am using the latest version of Moralis and I want to execute in a smart contract function with the runContract function but it keeps throwing this error which i don’t understand. Here is the error
{"message":"Function `createMarketItem` is not read only"}
here is the code
export const listMomentForSale = async (params: paramsType) => {
const response = await Moralis.EvmApi.utils.runContractFunction({
abi: LIST_ITEM_TO_MARKETPLACE_ABI,
chain: process.env.NEXT_PUBLIC_CHAINID,
address: process.env.NEXT_PUBLIC_CONTRACT_ADDRESS,
functionName: "createMarketItem",
params: { ...params },
});
return response.result;
};
example params which i am passing to the function
const params = {
nftContract: address,
price: 1,
tokenId:88888,
};