belaczek / hodlwatch

Simple, yet powerful web app for automatic cryptocurrency portfolio tracking
https://hodl.watch
MIT License
120 stars 26 forks source link

Unable to connect to Coinbase Pro #23

Closed tslpre closed 3 years ago

tslpre commented 3 years ago

Hello! I have built Hodlwatch on my machine but I am not able to connect to Coinbase Pro. I always receive the error "Error while trying to connect to exchange. Please check your credentials and try again."

I have created a fresh set of API as well to use with it.

Is there any other log that could help getting more information about where is this failing?

belaczek commented 3 years ago

Hi, I have just bumped up version of the dependency providing API connection. Can you please check again on the current master branch (or on the deployed app at https://hodl.watch) if it fixed your issue?

tslpre commented 3 years ago

Thank you for the quick update - unfortunately, after updating it, I do receive the same error message. Is there anything I can do to gather more information?

belaczek commented 3 years ago

This project uses https://github.com/ccxt/ccxt to handle API connections with exchanges. I suspect there could be some issue, but haven't seen anything relevant reported lately. Maybe try to check this comment about connecting to Coinbase Pro https://github.com/ccxt/ccxt/issues/7237#issuecomment-655132476. I don't have a Coinbase Pro account to test it myself. At least I have once again updated the dependency (they release new versions quite often) so you can give it one more try. 🤞

tslpre commented 3 years ago

Ok, I've updated again and as I couldn't see any difference (and yes, the credentials are correct, I've checked the link you shared on the ccxt project page). So I've thought to inspect the page in Firefox and I've noticed the following two errors:

  1. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.pro.coinbase.com/accounts. (Reason: header ‘cb-access-key’ is not allowed according to header ‘Access-Control-Allow-Headers’ from CORS preflight response)

  2. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://api.pro.coinbase.com/accounts. (Reason: CORS request did not succeed).

Would this mean that I need a CORS server? Or maybe just wait for #22 to be completed?

belaczek commented 3 years ago

I case of CORS errors, you should either use the default proxy server deployment https://hodlwatch-proxy.herokuapp.com/ or run it locally using this project https://github.com/Rob--W/cors-anywhere

tslpre commented 3 years ago

Ok - that was it indeed. I installed the cors-anywhere server and it worked right away... Thank you for the support, at least the dependencies are more updated now :)