Hi there. I got 429 errors each time while I send id of some user from opensea ( and got all nfts of the user ) but when i had try to render the imgs of the nfts i got “undefined” of MOST part of nfts ( just 1 or 2 render correctly ) maybe someone know how to fix it.Thanks a lot ) Preformatted text
getNFT = async () => {
let address = document.getElementById("nftaddress").value;
const options = { chain: 'chain', address: address };
const polygonOFNFT = await Moralis.Web3.getNFTs(options);
console.log(polygonOFNFT, ' - NFTs here - ')
// rendering nfts
await polygonOFNFT.forEach(e => {
let url = e.token_uri;
fetch(url)
.then(response => response.json())
.then(data => {
let currentDiv = document.getElementById("content");
let content = `
<div class="nft">
<p> ${data.name}</p>
<p> ${data.description}</p>
<img width=200px height=200px src="${data.name}"/>
</div>
`
currentDiv.innerHTML += content;
})
})
}
it looks like it doesn’t let you to access that link from open sea, you could try to access it from a cloud function:
something like this:
Moralis.Cloud.define("requestTest", async (request) => {
const logger = Moralis.Cloud.getLogger();
return Moralis.Cloud.httpRequest({
type:"GET",
url: 'https://adfadf/'
}).then(function(httpResponse) {
logger.info('Reply...' + JSON.stringify(httpResponse));
return httpResponse;
}, function(httpResponse) {
logger.error('Error...' + JSON.stringify(httpResponse));
return httpResponse;
});
})