dougdellolio / coinbasepro-csharp

The unofficial .NET/C# client library for the Coinbase Pro/GDAX API
MIT License
193 stars 90 forks source link

Why is an Authenticator required in order to use the GetHistoricRatesAsync method? #265

Closed XaeroDegreaz closed 3 years ago

XaeroDegreaz commented 3 years ago

This is a public Coinbase API which does not require authentication.

You can test it here: https://api.pro.coinbase.com/products/BTC-USD/candles?start=2021-01-30T12:15:00&end=2021-01-30T12:41:00&granularity=60

Stack:

CoinbasePro.Exceptions.CoinbaseProHttpException
Please provide an authenticator to the client to request "/products/BTC-USD/candles?start=2021-01-30T12:15:00&end=2021-01-30T12:41:00&granularity=60"
   at CoinbasePro.Network.HttpRequest.HttpRequestMessageService.CreateHttpRequestMessage(HttpMethod httpMethod, String requestUri, String contentBody)
   at CoinbasePro.Services.AbstractService.SendHttpRequestMessageAsync(HttpMethod httpMethod, String uri, String content)
   at CoinbasePro.Services.AbstractService.SendServiceCall[T](HttpMethod httpMethod, String uri, String content)
   at CoinbasePro.Services.Products.ProductsService.GetHistoricRatesAsync(ProductType productId, DateTime start, DateTime end, Int32 granularity)
   at CoinbasePro.Services.Products.ProductsService.GetHistoricRatesAsync(ProductType productPair, DateTime start, DateTime end, CandleGranularity granularity)

There are also no failures when mixing matching sandbox / prod credentials and client constructor flags, further making this evident that is a public API.

dougdellolio commented 3 years ago

hey @XaeroDegreaz . This is certainly a bug. I have fixed it here: https://github.com/dougdellolio/coinbasepro-csharp/commit/22424ad26e8bf753d598ffcac60d656b731a739a. Please upgrade to the latest version on NuGet. Let me know if you see any issues.

thanks!