Iām trying to fetch all of a userās NFTs. To test, I have a user that has some NFTs that were minted on my marketplace and some that were purchased off of opensea (both on rinkeby testnet).
The getNFTs function does return an array of tokenURIs for all the userās NFTs, however I get a CORS error when trying to fetch an NFTs metadata using the tokenURI (this seems to happen with NFTs from opensea).
For example, an NFT on minted on my marketplace has the tokenURI: https://ipfs.moralis.io:2053/ipfs/QmZQPMfos7iWV28HVEBNxHn8LLWph1hvAb7gHKCu3TKeQJ
This seems to work.
However some URIs from the openSea NFTs that donāt work are:
https://www.slackerduckpond.com/api/assets/20 and ipfs://QmNX4nsQQhQ8F3aB7EdSC8ja39du8RQ9YsX32S3bzM6y7g/0.json
An example of the error I get is:
Access to XMLHttpRequest at āhttps://www.slackerduckpond.com/api/assets/20ā from origin āhttp://localhost:3000ā has been blocked by CORS policy: No āAccess-Control-Allow-Originā header is present on the requested resource.
How do I get around this? Am I able to call getNfts() from inside a custom cloud function and use HttpRequest to get the metadata all on the server?