coinbase / coinbase-python

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

get_buy_price broken #40

Closed ghost closed 6 years ago

ghost commented 7 years ago
from coinbase.wallet.client import Client
client = Client(apikey, keysecret)
print(client.get_buy_price(currency_pay="BTC-EUR"))
print(client.get_buy_price(currency_pay="BTC-USD"))
print(client.get_buy_price(currency_pay="BTC-ETH"))

result is:

{
  "amount": "1374.55",
  "currency": "USD"
}
{
  "amount": "1374.55",
  "currency": "USD"
}
{
  "amount": "1374.55",
  "currency": "USD"
}

Regards, Carl Chenet

JohnLZeller commented 7 years ago

@chaica you've specified your currency_pair parameter as currency_pay. It'll default to currency_pair='BTC-USD' in this case. Your request should instead be: client.get_buy_price(currency_pair='BTC-EUR')

However, this still won't work as of version 2.0.6. But, a fix was in f9ed2249865c2012e3b86106dad5f8c6068366ed I'd expect this in the next release.

Note: bugfix mentioned here: https://github.com/coinbase/coinbase-python/issues/32

mattrasto commented 6 years ago

This default behavior of returning a USD/BTC or EUR/BTC rate is dangerous. Why is an error not returned instead?

Crupuk commented 6 years ago

Hi,

When the next release fixing this issue is planned ? Style no patch since 16/08/01

sds commented 6 years ago

2.0.7 was released January 26th 2018, and fixes this issue.