//========================================================== public void GetOrderBook(Bittrex B, String Market, BittrexOrderBook.Type OrderBookType, Int32 Depth) { BittrexResult <BittrexOrderBook> BOB = B.GetOrderBook(Market, OrderBookType, Depth); if (GetIsResultValid(BOB)) { Console.WriteLine(BOB.Result.ToString()); } }
//========================================================== // This is BS Bittrex... // Either return an array or an object for _all_ options. // Not one or the other depending on which option is passed in. public BittrexResult <BittrexOrderBook> GetOrderBook(String Market, BittrexOrderBook.Type OrderBookType, Int32 Depth) { Depth = Math.Min(100, Math.Max(1, Depth)); String APICall = API_URL + API_VER + "/public/getorderbook?market=" + Market + "&type=" + OrderBookType.ToString().ToLower() + "&depth=" + Depth; if (OrderBookType == BittrexOrderBook.Type.Buy) { BittrexResult <List <BittrexOrderBook.Entry> > Result = GetInternal <BittrexResult <List <BittrexOrderBook.Entry> > >(APICall) as BittrexResult <List <BittrexOrderBook.Entry> >; return(new BittrexResult <BittrexOrderBook>(Result.Success, Result.Message, new BittrexOrderBook(Result.Success ? Result.Result : new List <BittrexOrderBook.Entry>(), new List <BittrexOrderBook.Entry>()))); } else if (OrderBookType == BittrexOrderBook.Type.Sell) { BittrexResult <List <BittrexOrderBook.Entry> > Result = GetInternal <BittrexResult <List <BittrexOrderBook.Entry> > >(APICall) as BittrexResult <List <BittrexOrderBook.Entry> >; return(new BittrexResult <BittrexOrderBook>(Result.Success, Result.Message, new BittrexOrderBook(new List <BittrexOrderBook.Entry>(), Result.Success ? Result.Result : new List <BittrexOrderBook.Entry>()))); } return(GetInternal <BittrexResult <BittrexOrderBook> >(APICall) as BittrexResult <BittrexOrderBook>); }