Creating NFT Inventory
After requesting the project inventory from Xerial services, the JSON response needs to be processed to create an instance of the UserData class.
Usage
using System.Collections.Generic;
using UnityEngine;
using SimpleJSON;
using Xerial;
public class NFTResponseHandler
{
public void HandleNFTResponse(string response)
{
XerialServices.instance.inventoryManager.inventory = null;
JSONArray jsonArray = JSON.Parse(response).AsArray;
if (jsonArray != null && jsonArray.Count > 0)
{
JSONNode rootNode = jsonArray[0];
//Deserialize the object array
}
}Deserializing NFTs from Project Inventory Data
NFT
Collection
Metadata
Contract
Attributes
Token
Store the NFT inventory
Last updated