Beispiel #1
0
        /// <summary>
        /// Configure the client using the provided options
        /// </summary>
        /// <param name="exchangeOptions">Options</param>
        protected void Configure(ExchangeOptions exchangeOptions)
        {
            log.UpdateWriters(exchangeOptions.LogWriters);
            log.Level = exchangeOptions.LogVerbosity;

            BaseAddress = exchangeOptions.BaseAddress;
            apiProxy    = exchangeOptions.Proxy;
            if (apiProxy != null)
            {
                log.Write(LogVerbosity.Info, $"Setting api proxy to {exchangeOptions.Proxy.Host}:{exchangeOptions.Proxy.Port}");
            }
        }
        /// <summary>
        /// Configure the client using the provided options
        /// </summary>
        /// <param name="exchangeOptions">Options</param>
        protected void Configure(ExchangeOptions exchangeOptions)
        {
            log.UpdateWriters(exchangeOptions.LogWriters);
            log.Level = exchangeOptions.LogVerbosity;

            apiProxy = exchangeOptions.Proxy;
            if (apiProxy != null)
            {
                log.Write(LogVerbosity.Info, $"Setting api proxy to {exchangeOptions.Proxy.Host}:{exchangeOptions.Proxy.Port}");
            }

            rateLimiters = new List <IRateLimiter>();
            foreach (var rateLimiter in exchangeOptions.RateLimiters)
            {
                rateLimiters.Add(rateLimiter);
            }
        }
 protected ExchangeClient(ExchangeOptions exchangeOptions, AuthenticationProvider authenticationProvider)
 {
     log          = new Log();
     authProvider = authenticationProvider;
     Configure(exchangeOptions);
 }