Ejemplo n.º 1
0
 public Account()
 {
     _auth = null;
     Key   = string.Empty;
     Task.Run(() => Bws.Connect()).Wait();
     Status = "Inactive";
 }
Ejemplo n.º 2
0
        public void Init()
        {
            Accounts.Init();

            // Open websocket connection to get Market lists for all accounts
            Task.Run(() => Bws.Connect()).Wait();
            Task.Run(() => Bws.SendRequest("{\"trading_times\":\"2015-09-14\"}")).Wait();
            var jsonTradingTimesResponse = Task.Run(() => Bws.StartListen()).Result;
            var tradingTime = JsonConvert.DeserializeObject <TradingTimesResponse>(jsonTradingTimesResponse);

            foreach (var market in tradingTime.trading_times.markets)
            {
                MarketList.Add(new MarketSubmarket(market));
                foreach (var submarket in market.submarkets)
                {
                    MarketList.Add(new MarketSubmarket(submarket));
                }
            }
            SelectedMarket = MarketList[0];
        }