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(); }
/* * 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(); }
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; }
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; }
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)); }
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; }
#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); }
/// <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);
/// <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);
/// <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);
/// <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);
public OpenOrders GetOpenOrders(TradingPair pair) => _executor.Execute <OpenOrders>(_commands.OpenOrders, pair);