public static BitfinexLendbookResponse GetLendbook(string symbol) { var url = LendbookRequestUrl + symbol; var response = WebApi.GetBaseResponse(url); var lendBookResponseObj = JsonConvert.DeserializeObject <BitfinexLendbookResponse>(response); return(lendBookResponseObj); }
public static IList <BitfinexSymbolDetailsResponse> GetSymbols() { const string url = SymbolDetailsRequestUrl; var response = WebApi.GetBaseResponse(url); var symbolsResponseObj = JsonConvert.DeserializeObject <IList <BitfinexSymbolDetailsResponse> >(response); foreach (var bitfinexSymbolDetailsResponse in symbolsResponseObj) { Log.Info("Symbol: {0}", bitfinexSymbolDetailsResponse); } return(symbolsResponseObj); }
public static BitfinexPublicTickerGet GetPublicTicker(BtcInfo.PairTypeEnum pairType, BtcInfo.BitfinexUnauthenicatedCallsEnum callType) { var call = Enum.GetName(typeof(BtcInfo.BitfinexUnauthenicatedCallsEnum), callType); var symbol = Enum.GetName(typeof(BtcInfo.PairTypeEnum), pairType); var url = @"/v1/" + call.ToLower(CultureInfo.InvariantCulture) + "/" + symbol.ToLower(CultureInfo.InvariantCulture); var response = WebApi.GetBaseResponse(url); var publicticketResponseObj = JsonConvert.DeserializeObject <BitfinexPublicTickerGet>(response); Log.Info("Ticker: {0}", publicticketResponseObj); return(publicticketResponseObj); }
public static BitfinexOrderBookGet GetOrderBook(BtcInfo.PairTypeEnum pairType, int limitBids = 30, int limitAsks = 30) { try { var url = DepthOfBookRequestUrl + Enum.GetName(typeof(BtcInfo.PairTypeEnum), pairType); var response = WebApi.GetBaseResponse(url + string.Format("?limit_bids={0};limit_asks={1}", limitBids, limitAsks)); var orderBookResponseObj = JsonConvert.DeserializeObject <BitfinexOrderBookGet>(response); return(orderBookResponseObj); } catch (Exception ex) { Log.Error(ex); return(new BitfinexOrderBookGet()); } }
public static IList <BitfinexTradesGet> GetPairTrades(BtcInfo.PairTypeEnum pairType, BtcInfo.BitfinexUnauthenicatedCallsEnum callType) { var call = Enum.GetName(typeof(BtcInfo.BitfinexUnauthenicatedCallsEnum), callType); var symbol = Enum.GetName(typeof(BtcInfo.PairTypeEnum), pairType); var url = @"/v1/" + call.ToLower(CultureInfo.InvariantCulture) + "/" + symbol.ToLower(CultureInfo.InvariantCulture); var response = WebApi.GetBaseResponse(url); var pairTradesResponseObj = JsonConvert.DeserializeObject <IList <BitfinexTradesGet> >(response); foreach (var pairTrade in pairTradesResponseObj) { Log.Info("Pair Trade: {0}", pairTrade); } return(pairTradesResponseObj); }