public IActionResult Check(string checksum) { var model = new ChecksumViewModel(); model.Checksum = checksum; //Get checksum info from storage var checksumStorage = NeoAPI.getStorage(NeoAPI.Net.Test, _scriptHash, checksum); if (checksumStorage != null && checksumStorage.Value != null) { string checksumValue = checksumStorage.Value; ChecksumInfo checksumInfo = ChecksumInfo.FromBytes(Encoding.ASCII.GetBytes(checksumValue)); model.ChecksumInfo = checksumInfo; //Get address info from storage (based on address from checksum info) var addressStorage = NeoAPI.getStorage(NeoAPI.Net.Test, _scriptHash, checksumInfo.Address.AsString()); if (addressStorage != null && addressStorage.Value != null) { string value = addressStorage.Value; AddressInfo addressInfo = AddressInfo.FromBytes(Encoding.ASCII.GetBytes(value)); model.AddressInfo = addressInfo; } } return(View(model)); }
/// <summary> /// Returns only the base64 string of an image /// </summary> /// <param name="id"></param> /// <returns></returns> public IActionResult Img(string id) { //Get base64string for this id from the NEO blockchain var image = NeoAPI.getStorage(NeoAPI.Net.Test, _scriptHash, id); //Check if we find an image if (image == null || image.Value == null) { return(new NotFoundResult()); } return(Content(image.Value)); }
/// <summary> /// Preview an image /// </summary> /// <param name="id"></param> /// <returns></returns> public IActionResult Preview(string id) { //Get base64string for this id from the NEO blockchain var image = NeoAPI.getStorage(NeoAPI.Net.Test, _scriptHash, id); //Check if we find an image if (image == null || image.Value == null) { return(new NotFoundResult()); } PreviewViewModel model = new PreviewViewModel(); model.Image = image.Value; return(View(model)); }