UnitySDK GetNFTMetadata Solana

I’m trying to get a NFT metadata from its mintaddress the easiest way possible, but I don’t see how to do it.

NftMetadata bal = await MoralisSolanaClient.SolanaApi.Nft.GetNFTMetadata(NetworkTypes.mainnet, “MyNFTMintAddress”);

Initialisation seems ok, but when GetNFTMetadata is called I have an exception :
NullReferenceException: Moralis.SolanaApi.Client.ApiClient… ApiClient.cs:59
=> a queryParam variable which is null.
I tried to correct that but it crashes after.
Does someone know what is wrong with my approach?


That’s exactly what I’m doing.

Does someone know what’s wrong with the code?

hey, can you take a look at the docs ?

i dont think this extra stuffs is need, if you are authenticated, you should be able to call it

There are no answer in the docs unfortunately, reason why I’m coming here.
I just gave up with Moralis, and found another solution.
Just to say that’s really sad to be stopped on something I’m sure is more than easy to correct.
The team should just make some tutorial code from the initialisation for that, it’s just a few lines to add I suppose, and ppl wouldn’t have to fight days on some obvious stuff.

Same story here just installed latest moralisweb3sdk_v1_2_0.unitypackage moralis sdk for unity and cant get none of functions to work (from example docs)
https://docs.moralis.io/moralis-dapp/solana-api/account first it asks for start after adding Moralis.Start(); NativeBalance solBalance = await Moralis.SolanaApi.Account.Balance(NetworkTypes.mainnet, “6XU36wCxWobLx5Rtsb58kmgAJKVYmMVqy4SHXxENAyAe”); throwing error NullReferenceException: Object reference not set to an instance of an object
MoralisUnity.SolanaApi.Client.ApiClient.CallApi (System.String path, MoralisUnity.SolanaApi.Models.Method method, System.Collections.Generic.Dictionary2[TKey,TValue] queryParams, System.String postBody, System.Collections.Generic.Dictionary2[TKey,TValue] headerParams, System.Collections.Generic.Dictionary2[TKey,TValue] formParams, System.Collections.Generic.Dictionary2[TKey,TValue] fileParams, System.String[] authSettings) (at Packages/io.moralis.web3-unity-sdk/Runtime/SolanaApi/Client/ApiClient.cs:101)
Cysharp.Threading.Tasks.UniTask+ExceptionResultSource1[T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.Factory.cs:235) MoralisUnity.SolanaApi.CloudApi.AccountApi.Balance (MoralisUnity.SolanaApi.Models.NetworkTypes network, System.String address) (at Packages/io.moralis.web3-unity-sdk/Runtime/SolanaApi/CloudApi/AccountApi.cs:79) Cysharp.Threading.Tasks.UniTask+ExceptionResultSource1[T].GetResult (System.Int16 token) (at Packages/io.moralis.web3-unity-sdk/Runtime/External/UniTask/Runtime/UniTask.Factory.cs:235)
MoralisNFT.Start () (at Assets/MoralisNFT.cs:40)
System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c.b__7_0 (System.Object state) (at :0)
UnityEngine.UnitySynchronizationContext+WorkRequest.Invoke () (at :0)
UnityEngine.UnitySynchronizationContext.Exec () (at :0)
UnityEngine.UnitySynchronizationContext.ExecuteTasks () (at :0)

update to the latest sdk version, and post the code you are trying, pls ensure you take a look at the docs