I am currently using Moralis.Web3API.account.getNFTs() to retrieve the Result data of all NFTs owned by a certain address, but I can get up to 100 pieces of data. After that, I need to use Cursor to get the latter data, but when I use Moralis.Web3API When .account.getNFTs(), there is no Cursor data in Json, how can I get the Cursor data
if you are using the sdk then it is .next() method that you can use to get the next page
In Unity, I canโt use the method Next() to get the next page
You will need to use cursor
manually then (passing in the cursor
string with the same request to get the next page).
What is the exact code (including parameters) youโre using for getNFTs()
with the Unity SDK?
In that case you can call the API differently. You could try something like:
using System.Collections.Generic; // for Dictionary
IDictionary<string, object> nftParams = new Dictionary<string, object>();
nftParams.Add("address", "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045");
nftParams.Add("chain", "0x1");
Dictionary<string, object> nfts = await Moralis.Cloud.RunAsync<Dictionary<string, object>>("getNFTs", nftParams);
Debug.Log("page 1" + nfts["result"]);
nftParams.Add("cursor", nfts["cursor"]);
nfts = await Moralis.Cloud.RunAsync<Dictionary<string, object>>("getNFTs", nftParams);
Debug.Log("page 2" + nfts["result"]);
2 Likes
Thanks, I can get the information I want