public async Task <DataTablesResponse> GetWalletTransactions(WalletTxRequestModel model, DataTablesModel tableModel) { var cacheResult = await CacheService.GetOrSetMemoryAsync(CacheKey.WalletTransactions(model.Currency), TimeSpan.FromMinutes(10), async() => { int currencyId = -1; using (var context = ExchangeDataContextFactory.CreateReadOnlyContext()) { Entity.Currency selectedCurrency = await context.Currency.FirstOrDefaultNoLockAsync(c => c.Symbol.Equals(model.Currency)); if (selectedCurrency != null) { currencyId = selectedCurrency.Id; } } if (currencyId == -1) { return(null); } List <WalletTransaction> transactions = new List <WalletTransaction>(); using (var service = new AdmintopiaServiceClient()) transactions = await service.GetWalletTransactionsSinceAsync(AdmintopiaService.TransactionDataType.Withdraw, currencyId, WalletTimeoutMinutes, model.BlockLength); return(transactions.Select(x => new { Type = x.Type, Amount = x.Amount, Txid = x.Txid, Address = x.Address })); }); return(cacheResult.GetDataTableResult(tableModel, true)); }
public async Task <ActionResult> GetWalletTransactions(WalletTxRequestModel model, DataTablesModel tableModel) { DataTablesResponse response = await ReprocessingReader.GetWalletTransactions(model, tableModel); return(DataTable(response)); }