allartprotocol / unity-solana-wallet

The First Open-Source Unity-Solana Wallet with NFT support
285 stars 133 forks source link

JSON Exeption on GetOwnedTokenAccounts() #30

Closed clibc closed 2 years ago

clibc commented 2 years ago
public class Test : MonoBehaviour {
    [SerializeField] WalletBaseComponent Wallet_Base;

    void Start() {
        GetData();
    }

    async void GetData() {
        string pubkey = "9UeHg5HvpK1GeRbTWLK1uuW2Wjk6x3reeqWMBQWAh7Pq";
        TokenAccount[] owned_tokens = await Wallet_Base.GetOwnedTokenAccounts( pubkey, "", TokenProgram.ProgramId );
        Debug.Log( owned_tokens.Length );
    }
}
JsonSerializationException: Cannot deserialize the current JSON object (e.g. {"name":"value"}) into type 'System.UInt64' because the type requires a JSON primitive value (e.g. string, number, boolean, null) to deserialize correctly.
To fix this error either change the JSON to a JSON primitive value (e.g. string, number, boolean, null) or change the deserialized type so that it is a normal .NET type (e.g. not a primitive type like integer, not a collection type like an array or List<T>) that can be deserialized from a JSON object. JsonObjectAttribute can also be added to the type to force it to deserialize from a JSON object.
Path 'result.value[0].account.data.parsed.info.delegatedAmount.amount', line 1, position 189.
amurad77 commented 2 years ago

King

kimo-do commented 2 years ago

Is this fixed? Getting the same error for 1 of the NFTs in my wallet