Esempio n. 1
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            IExchange cryptopia = new Cryptopia();
            TradePair tp        = new TradePair()
            {
                BaseLabel = "BTC", CurrencyLabel = "ETN"
            };
            MarketOrdersResponse r = cryptopia.GetMarketOrders(new MarketOrdersRequest(tp));

            //IExchange bittrex = new Bittrex();
            //TradePair tp = new TradePair() { BaseLabel = "BTC", CurrencyLabel = "RDD" };
            //MarketOrdersRequest mr = new MarketOrdersRequest(tp);
            //MarketOrdersResponse r = bittrex.GetMarketOrders(mr);
            int i = 1;
        }
Esempio n. 2
0
        public MarketOrdersResponse GetMarketOrders(MarketOrdersRequest request)
        {
            var query = "getorderbook?market=" + $"{request.TradePair.PairLabel}" + "&type=both";
            MarketOrdersResponse r = GetResult <MarketOrdersResponse>(PublicApiCall.GetMarketOrders, query);

            foreach (var c in r.Data.Buy)
            {
                c.Label = request.TradePair.PairLabel;
                c.Total = c.Price * c.Volume;
            }

            foreach (var c in r.Data.Sell)
            {
                c.Label = request.TradePair.PairLabel;
                c.Total = c.Price * c.Volume;
            }

            return(r);
        }