commit 1c02ced131c2f0cad9aeb5e49f72c2d128912734
parent 1347004e63472c897fc137b5cdc7db3b7e1cbc7b
Author: Alexx Saver <lzsaver@users.noreply.github.com>
Date: Mon, 5 Jun 2017 12:25:21 +0400
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.
Diffstat:
1 file changed, 9 insertions(+), 0 deletions(-)
diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py
@@ -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',