add Kraken exchange to exchange_rate plugin
This commit is contained in:
parent
f7b39f4952
commit
23312cbcd1
|
@ -229,6 +229,15 @@ class itBit(ExchangeBase):
|
||||||
result[ccy] = Decimal(json['lastPrice'])
|
result[ccy] = Decimal(json['lastPrice'])
|
||||||
return result
|
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):
|
class LocalBitcoins(ExchangeBase):
|
||||||
def get_rates(self, ccy):
|
def get_rates(self, ccy):
|
||||||
json = self.get_json('localbitcoins.com',
|
json = self.get_json('localbitcoins.com',
|
||||||
|
|
Loading…
Reference in New Issue