From 1c02ced131c2f0cad9aeb5e49f72c2d128912734 Mon Sep 17 00:00:00 2001 From: Alexx Saver Date: Mon, 5 Jun 2017 12:25:21 +0400 Subject: [PATCH] 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. --- lib/exchange_rate.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py index c9c750d85..4fdf84d64 100644 --- 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',