private void AddBitMexHeaders(HttpClient client, HttpMethod method, string url, string content) { client.DefaultRequestHeaders.Add("api-key", _publicKey); client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); string apiExpires = new BitmexExpiresCalculator().Calculate(); client.DefaultRequestHeaders.Add("api-expires", apiExpires); client.DefaultRequestHeaders.Add("api-signature", _bitMexSignatureCalculator.Calculate(method, url, apiExpires, content)); }
public AuthSubscriptionTopic(string apiKey, string privateKey) { ApiKey = apiKey; Expires = new BitmexExpiresCalculator().Calculate(24 * 60 * 60); //24 hours Signature = new BitMexSignatureCalculator(privateKey).Calculate(HttpMethod.Get, "/realtime", Expires, ""); }