Hello,
I hope you are well. I am having some issues with RateLimits/Throttle.
"error: "Too many requests to Web3 API from this particular client, the clients needs to wait before sending more requests. This can be adjusted using Moralis.settings.setAPIRateLimit. Read More: https://docs.moralis.io/moralis-server/web3-sdk/rate-limit."
I have upgraded to a Pro plan, but my server is still responding with this error.
I am calling …
const nfts = await Web3Api.account.getNFTs({
address: account as string,
chain: chainId,
});
This is returning about 500 results for the currently selected account.
Following advice from Rate limit per second? and other forum posts i am getting the metadata in batches for each time. I’ve set batch size to 50, but am filtering on token_type ERC721 so the first batch is only 38 items long when making the getTokenIdMetadata request.
I have upgraded my plan from free to Pro, but am still using the server i created during my free period.
for (let i = 0; i < nfts.result.length; i += batchSize) {
for (let j = 0; j < batchSize; j += 1) {
const nft = nfts.result[i + j];
if (nft.contract_type === "ERC721") {
const options = {
address: nft.token_address,
token_id: nft.token_id,
chain: chainId,
};
promises.push(Web3Api.token.getTokenIdMetadata(options));
}
}
const metaDataRes = await Promise.all(promises);
res.push(...metaDataRes);
}
I have also read…https://docs.moralis.io/moralis-server/web3-sdk/rate-limit which only tells you how to SET rate limits, but not understand the current rate limit set.
Can you provide some advice on this please?
Regards,
Daniel