[SOLVED] Wrong results on "total" for getNFTTransfers

The code below is s short version for collecting the NFT “to” transfers for Ether as well as Polygon mainnet for the same wallet address.
But the “total” shows the same value for Ether and Polygon (both 1662) which is not the case, as Polygon has total of 1662 (as of today) and Ether a total of 22 (as also shown in “results” as of today):

Here the code:

<!DOCTYPE html>
    <title>Vanilla Boilerplate</title>
    <script src="https://unpkg.com/moralis/dist/moralis.js"></script>

    <h1>Moralis Hello World!</h1>
    <button id="btn-startFunc">Start</button>

  <script type="text/javascript">

    /** Connect to Moralis server */
    const serverUrl = "add_here";
    const appId = "add_here";
    Moralis.start({ serverUrl, appId });

    async function startFunc() {

        const optionsPolygon2 = { chain: "polygon", direction: "to", address: "0xa400f50d2c9cba8c7c125be8b37ff04edff5a018" };
        let transfersNFTPolygon = await Moralis.Web3API.account.getNFTTransfers(optionsPolygon2);

        const optionsEthereum2 = { chain: "eth", direction: "to", address: "0xa400f50d2c9cba8c7c125be8b37ff04edff5a018", limit: 100 };
        let transfersNFTEthereum = await Moralis.Web3API.account.getNFTTransfers(optionsEthereum2);


    document.getElementById("btn-startFunc").onclick = startFunc;


Thanks for reporting, we will investigate

can you try again now to see if it works as expected?

Awesome. Works as expected now.
Thanks so much ! Saved my day :slight_smile:

What was the issue ?!

it looks like it was something related to caching

Thanks again for fixing so quickly !

1 Like