dougdellolio / coinbasepro-csharp

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

Deal with timestamp timeouts #299

Closed billynieto closed 2 years ago

billynieto commented 2 years ago

I'm attempting to perform a simple GetAllAccountsAsync() call, and the response is always: "request timestamp expired"

I'm getting this response almost immediately, so there is a skewed time difference between my local time and the server time, of which must be under 30 milliseconds. Is there a way to modify the code to allow me to adjust this?

The bottom of https://docs.cloud.coinbase.com/exchange/docs/authorization-and-authentication notes you can use the Time endpoint.

dougdellolio commented 2 years ago

hi @billynieto I have seen this when the clock on my computer is off. if you're on windows you can synchronize your clock to the windows time server. I would suggest trying that out and seeing how it goes

billynieto commented 2 years ago

I confirmed my timezone is automatically set, and that it automatically syncs to Windows. I am, however, in Alaska, and I see their single server is in Virginia. I doubt this is the cause, but may affect it enough. Is it possible to expose the time endpoint also, so I can play with this timeout variable?

dougdellolio commented 2 years ago

feel free to open up a PR with these changes - I would be happy to merge it in as a feature. however, I am pretty sure this is related to an issue with the time on your computer. There are some other threads that might help troubleshoot from other users that ran into the same issue. I am sure you've already tried this but a good restart on you computer may even do the trick :)

other threads from the past:

https://github.com/dougdellolio/coinbasepro-csharp/issues/40 https://github.com/dougdellolio/coinbasepro-csharp/issues/293

billynieto commented 2 years ago

I tested the app on my physical device, and it works fine. I was experiencing it when I was running the android emulator. My virtual device's time was set to automatic, and I turned it off and on, though I may have to run a command line script each time to resync it from my build machine each time.

I may just debug off my physical device... Regardless, all is well. Thanks for the help.