Devs are working on the fix right now. It should be working very soon.
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
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();
Yes its working But I dont understand why string but okey
Yes, it is working! Please donβt turn off the string acceptance
We plan to also make it work without being a string.
const options = {
address: currentAccount,
chain: Moralis.Chains.POLYGON_MAINNET,
"disableTotal": 'false'
};
const NFTS = await Web3Api.account.getNFTs(options);
setNfts(NFTS.total);
Where is the problem here?
what happens? it should work if you have latest version of the SDK
console.log(β'NFTS", NFTS) and you will see there is no total. To get total it should be something like -> NFTS.jsonResponse.total, see the log
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.