[solved] How long doest it take to take effect for disable_total flag

Hey

I added changes to my options:

const options = {
    chainId,
    address,
    disable_total: false,
  };

let NFTs = await Moralis.EvmApi.nft.getContractNFTs(options);

my params:

{
    "chain": "0x1",
    "address": "0x17712C2692e4eF77Db387Ad0cdA81Bcb78148dbb",
    "disable_total": false
}

However, I’m getting a total as NULL. Should I wait for a specific period of time to get it working? Can you assist me with this issue?

It should work instantly. If you test in docs interface then it works?

There seems to be an issue with this. It does not seem to be working as expected when it is set to false

1 Like

I did upgrade to the following

    "@moralisweb3/common-evm-utils": "^2.12.0",
    "moralis": "^2.12.0",

then, l changed disable_total to the disableTotal, because:

Moralis SDK Error: [C0005] Request contains unknown parameter: disable_total. This operation supports the following parameters: address, chain, format, limit, totalRanges, range, cursor, normalizeMetadata, disableTotal

and still, I get NULL for the total. What else can be done to make it work?

Devs are working on the fix right now. It should be working very soon.

2 Likes

can you check again now? it should be fixed now

Dear,

I using the following code but its not working the disableTotal parameter. Same response :frowning:

        const response = await Moralis.EvmApi.nft.getNFTOwners({ 
            address: contractAddress, 
            chain: chain, 
            limit: 100, 
            cursor: cursor, 
            disableTotal: false,
        });

can you try with disable_total instead of disableTotal?

Hey,

I runned the npm upgraded:

npm upgrade

up to date, audited 409 packages in 13s

61 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

then I tried using the disable_total parameter but I runned the error:

server/node_modules/@moralisweb3/common-core/lib/operations/OperationRequestValidator.js:24
                throw new Error_1.MoralisError({
                      ^

MoralisError [Moralis SDK Error]: [C0005] Request contains unknown parameter: disable_total. This operation supports the following parameters: address, chain, format, limit, cursor, normalizeMetadata, disableTotal
    at OperationRequestValidator.validate (server/node_modules/@moralisweb3/common-core/lib/operations/OperationRequestValidator.js:24:23)
    at PaginatedOperationResolver.<anonymous> (server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:57:47)
    at step (server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:33:23)
    at Object.next (server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:14:53)
    at server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:4:12)
    at PaginatedOperationResolver.fetch (server/node_modules/@moralisweb3/api-utils/lib/resolvers2/PaginatedOperationResolver.js:51:50)
    at Object.getNFTOwners (server/node_modules/@moralisweb3/evm-api/lib/generated/ClientEvmApi.js:74:136)
    at validator (server/server.js:313:51) {
  isMoralisError: true,
  code: 'C0005',
  details: undefined,
  [cause]: undefined
}

Nope. I’m getting NULL

I’m getting error from sdk that disable_total is unknown parameter

does it work in docs interface when you test?

it looks like you used it here like that

we have to check, it seems to be an SDK issue now

Either way not working, disable_total is not accepted by SDK, and use of the disableTotal results in total being NULL

Testing page https://docs.moralis.io/web3-data-api/reference/get-contract-nfts
gives proper total result

I believe it is SDK issue

yes, it is an SDK issue, this works:


Moralis = require("moralis").default

const runApp = async () => {

  await Moralis.start({
    apiKey: "API_KEY_HERE",
  });
   const response = await Moralis.EvmApi.nft.getContractNFTs({

    "chain": "0x1",
    "limit": "1",
    "address": "0x17712C2692e4eF77Db387Ad0cdA81Bcb78148dbb",
    "disableTotal": 'false'
    });

  console.log(response.toJSON());
}

runApp();

@Locutus, you can see the solution from above

Yes its working :smiley: But I dont understand why string but okey :smiley:

1 Like

Yes, it is working! Please don’t turn off the string acceptance

We plan to also make it work without being a string.