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

            BaseAddress = clientOptions.BaseAddress;
            apiProxy    = clientOptions.Proxy;
            if (apiProxy != null)
            {
                log.Write(LogVerbosity.Info, $"Setting api proxy to {clientOptions.Proxy.Host}:{clientOptions.Proxy.Port}");
            }
        }
Example #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;

            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);
            }
        }