public ActionResult Index(string search)
        {
            SearchResult result = BlockChainHelper.GetSearchAction(search);

            if (result.Action == "Index")
            {
                ExplorerError error = new ExplorerError();
                error.Errors.Add("No records found. Try again or contact us for assistance");

                TempData["Errors"] = error;
            }
            return(RedirectToAction(result.Action, result.Controller, result.RouteValue));
        }
        /// <summary>
        /// Get block information for a given hash or height
        /// </summary>
        /// <param name="id">blockhash or height</param>
        /// <returns></returns>
        public ActionResult Block(string id)
        {
            BlockResponse b = _blocks.Get(id);

            if (b == null)
            {
                ExplorerError error = new ExplorerError();
                error.Errors.Add("Block not found. Try again or contact us for assistance");

                TempData["Errors"] = error;
                return(RedirectToAction("Index"));
            }

            return(View(b));
        }
        /// <summary>
        /// Get transaction details for a given transaction hash
        /// </summary>
        /// <param name="id">Transaction Hash</param>
        /// <returns></returns>
        public ActionResult Tx(string id)
        {
            RawTransactionResponse vtr = _transaction.Get(id);

            if (vtr == null)
            {
                ExplorerError error = new ExplorerError();
                error.Errors.Add("Transaction not found. Try again or contact us for assistance");

                TempData["Errors"] = error;
                return(RedirectToAction("Index"));
            }

            return(View(vtr));
        }
        /// <summary>
        /// This will import the address details then show all transactions for the particular address
        /// </summary>
        /// <param name="id">Wallet Address</param>
        /// <returns></returns>
        public ActionResult Address(string id)
        {
            List <AddressTransactionResponse> items = _address.Get(id);

            if (items == null)
            {
                ExplorerError error = new ExplorerError();
                error.Errors.Add("Address not found. Try again or contact us for assistance");

                TempData["Errors"] = error;
                return(RedirectToAction("Index"));
            }

            AddressDetail ad = new AddressDetail();

            ad.Address = id;
            ad.Transactions.AddRange(items);
            return(View(ad));
        }
Ejemplo n.º 5
0
 /// <summary>
 /// Invocator for <see cref="ExplorerError"/> event.
 /// </summary>
 /// <param name="e"></param>
 private void InvokeExplorerError(ExplorerTreeViewErrorEventArgs e)
 {
     ExplorerError?.Invoke(this, e);
 }