Added BTCe to exchange_rate.py

Notice: BTCe uses RUR for RUB, it is not compatible with ISO 4217, so we return it as RUB. Also we use an official mirror because btc-e.com is banned in Russia.
This commit is contained in:
Alexx Saver 2017-06-05 12:25:21 +04:00 committed by ThomasV
parent 1347004e63
commit 1c02ced131
1 changed files with 9 additions and 0 deletions

View File

@ -157,6 +157,15 @@ class BTCChina(ExchangeBase):
json = self.get_json('data.btcchina.com', '/data/ticker')
return {'CNY': Decimal(json['ticker']['last'])}
class BTCe(ExchangeBase):
def get_rates(self, ccy):
json_eur = self.get_json('btc-e.nz', '/api/3/ticker/btc_eur')
json_rub = self.get_json('btc-e.nz', '/api/3/ticker/btc_rur')
json_usd = self.get_json('btc-e.nz', '/api/3/ticker/btc_usd')
return {'EUR': Decimal(json_eur['btc_eur']['last']),
'RUB': Decimal(json_rub['btc_rur']['last']),
'USD': Decimal(json_usd['btc_usd']['last'])}
class Coinbase(ExchangeBase):
def get_rates(self, ccy):
json = self.get_json('coinbase.com',