From ad198c372bb3c5eda748d59c5122dc98084aa902 Mon Sep 17 00:00:00 2001 From: Tim Bellefleur Date: Thu, 15 Oct 2015 13:10:15 -0700 Subject: [PATCH] Add BitStamp to exchange rate options. --- plugins/exchange_rate.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/exchange_rate.py b/plugins/exchange_rate.py index 25603c76..df1323f9 100644 --- a/plugins/exchange_rate.py +++ b/plugins/exchange_rate.py @@ -130,6 +130,11 @@ class BitPay(ExchangeBase): json = self.get_json('bitpay.com', '/api/rates') return dict([(r['code'], Decimal(r['rate'])) for r in json]) +class BitStamp(ExchangeBase): + def get_rates(self, ccy): + json = self.get_json('www.bitstamp.net', '/api/ticker/') + return {'USD': Decimal(json['last'])} + class BlockchainInfo(ExchangeBase): def get_rates(self, ccy): json = self.get_json('blockchain.info', '/ticker')