public static IKrakenClient CreateResponseClient(string response, KrakenClientOptions options = null) { var client = (KrakenClient)CreateClient(options); SetResponse(client, response); return(client); }
public static IKrakenClient CreateResponseClient <T>(T response, KrakenClientOptions options = null) { var client = (KrakenClient)CreateClient(options); SetResponse(client, JsonConvert.SerializeObject(response)); return(client); }
public static IKrakenClient CreateClient(KrakenClientOptions options = null) { IKrakenClient client; client = options != null ? new KrakenClient(options) : new KrakenClient(new KrakenClientOptions() { LogVerbosity = LogVerbosity.Debug }); client.RequestFactory = Mock.Of <IRequestFactory>(); return(client); }
/// <summary> /// ctor /// </summary> public ExchangeKraken() { var cred = @"./credentials"; if (File.Exists(cred)) { using (var stream = File.OpenRead("./credentials")) { var ko = new KrakenClientOptions(); ko.ApiCredentials = new ApiCredentials(stream, "krakenKey", "krakenSecret"); ko.RateLimitingBehaviour = CryptoExchange.Net.Objects.RateLimitingBehaviour.Wait; kc = new KrakenClient(ko); _privateAPI = true; } } else { kc = new KrakenClient(); } kc.AddRateLimiter(new RateLimiterAPIKey(15, TimeSpan.FromSeconds(3))); }