Iāve noticed some variance when fetching NFTs (eg, Moralis.Web3API.account.getNFTs(options)) - are the results from a previous getNFT call cached, or is it considered fresh each time?
Thanks
Iāve noticed some variance when fetching NFTs (eg, Moralis.Web3API.account.getNFTs(options)) - are the results from a previous getNFT call cached, or is it considered fresh each time?
Thanks
What is the difference that you observed? Metadata for nfts is cached.
Is there a way I can clear the cache, to see how it would perform on the first load?
What is the difference that you observed? Caching shouldnāt be something that creates you problems.
Well I was grabbing the NFTs and then performing some operations on them, and logging the performance before and after, and noticed that in some cases it would take longer than usual. Now Iām logging how long Moralis takes to fetch and comparing my operations on them to see where the issue lies, but I canāt seem to replicate the issue, hence why Iād like to clear the cache to test
Also, for an address Iām testing, Moralis is only returning 49 of the 57 available NFTs (theyāre all available on OpenSea). Could this be a caching issue?
Opensea can have lazy minted nfts, or there are contracts that we donāt track yet. We start to track a new nft contract when getTokenIdMetadata is called first time for that contract.
For caching, sometimes it takes longer, sometimes it is faster, usually if you do same request at small time interval the second time may be from caching and it may be faster.
The NFTs not being included are of the same contract as other NFTs that are included, during the fetch
In this specific case, itās the OPENSTORE contract (0x88B48F654c30e99bc2e4A1559b4Dcf1aD93FA656), I believe this is executed when a token is minted on Rinkeby through the OpenSea minting interface
Only 1 is being included though, the other 8 seem to be missing
that 0x88B48F654c30e99bc2e4A1559b4Dcf1aD93FA656
looks like a marketplace contract for opensea
When you mint a token on the OpenSea testnet, thatās the contract OpenSea uses (it seems to use a a ERC1155 contract for the mainnet too). ERC1155 is compatible with NFTs, and so Moralis should be able to pull, right? getNFTs even returns one of them (but not the rest), any idea why?
If Moralis canāt pull, then are NFTs minted on OpenSea directly just unreachable using Moralis?
can you give an example of an NFT that is on blockchain for that contract and is not found on Moralis?
Metadata Editable
that means that there was not transaction on chain and that NFT is only a lazy minted nft.
Can you point me to the transaction on chain that minted that NFT?
Oh okay, I see. I didnāt realize itās offchain upon initial mint. If I freeze the metadata, will that trigger an on-chain transaction?
I donāt know, usually on a transfer or sell it will do that mint on chain
I think you may be right. The one token that did show up says the metadata is āCentralizedā rather than āFrozenā. I couldnāt find any documentation on what that meant though. Iām guessing itās triggered by a sell/transfer of an unfrozen token?
Anyway, thanks for the help
It seems that Moralis API is useless if your tokenUri is updated laterā¦ it will NOT ever reflect in your Moralis calls.
You can update it manually with reSyncMetadata.
Outside of the scenarios outlined here, it wonāt update automatically because it would be far too intensive and wasteful to re-check all NFTs again if their token_uri is potentially updated or not.