Hello,
i just migrated from useDapp to moralis. im Using await Moralis.executeFunction(options). When doing this multiple times in a row, from time to time only sometimes for some reason, i get this inpage.js:1 MetaMask - RPC Error: Internal JSON-RPC error. 32005
Which seems to be related to a rate limit exceed.
I already did a lot of research. any ideas on this one? Thanks!
const fetchPendingRewards = () => {
if (walletAddress && isAuthenticated) {
const fetch = async () => {
const options = {
contractAddress: stakingAddress,
functionName: 'pendingReward',
abi: StakingContractProvider.abi,
params: {_user: walletAddress},
}
try {
// @ts-ignore
const response = await Moralis.executeFunction(options)
if (response && BigNumber.isBigNumber(response)) {
setPendingReward(Number(formatUnits(response, 18)))
}
} catch (e) {
console.log('pendingReward', e)
}
}
fetch()
} else {
setPendingReward(0)
}
}