diff --git a/basicswap/basicswap.py b/basicswap/basicswap.py index 3b1da83..962203b 100644 --- a/basicswap/basicswap.py +++ b/basicswap/basicswap.py @@ -36,7 +36,7 @@ from .interface.part import PARTInterface, PARTInterfaceAnon, PARTInterfaceBlind from . import __version__ from .rpc import escape_rpcauth from .rpc_xmr import make_xmr_rpc2_func -from .ui.util import getCoinName +from .ui.util import getCoinName, known_chart_coins from .util import ( AutomationConstraint, LockedCoinError, @@ -6484,6 +6484,25 @@ class BasicSwap(BaseApp): settings_copy.pop('coingecko_api_key') settings_changed = True + if 'enabled_chart_coins' in data: + new_value = data['enabled_chart_coins'].strip() + ensure(isinstance(new_value, str), 'New enabled_chart_coins value not a string') + if new_value.lower() == 'all' or new_value == '': + pass + else: + tickers = new_value.split(',') + seen_tickers = [] + for ticker in tickers: + upcased_ticker = ticker.strip().upper() + if upcased_ticker not in known_chart_coins: + raise ValueError(f'Unknown coin: {ticker}') + if upcased_ticker in seen_tickers: + raise ValueError(f'Duplicate coin: {ticker}') + seen_tickers.append(upcased_ticker) + if settings_copy.get('enabled_chart_coins', '') != new_value: + settings_copy['enabled_chart_coins'] = new_value + settings_changed = True + if settings_changed: settings_path = os.path.join(self.data_dir, cfg.CONFIG_FILENAME) settings_path_new = settings_path + '.new' diff --git a/basicswap/templates/header.html b/basicswap/templates/header.html index 81e9861..484a0b6 100644 --- a/basicswap/templates/header.html +++ b/basicswap/templates/header.html @@ -1,6 +1,5 @@ -{% from 'style.html' import notifications_network_offer_svg, notifications_bid_accepted_svg, notifications_unknow_event_svg, notifications_new_bid_on_offer_svg, notifications_close_svg, swap_in_progress_mobile_svg, wallet_svg, page_back_svg, order_book_svg, new_offer_svg, settings_svg, asettings_svg, cog_svg, rpc_svg, debug_svg, explorer_svg, tor_svg, smsg_svg, outputs_svg, automation_svg, shutdown_svg, notifications_svg, debug_nerd_svg, wallet_locked_svg, mobile_menu_svg, wallet_unlocked_svg, tor_purple_svg, sun_svg, moon_svg, swap_in_progress_svg, swap_in_progress_green_svg, available_bids_svg, your_offers_svg, bids_received_svg, bids_sent_svg, header_arrow_down_svg, love_svg %} - +{% from 'style.html' import notifications_network_offer_svg, notifications_bid_accepted_svg, notifications_unknow_event_svg, notifications_new_bid_on_offer_svg, notifications_close_svg, swap_in_progress_mobile_svg, wallet_svg, page_back_svg, order_book_svg, new_offer_svg, settings_svg, asettings_svg, cog_svg, rpc_svg, debug_svg, explorer_svg, tor_svg, smsg_svg, outputs_svg, automation_svg, shutdown_svg, notifications_svg, debug_nerd_svg, wallet_locked_svg, mobile_menu_svg, wallet_unlocked_svg, tor_purple_svg, sun_svg, moon_svg, swap_in_progress_svg, swap_in_progress_green_svg, available_bids_svg, your_offers_svg, bids_received_svg, bids_sent_svg, header_arrow_down_svg, love_svg %}
@@ -340,16 +339,16 @@
+ + Bitcoin (BTC) +
++ + +
+
+
- Bitcoin (BTC) + Monero (XMR)
+
- +
- - Monero (XMR) -
-- - -
-
@@ -160,7 +164,8 @@
@@ -226,11 +232,12 @@
+
PIVX (PIVX)
@@ -259,7 +266,8 @@