This commit is contained in:
Thomas Zarebczan 2019-03-22 00:43:59 -04:00
parent 1684dbf7cc
commit 46eeb9c767
4 changed files with 13 additions and 9 deletions

View file

@ -287,6 +287,10 @@ class Coinsecure(ExchangeBase):
json = await self.get_json('api.coinsecure.in', '/v0/noauth/newticker')
return {'INR': Decimal(json['lastprice'] / 100.0 )}
class CoinMarketCap(ExchangeBase):
async def get_rates(self, ccy):
json = await self.get_json('api.coinmarketcap.com', '/v2/ticker/1298/?convert=BTC')
return {'LBC': Decimal(json['quotes']['USD']['price'])}
class Foxbit(ExchangeBase):
@ -514,10 +518,10 @@ class FxThread(ThreadJob):
def get_currency(self):
'''Use when dynamic fetching is needed'''
return self.config.get("currency", "EUR")
return self.config.get("currency", "USD")
def config_exchange(self):
return self.config.get('use_exchange', 'BitcoinAverage')
return self.config.get('use_exchange', 'CoinMarketCap')
def show_history(self):
return self.is_enabled() and self.get_history_config() and self.ccy in self.exchange.history_ccys()

View file

@ -2729,7 +2729,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
)
fee_type_label = HelpLabel(_('Fee estimation') + ':', msg)
fee_type_combo = QComboBox()
fee_type_combo.addItems([_('Static'), _('ETA'), _('Mempool')])
fee_type_combo.addItems([_('Static')])
fee_type_combo.setCurrentIndex((2 if self.config.use_mempool_fees() else 1) if self.config.is_dynfee() else 0)
def on_fee_type(x):
self.config.set_key('mempool_fees', x==2)
@ -2739,7 +2739,7 @@ class ElectrumWindow(QMainWindow, MessageBoxMixin, PrintError):
fee_widgets.append((fee_type_label, fee_type_combo))
feebox_cb = QCheckBox(_('Edit fees manually'))
feebox_cb.setChecked(self.config.get('show_fee', True))
feebox_cb.setChecked(self.config.get('show_fee', False))
feebox_cb.setToolTip(_("Show fee edit box in send tab."))
def on_feebox(x):
self.config.set_key('show_fee', x == Qt.Checked)

View file

@ -22,7 +22,7 @@ FEERATE_MAX_DYNAMIC = 1500000
FEERATE_WARNING_HIGH_FEE = 600000
FEERATE_FALLBACK_STATIC_FEE = 50000
FEERATE_DEFAULT_RELAY = 50000
FEERATE_STATIC_VALUES = [50000, 50000,]
FEERATE_STATIC_VALUES = [50000]
config = None

View file

@ -488,9 +488,9 @@ def user_dir():
elif os.name == 'posix':
return os.path.join(os.environ["HOME"], ".electrum")
elif "APPDATA" in os.environ:
return os.path.join(os.environ["APPDATA"], "Electrum")
return os.path.join(os.environ["APPDATA"], "Electrum-lbry")
elif "LOCALAPPDATA" in os.environ:
return os.path.join(os.environ["LOCALAPPDATA"], "Electrum")
return os.path.join(os.environ["LOCALAPPDATA"], "Electrum-lbry")
else:
#raise Exception("No home directory found in environment variables.")
return
@ -623,7 +623,7 @@ mainnet_block_explorers = {
'LBRY Explorer': ('https://explorer.lbry.io/',
{'tx': 'tx/', 'addr': 'address/'}),
}
testnet_block_explorers = {
'Blocktrail.com': ('https://www.blocktrail.com/tBTC/',
{'tx': 'tx/', 'addr': 'address/'}),
@ -647,7 +647,7 @@ def block_explorer_info():
def block_explorer(config: 'SimpleConfig') -> str:
from . import constants
default_ = 'Blockstream.info'
default_ = 'LBRY Explorer'
be_key = config.get('block_explorer', default_)
be = block_explorer_info().get(be_key)
return be_key if be is not None else default_