diff --git a/lib/app_config.dart b/lib/app_config.dart index 5f9a95829..62ce560c3 100644 --- a/lib/app_config.dart +++ b/lib/app_config.dart @@ -27,6 +27,8 @@ abstract class AppConfig { static List get coins => _supportedCoins; + static ({String from, String to}) get swapDefaults => _swapDefaults; + static bool get isSingleCoinApp => coins.length == 1; static CryptoCurrency? getCryptoCurrencyFor(String coinIdentifier) { diff --git a/lib/services/exchange/exchange_data_loading_service.dart b/lib/services/exchange/exchange_data_loading_service.dart index cfb01e150..811949d6e 100644 --- a/lib/services/exchange/exchange_data_loading_service.dart +++ b/lib/services/exchange/exchange_data_loading_service.dart @@ -12,6 +12,7 @@ import 'package:flutter/foundation.dart'; import 'package:isar/isar.dart'; import 'package:tuple/tuple.dart'; +import '../../app_config.dart'; import '../../db/hive/db.dart'; import '../../models/exchange/active_pair.dart'; import '../../models/exchange/aggregate_currency.dart'; @@ -79,7 +80,7 @@ class ExchangeDataLoadingService { if (await isar.currencies.count() > 0) { pair?.setSend( await getAggregateCurrency( - "BTC", + AppConfig.swapDefaults.from, rateType, null, ), @@ -88,7 +89,7 @@ class ExchangeDataLoadingService { pair?.setReceive( await getAggregateCurrency( - "XMR", + AppConfig.swapDefaults.to, rateType, null, ), diff --git a/scripts/app_config/configure_campfire.sh b/scripts/app_config/configure_campfire.sh index 2b92a9911..883d67fa0 100755 --- a/scripts/app_config/configure_campfire.sh +++ b/scripts/app_config/configure_campfire.sh @@ -62,4 +62,6 @@ final List _supportedCoins = List.unmodifiable([ Firo(CryptoCurrencyNetwork.main), ]); +final ({String from, String to}) _swapDefaults = (from: "BTC", to: "FIRO"); + EOF \ No newline at end of file diff --git a/scripts/app_config/configure_stack_duo.sh b/scripts/app_config/configure_stack_duo.sh index 143faf644..7d1a7665a 100755 --- a/scripts/app_config/configure_stack_duo.sh +++ b/scripts/app_config/configure_stack_duo.sh @@ -64,4 +64,6 @@ final List _supportedCoins = List.unmodifiable([ BitcoinFrost(CryptoCurrencyNetwork.test4), ]); +final ({String from, String to}) _swapDefaults = (from: "BTC", to: "XMR"); + EOF \ No newline at end of file diff --git a/scripts/app_config/configure_stack_wallet.sh b/scripts/app_config/configure_stack_wallet.sh index 6f4a87981..0fd8e5e8a 100755 --- a/scripts/app_config/configure_stack_wallet.sh +++ b/scripts/app_config/configure_stack_wallet.sh @@ -85,4 +85,6 @@ final List _supportedCoins = List.unmodifiable([ Stellar(CryptoCurrencyNetwork.test), ]); +final ({String from, String to}) _swapDefaults = (from: "BTC", to: "XMR"); + EOF \ No newline at end of file