coinbase / coinbase-python

DEPRECATED — Coinbase Python API
Apache License 2.0
528 stars 217 forks source link

Get buy/sell price ignores the currency pair requested #63

Closed F1Rumors closed 6 years ago

F1Rumors commented 6 years ago

When asking for BTC-USD I am regularly seeing EUR prices come up - though it does at least also report that the currency is EUR when that happens: >>> client.get_buy_price(currency_pair='BTC-USD') { "amount": "13471.88", "base": "BTC", "currency": "EUR" } I presume it is actually reporting the most recent BTC price without considering the underlying currency that was traded against it.

Resolution:

jrhee17 commented 6 years ago

This seems to work in the master branch

Hopefully you guys can publish a new version based on the current master

thepieuvre commented 6 years ago

Same bug with version 2.0.6. I found a workaround:

   from coinbase.wallet.model import APIObject
   ...
   currency_pair = 'ETH-EUR'
   params = {'currency_pair': currency_pair}
   response = client._get('v2', 'prices', currency_pair, 'buy', data=params)
   price = client._make_api_object(response, APIObject)
sds commented 6 years ago

Hey @F1Rumors, can you confirm if this is reproducible in version 2.0.7 and open a new issue if that's the case? Thanks!