Browse Source

Add BitStamp to exchange rate options.

283
Tim Bellefleur 9 years ago
parent
commit
ad198c372b
  1. 5
      plugins/exchange_rate.py

5
plugins/exchange_rate.py

@ -130,6 +130,11 @@ class BitPay(ExchangeBase):
json = self.get_json('bitpay.com', '/api/rates') json = self.get_json('bitpay.com', '/api/rates')
return dict([(r['code'], Decimal(r['rate'])) for r in json]) 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): class BlockchainInfo(ExchangeBase):
def get_rates(self, ccy): def get_rates(self, ccy):
json = self.get_json('blockchain.info', '/ticker') json = self.get_json('blockchain.info', '/ticker')

Loading…
Cancel
Save