Web3Api.account.getNFTsForContract has been returning null metadata for the past 4/5 days. In the meantime, I’m trying to extract the metadata json object from the IPFS token_uri.
Chain: 0x4, Server subdomain: z62iwqedukzn
This is the cloud function I’m using:
Moralis.Cloud.define("get_token_uri", async (url) => {
return await Moralis.Cloud.httpRequest({
url: url,
headers: {
method: "GET",
accept: "application/json",
},
})
.then((httpResponse) => httpResponse.data)
.catch((error) => logger.info(error));
});
let tokenList;
function getData() {
tokenList = data.result.map(async (token) => {
let metadata = await Moralis.Cloud.run(
"get_token_uri",
token.token_uri
);
return { id: token.token_id, metadata };
});
}
But here, metadata is returning undefined. How can I actually get the metadata from the token_uri?