Ejemplo n.º 1
0
        /// <summary>
        /// Gets the proxy
        /// </summary>
        /// <param name="exchangeCode"></param>
        /// <returns></returns>
        public static IExchange GetProxy(string exchangeCode)
        {
            IExchange ret;

            if (!_singletons.TryGetValue(exchangeCode, out ret))
            {
                if (exchangeCode == ExchangesInternalCodes.Bitstamp)
                {
                    ret = new BitstampWrapper();
                }
                else if (exchangeCode == ExchangesInternalCodes.Btce)
                {
                    ret = new BtceWrapper();
                }
                else if (exchangeCode == ExchangesInternalCodes.Cryptsy)
                {
                    ret = new CryptsyWrapper();
                }
                else if (exchangeCode == ExchangesInternalCodes.Gdax)
                {
                    ret = new GdaxWrapper();
                }
                else
                {
                    throw new ArgumentException("Unknown exchange code " + exchangeCode);
                }
                _singletons[exchangeCode] = ret;
            }
            return(ret);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets the proxy
 /// </summary>
 /// <param name="exchangeCode"></param>
 /// <returns></returns>
 public static IExchange GetProxy(string exchangeCode)
 {
     IExchange ret;
     if (!_singletons.TryGetValue(exchangeCode, out ret))
     {
         if (exchangeCode == ExchangesInternalCodes.Bitstamp)
         {
             ret = new BitstampWrapper();
         }
         else if (exchangeCode == ExchangesInternalCodes.Btce)
         {
             ret = new BtceWrapper();
         }
         else if (exchangeCode == ExchangesInternalCodes.Cryptsy)
         {
             ret = new CryptsyWrapper();
         }
         else
         {
             throw new ArgumentException("Unknown exchange code " + exchangeCode);
         }
         _singletons[exchangeCode] = ret;
     }
     return ret;
 }