Example #1
0
        private async Task CheckSentDividendTransactions()
        {
            foreach (var dividendTransaction in _newTransactions.Where(t => t.TransactionType == TransactionType.DividendPayment && t.UserIsTransactionSender))
            {
                var attachment  = (ColoredCoinsDividendPaymentAttachment)dividendTransaction.Attachment;
                var myOwnership = await _assetTracker.GetOwnership(attachment.AssetId, attachment.Height);

                var quantityQnt = await _assetTracker.GetAssetQuantity(attachment.AssetId, attachment.Height);

                var shareholdersQnt = quantityQnt - myOwnership.BalanceQnt;
                var expenseNqt      = attachment.AmountPerQnt.Nqt * shareholdersQnt;
                dividendTransaction.NqtAmount = expenseNqt;
            }
        }