public async Task <IEnumerable <TransactionContentModel> > GetTransactionHistory(AddressTransaction addressTransactions)
        {
            var transactionResponseRaw = await _ethereumSamuraiApi.ApiTransactionByAddressGetAsync(addressTransactions.Address, addressTransactions.Start, addressTransactions.Count);

            var transactionResponse = transactionResponseRaw as FilteredTransactionsResponse;

            ThrowOnError(transactionResponseRaw);
            int responseCount = transactionResponse.Transactions?.Count ?? 0;
            List <TransactionContentModel> result = new List <TransactionContentModel>(responseCount);

            foreach (var transaction in transactionResponse.Transactions)
            {
                result.Add(new TransactionContentModel()
                {
                    Transaction = MapTransactionResponseToModel(transaction)
                });
            }

            return(result);
        }
Пример #2
0
 /// <param name='operations'>
 /// The operations group for this extension method.
 /// </param>
 /// <param name='address'>
 /// </param>
 /// <param name='count'>
 /// </param>
 /// <param name='start'>
 /// </param>
 public static object ApiTransactionByAddressGet(this IEthereumSamuraiAPI operations, string address, int count, int start)
 {
     return(operations.ApiTransactionByAddressGetAsync(address, count, start).GetAwaiter().GetResult());
 }