using Knoks.CryptoExchanges.ExchangeClients;
using Knoks.Framework.Extentions;
using Microsoft.Extensions.Configuration;
using System.Collections.Generic;
using System.Linq;

namespace Knoks.CryptoExchanges
{
    static class CryptoExchangeFactory
    {
        public static IExchangeContainer InitialyzeExchange(int exchangeId, string exchangeName, IConfiguration settings)
        {
            switch (exchangeName.ToLower())
            {
                case "bittrex":
                    var exchangeBitrex = new BittrexExchange(exchangeId);
                    //exchangeBitrex.ReplaceSymbols = settings.Load<Dictionary<string, string>>("Bittrex:ReplaceSymbols");
                    return exchangeBitrex;
                case "binance":
                    var exchangeBinance = new BinanceExchange(exchangeId);
                    return exchangeBinance;
                case "cex":
                    var exchangeCex = new CexExchange(exchangeId);
                    return exchangeCex;
                case "bitfinex":
                    var exchangeBitfinex = new BitfinexExchange(exchangeId);
                    return exchangeBitfinex;
                case "huobi":
                    var exchangeHUOBI = new HUOBIExchange(exchangeId);
                    return exchangeHUOBI;
                case "okex":
                    var exchangeOKEx = new OKExExchange(exchangeId);
                    return exchangeOKEx;
                default:
                    return null;
            }
        }
    }
}
