Skip to content

Commit 0bf88fa

Browse files
committed
API: Fix for broken json in GetNFT
1 parent 798991d commit 0bf88fa

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Phantasma.API/NexusAPI.cs

+12-2
Original file line numberDiff line numberDiff line change
@@ -608,9 +608,19 @@ private TokenDataResult FillNFT(string symbol, BigInteger ID, bool extended)
608608
}
609609
else
610610
{
611-
Blockchain.Tokens.TokenUtils.FetchProperty(Nexus.RootStorage, chain, method.name, series, ID, (propName, propValue) =>
611+
TokenUtils.FetchProperty(Nexus.RootStorage, chain, method.name, series, ID, (propName, propValue) =>
612612
{
613-
properties.Add(new TokenPropertyResult() { Key = propName, Value = propValue.AsString() });
613+
string temp;
614+
if (propValue.Type == VMType.Bytes)
615+
{
616+
temp = "0x" + Base16.Encode(propValue.AsByteArray());
617+
}
618+
else
619+
{
620+
temp = propValue.AsString();
621+
}
622+
623+
properties.Add(new TokenPropertyResult() { Key = propName, Value = temp });
614624
});
615625
}
616626
}

0 commit comments

Comments
 (0)