public CoinbaseProWebSocket(WebSocketConfig config = null)
 {
     this.Config = config ?? new WebSocketConfig();
 }
Exemple #2
0
        public static async Task <string> MakeAuthenticatedSubscriptionAsync(Subscription subscription, WebSocketConfig config)
        {
            subscription.ExtraJson.Add("key", config.ApiKey);
            subscription.ExtraJson.Add("passphrase", config.Passphrase);

            var timestamp = await TimeHelper.GetCurrentTimestampAsync(config.UseTimeApi)
                            .ConfigureAwait(false);

            subscription.ExtraJson.Add("timestamp", timestamp);

            var signature = ApiKeyAuthenticator.GenerateSignature(timestamp, "GET", "/users/self/verify", null, config.Secret);

            subscription.ExtraJson.Add("signature", signature);

            return(JsonConvert.SerializeObject(subscription));
        }