I tried to use runContractFunction as you mentioned and docs.
import { useMoralisWeb3Api, useMoralisWeb3ApiCall } from âreact-moralisâ;
const NewItems = () => {
âŚ
const { native } = useMoralisWeb3Api();
const ops = {
chain: process.env.REACT_APP_CHAIN_ID,
address: marketAddress,
function_name: âgetSaleInfoâ,
abi: contractABI,
params: {
startIdx: 0,
count: 100000
},
};
const { fetch: fetchSalesData, data: salesData, error: salesError, isLoading: isSalesLoading } =
useMoralisWeb3ApiCall(
native.runContractFunction,
{ âŚops }
);
useEffect(async () => {
fetchSalesData({ params: ops });
}, []);
but, even though I put startIdx in params, it returns error code 141 - âstartIdx is requiredâ.
Whatâs up?
I need your help.