コード例 #1
0
        internal UserTransactions(
            IEnumerable <IExchangeResponseIntermediate <UserTransaction> > transactions,
            TradingPair pair,
            IExchangeConfiguration configuration)
            : base(DateTime.UtcNow, configuration.ExchangeSourceType)
        {
            Pair = pair;

            TransactionsCollection =
                transactions
                .Select(x => x.Convert(pair))
                .Where(x => x != default(UserTransaction))
                .ToList()
                .AsReadOnly();
        }
コード例 #2
0
ファイル: Transactions.cs プロジェクト: llenroc/BEx
        /*
         * internal Transactions(IEnumerable<Transaction> transactions, TradingPair pair,
         *  ExchangeType sourceExchange)
         *  : base(DateTime.UtcNow, sourceExchange)
         * {
         *  Pair = pair;
         *
         *  TransactionsCollection =
         *      transactions
         *          .Where(x => x != default(Transaction))
         *          .OrderByDescending(x => x.UnixCompletedTimeStamp)
         *          .ToList()
         *          .AsReadOnly();
         * }*/

        internal Transactions(
            IEnumerable <IExchangeResponseIntermediate <Transaction> > transactions,
            TradingPair pair,
            IExchangeConfiguration configuration)
            : base(DateTime.UtcNow, configuration.ExchangeSourceType)
        {
            Pair = pair;

            TransactionsCollection =
                transactions
                .Select(x => x.Convert(pair))
                .Where(x => x != default(Transaction))
                .OrderByDescending(x => x.UnixCompletedTimeStamp)
                .ToList()
                .AsReadOnly();
        }
コード例 #3
0
ファイル: Transaction.cs プロジェクト: llenroc/BEx
 internal Transaction(
     string amount,
     TradingPair pair,
     long unixTimeStamp,
     int transactionId,
     string price,
     ExchangeType sourceExchange)
     : this()
 {
     Amount = Conversion.ToDecimalInvariant(amount);
     Pair   = pair;
     UnixCompletedTimeStamp = unixTimeStamp;
     CompletedTime          = unixTimeStamp.ToDateTimeUTC();
     ExchangeTimeStampUTC   = CompletedTime;
     LocalTimeStampUTC      = DateTime.UtcNow;
     Price          = Conversion.ToDecimalInvariant(price);
     SourceExchange = sourceExchange;
     TransactionId  = transactionId;
 }
コード例 #4
0
ファイル: Order.cs プロジェクト: llenroc/BEx
 internal Order(
     decimal amount,
     TradingPair pair,
     string id,
     decimal price,
     OrderType tradeType,
     DateTime exchangeTimeStamp,
     ExchangeType source)
     : this()
 {
     Amount               = amount;
     Pair                 = pair;
     Id                   = id;
     Price                = price;
     TradeType            = tradeType;
     ExchangeTimeStampUTC = exchangeTimeStamp;
     SourceExchange       = source;
     LocalTimeStampUTC    = DateTime.UtcNow;
 }
コード例 #5
0
        internal OpenOrders(
            IEnumerable <IExchangeResponseIntermediate <Order> > orders,
            TradingPair pair,
            IExchangeConfiguration configuration)
            : base(DateTime.UtcNow, configuration.ExchangeSourceType)
        {
            var allOrders = orders
                            .Select(x => x.Convert(pair))
                            .Distinct();

            BuyOrders =
                new ReadOnlyDictionary <string, Order>(
                    allOrders
                    .Where(x => x.IsBuyOrder)
                    .ToDictionary(x => x.Id, x => x));

            SellOrders = new ReadOnlyDictionary <string, Order>(
                allOrders
                .Where(x => x.IsSellOrder)
                .ToDictionary(x => x.Id, x => x));
        }
コード例 #6
0
        internal Tick(
            decimal ask,
            decimal bid,
            decimal last,
            decimal volume,
            TradingPair pair,
            ExchangeType sourceExchange,
            long timestamp)
            : this()
        {
            Ask = ask;
            Bid = bid;

            Last   = last;
            Volume = volume;
            Pair   = pair;

            SourceExchange       = sourceExchange;
            UnixTimeStamp        = timestamp;
            ExchangeTimeStampUTC = timestamp.ToDateTimeUTC();
            LocalTimeStampUTC    = DateTime.UtcNow;
        }
コード例 #7
0
#pragma warning disable RECS0154 // Parameter is never used
        internal AccountBalance(IEnumerable <Balance> balances, TradingPair pair, IExchangeConfiguration configuration)
#pragma warning restore RECS0154 // Parameter is never used
            : base(DateTime.UtcNow, configuration.ExchangeSourceType)
        {
            BalanceByCurrency = CreateDictionary(balances, configuration);
        }
コード例 #8
0
 /// <summary>
 ///     Verify that a currency pair (e.g. BTC/USD) is supported by this exchange.
 /// </summary>
 /// <param name="pair">Currency Pair</param>
 /// <returns>True if supported, otherwise false.</returns>
 public bool IsTradingPairSupported(TradingPair pair) => _configuration.SupportedPairs.Contains(pair);
コード例 #9
0
 /// <summary>
 ///     Return your last 50 Order Transactions for the Default Trading Pair
 /// </summary>
 /// <returns>UserTransactions, non-null</returns>
 public UserTransactions GetUserTransactions(TradingPair pair)
 => _executor.Execute <UserTransactions>(_commands.UserTransactions, pair);
コード例 #10
0
 /// <summary>
 ///     Retrieve the last Tick for the Exchange
 /// </summary>
 /// <param name="pair">Retrieve Tick for this Trading Pair</param>
 /// <returns>BEx.Tick</returns>
 public Tick GetTick(TradingPair pair) => _executor.Execute <Tick>(_commands.Tick, pair);
コード例 #11
0
 /// <summary>
 ///     Url the current Order Book for the specified Currency pair.
 /// </summary>
 /// <param name="pair"></param>
 /// <returns></returns>
 public OrderBook GetOrderBook(TradingPair pair) => _executor.Execute <OrderBook>(_commands.OrderBook, pair);
コード例 #12
0
 public OpenOrders GetOpenOrders(TradingPair pair) => _executor.Execute <OpenOrders>(_commands.OpenOrders, pair);