Merge pull request #161 from cypherstack/staging

Staging
This commit is contained in:
Marco Salazar 2022-10-18 15:32:36 -06:00 committed by GitHub
commit 66fe3f1fdb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 163 additions and 137 deletions

View file

@ -451,7 +451,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 75; CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = 4DQKUWSG6C; DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -505,7 +505,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
); );
MARKETING_VERSION = 1.5.5; MARKETING_VERSION = 1.5.8;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -635,7 +635,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 75; CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = 4DQKUWSG6C; DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -689,7 +689,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
); );
MARKETING_VERSION = 1.5.5; MARKETING_VERSION = 1.5.8;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
@ -711,7 +711,7 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 75; CURRENT_PROJECT_VERSION = 78;
DEVELOPMENT_TEAM = 4DQKUWSG6C; DEVELOPMENT_TEAM = 4DQKUWSG6C;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = ( FRAMEWORK_SEARCH_PATHS = (
@ -765,7 +765,7 @@
"$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**", "$(PROJECT_DIR)/../crypto_plugins/flutter_libmonero/cw_shared_external/ios/External/ios/**",
"$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs", "$(PROJECT_DIR)/../crypto_plugins/flutter_libepiccash/ios/libs",
); );
MARKETING_VERSION = 1.5.5; MARKETING_VERSION = 1.5.8;
ONLY_ACTIVE_ARCH = NO; ONLY_ACTIVE_ARCH = NO;
PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet; PRODUCT_BUNDLE_IDENTIFIER = com.cypherstack.stackwallet;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";

View file

@ -207,6 +207,7 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
didLoad = true; didLoad = true;
await DB.instance.init(); await DB.instance.init();
await _prefs.init();
_notificationsService = ref.read(notificationsProvider); _notificationsService = ref.read(notificationsProvider);
_nodeService = ref.read(nodeServiceChangeNotifierProvider); _nodeService = ref.read(nodeServiceChangeNotifierProvider);
@ -223,7 +224,6 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
tradesService: _tradesService, tradesService: _tradesService,
prefs: _prefs, prefs: _prefs,
); );
await _prefs.init();
ref.read(priceAnd24hChangeNotifierProvider).start(true); ref.read(priceAnd24hChangeNotifierProvider).start(true);
await _wallets.load(_prefs); await _wallets.load(_prefs);
loadingCompleter.complete(); loadingCompleter.complete();

View file

@ -5,6 +5,7 @@ import 'package:flutter_svg/svg.dart';
import 'package:stackwallet/models/exchange/response_objects/estimate.dart'; import 'package:stackwallet/models/exchange/response_objects/estimate.dart';
import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/providers.dart';
import 'package:stackwallet/services/exchange/change_now/change_now_exchange.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/exchange_response.dart';
import 'package:stackwallet/services/exchange/simpleswap/simpleswap_exchange.dart'; import 'package:stackwallet/services/exchange/simpleswap/simpleswap_exchange.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
@ -46,6 +47,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
ChangeNowExchange.exchangeName) { ChangeNowExchange.exchangeName) {
ref.read(currentExchangeNameStateProvider.state).state = ref.read(currentExchangeNameStateProvider.state).state =
ChangeNowExchange.exchangeName; ChangeNowExchange.exchangeName;
ref.read(exchangeFormStateProvider).exchange =
Exchange.fromName(
ref.read(currentExchangeNameStateProvider.state).state);
} }
}, },
child: Container( child: Container(
@ -69,6 +73,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
ref ref
.read(currentExchangeNameStateProvider.state) .read(currentExchangeNameStateProvider.state)
.state = value; .state = value;
ref.read(exchangeFormStateProvider).exchange =
Exchange.fromName(ref
.read(currentExchangeNameStateProvider.state)
.state);
} }
}, },
), ),
@ -214,6 +222,9 @@ class ExchangeProviderOptions extends ConsumerWidget {
SimpleSwapExchange.exchangeName) { SimpleSwapExchange.exchangeName) {
ref.read(currentExchangeNameStateProvider.state).state = ref.read(currentExchangeNameStateProvider.state).state =
SimpleSwapExchange.exchangeName; SimpleSwapExchange.exchangeName;
ref.read(exchangeFormStateProvider).exchange =
Exchange.fromName(
ref.read(currentExchangeNameStateProvider.state).state);
} }
}, },
child: Container( child: Container(
@ -237,6 +248,10 @@ class ExchangeProviderOptions extends ConsumerWidget {
ref ref
.read(currentExchangeNameStateProvider.state) .read(currentExchangeNameStateProvider.state)
.state = value; .state = value;
ref.read(exchangeFormStateProvider).exchange =
Exchange.fromName(ref
.read(currentExchangeNameStateProvider.state)
.state);
} }
}, },
), ),

View file

@ -79,6 +79,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
transactionIfSentFromStack = widget.transactionIfSentFromStack; transactionIfSentFromStack = widget.transactionIfSentFromStack;
walletId = widget.walletId; walletId = widget.walletId;
if (ref.read(prefsChangeNotifierProvider).externalCalls) {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) async { WidgetsBinding.instance.addPostFrameCallback((timeStamp) async {
final trade = ref final trade = ref
.read(tradesServiceProvider) .read(tradesServiceProvider)
@ -96,6 +97,7 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> {
} }
} }
}); });
}
super.initState(); super.initState();
} }

View file

@ -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/settings_views/global_settings_view/hidden_settings.dart';
import 'package:stackwallet/pages/wallets_view/wallets_view.dart'; import 'package:stackwallet/pages/wallets_view/wallets_view.dart';
import 'package:stackwallet/providers/global/notifications_provider.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/home_view_index_provider.dart';
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart'; import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart'; import 'package:stackwallet/services/exchange/exchange_data_loading_service.dart';
import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/assets.dart';
import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/constants.dart';
import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/logger.dart';
import 'package:stackwallet/utilities/prefs.dart';
import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
@ -83,9 +83,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
void _loadCNData() { void _loadCNData() {
// unawaited future // unawaited future
// if (ref.read(prefsChangeNotifierProvider).externalCalls) {
final externalCalls = Prefs.instance.externalCalls;
if (externalCalls) {
_exchangeDataLoadingService.loadAll(ref); _exchangeDataLoadingService.loadAll(ref);
} else { } else {
Logging.instance.log("User does not want to use external calls", Logging.instance.log("User does not want to use external calls",
@ -289,7 +287,7 @@ class _HomeViewState extends ConsumerState<HomeView> {
(previous, next) { (previous, next) {
if (next is int) { if (next is int) {
if (next == 1) { if (next == 1) {
_loadCNData(); _exchangeDataLoadingService.loadAll(ref);
} }
if (next >= 0 && next <= 1) { if (next >= 0 && next <= 1) {
_pageController.animateToPage( _pageController.animateToPage(

View file

@ -101,10 +101,10 @@ class _HomeViewButtonBarState extends ConsumerState<HomeViewButtonBar> {
ref.read(homeViewPageIndexStateProvider.state).state = 1; ref.read(homeViewPageIndexStateProvider.state).state = 1;
} }
// DateTime now = DateTime.now(); // DateTime now = DateTime.now();
if (ref.read(prefsChangeNotifierProvider).externalCalls) { // if (ref.read(prefsChangeNotifierProvider).externalCalls) {
print("loading?"); // print("loading?");
await ExchangeDataLoadingService().loadAll(ref); await ExchangeDataLoadingService().loadAll(ref);
} // }
// if (now.difference(_lastRefreshed) > _refreshInterval) { // if (now.difference(_lastRefreshed) > _refreshInterval) {
// await ExchangeDataLoadingService().loadAll(ref); // await ExchangeDataLoadingService().loadAll(ref);
// } // }

View file

@ -70,6 +70,8 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
builder: (_, ref, __) { builder: (_, ref, __) {
final Coin coin = final Coin coin =
ref.watch(managerProvider.select((value) => value.coin)); ref.watch(managerProvider.select((value) => value.coin));
final externalCalls = ref.watch(prefsChangeNotifierProvider
.select((value) => value.externalCalls));
Future<Decimal>? totalBalanceFuture; Future<Decimal>? totalBalanceFuture;
Future<Decimal>? availableBalanceFuture; Future<Decimal>? availableBalanceFuture;
@ -176,6 +178,7 @@ class _WalletSummaryInfoState extends State<WalletSummaryInfo> {
), ),
), ),
), ),
if (externalCalls)
Text( Text(
"${Format.localizedStringAsFixed( "${Format.localizedStringAsFixed(
value: priceTuple.item1 * balanceToShow, value: priceTuple.item1 * balanceToShow,

View file

@ -255,6 +255,8 @@ class _TransactionDetailsViewState
const SizedBox( const SizedBox(
height: 2, height: 2,
), ),
if (ref.watch(prefsChangeNotifierProvider
.select((value) => value.externalCalls)))
SelectableText( 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( "${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 localeServiceChangeNotifierProvider

View file

@ -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/coin_enum.dart';
import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart';
import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.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/text_styles.dart';
import 'package:stackwallet/utilities/theme/stack_colors.dart'; import 'package:stackwallet/utilities/theme/stack_colors.dart';
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.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:stackwallet/widgets/stack_dialog.dart';
import 'package:tuple/tuple.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 /// [eventBus] should only be set during testing
class WalletView extends ConsumerStatefulWidget { class WalletView extends ConsumerStatefulWidget {
const WalletView({ const WalletView({
@ -235,12 +230,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
} }
void _onExchangePressed(BuildContext context) async { 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; final coin = ref.read(managerProvider).coin;
if (coin == Coin.epicCash) { if (coin == Coin.epicCash) {
@ -371,9 +362,7 @@ class _WalletViewState extends ConsumerState<WalletView> {
void _loadCNData() { void _loadCNData() {
// unawaited future // unawaited future
final externalCalls = DB.instance if (ref.read(prefsChangeNotifierProvider).externalCalls) {
.get<dynamic>(boxName: DB.boxNamePrefs, key: "externalCalls") as bool?;
if (externalCalls ?? false) {
_cnLoadingService.loadAll(ref, coin: ref.read(managerProvider).coin); _cnLoadingService.loadAll(ref, coin: ref.read(managerProvider).coin);
} else { } else {
Logging.instance.log("User does not want to use external calls", Logging.instance.log("User does not want to use external calls",

View file

@ -49,6 +49,8 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final coin = ref.watch(managerProvider.select((value) => value.coin)); final coin = ref.watch(managerProvider.select((value) => value.coin));
final externalCalls = ref.watch(
prefsChangeNotifierProvider.select((value) => value.externalCalls));
return GestureDetector( return GestureDetector(
onTap: () { onTap: () {
@ -70,7 +72,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
width: widget.width, width: widget.width,
height: widget.height, height: widget.height,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).extension<StackColors>()!.colorForCoin(coin), color: Theme.of(context)
.extension<StackColors>()!
.colorForCoin(coin),
borderRadius: BorderRadius.circular( borderRadius: BorderRadius.circular(
Constants.size.circularBorderRadius, Constants.size.circularBorderRadius,
), ),
@ -138,7 +142,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
ref.watch(managerProvider ref.watch(managerProvider
.select((value) => value.walletName)), .select((value) => value.walletName)),
style: STextStyles.itemSubtitle12(context).copyWith( style: STextStyles.itemSubtitle12(context).copyWith(
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard, color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
), ),
overflow: TextOverflow.fade, overflow: TextOverflow.fade,
), ),
@ -159,6 +165,7 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
snapshot.hasData) { snapshot.hasData) {
if (snapshot.data != null) { if (snapshot.data != null) {
_cachedBalance = snapshot.data!; _cachedBalance = snapshot.data!;
if (externalCalls) {
_cachedFiatValue = _cachedBalance * _cachedFiatValue = _cachedBalance *
ref ref
.watch( .watch(
@ -169,6 +176,7 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
.item1; .item1;
} }
} }
}
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -185,13 +193,17 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
)} ${coin.ticker}", )} ${coin.ticker}",
style: STextStyles.titleBold12(context).copyWith( style: STextStyles.titleBold12(context).copyWith(
fontSize: 16, fontSize: 16,
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard, color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
), ),
), ),
), ),
if (externalCalls)
const SizedBox( const SizedBox(
height: 4, height: 4,
), ),
if (externalCalls)
Text( Text(
"${Format.localizedStringAsFixed( "${Format.localizedStringAsFixed(
decimalPlaces: 2, decimalPlaces: 2,
@ -206,7 +218,9 @@ class _FavoriteCardState extends ConsumerState<FavoriteCard> {
)}", )}",
style: STextStyles.itemSubtitle12(context).copyWith( style: STextStyles.itemSubtitle12(context).copyWith(
fontSize: 10, fontSize: 10,
color: Theme.of(context).extension<StackColors>()!.textFavoriteCard, color: Theme.of(context)
.extension<StackColors>()!
.textFavoriteCard,
), ),
), ),
], ],

View file

@ -254,7 +254,7 @@ Future<Map<String, dynamic>> isolateRestore(
} }
final root = getBip32Root(mnemonic, network); final root = getBip32Root(mnemonic, network);
while (currentIndex < lastFoundIndex + 20) { while (currentIndex < lastFoundIndex + 50) {
final mintKeyPair = getBip32NodeFromRoot(MINT_INDEX, currentIndex, root); final mintKeyPair = getBip32NodeFromRoot(MINT_INDEX, currentIndex, root);
final mintTag = CreateTag( final mintTag = CreateTag(
Format.uint8listToString(mintKeyPair.privateKey!), Format.uint8listToString(mintKeyPair.privateKey!),
@ -1356,7 +1356,7 @@ class FiroWallet extends CoinServiceAPI {
List<UtxoObject> utxoObjectsToUse = []; List<UtxoObject> utxoObjectsToUse = [];
for (var i = 0; for (var i = 0;
satoshisBeingUsed < satoshiAmountToSend && i < spendableOutputs.length; satoshisBeingUsed <= satoshiAmountToSend && i < spendableOutputs.length;
i++) { i++) {
utxoObjectsToUse.add(spendableOutputs[i]); utxoObjectsToUse.add(spendableOutputs[i]);
satoshisBeingUsed += spendableOutputs[i].value; satoshisBeingUsed += spendableOutputs[i].value;

View file

@ -84,7 +84,9 @@ class NotificationsService extends ChangeNotifier {
_timer = Timer.periodic(notificationRefreshInterval, (_) { _timer = Timer.periodic(notificationRefreshInterval, (_) {
Logging.instance Logging.instance
.log("Periodic notifications update check", level: LogLevel.Info); .log("Periodic notifications update check", level: LogLevel.Info);
if (prefs.externalCalls) {
_checkTrades(); _checkTrades();
}
_checkTransactions(); _checkTransactions();
}); });
} }

View file

@ -7,9 +7,8 @@ import 'package:http/http.dart';
import 'package:stackwallet/hive/db.dart'; import 'package:stackwallet/hive/db.dart';
import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart';
import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/logger.dart';
import 'package:tuple/tuple.dart';
import 'package:stackwallet/utilities/prefs.dart'; import 'package:stackwallet/utilities/prefs.dart';
import 'package:tuple/tuple.dart';
class PriceAPI { class PriceAPI {
static const refreshInterval = 60; static const refreshInterval = 60;

View file

@ -19,9 +19,7 @@ class PriceService extends ChangeNotifier {
Tuple2<Decimal, double> getPrice(Coin coin) => _cachedPrices[coin]!; Tuple2<Decimal, double> getPrice(Coin coin) => _cachedPrices[coin]!;
PriceService(this.baseTicker) { PriceService(this.baseTicker);
start(true);
}
Future<void> updatePrice() async { Future<void> updatePrice() async {
final priceMap = final priceMap =

View file

@ -159,8 +159,8 @@ abstract class DefaultNodes {
); );
static NodeModel get bitcoincashTestnet => NodeModel( static NodeModel get bitcoincashTestnet => NodeModel(
host: "testnet.hsmiths.com", host: "bitcoincash-testnet.stackwallet.com",
port: 53012, port: 60002,
name: defaultName, name: defaultName,
id: _nodeId(Coin.bitcoincashTestnet), id: _nodeId(Coin.bitcoincashTestnet),
useSSL: true, useSSL: true,

View file

@ -569,6 +569,6 @@ class Prefs extends ChangeNotifier {
Future<bool> _getHasExternalCalls() async { Future<bool> _getHasExternalCalls() async {
return await DB.instance.get<dynamic>( return await DB.instance.get<dynamic>(
boxName: DB.boxNamePrefs, key: "externalCalls") as bool? ?? boxName: DB.boxNamePrefs, key: "externalCalls") as bool? ??
false; true;
} }
} }

View file

@ -202,9 +202,13 @@ class _TransactionCardState extends ConsumerState<TransactionCard> {
), ),
), ),
), ),
if (ref.watch(prefsChangeNotifierProvider
.select((value) => value.externalCalls)))
const SizedBox( const SizedBox(
width: 10, width: 10,
), ),
if (ref.watch(prefsChangeNotifierProvider
.select((value) => value.externalCalls)))
Flexible( Flexible(
child: FittedBox( child: FittedBox(
fit: BoxFit.scaleDown, fit: BoxFit.scaleDown,

View file

@ -11,7 +11,7 @@ description: Stack Wallet
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.5.7+77 version: 1.5.8+78
environment: environment:
sdk: ">=2.17.0 <3.0.0" sdk: ">=2.17.0 <3.0.0"

2
scripts/prebuild.sh Normal file → Executable file
View file

@ -2,5 +2,5 @@
KEYS=../lib/external_api_keys.dart KEYS=../lib/external_api_keys.dart
if ! test -f "$KEYS"; then if ! test -f "$KEYS"; then
echo 'prebuild.sh: creating template lib/external_api_keys.dart file' echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
echo 'const kChangeNowApiKey = "";' > $KEYS printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
fi fi

View file

@ -29,7 +29,7 @@ git submodule update --init --recursive
KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart" KEYS="$HOME/projects/stack_wallet/lib/external_api_keys.dart"
if ! test -f "$KEYS"; then if ! test -f "$KEYS"; then
echo 'prebuild.sh: creating template lib/external_api_keys.dart file' echo 'prebuild.sh: creating template lib/external_api_keys.dart file'
echo 'const kChangeNowApiKey = "";' > $KEYS printf 'const kChangeNowApiKey = "";\nconst kSimpleSwapApiKey = "";' > $KEYS
fi fi
#install stack wallet dependencies #install stack wallet dependencies