public async Task <PartialViewResult> AccountSummaryTipBotPartialView() { try { var address = GetCurrentUserAsync().Address; ViewBag.userpic = GetCurrentUserAsync().Photo_Url; var tipAccountSummaryViewModel = new AccountSummaryViewModel { coinQuoteCol = CoinQuoteResult.Current, coinbaseBtcQuoteResult = CoinbaseBtcQuote.Current, transactionsResult = TransactionsResult.Current, delegateResult = DelegateResult.Current, walletAccountResult = await WalletAccountFetcher.FetchRiseWalletAccount(address), coinReceivedByAccount = await TransactionsFetcher.FetchTransactions(address), coinSentByAccount = await TransactionsFetcher.FetchOutgoingTransactions(address) }; return(PartialView("_AccountSummaryTipBotPartial", tipAccountSummaryViewModel)); } catch (Exception ex) { var log = new Log(); log.LogMessage(ex.Message + " " + ex.StackTrace + " " + ex.InnerException); _appdb.Logger.Add(log); _appdb.SaveChangesAsync().Wait(); return(null); } }
public async Task <PartialViewResult> AccountSummaryAsync(string address) { AccountSummaryViewModel accountSummaryViewModel; try { if (address != null) { var delegate_account = DelegateResult.Current.Delegates.Where(x => x.Username.Contains(address.ToLower()) || x.Address == address).OrderBy(j => j.Username.Length).FirstOrDefault(); if (delegate_account != null) { address = delegate_account.Address; accountSummaryViewModel = new AccountSummaryViewModel { coinQuoteCol = CoinQuoteResult.Current, coinbaseBtcQuoteResult = CoinbaseBtcQuote.Current, transactionsResult = TransactionsResult.Current, delegateResult = DelegateResult.Current, walletAccountResult = await WalletAccountFetcher.FetchRiseWalletAccount(address), delegateVotesResult = await DelegateVotesFetcher.FetchRiseDelegateVotes(address), forgedByAccount = await ForgedByAccountFetcher.FetchForgedByAccount(delegate_account.PublicKey), coinReceivedByAccount = await TransactionsFetcher.FetchTransactions(address), coinSentByAccount = await TransactionsFetcher.FetchOutgoingTransactions(address) }; } else { accountSummaryViewModel = new AccountSummaryViewModel { coinQuoteCol = CoinQuoteResult.Current, coinbaseBtcQuoteResult = CoinbaseBtcQuote.Current, transactionsResult = TransactionsResult.Current, delegateResult = DelegateResult.Current, walletAccountResult = await WalletAccountFetcher.FetchRiseWalletAccount(address), coinReceivedByAccount = await TransactionsFetcher.FetchTransactions(address), coinSentByAccount = await TransactionsFetcher.FetchOutgoingTransactions(address) }; } if (accountSummaryViewModel.walletAccountResult == null) { return(null); } else { return(PartialView("_AccountSummaryPartial", accountSummaryViewModel)); } } } catch (Exception e) { Console.WriteLine("Error:" + e.InnerException); } return(null); }
public async Task <PartialViewResult> DelegatePaymentsChartAsync(string address, int minutes) { var mydelegate = DelegateResult.Current.Delegates.Where(x => x.Address == address).FirstOrDefault(); var quoteInfoViewModel = new DelegateStatsViewModel { DelegateResult = DelegateResult.Current, TransactionsResult = await TransactionsFetcher.FetchOutgoingTransactions(address) }; // Show Payments from cuurentTime - minutes ViewBag.Minutes = minutes; return(PartialView("_DelegatePaymentsChartPartial", quoteInfoViewModel)); }