Ejemplo n.º 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}");
            }
        }
Ejemplo n.º 2
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;

            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);
            }
        }
Ejemplo n.º 3
0
 protected ExchangeClient(ExchangeOptions exchangeOptions, AuthenticationProvider authenticationProvider)
 {
     log          = new Log();
     authProvider = authenticationProvider;
     Configure(exchangeOptions);
 }