public CoinbaseRestApiFixture() { var configuration = new ConfigurationBuilder() .AddEnvironmentVariables() .Build(); ApiFactory = CoinbaseApiFactory.Create(builder => builder.ConfigureApiKey(apiKey => { apiKey.Key = configuration["CoinbaseApiKey:Key"]; apiKey.Passphrase = configuration["CoinbaseApiKey:Passphrase"]; apiKey.Secret = configuration["CoinbaseApiKey:Secret"]; }), api => api.UseSandbox()); }
private async Task RecordMessages(Action <IWebSocketSubscriptionsBuilder> configureFeed) { using var factory = CoinbaseApiFactory.Create( builder => builder.ConfigureFeed(configureFeed), options => options.UseSandbox()); var feed = await factory.StartMarketDataFeed(CancellationToken.None); _testOutput.WriteLine("Started recording."); // Wait for some messages to come through. await Task.Delay(TimeSpan.FromSeconds(3)); await feed.StopAsync(CancellationToken.None); _testOutput.WriteLine("Stopped recording."); }