/// <summary> /// Update Wallet TX Data /// </summary> public async void UpdateWalletTXs() { //this is called by a different method, if it errored then all the code below would mess up. if (!errorFsInfo) { //loop through all loaded wallets foreach (string wallet in WalletAccounts.Keys) { //Loop through all Wallet Accounts foreach (string account in WalletAccounts[wallet]) { //Get Account history GetWalletHistoryResponse accountHistory = await restClient.GetWalletHistory(wallet, account); if (accountHistory != null) { //there is only one entry for "history" ProcessAccountTXs(wallet, account, accountHistory.history[0].transactionsHistory); } else { logger.LogInformation( $"An Error Occured Getting Account '{account}' TX History For Wallet '{wallet}', API Response Was NULL!"); } } } } }
} //end of public async Task<string> GetWalletBalence(string walletName, string accountName = null) /// <summary> /// Get The Transaction History /// </summary> /// <param name="walletName">Wallet Name</param> /// <param name="account">Account Name (Leave Blank for all)</param> /// <param name="skip">Skip X Records (Leave Blank for all)</param> /// <param name="take">Take X Records (Leave Blank for all)</param> /// <param name="searchQuery">Search Query To Use (Leave Blank for all)</param> public async Task <GetWalletHistoryResponse> GetWalletHistory(string walletName, string account = null, int skip = -1, int take = -1, string searchQuery = null) { try { StringBuilder queryURL = new StringBuilder($"api/Wallet/history?WalletName={walletName.Trim()}"); if (!string.IsNullOrWhiteSpace(account)) { queryURL.Append($"&AccountName={Uri.EscapeDataString(account.Trim())}"); } if (skip > -1) { queryURL.Append($"&Skip={skip}"); } if (take > -1) { queryURL.Append($"&Take={take}"); } if (!string.IsNullOrWhiteSpace(searchQuery)) { queryURL.Append($"&SearchQuery={Uri.EscapeDataString(searchQuery.Trim())}"); } GetWalletHistoryResponse response = await base.SendGet <GetWalletHistoryResponse>(queryURL.ToString()); Guard.Null(response, nameof(response), "'api/Wallet/history' API Response Was Null!"); return(response); } catch (Exception ex) { Logger.Fatal($"An Error '{ex.Message}' Occured When Getting History For Wallet '{walletName.Trim()}'!", ex); throw; } //end of try-catch } //end of public async Task<GetWalletHistoryResponse> GetWalletHistory(string walletName, string account = null, int skip = -1, int take = -1, string searchQuery = null)