kennethreitz / coinbin.org

₿ A Human–Friendly API Service for Crypto Currency Information.
https://coinbin.org/
253 stars 33 forks source link

Fix get_exchange_value #1

Closed tspivey closed 7 years ago

tspivey commented 7 years ago

This pull request fixes two problems in get_exchange_value:

  1. value.currency was always USD. To fix this, coin2 is returned as the value of value.currency.
  2. An extra API request was made, because Coin.value was called twice. Now coin2's value is stored in a variable to avoid this.

Testing performed:

Possible problems: The CoinMarketCap API seems to be case insensitive. If I call this from curl and write XMR instead of xmr, I'll get XMR back. If this is something to worry about normalizing, the API returns a symbol for coins. I can modify Coin.get_value to take a Coin and use the provided symbol if that would work better.

kennethreitz commented 7 years ago

✨🍰✨

kennethreitz commented 7 years ago

going to merge this manually, since github was out of date, sorry.