mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 11:29:23 +00:00
app config swap field defaults
This commit is contained in:
parent
e0d2c8ec74
commit
44fbab715a
5 changed files with 11 additions and 2 deletions
|
@ -27,6 +27,8 @@ abstract class AppConfig {
|
|||
|
||||
static List<CryptoCurrency> get coins => _supportedCoins;
|
||||
|
||||
static ({String from, String to}) get swapDefaults => _swapDefaults;
|
||||
|
||||
static bool get isSingleCoinApp => coins.length == 1;
|
||||
|
||||
static CryptoCurrency? getCryptoCurrencyFor(String coinIdentifier) {
|
||||
|
|
|
@ -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,
|
||||
),
|
||||
|
|
|
@ -62,4 +62,6 @@ final List<CryptoCurrency> _supportedCoins = List.unmodifiable([
|
|||
Firo(CryptoCurrencyNetwork.main),
|
||||
]);
|
||||
|
||||
final ({String from, String to}) _swapDefaults = (from: "BTC", to: "FIRO");
|
||||
|
||||
EOF
|
|
@ -64,4 +64,6 @@ final List<CryptoCurrency> _supportedCoins = List.unmodifiable([
|
|||
BitcoinFrost(CryptoCurrencyNetwork.test4),
|
||||
]);
|
||||
|
||||
final ({String from, String to}) _swapDefaults = (from: "BTC", to: "XMR");
|
||||
|
||||
EOF
|
|
@ -85,4 +85,6 @@ final List<CryptoCurrency> _supportedCoins = List.unmodifiable([
|
|||
Stellar(CryptoCurrencyNetwork.test),
|
||||
]);
|
||||
|
||||
final ({String from, String to}) _swapDefaults = (from: "BTC", to: "XMR");
|
||||
|
||||
EOF
|
Loading…
Reference in a new issue