add Kraken exchange to exchange_rate plugin

This commit is contained in:
Fabian Hirschmann 2016-01-13 01:03:30 +01:00
parent f7b39f4952
commit 23312cbcd1
1 changed files with 9 additions and 0 deletions

View File

@ -229,6 +229,15 @@ class itBit(ExchangeBase):
result[ccy] = Decimal(json['lastPrice'])
return result
class Kraken(ExchangeBase):
def get_rates(self, ccy):
ccys = ['EUR', 'USD', 'CAD', 'GBP', 'JPY']
pairs = ['XBT%s' % c for c in ccys]
json = self.get_json('api.kraken.com',
'/0/public/Ticker?pair=%s' % ','.join(pairs))
return dict((k[-3:], Decimal(float(v['c'][0])))
for k, v in json['result'].items())
class LocalBitcoins(ExchangeBase):
def get_rates(self, ccy):
json = self.get_json('localbitcoins.com',