public HitBTCExchange(ExchangeDTO exchangeSettings, UserExchangeSecretDTO secrets, ExchangeLogService logService)
     : base(true, true, exchangeSettings, secrets, logService)
 {
     this.api    = new HitBTCApi(exchangeSettings, logService, secrets);
     this.wss    = new HitBTCWSS();
     this.reader = new HitBTCReader();
 }
示例#2
0
        public async Task <ISpotExchangeFacade> CreateExchanges(ExchangeDTO exx)
        {
            ISpotExchangeFacade fac = null;

            if (exx.Name == ExchangeName.Binance.ToString() && this.exchanges.FirstOrDefault(x => x.ExchangeName == ExchangeName.Binance) != null)
            {
                UserExchangeSecretDTO secrets = await this.repoExchangeSecrets.GetByExchangeId(exx.ID);

                fac = new BinanceExchange(exx, secrets, logger);
            }
            else if (exx.Name == ExchangeName.HitBTC.ToString() && this.exchanges.FirstOrDefault(x => x.ExchangeName == ExchangeName.Binance) != null)
            {
                UserExchangeSecretDTO secrets = await this.repoExchangeSecrets.GetByExchangeId(exx.ID);

                fac = new HitBTCExchange(exx, secrets, logger);
            }
            else if (exx.Name == ExchangeName.KuCoin.ToString() && this.exchanges.FirstOrDefault(x => x.ExchangeName == ExchangeName.Binance) != null)
            {
                UserExchangeSecretDTO secrets = await this.repoExchangeSecrets.GetByExchangeId(exx.ID);

                fac = new KuCoinExchange(exx, secrets, logger);
            }

            if (fac != null)
            {
                this.exchanges.Add(fac);
            }
            else
            {
                fac = this.exchanges.FirstOrDefault(x => x.ExchangeName.ToString() == exx.Name);
            }

            return(fac);
        }
 public KuCoinExchange(ExchangeDTO exchangeSettings, UserExchangeSecretDTO secrets, ExchangeLogService logService)
     : base(true, true, exchangeSettings, secrets, logService)
 {
     this.api    = new KuCoinApi(exchangeSettings, logService, secrets);
     this.wss    = new KuCoinWSS();
     this.reader = new KuCoinReader();
 }
 public BinanceExchange(ExchangeDTO exchangeSettings, UserExchangeSecretDTO secrets, ExchangeLogService logService)
     : base(true, true, exchangeSettings, secrets, logService)
 {
     this.api    = new BinanceApi(exchangeSettings, logService, secrets);
     this.wss    = new BinanceWSS();
     this.reader = new BinanceReader();
 }
        public async Task <IActionResult> Update([FromBody] UserExchangeSecretDTO dto)
        {
            try
            {
                string userId = this.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value;
                await this.repo.Update(dto, userId);

                return(Ok());
            }
            catch (Exception ex)
            {
                log.Log(ex);
                return(BadRequest());
            }
        }
        public async Task <IActionResult> GetById(int id)
        {
            try
            {
                string userId             = this.User.Claims.FirstOrDefault(x => x.Type == ClaimTypes.NameIdentifier).Value;
                UserExchangeSecretDTO dto = await this.repo.GetById(id, userId);

                return(Ok(dto));
            }
            catch (Exception ex)
            {
                log.Log(ex);
                return(BadRequest());
            }
        }
示例#7
0
 public SpotExchange_API(bool ObserveAllSymbolsMode, bool ObserveAllBalancesMode, ExchangeDTO exchangeSettings, UserExchangeSecretDTO secrets, ExchangeLogService logService)
     : base(ObserveAllSymbolsMode, ObserveAllBalancesMode, exchangeSettings, secrets, logService)
 {
 }
示例#8
0
 public BinanceApi(ExchangeDTO exchangeSettings, ExchangeLogService logger, UserExchangeSecretDTO secrets) : base(exchangeSettings, logger, secrets)
 {
 }