Example #1
0
        public List <MerchantTransferDTO> TransferStatement(Guid merchantAccountId, long merchantWalletId, int pageIndex, int pageSize)
        {
            var dac  = new MerchantWalletDAC();
            var list = dac.GetMerchantTransferStatementById(merchantAccountId, merchantWalletId, pageIndex, pageSize);

            var cryptoList = new CryptocurrencyDAC().GetAll();

            return(list.Select(e =>
            {
                var crypto = cryptoList.FirstOrDefault(c => c.Id == e.CryptoId);

                return new MerchantTransferDTO
                {
                    Id = e.Id,
                    TransactionType = e.TransferType,
                    TransactionStatus = e.Status,
                    CryptoCode = crypto?.Code,
                    Amount = e.Amount.ToString(crypto?.DecimalPlace ?? 0),
                    Timestamp = e.Timestamp.ToUnixTime()
                };
            }).ToList());
        }