I have deployed a basic ERC721 token with some image metadata. I want to build a dashboard to view all the tokens and looking for an effective way of doing it.
One approach I have tried is:
Loop through all the tokens given the number of tokens deployed and make a request for each tokenURI as shown below:
var numTokens = 10
var datas = []
for (let i = 0; i < numTokens; i++) {
let data = await contract.methods.tokenURI(i);
datas.push(data);
}
Here, for 10 tokens
10 requests will be made and 100 requests for 100 tokens
which seems very ineffective. What would be an effective way to list all tokens in the dashboard?