private async Task <HistoricalTransactionContract> ConvertToHistoricalTransactionContractAsync(
     TransactionReceipt transactionReceipt)
 {
     return(new HistoricalTransactionContract
     {
         Amount = transactionReceipt.Amount.ToString(),
         AssetId = _assetService.Get().Id,
         FromAddress = await _addressService.AddChecksumAsync(transactionReceipt.From),
         Hash = transactionReceipt.Hash,
         Timestamp = DateTimeOffset.FromUnixTimeSeconds((long)transactionReceipt.Timestamp).UtcDateTime,
         ToAddress = await _addressService.AddChecksumAsync(transactionReceipt.To)
     });
 }
        public async Task <ActionResult <PaginationResponse <BlacklistedAddressResponse> > > GetBlacklistedAddresses(
            PaginationRequest request)
        {
            var(addresses, continuationToken) = await _addressService.GetBlacklistedAddressesAsync(request.Take, request.Continuation);

            var result = new PaginationResponse <BlacklistedAddressResponse>()
            {
                Continuation = continuationToken,
                Items        = addresses.Select(async x => new BlacklistedAddressResponse
                {
                    Address            = await _addressService.AddChecksumAsync(x.Address),
                    BlacklistingReason = x.BlacklistingReason
                })
                               .Select(x => x.Result)
                               .ToImmutableArray()
            };

            return(Ok(result));
        }
Exemple #3
0
        public async Task <ActionResult <PaginationResponse <WalletBalanceContract> > > GetBalanceList(
            PaginationRequest request)
        {
            var(balances, continuation) = await _balanceService.GetTransferableBalancesAsync(request.Take, request.Continuation);

            return(new PaginationResponse <WalletBalanceContract>
            {
                Continuation = continuation,
                Items = await balances.SelectItemsAsync(async x => new WalletBalanceContract
                {
                    Address = await _addressService.AddChecksumAsync(x.Address),
                    AssetId = _assetService.Get().Id,
                    Balance = x.Amount.ToString(),
                    Block = (long)x.BlockNumber
                })
            });
        }