tMerge pull request #4007 from wakiyamap/add_jpy_exchange_rate - electrum - Electrum Bitcoin wallet
HTML git clone https://git.parazyd.org/electrum
DIR Log
DIR Files
DIR Refs
DIR Submodules
---
DIR commit 451ac0d2599e3192657fe36f5acfde35b8b66581
DIR parent 10057b18de218e7c6328324ccc09376f94441355
HTML Author: ThomasV <thomasv@electrum.org>
Date: Sun, 4 Mar 2018 09:31:45 +0100
Merge pull request #4007 from wakiyamap/add_jpy_exchange_rate
Add JPY exchange rate
Diffstat:
M lib/currencies.json | 14 +++++++++++---
M lib/exchange_rate.py | 19 +++++++++++++++++++
2 files changed, 30 insertions(+), 3 deletions(-)
---
DIR diff --git a/lib/currencies.json b/lib/currencies.json
t@@ -798,5 +798,14 @@
"RUB",
"USD"
],
- "itBit": []
-}
-\ No newline at end of file
+ "itBit": [],
+ "Bitbank": [
+ "JPY"
+ ],
+ "Bitflyer": [
+ "JPY"
+ ],
+ "Zaif": [
+ "JPY"
+ ]
+}
DIR diff --git a/lib/exchange_rate.py b/lib/exchange_rate.py
t@@ -159,6 +159,19 @@ class BitcoinVenezuela(ExchangeBase):
return self.get_json('api.bitcoinvenezuela.com',
"/historical/index.php?coin=BTC")[ccy +'_BTC']
+class Bitbank(ExchangeBase):
+
+ def get_rates(self, ccy):
+ json = self.get_json('public.bitbank.cc', '/btc_jpy/ticker')
+ return {'JPY': Decimal(json['data']['last'])}
+
+
+class BitFlyer(ExchangeBase):
+
+ def get_rates(self, ccy):
+ json = self.get_json('bitflyer.jp', '/api/echo/price')
+ return {'JPY': Decimal(json['mid'])}
+
class Bitmarket(ExchangeBase):
t@@ -350,6 +363,12 @@ class Winkdex(ExchangeBase):
for h in history])
+class Zaif(ExchangeBase):
+ def get_rates(self, ccy):
+ json = self.get_json('api.zaif.jp', '/api/1/last_price/btc_jpy')
+ return {'JPY': Decimal(json['last_price'])}
+
+
def dictinvert(d):
inv = {}
for k, vlist in d.items():