Example #1
0
        public static BitfinexLendbookResponse GetLendbook(string symbol)
        {
            var url      = LendbookRequestUrl + symbol;
            var response = WebApi.GetBaseResponse(url);

            var lendBookResponseObj = JsonConvert.DeserializeObject <BitfinexLendbookResponse>(response);

            return(lendBookResponseObj);
        }
Example #2
0
        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);
        }
Example #3
0
        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);
        }
Example #4
0
 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());
     }
 }
Example #5
0
        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);
        }