Esempio n. 1
0
        public static CryptoTransaction NewIn(string transactionKey, DateTime dateTime, Guid exchangeId, string comment, decimal inAmount, string inCurrency, string fromAddress, string toAddress, string transactionHash)
        {
            var t = new CryptoTransaction()
            {
                Type            = TransactionType.In,
                TransactionKey  = transactionKey,
                DateTime        = dateTime,
                ExchangeId      = exchangeId,
                Comment         = comment,
                InAmount        = inAmount,
                InCurrency      = inCurrency,
                FromAddress     = fromAddress,
                ToAddress       = toAddress,
                TransactionHash = transactionHash
            };

            return(t);
        }
Esempio n. 2
0
        public static CryptoTransaction NewOut(string transactionKey, DateTime dateTime, Guid exchangeId, string comment, decimal outAmount, string outCurrency, decimal fee, string feeCurrency, string fromAddress, string toAddress, string transactionHash)
        {
            var t = new CryptoTransaction()
            {
                Type            = TransactionType.Out,
                TransactionKey  = transactionKey,
                DateTime        = dateTime,
                ExchangeId      = exchangeId,
                Comment         = comment,
                OutAmount       = outAmount,
                OutCurrency     = outCurrency,
                FeeAmount       = fee,
                FeeCurrency     = feeCurrency,
                FromAddress     = fromAddress,
                ToAddress       = toAddress,
                TransactionHash = transactionHash
            };

            return(t);
        }
Esempio n. 3
0
        // Fee is always added!
        /// <summary>
        /// News the trade.
        /// </summary>
        /// <param name="transactionKey">The transaction key.</param>
        /// <param name="dateTime">The date time.</param>
        /// <param name="exchangeId">The exchange identifier.</param>
        /// <param name="comment">The comment.</param>
        /// <param name="buyAmount">The buy amount.</param>
        /// <param name="buyCurrency">The buy currency.</param>
        /// <param name="fee">The fee.</param>
        /// <param name="feeCurrency">The fee currency.</param>
        /// <param name="sellAmount">Without fee</param>
        /// <param name="sellCurrency">The sell currency.</param>
        /// <param name="fiatRate">The fiat rate of the buying currency.</param>
        /// <returns>CryptoTransaction.</returns>
        public static CryptoTransaction NewTrade(string transactionKey, DateTime dateTime, Guid exchangeId, string comment, decimal buyAmount, string buyCurrency, decimal fee, string feeCurrency, decimal sellAmount, string sellCurrency, decimal fiatRate)
        {
            var t = new CryptoTransaction()
            {
                Type           = TransactionType.Trade,
                TransactionKey = transactionKey,
                DateTime       = dateTime,
                ExchangeId     = exchangeId,
                Comment        = comment,
                BuyAmount      = buyAmount,
                BuyCurrency    = buyCurrency,
                FeeAmount      = fee,
                FeeCurrency    = feeCurrency,
                SellAmount     = sellAmount,
                SellCurrency   = sellCurrency,
                Rate           = sellAmount / buyAmount,
                BuyFiatRate    = fiatRate,
                BuyFiatAmount  = fiatRate * buyAmount
            };

            return(t);
        }