mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 20:09:23 +00:00
commit
66fe3f1fdb
20 changed files with 163 additions and 137 deletions
|
@ -451,7 +451,7 @@
|
|||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 75;
|
||||
CURRENT_PROJECT_VERSION = 78;
|
||||
DEVELOPMENT_TEAM = 4DQKUWSG6C;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
@ -505,7 +505,7 @@
|
|||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
|
||||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.5;
|
||||
MARKETING_VERSION = 1.5.8;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -635,7 +635,7 @@
|
|||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 75;
|
||||
CURRENT_PROJECT_VERSION = 78;
|
||||
DEVELOPMENT_TEAM = 4DQKUWSG6C;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
@ -689,7 +689,7 @@
|
|||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
|
||||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.5;
|
||||
MARKETING_VERSION = 1.5.8;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
@ -711,7 +711,7 @@
|
|||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = 75;
|
||||
CURRENT_PROJECT_VERSION = 78;
|
||||
DEVELOPMENT_TEAM = 4DQKUWSG6C;
|
||||
ENABLE_BITCODE = NO;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
|
@ -765,7 +765,7 @@
|
|||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
|
||||
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
|
||||
);
|
||||
MARKETING_VERSION = 1.5.5;
|
||||
MARKETING_VERSION = 1.5.8;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
|
|
|
@ -207,6 +207,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
|||
didLoad = true;
|
||||
|
||||
await DB.instance.init();
|
||||
await _prefs.init();
|
||||
|
||||
_notificationsService = ref.read(notificationsProvider);
|
||||
_nodeService = ref.read(nodeServiceChangeNotifierProvider);
|
||||
|
@ -223,7 +224,6 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
|||
tradesService: _tradesService,
|
||||
prefs: _prefs,
|
||||
);
|
||||
await _prefs.init();
|
||||
ref.read(priceAnd24hChangeNotifierProvider).start(true);
|
||||
await _wallets.load(_prefs);
|
||||
loadingCompleter.complete();
|
||||
|
|
|
@ -5,6 +5,7 @@ import 'package:flutter_svg/svg.dart';
|
|||
import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
|
||||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange_response.dart';
|
||||
import 'package:stackwallet/services/exchange/simpleswap/simpleswap_exchange.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
|
@ -46,6 +47,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ChangeNowExchange.exchangeName) {
|
||||
ref.read(currentExchangeNameStateProvider.state).state =
|
||||
ChangeNowExchange.exchangeName;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(
|
||||
ref.read(currentExchangeNameStateProvider.state).state);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -69,6 +73,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state = value;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
@ -214,6 +222,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
SimpleSwapExchange.exchangeName) {
|
||||
ref.read(currentExchangeNameStateProvider.state).state =
|
||||
SimpleSwapExchange.exchangeName;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(
|
||||
ref.read(currentExchangeNameStateProvider.state).state);
|
||||
}
|
||||
},
|
||||
child: Container(
|
||||
|
@ -237,6 +248,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
|
|||
ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state = value;
|
||||
ref.read(exchangeFormStateProvider).exchange =
|
||||
Exchange.fromName(ref
|
||||
.read(currentExchangeNameStateProvider.state)
|
||||
.state);
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
|
@ -79,23 +79,25 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
|
|||
transactionIfSentFromStack = widget.transactionIfSentFromStack;
|
||||
walletId = widget.walletId;
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
final trade = ref
|
||||
.read(tradesServiceProvider)
|
||||
.trades
|
||||
.firstWhere((e) => e.tradeId == tradeId);
|
||||
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
|
||||
final trade = ref
|
||||
.read(tradesServiceProvider)
|
||||
.trades
|
||||
.firstWhere((e) => e.tradeId == tradeId);
|
||||
|
||||
if (mounted) {
|
||||
final exchange = Exchange.fromName(trade.exchangeName);
|
||||
final response = await exchange.updateTrade(trade);
|
||||
if (mounted) {
|
||||
final exchange = Exchange.fromName(trade.exchangeName);
|
||||
final response = await exchange.updateTrade(trade);
|
||||
|
||||
if (mounted && response.value != null) {
|
||||
await ref
|
||||
.read(tradesServiceProvider)
|
||||
.edit(trade: response.value!, shouldNotifyListeners: true);
|
||||
if (mounted && response.value != null) {
|
||||
await ref
|
||||
.read(tradesServiceProvider)
|
||||
.edit(trade: response.value!, shouldNotifyListeners: true);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
super.initState();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,13 +11,13 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/global_set
|
|||
import 'package:stackwallet/pages/settings_views/global_settings_view/hidden_settings.dart';
|
||||
import 'package:stackwallet/pages/wallets_view/wallets_view.dart';
|
||||
import 'package:stackwallet/providers/global/notifications_provider.dart';
|
||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||
import 'package:stackwallet/providers/ui/home_view_index_provider.dart';
|
||||
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
|
||||
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
|
||||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/constants.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -83,9 +83,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
|
|||
|
||||
void _loadCNData() {
|
||||
// unawaited future
|
||||
//
|
||||
final externalCalls = Prefs.instance.externalCalls;
|
||||
if (externalCalls) {
|
||||
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||
_exchangeDataLoadingService.loadAll(ref);
|
||||
} else {
|
||||
Logging.instance.log("User does not want to use external calls",
|
||||
|
@ -289,7 +287,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
|
|||
(previous, next) {
|
||||
if (next is int) {
|
||||
if (next == 1) {
|
||||
_loadCNData();
|
||||
_exchangeDataLoadingService.loadAll(ref);
|
||||
}
|
||||
if (next >= 0 && next <= 1) {
|
||||
_pageController.animateToPage(
|
||||
|
|
|
@ -101,10 +101,10 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
|
|||
ref.read(homeViewPageIndexStateProvider.state).state = 1;
|
||||
}
|
||||
// DateTime now = DateTime.now();
|
||||
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||
print("loading?");
|
||||
await ExchangeDataLoadingService().loadAll(ref);
|
||||
}
|
||||
// if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||
// print("loading?");
|
||||
await ExchangeDataLoadingService().loadAll(ref);
|
||||
// }
|
||||
// if (now.difference(_lastRefreshed) > _refreshInterval) {
|
||||
// await ExchangeDataLoadingService().loadAll(ref);
|
||||
// }
|
||||
|
|
|
@ -70,6 +70,8 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
|
|||
builder: (_, ref, __) {
|
||||
final Coin coin =
|
||||
ref.watch(managerProvider.select((value) => value.coin));
|
||||
final externalCalls = ref.watch(prefsChangeNotifierProvider
|
||||
.select((value) => value.externalCalls));
|
||||
|
||||
Future<Decimal>? totalBalanceFuture;
|
||||
Future<Decimal>? availableBalanceFuture;
|
||||
|
@ -176,18 +178,19 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
|
|||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
value: priceTuple.item1 * balanceToShow,
|
||||
locale: locale,
|
||||
decimalPlaces: 2,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
if (externalCalls)
|
||||
Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
value: priceTuple.item1 * balanceToShow,
|
||||
locale: locale,
|
||||
decimalPlaces: 2,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.subtitle500(context).copyWith(
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
|
|
|
@ -255,17 +255,19 @@ class _TransactionDetailsViewState
|
|||
const SizedBox(
|
||||
height: 2,
|
||||
),
|
||||
SelectableText(
|
||||
"${Format.localizedStringAsFixed(value: (coin == Coin.monero ? (amount / 10000.toDecimal()).toDecimal() : coin == Coin.wownero ? (amount / 1000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider
|
||||
.select((value) => value.locale),
|
||||
), decimalPlaces: 2)} ${ref.watch(
|
||||
prefsChangeNotifierProvider.select(
|
||||
(value) => value.currency,
|
||||
),
|
||||
)}",
|
||||
style: STextStyles.itemSubtitle(context),
|
||||
),
|
||||
if (ref.watch(prefsChangeNotifierProvider
|
||||
.select((value) => value.externalCalls)))
|
||||
SelectableText(
|
||||
"${Format.localizedStringAsFixed(value: (coin == Coin.monero ? (amount / 10000.toDecimal()).toDecimal() : coin == Coin.wownero ? (amount / 1000.toDecimal()).toDecimal() : amount) * ref.watch(priceAnd24hChangeNotifierProvider.select((value) => value.getPrice(coin).item1)), locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider
|
||||
.select((value) => value.locale),
|
||||
), decimalPlaces: 2)} ${ref.watch(
|
||||
prefsChangeNotifierProvider.select(
|
||||
(value) => value.currency,
|
||||
),
|
||||
)}",
|
||||
style: STextStyles.itemSubtitle(context),
|
||||
),
|
||||
],
|
||||
),
|
||||
TxIcon(
|
||||
|
|
|
@ -37,6 +37,7 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
|
|||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
|
||||
import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -45,12 +46,6 @@ import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
|||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import 'package:stackwallet/hive/db.dart';
|
||||
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
|
||||
/// [eventBus] should only be set during testing
|
||||
class WalletView extends ConsumerStatefulWidget {
|
||||
const WalletView({
|
||||
|
@ -235,12 +230,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
}
|
||||
|
||||
void _onExchangePressed(BuildContext context) async {
|
||||
final _cnLoadingService = ExchangeDataLoadingService();
|
||||
final externalCalls = Prefs.instance.externalCalls;
|
||||
if (!externalCalls) {
|
||||
print("loading?");
|
||||
unawaited(_cnLoadingService.loadAll(ref));
|
||||
}
|
||||
unawaited(_cnLoadingService.loadAll(ref));
|
||||
|
||||
final coin = ref.read(managerProvider).coin;
|
||||
|
||||
if (coin == Coin.epicCash) {
|
||||
|
@ -371,9 +362,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
|
||||
void _loadCNData() {
|
||||
// unawaited future
|
||||
final externalCalls = DB.instance
|
||||
.get<dynamic>(boxName: DB.boxNamePrefs, key: "externalCalls") as bool?;
|
||||
if (externalCalls ?? false) {
|
||||
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
|
||||
_cnLoadingService.loadAll(ref, coin: ref.read(managerProvider).coin);
|
||||
} else {
|
||||
Logging.instance.log("User does not want to use external calls",
|
||||
|
|
|
@ -49,6 +49,8 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final coin = ref.watch(managerProvider.select((value) => value.coin));
|
||||
final externalCalls = ref.watch(
|
||||
prefsChangeNotifierProvider.select((value) => value.externalCalls));
|
||||
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
|
@ -70,7 +72,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
width: widget.width,
|
||||
height: widget.height,
|
||||
decoration: BoxDecoration(
|
||||
color: Theme.of(context).extension<StackColors>()!.colorForCoin(coin),
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.colorForCoin(coin),
|
||||
borderRadius: BorderRadius.circular(
|
||||
Constants.size.circularBorderRadius,
|
||||
),
|
||||
|
@ -138,7 +142,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
ref.watch(managerProvider
|
||||
.select((value) => value.walletName)),
|
||||
style: STextStyles.itemSubtitle12(context).copyWith(
|
||||
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
overflow: TextOverflow.fade,
|
||||
),
|
||||
|
@ -159,14 +165,16 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
snapshot.hasData) {
|
||||
if (snapshot.data != null) {
|
||||
_cachedBalance = snapshot.data!;
|
||||
_cachedFiatValue = _cachedBalance *
|
||||
ref
|
||||
.watch(
|
||||
priceAnd24hChangeNotifierProvider.select(
|
||||
(value) => value.getPrice(coin),
|
||||
),
|
||||
)
|
||||
.item1;
|
||||
if (externalCalls) {
|
||||
_cachedFiatValue = _cachedBalance *
|
||||
ref
|
||||
.watch(
|
||||
priceAnd24hChangeNotifierProvider.select(
|
||||
(value) => value.getPrice(coin),
|
||||
),
|
||||
)
|
||||
.item1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return Column(
|
||||
|
@ -185,30 +193,36 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
|
|||
)} ${coin.ticker}",
|
||||
style: STextStyles.titleBold12(context).copyWith(
|
||||
fontSize: 16,
|
||||
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
decimalPlaces: 2,
|
||||
value: _cachedFiatValue,
|
||||
locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider
|
||||
.select((value) => value.locale),
|
||||
),
|
||||
)} ${ref.watch(
|
||||
prefsChangeNotifierProvider
|
||||
.select((value) => value.currency),
|
||||
)}",
|
||||
style: STextStyles.itemSubtitle12(context).copyWith(
|
||||
fontSize: 10,
|
||||
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard,
|
||||
if (externalCalls)
|
||||
const SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
if (externalCalls)
|
||||
Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
decimalPlaces: 2,
|
||||
value: _cachedFiatValue,
|
||||
locale: ref.watch(
|
||||
localeServiceChangeNotifierProvider
|
||||
.select((value) => value.locale),
|
||||
),
|
||||
)} ${ref.watch(
|
||||
prefsChangeNotifierProvider
|
||||
.select((value) => value.currency),
|
||||
)}",
|
||||
style: STextStyles.itemSubtitle12(context).copyWith(
|
||||
fontSize: 10,
|
||||
color: Theme.of(context)
|
||||
.extension<StackColors>()!
|
||||
.textFavoriteCard,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
|
|
|
@ -254,7 +254,7 @@ Future<Map<String, dynamic>> isolateRestore(
|
|||
}
|
||||
|
||||
final root = getBip32Root(mnemonic, network);
|
||||
while (currentIndex < lastFoundIndex + 20) {
|
||||
while (currentIndex < lastFoundIndex + 50) {
|
||||
final mintKeyPair = getBip32NodeFromRoot(MINT_INDEX, currentIndex, root);
|
||||
final mintTag = CreateTag(
|
||||
Format.uint8listToString(mintKeyPair.privateKey!),
|
||||
|
@ -1356,7 +1356,7 @@ class FiroWallet extends CoinServiceAPI {
|
|||
List<UtxoObject> utxoObjectsToUse = [];
|
||||
|
||||
for (var i = 0;
|
||||
satoshisBeingUsed < satoshiAmountToSend && i < spendableOutputs.length;
|
||||
satoshisBeingUsed <= satoshiAmountToSend && i < spendableOutputs.length;
|
||||
i++) {
|
||||
utxoObjectsToUse.add(spendableOutputs[i]);
|
||||
satoshisBeingUsed += spendableOutputs[i].value;
|
||||
|
|
|
@ -84,7 +84,9 @@ class NotificationsService extends ChangeNotifier {
|
|||
_timer = Timer.periodic(notificationRefreshInterval, (_) {
|
||||
Logging.instance
|
||||
.log("Periodic notifications update check", level: LogLevel.Info);
|
||||
_checkTrades();
|
||||
if (prefs.externalCalls) {
|
||||
_checkTrades();
|
||||
}
|
||||
_checkTransactions();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -7,9 +7,8 @@ import 'package:http/http.dart';
|
|||
import 'package:stackwallet/hive/db.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
class PriceAPI {
|
||||
static const refreshInterval = 60;
|
||||
|
|
|
@ -19,9 +19,7 @@ class PriceService extends ChangeNotifier {
|
|||
|
||||
Tuple2<Decimal, double> getPrice(Coin coin) => _cachedPrices[coin]!;
|
||||
|
||||
PriceService(this.baseTicker) {
|
||||
start(true);
|
||||
}
|
||||
PriceService(this.baseTicker);
|
||||
|
||||
Future<void> updatePrice() async {
|
||||
final priceMap =
|
||||
|
|
|
@ -159,8 +159,8 @@ abstract class DefaultNodes {
|
|||
);
|
||||
|
||||
static NodeModel get bitcoincashTestnet => NodeModel(
|
||||
host: "testnet.hsmiths.com",
|
||||
port: 53012,
|
||||
host: "bitcoincash-testnet.stackwallet.com",
|
||||
port: 60002,
|
||||
name: defaultName,
|
||||
id: _nodeId(Coin.bitcoincashTestnet),
|
||||
useSSL: true,
|
||||
|
|
|
@ -569,6 +569,6 @@ class Prefs extends ChangeNotifier {
|
|||
Future<bool> _getHasExternalCalls() async {
|
||||
return await DB.instance.get<dynamic>(
|
||||
boxName: DB.boxNamePrefs, key: "externalCalls") as bool? ??
|
||||
false;
|
||||
true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -202,35 +202,39 @@ class _TransactionCardState extends ConsumerState<TransactionCard> {
|
|||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Builder(
|
||||
builder: (_) {
|
||||
// TODO: modify Format.<functions> to take optional Coin parameter so this type oif check isn't done in ui
|
||||
int value = _transaction.amount;
|
||||
if (coin == Coin.monero) {
|
||||
value = (value ~/ 10000);
|
||||
} else if (coin == Coin.wownero) {
|
||||
value = (value ~/ 1000);
|
||||
}
|
||||
if (ref.watch(prefsChangeNotifierProvider
|
||||
.select((value) => value.externalCalls)))
|
||||
const SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
if (ref.watch(prefsChangeNotifierProvider
|
||||
.select((value) => value.externalCalls)))
|
||||
Flexible(
|
||||
child: FittedBox(
|
||||
fit: BoxFit.scaleDown,
|
||||
child: Builder(
|
||||
builder: (_) {
|
||||
// TODO: modify Format.<functions> to take optional Coin parameter so this type oif check isn't done in ui
|
||||
int value = _transaction.amount;
|
||||
if (coin == Coin.monero) {
|
||||
value = (value ~/ 10000);
|
||||
} else if (coin == Coin.wownero) {
|
||||
value = (value ~/ 1000);
|
||||
}
|
||||
|
||||
return Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
value: Format.satoshisToAmount(value) *
|
||||
price,
|
||||
locale: locale,
|
||||
decimalPlaces: 2,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.label(context),
|
||||
);
|
||||
},
|
||||
return Text(
|
||||
"${Format.localizedStringAsFixed(
|
||||
value: Format.satoshisToAmount(value) *
|
||||
price,
|
||||
locale: locale,
|
||||
decimalPlaces: 2,
|
||||
)} $baseCurrency",
|
||||
style: STextStyles.label(context),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
|
|
|
@ -11,7 +11,7 @@ description: Stack Wallet
|
|||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
version: 1.5.7+77
|
||||
version: 1.5.8+78
|
||||
|
||||
environment:
|
||||
sdk: ">=2.17.0 <3.0.0"
|
||||
|
|
2
scripts/prebuild.sh
Normal file → Executable file
2
scripts/prebuild.sh
Normal file → Executable file
|
@ -2,5 +2,5 @@
|
|||
KEYS=../lib/external_api_keys.dart
|
||||
if ! test -f "$KEYS"; then
|
||||
echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
|
||||
echo 'const kChangeNowApiKey = "";' > $KEYS
|
||||
printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
|
||||
fi
|
||||
|
|
|
@ -29,7 +29,7 @@ git submodule update --init --recursive
|
|||
KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart"
|
||||
if ! test -f "$KEYS"; then
|
||||
echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
|
||||
echo 'const kChangeNowApiKey = "";' > $KEYS
|
||||
printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
|
||||
fi
|
||||
|
||||
#install stack wallet dependencies
|
||||
|
|
Loading…
Reference in a new issue