Browse Source

Add Bit2C exchange (#8767)

* Add Bit2C exchange
* Remove whitespace

---------

Co-authored-by: sha-265 <sha@mempool.party>
master
sha-265 2 years ago committed by GitHub
parent
commit
92a08a5fe7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      electrum/currencies.json
  2. 17
      electrum/exchange_rate.py

3
electrum/currencies.json

@ -2,6 +2,9 @@
"BitFlyer": [
"JPY"
],
"Bit2C": [
"ILS"
],
"BitPay": [
"AED",
"AFN",

17
electrum/exchange_rate.py

@ -358,6 +358,23 @@ class CoinGecko(ExchangeBase):
for h in history['prices']])
class Bit2C(ExchangeBase):
async def get_rates(self, ccy):
json = await self.get_json('bit2c.co.il', '/Exchanges/BtcNis/Ticker.json')
return {'ILS': to_decimal(json['ll'])}
def history_ccys(self):
return CURRENCIES[self.name()]
async def request_history(self, ccy):
history = await self.get_json('bit2c.co.il',
'/Exchanges/BtcNis/KLines?resolution=1D&from=1357034400&to=%s' % int(time.time()))
return dict([(datetime.utcfromtimestamp(h[0]).strftime('%Y-%m-%d'), str(h[6]))
for h in history])
class CointraderMonitor(ExchangeBase):
async def get_rates(self, ccy):

Loading…
Cancel
Save