This is my code
const getPage = async (cursor: string | undefined = undefined) =>
await Moralis.EvmApi.nft.getNFTOwners({
address, chain,
format: `decimal`,
limit: 100, cursor
});
const getCollectionSnapshot = async () => {
const firstPage = await getPage();
const totalPages = Math.ceil(firstPage.raw.total / firstPage.raw.page_size);
const pages = [firstPage];
let cursor = firstPage.raw.cursor;
for (let i = 2; i <= totalPages; i++) {
const page = await getPage(cursor);
pages.push(page);
cursor = page.raw.cursor;
await new Promise(resolve => setTimeout(resolve, 200));
}
}
I have the free plan, 25 CU * second is the rate, and the nft owner API should weigh 5CU, I don’t understand why I’m getting the following error after some calls (like 10/15, the number changes)
MoralisError [Moralis SDK Core Error]: [C0006] Request failed: timeout of 10000ms exceeded