public void OnGet() { var query = Request.QueryString.Value.Replace("?", ""); Utilities.Web3Client w3client = new Utilities.Web3Client(); Transaction = w3client.GetTransaction(query).GetAwaiter().GetResult(); }
public void OnGet() { var query = Request.QueryString.Value.Replace("?", ""); if (query.Length == 42)//Verify it's an address sized string that was fed in { Utilities.Web3Client w3client = new Utilities.Web3Client(); AccountBalance = w3client.GetAccountBalance(query).GetAwaiter().GetResult(); Account = query; } }
public void OnGet() { var query = Request.QueryString.Value.Replace("?", ""); Utilities.Web3Client w3client = new Utilities.Web3Client(); if (int.TryParse(query, out int blockNumber))//If the query is an int, assume it's a block number { block = w3client.BlockWithTransactions(blockNumber).GetAwaiter().GetResult(); } else if (query.Length == 66) { block = w3client.BlockByHash(query).GetAwaiter().GetResult(); } else { block = w3client.BlockWithTransactions().GetAwaiter().GetResult(); } }
public static string Decipher(string text) { int blockNumber; if (int.TryParse(text, out blockNumber)) { return($"/Block?{text}"); } Utilities.Web3Client w3client = new Utilities.Web3Client(); switch (text.Length) { case 42: return($"/Address?{text}"); case 66: return($"/{w3client.DeciperTypeOfHash(text).GetAwaiter().GetResult()}?{text}"); default: return("/Index"); } }