Example #1
0
        private KunaClient GetClientWithAuthentication(bool pro)
        {
            var config = new ConfigurationBuilder().AddJsonFile("keys.json").Build();
            var key    = config["key"];
            var secret = config["secret"];


            ApiCredentials c      = string.IsNullOrEmpty(key) ? null : new CryptoExchange.Net.Authentication.ApiCredentials(key, secret);
            var            client = new KunaClient(new KunaClientOptions()
            {
                ApiCredentials = c,

                LogLevel = LogLevel.Debug,

                LogWriters = new List <ILogger>()
                {
                    new DebugLogger(), new ConsoleLogger()
                },
                IsProAccount = pro,
                //RateLimiters = new List<CryptoExchange.Net.Interfaces.IRateLimiter>() { new RateLimiterTotal(1100, TimeSpan.FromMinutes(1)) },
                //RateLimitingBehaviour = CryptoExchange.Net.Objects.RateLimitingBehaviour.Fail,
                RequestTimeout = TimeSpan.FromSeconds(4)
            });

            return(client);
        }
Example #2
0
 public KunaV2ApiClient(Log log, KunaClient baseClient, KunaClientOptions options, KunaApiClientOptions apiOptions) : base(options, apiOptions)
 {
     _log        = log;
     _kunaClient = baseClient;
 }
Example #3
0
 public KunaExchange(ExchangeSettingsData setting) : base(setting)
 {
     _client = new KunaClient(setting);
 }
Example #4
0
 public KunaApiClient(Log log, KunaClient baseClient, KunaClientOptions options, KunaApiClientOptions apiOptions) : base(options, apiOptions)
 {
     _log        = log;
     _kunaClient = baseClient;
     OnError     = HandleProAccountEndpointError;
 }
Example #5
0
 public IntegrationTests()
 {
     client = GetClientWithAuthentication(false);
 }