mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 10:34:32 +00:00
Merge branch 'ui-testing' into speedup
This commit is contained in:
commit
fa39ef6aff
47 changed files with 1243 additions and 331 deletions
|
@ -589,9 +589,16 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
_loadChangeNowData();
|
_loadChangeNowData();
|
||||||
}
|
}
|
||||||
|
|
||||||
return const LockscreenView(
|
String? startupWalletId;
|
||||||
|
if (ref.read(prefsChangeNotifierProvider).gotoWalletOnStartup) {
|
||||||
|
startupWalletId =
|
||||||
|
ref.read(prefsChangeNotifierProvider).startupWalletId;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LockscreenView(
|
||||||
isInitialAppLogin: true,
|
isInitialAppLogin: true,
|
||||||
routeOnSuccess: HomeView.routeName,
|
routeOnSuccess: HomeView.routeName,
|
||||||
|
routeOnSuccessArguments: startupWalletId,
|
||||||
biometricsAuthenticationTitle: "Unlock Stack",
|
biometricsAuthenticationTitle: "Unlock Stack",
|
||||||
biometricsLocalizedReason:
|
biometricsLocalizedReason:
|
||||||
"Unlock your stack wallet using biometrics",
|
"Unlock your stack wallet using biometrics",
|
||||||
|
|
|
@ -1,20 +1,18 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:stackwallet/providers/exchange/available_currencies_state_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/exchange/available_floating_rate_pairs_state_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/exchange/change_now_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart';
|
import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart';
|
||||||
import 'package:stackwallet/providers/exchange/estimate_rate_exchange_form_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/exchange/fixed_rate_exchange_form_provider.dart';
|
|
||||||
import 'package:stackwallet/providers/exchange/fixed_rate_market_pairs_provider.dart';
|
|
||||||
import 'package:stackwallet/utilities/cfcolors.dart';
|
import 'package:stackwallet/utilities/cfcolors.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||||
import 'package:stackwallet/widgets/stack_dialog.dart';
|
import 'package:stackwallet/widgets/stack_dialog.dart';
|
||||||
|
|
||||||
class ExchangeLoadingOverlayView extends ConsumerStatefulWidget {
|
class ExchangeLoadingOverlayView extends ConsumerStatefulWidget {
|
||||||
const ExchangeLoadingOverlayView({Key? key}) : super(key: key);
|
const ExchangeLoadingOverlayView({
|
||||||
|
Key? key,
|
||||||
|
required this.unawaitedLoad,
|
||||||
|
}) : super(key: key);
|
||||||
|
|
||||||
|
final VoidCallback unawaitedLoad;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
ConsumerState<ExchangeLoadingOverlayView> createState() =>
|
ConsumerState<ExchangeLoadingOverlayView> createState() =>
|
||||||
|
@ -28,103 +26,6 @@ class _ExchangeLoadingOverlayViewState
|
||||||
|
|
||||||
bool userReloaded = false;
|
bool userReloaded = false;
|
||||||
|
|
||||||
Future<void> _loadFixedRateMarkets() async {
|
|
||||||
if (ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state ==
|
|
||||||
ChangeNowLoadStatus.loading) {
|
|
||||||
// already in progress so just
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.loading;
|
|
||||||
|
|
||||||
final response3 =
|
|
||||||
await ref.read(changeNowProvider).getAvailableFixedRateMarkets();
|
|
||||||
if (response3.value != null) {
|
|
||||||
ref.read(fixedRateMarketPairsStateProvider.state).state =
|
|
||||||
response3.value!;
|
|
||||||
|
|
||||||
if (ref.read(fixedRateExchangeFormProvider).market == null) {
|
|
||||||
final matchingMarkets =
|
|
||||||
response3.value!.where((e) => e.to == "doge" && e.from == "btc");
|
|
||||||
if (matchingMarkets.isNotEmpty) {
|
|
||||||
await ref
|
|
||||||
.read(fixedRateExchangeFormProvider)
|
|
||||||
.updateMarket(matchingMarkets.first, true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Logging.instance.log(
|
|
||||||
"Failed to load changeNOW fixed rate markets: ${response3.exception?.errorMessage}",
|
|
||||||
level: LogLevel.Error);
|
|
||||||
|
|
||||||
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.failed;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.success;
|
|
||||||
}
|
|
||||||
|
|
||||||
Future<void> _loadChangeNowStandardCurrencies() async {
|
|
||||||
if (ref
|
|
||||||
.read(changeNowEstimatedInitialLoadStatusStateProvider.state)
|
|
||||||
.state ==
|
|
||||||
ChangeNowLoadStatus.loading) {
|
|
||||||
// already in progress so just
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.loading;
|
|
||||||
|
|
||||||
final response = await ref.read(changeNowProvider).getAvailableCurrencies();
|
|
||||||
final response2 =
|
|
||||||
await ref.read(changeNowProvider).getAvailableFloatingRatePairs();
|
|
||||||
if (response.value != null) {
|
|
||||||
ref.read(availableChangeNowCurrenciesStateProvider.state).state =
|
|
||||||
response.value!;
|
|
||||||
if (response2.value != null) {
|
|
||||||
ref.read(availableFloatingRatePairsStateProvider.state).state =
|
|
||||||
response2.value!;
|
|
||||||
|
|
||||||
if (response.value!.length > 1) {
|
|
||||||
if (ref.read(estimatedRateExchangeFormProvider).from == null) {
|
|
||||||
if (response.value!.where((e) => e.ticker == "btc").isNotEmpty) {
|
|
||||||
await ref.read(estimatedRateExchangeFormProvider).updateFrom(
|
|
||||||
response.value!.firstWhere((e) => e.ticker == "btc"), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (ref.read(estimatedRateExchangeFormProvider).to == null) {
|
|
||||||
if (response.value!.where((e) => e.ticker == "doge").isNotEmpty) {
|
|
||||||
await ref.read(estimatedRateExchangeFormProvider).updateTo(
|
|
||||||
response.value!.firstWhere((e) => e.ticker == "doge"), false);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Logging.instance.log(
|
|
||||||
"Failed to load changeNOW available floating rate pairs: ${response2.exception?.errorMessage}",
|
|
||||||
level: LogLevel.Error);
|
|
||||||
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.failed;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Logging.instance.log(
|
|
||||||
"Failed to load changeNOW currencies: ${response.exception?.errorMessage}",
|
|
||||||
level: LogLevel.Error);
|
|
||||||
await Future<void>.delayed(const Duration(seconds: 3));
|
|
||||||
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.failed;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
|
||||||
ChangeNowLoadStatus.success;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_statusEst =
|
_statusEst =
|
||||||
|
@ -168,8 +69,10 @@ class _ExchangeLoadingOverlayViewState
|
||||||
child: const CustomLoadingOverlay(
|
child: const CustomLoadingOverlay(
|
||||||
message: "Loading ChangeNOW data", eventBus: null),
|
message: "Loading ChangeNOW data", eventBus: null),
|
||||||
),
|
),
|
||||||
if (_statusEst == ChangeNowLoadStatus.failed ||
|
if ((_statusEst == ChangeNowLoadStatus.failed ||
|
||||||
_statusFixed == ChangeNowLoadStatus.failed)
|
_statusFixed == ChangeNowLoadStatus.failed) &&
|
||||||
|
_statusEst != ChangeNowLoadStatus.loading &&
|
||||||
|
_statusFixed != ChangeNowLoadStatus.loading)
|
||||||
Container(
|
Container(
|
||||||
color: CFColors.stackAccent.withOpacity(0.7),
|
color: CFColors.stackAccent.withOpacity(0.7),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
@ -186,13 +89,8 @@ class _ExchangeLoadingOverlayViewState
|
||||||
.copyWith(color: CFColors.stackAccent),
|
.copyWith(color: CFColors.stackAccent),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (_statusEst == ChangeNowLoadStatus.failed) {
|
|
||||||
_loadChangeNowStandardCurrencies();
|
|
||||||
}
|
|
||||||
if (_statusFixed == ChangeNowLoadStatus.failed) {
|
|
||||||
userReloaded = true;
|
userReloaded = true;
|
||||||
_loadFixedRateMarkets();
|
widget.unawaitedLoad();
|
||||||
}
|
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
|
@ -29,7 +29,6 @@ import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/cfcolors.dart';
|
import 'package:stackwallet/utilities/cfcolors.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/format.dart';
|
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||||
|
@ -1272,55 +1271,55 @@ class _WalletInitiatedExchangeViewState
|
||||||
.read(estimatedRateExchangeFormProvider)
|
.read(estimatedRateExchangeFormProvider)
|
||||||
.fromAmountString);
|
.fromAmountString);
|
||||||
|
|
||||||
if (ft.toLowerCase() ==
|
// if (ft.toLowerCase() ==
|
||||||
coin.ticker.toLowerCase()) {
|
// coin.ticker.toLowerCase()) {
|
||||||
bool shouldPop = false;
|
// bool shouldPop = false;
|
||||||
bool wasPopped = false;
|
// bool wasPopped = false;
|
||||||
unawaited(showDialog<void>(
|
// unawaited(showDialog<void>(
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (_) => WillPopScope(
|
// builder: (_) => WillPopScope(
|
||||||
onWillPop: () async {
|
// onWillPop: () async {
|
||||||
if (shouldPop) {
|
// if (shouldPop) {
|
||||||
wasPopped = true;
|
// wasPopped = true;
|
||||||
}
|
// }
|
||||||
return shouldPop;
|
// return shouldPop;
|
||||||
},
|
// },
|
||||||
child: const CustomLoadingOverlay(
|
// child: const CustomLoadingOverlay(
|
||||||
message: "Checking available balance",
|
// message: "Checking available balance",
|
||||||
eventBus: null,
|
// eventBus: null,
|
||||||
),
|
// ),
|
||||||
),
|
// ),
|
||||||
));
|
// ));
|
||||||
|
//
|
||||||
final availableBalance =
|
// final availableBalance =
|
||||||
await manager.availableBalance;
|
// await manager.availableBalance;
|
||||||
|
//
|
||||||
final feeObject = await manager.fees;
|
// final feeObject = await manager.fees;
|
||||||
|
//
|
||||||
final fee = await manager.estimateFeeFor(
|
// final fee = await manager.estimateFeeFor(
|
||||||
Format.decimalAmountToSatoshis(
|
// Format.decimalAmountToSatoshis(
|
||||||
sendAmount),
|
// sendAmount),
|
||||||
feeObject.medium);
|
// feeObject.medium);
|
||||||
|
//
|
||||||
shouldPop = true;
|
// shouldPop = true;
|
||||||
if (!wasPopped && mounted) {
|
// if (!wasPopped && mounted) {
|
||||||
Navigator.of(context).pop();
|
// Navigator.of(context).pop();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
if (availableBalance <
|
// if (availableBalance <
|
||||||
sendAmount +
|
// sendAmount +
|
||||||
Format.satoshisToAmount(fee)) {
|
// Format.satoshisToAmount(fee)) {
|
||||||
unawaited(showDialog<void>(
|
// unawaited(showDialog<void>(
|
||||||
context: context,
|
// context: context,
|
||||||
builder: (_) => StackOkDialog(
|
// builder: (_) => StackOkDialog(
|
||||||
title: "Insufficient balance",
|
// title: "Insufficient balance",
|
||||||
message:
|
// message:
|
||||||
"Current ${coin.prettyName} wallet does not have enough ${coin.ticker} for this trade",
|
// "Current ${coin.prettyName} wallet does not have enough ${coin.ticker} for this trade",
|
||||||
),
|
// ),
|
||||||
));
|
// ));
|
||||||
return;
|
// return;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (isEstimated) {
|
if (isEstimated) {
|
||||||
final fromTicker = ref
|
final fromTicker = ref
|
||||||
|
|
|
@ -13,6 +13,7 @@ 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/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/change_now/change_now_loading_service.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/cfcolors.dart';
|
import 'package:stackwallet/utilities/cfcolors.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
@ -40,7 +41,16 @@ class _HomeViewState extends ConsumerState<HomeView> {
|
||||||
|
|
||||||
bool _exitEnabled = false;
|
bool _exitEnabled = false;
|
||||||
|
|
||||||
|
final _cnLoadingService = ChangeNowLoadingService();
|
||||||
|
|
||||||
Future<bool> _onWillPop() async {
|
Future<bool> _onWillPop() async {
|
||||||
|
|
||||||
|
// go to home view when tapping back on the main exchange view
|
||||||
|
if (ref.read(homeViewPageIndexStateProvider.state).state == 1) {
|
||||||
|
ref.read(homeViewPageIndexStateProvider.state).state = 0;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (_exitEnabled) {
|
if (_exitEnabled) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +80,11 @@ class _HomeViewState extends ConsumerState<HomeView> {
|
||||||
return _exitEnabled;
|
return _exitEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _loadCNData() {
|
||||||
|
// unawaited future
|
||||||
|
_cnLoadingService.loadAll(ref);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
_pageController = PageController();
|
_pageController = PageController();
|
||||||
|
@ -77,9 +92,11 @@ class _HomeViewState extends ConsumerState<HomeView> {
|
||||||
const WalletsView(),
|
const WalletsView(),
|
||||||
if (Constants.enableExchange)
|
if (Constants.enableExchange)
|
||||||
Stack(
|
Stack(
|
||||||
children: const [
|
children: [
|
||||||
ExchangeView(),
|
const ExchangeView(),
|
||||||
ExchangeLoadingOverlayView(),
|
ExchangeLoadingOverlayView(
|
||||||
|
unawaitedLoad: _loadCNData,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// const BuyView(),
|
// const BuyView(),
|
||||||
|
|
|
@ -1,9 +1,14 @@
|
||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
|
||||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||||
|
import 'package:stackwallet/pages/home_view/home_view.dart';
|
||||||
|
import 'package:stackwallet/pages/wallet_view/wallet_view.dart';
|
||||||
// import 'package:stackwallet/providers/global/has_authenticated_start_state_provider.dart';
|
// import 'package:stackwallet/providers/global/has_authenticated_start_state_provider.dart';
|
||||||
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||||
// import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart';
|
// import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/biometrics.dart';
|
import 'package:stackwallet/utilities/biometrics.dart';
|
||||||
|
@ -15,6 +20,7 @@ import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
|
import 'package:stackwallet/widgets/custom_pin_put/custom_pin_put.dart';
|
||||||
import 'package:stackwallet/widgets/shake/shake.dart';
|
import 'package:stackwallet/widgets/shake/shake.dart';
|
||||||
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class LockscreenView extends ConsumerStatefulWidget {
|
class LockscreenView extends ConsumerStatefulWidget {
|
||||||
const LockscreenView({
|
const LockscreenView({
|
||||||
|
@ -75,10 +81,20 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
if (widget.popOnSuccess) {
|
if (widget.popOnSuccess) {
|
||||||
Navigator.of(context).pop(widget.routeOnSuccessArguments);
|
Navigator.of(context).pop(widget.routeOnSuccessArguments);
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pushReplacementNamed(
|
unawaited(Navigator.of(context).pushReplacementNamed(
|
||||||
widget.routeOnSuccess,
|
widget.routeOnSuccess,
|
||||||
arguments: widget.routeOnSuccessArguments,
|
arguments: widget.routeOnSuccessArguments,
|
||||||
);
|
));
|
||||||
|
if (widget.routeOnSuccess == HomeView.routeName &&
|
||||||
|
widget.routeOnSuccessArguments is String) {
|
||||||
|
final walletId = widget.routeOnSuccessArguments as String;
|
||||||
|
unawaited(Navigator.of(context).pushNamed(WalletView.routeName,
|
||||||
|
arguments: Tuple2(
|
||||||
|
walletId,
|
||||||
|
ref
|
||||||
|
.read(walletsChangeNotifierProvider)
|
||||||
|
.getManagerProvider(walletId))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +121,7 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
// await walletsService.getWalletId(currentWalletName));
|
// await walletsService.getWalletId(currentWalletName));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
_onUnlock();
|
unawaited(_onUnlock());
|
||||||
}
|
}
|
||||||
// leave this commented to enable pin fall back should biometrics not work properly
|
// leave this commented to enable pin fall back should biometrics not work properly
|
||||||
// else {
|
// else {
|
||||||
|
@ -250,10 +266,10 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
_timeout = const Duration(minutes: 60);
|
_timeout = const Duration(minutes: 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void>.delayed(_timeout).then((_) {
|
unawaited(Future<void>.delayed(_timeout).then((_) {
|
||||||
_attemptLock = false;
|
_attemptLock = false;
|
||||||
_attempts = 0;
|
_attempts = 0;
|
||||||
});
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_attemptLock) {
|
if (_attemptLock) {
|
||||||
|
@ -264,13 +280,13 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
prettyTime += "${_timeout.inSeconds} seconds";
|
prettyTime += "${_timeout.inSeconds} seconds";
|
||||||
}
|
}
|
||||||
|
|
||||||
showFloatingFlushBar(
|
unawaited(showFloatingFlushBar(
|
||||||
type: FlushBarType.warning,
|
type: FlushBarType.warning,
|
||||||
message:
|
message:
|
||||||
"Incorrect PIN entered too many times. Please wait $prettyTime",
|
"Incorrect PIN entered too many times. Please wait $prettyTime",
|
||||||
context: context,
|
context: context,
|
||||||
iconAsset: Assets.svg.alertCircle,
|
iconAsset: Assets.svg.alertCircle,
|
||||||
);
|
));
|
||||||
|
|
||||||
await Future<void>.delayed(
|
await Future<void>.delayed(
|
||||||
const Duration(milliseconds: 100));
|
const Duration(milliseconds: 100));
|
||||||
|
@ -286,15 +302,15 @@ class _LockscreenViewState extends ConsumerState<LockscreenView> {
|
||||||
if (storedPin == pin) {
|
if (storedPin == pin) {
|
||||||
await Future<void>.delayed(
|
await Future<void>.delayed(
|
||||||
const Duration(milliseconds: 200));
|
const Duration(milliseconds: 200));
|
||||||
_onUnlock();
|
unawaited(_onUnlock());
|
||||||
} else {
|
} else {
|
||||||
_shakeController.shake();
|
unawaited(_shakeController.shake());
|
||||||
showFloatingFlushBar(
|
unawaited(showFloatingFlushBar(
|
||||||
type: FlushBarType.warning,
|
type: FlushBarType.warning,
|
||||||
message: "Incorrect PIN. Please try again",
|
message: "Incorrect PIN. Please try again",
|
||||||
context: context,
|
context: context,
|
||||||
iconAsset: Assets.svg.alertCircle,
|
iconAsset: Assets.svg.alertCircle,
|
||||||
);
|
));
|
||||||
|
|
||||||
await Future<void>.delayed(
|
await Future<void>.delayed(
|
||||||
const Duration(milliseconds: 100));
|
const Duration(milliseconds: 100));
|
||||||
|
|
|
@ -9,6 +9,7 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/language_v
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/security_views/security_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/security_views/security_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart';
|
||||||
|
import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/support_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/support_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_button.dart';
|
import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_button.dart';
|
||||||
|
@ -166,6 +167,18 @@ class GlobalSettingsView extends StatelessWidget {
|
||||||
const SizedBox(
|
const SizedBox(
|
||||||
height: 8,
|
height: 8,
|
||||||
),
|
),
|
||||||
|
SettingsListButton(
|
||||||
|
iconAssetName: Assets.svg.arrowUpRight,
|
||||||
|
iconSize: 16,
|
||||||
|
title: "Startup",
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
StartupPreferencesView.routeName);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 8,
|
||||||
|
),
|
||||||
SettingsListButton(
|
SettingsListButton(
|
||||||
iconAssetName: Assets.svg.sun,
|
iconAssetName: Assets.svg.sun,
|
||||||
iconSize: 18,
|
iconSize: 18,
|
||||||
|
|
|
@ -0,0 +1,269 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart';
|
||||||
|
import 'package:stackwallet/providers/global/prefs_provider.dart';
|
||||||
|
import 'package:stackwallet/utilities/cfcolors.dart';
|
||||||
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
class StartupPreferencesView extends ConsumerStatefulWidget {
|
||||||
|
const StartupPreferencesView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const String routeName = "/startupPreferences";
|
||||||
|
|
||||||
|
@override
|
||||||
|
ConsumerState<StartupPreferencesView> createState() =>
|
||||||
|
_StartupPreferencesViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _StartupPreferencesViewState
|
||||||
|
extends ConsumerState<StartupPreferencesView> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: CFColors.almostWhite,
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: AppBarBackButton(
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: Text(
|
||||||
|
"Startup preferences",
|
||||||
|
style: STextStyles.navBarTitle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: Padding(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
child: LayoutBuilder(
|
||||||
|
builder: (context, constraints) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: constraints.maxHeight,
|
||||||
|
),
|
||||||
|
child: IntrinsicHeight(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
RoundedWhiteContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(4.0),
|
||||||
|
child: RawMaterialButton(
|
||||||
|
// splashColor: CFColors.splashLight,
|
||||||
|
materialTapTargetSize:
|
||||||
|
MaterialTapTargetSize.shrinkWrap,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
Constants.size.circularBorderRadius,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
ref
|
||||||
|
.read(prefsChangeNotifierProvider)
|
||||||
|
.gotoWalletOnStartup = false;
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: Radio(
|
||||||
|
activeColor: CFColors.link2,
|
||||||
|
value: false,
|
||||||
|
groupValue: ref.watch(
|
||||||
|
prefsChangeNotifierProvider
|
||||||
|
.select((value) => value
|
||||||
|
.gotoWalletOnStartup),
|
||||||
|
),
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value is bool) {
|
||||||
|
ref
|
||||||
|
.read(
|
||||||
|
prefsChangeNotifierProvider)
|
||||||
|
.gotoWalletOnStartup = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 12,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Home screen",
|
||||||
|
style: STextStyles.titleBold12,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Stack Wallet home screen",
|
||||||
|
style: STextStyles.itemSubtitle,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: RawMaterialButton(
|
||||||
|
// splashColor: CFColors.splashLight,
|
||||||
|
materialTapTargetSize:
|
||||||
|
MaterialTapTargetSize.shrinkWrap,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
Constants.size.circularBorderRadius,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
ref
|
||||||
|
.read(prefsChangeNotifierProvider)
|
||||||
|
.gotoWalletOnStartup = true;
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
child: Radio(
|
||||||
|
activeColor: CFColors.link2,
|
||||||
|
value: true,
|
||||||
|
groupValue: ref.watch(
|
||||||
|
prefsChangeNotifierProvider
|
||||||
|
.select((value) => value
|
||||||
|
.gotoWalletOnStartup),
|
||||||
|
),
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value is bool) {
|
||||||
|
ref
|
||||||
|
.read(
|
||||||
|
prefsChangeNotifierProvider)
|
||||||
|
.gotoWalletOnStartup = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 12,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Specific wallet",
|
||||||
|
style: STextStyles.titleBold12,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Select a specific wallet to load into on startup",
|
||||||
|
style: STextStyles.itemSubtitle,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (!ref.watch(prefsChangeNotifierProvider
|
||||||
|
.select((value) => value.gotoWalletOnStartup)))
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
if (ref.watch(prefsChangeNotifierProvider
|
||||||
|
.select((value) => value.gotoWalletOnStartup)))
|
||||||
|
Container(
|
||||||
|
color: Colors.transparent,
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 12.0,
|
||||||
|
right: 12,
|
||||||
|
bottom: 12,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
width: 12 + 20,
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
Flexible(
|
||||||
|
child: RawMaterialButton(
|
||||||
|
// splashColor: CFColors.splashLight,
|
||||||
|
materialTapTargetSize:
|
||||||
|
MaterialTapTargetSize.shrinkWrap,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
Constants
|
||||||
|
.size.circularBorderRadius,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context).pushNamed(
|
||||||
|
StartupWalletSelectionView
|
||||||
|
.routeName);
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
"Select wallet...",
|
||||||
|
style: STextStyles.link2,
|
||||||
|
textAlign: TextAlign.left,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,197 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:flutter_svg/svg.dart';
|
||||||
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
|
import 'package:stackwallet/utilities/cfcolors.dart';
|
||||||
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart';
|
||||||
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
class StartupWalletSelectionView extends ConsumerStatefulWidget {
|
||||||
|
const StartupWalletSelectionView({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
static const String routeName = "/startupWalletSelection";
|
||||||
|
@override
|
||||||
|
ConsumerState<StartupWalletSelectionView> createState() =>
|
||||||
|
_StartupWalletSelectionViewState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _StartupWalletSelectionViewState
|
||||||
|
extends ConsumerState<StartupWalletSelectionView> {
|
||||||
|
final Map<String, DSBController> _controllers = {};
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final managers = ref
|
||||||
|
.watch(walletsChangeNotifierProvider.select((value) => value.managers));
|
||||||
|
|
||||||
|
_controllers.clear();
|
||||||
|
for (final manager in managers) {
|
||||||
|
_controllers[manager.walletId] = DSBController();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: CFColors.almostWhite,
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: AppBarBackButton(
|
||||||
|
onPressed: () async {
|
||||||
|
Navigator.of(context).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
title: FittedBox(
|
||||||
|
fit: BoxFit.scaleDown,
|
||||||
|
child: Text(
|
||||||
|
"Select startup wallet",
|
||||||
|
style: STextStyles.navBarTitle,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
body: LayoutBuilder(builder: (context, constraints) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
left: 12,
|
||||||
|
top: 12,
|
||||||
|
right: 12,
|
||||||
|
),
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: ConstrainedBox(
|
||||||
|
constraints: BoxConstraints(
|
||||||
|
minHeight: constraints.maxHeight - 24,
|
||||||
|
),
|
||||||
|
child: IntrinsicHeight(
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
const SizedBox(
|
||||||
|
height: 4,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
"Select a wallet to load into immediately on startup",
|
||||||
|
style: STextStyles.smallMed12,
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
height: 12,
|
||||||
|
),
|
||||||
|
RoundedWhiteContainer(
|
||||||
|
padding: const EdgeInsets.all(0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
...managers.map(
|
||||||
|
(manager) => Padding(
|
||||||
|
padding: const EdgeInsets.all(12),
|
||||||
|
child: Row(
|
||||||
|
key: Key(
|
||||||
|
"startupWalletSelectionGroupKey_${manager.walletId}"),
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: CFColors.coin
|
||||||
|
.forCoin(manager.coin)
|
||||||
|
.withOpacity(0.5),
|
||||||
|
borderRadius: BorderRadius.circular(
|
||||||
|
Constants.size.circularBorderRadius,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(4),
|
||||||
|
child: SvgPicture.asset(
|
||||||
|
Assets.svg
|
||||||
|
.iconFor(coin: manager.coin),
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const SizedBox(
|
||||||
|
width: 12,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
manager.walletName,
|
||||||
|
style: STextStyles.titleBold12,
|
||||||
|
),
|
||||||
|
// const SizedBox(
|
||||||
|
// height: 2,
|
||||||
|
// ),
|
||||||
|
// FutureBuilder(
|
||||||
|
// future: manager.totalBalance,
|
||||||
|
// builder: (builderContext,
|
||||||
|
// AsyncSnapshot<Decimal> snapshot) {
|
||||||
|
// if (snapshot.connectionState ==
|
||||||
|
// ConnectionState.done &&
|
||||||
|
// snapshot.hasData) {
|
||||||
|
// return Text(
|
||||||
|
// "${Format.localizedStringAsFixed(
|
||||||
|
// value: snapshot.data!,
|
||||||
|
// locale: ref.watch(
|
||||||
|
// localeServiceChangeNotifierProvider
|
||||||
|
// .select((value) =>
|
||||||
|
// value.locale)),
|
||||||
|
// decimalPlaces: 8,
|
||||||
|
// )} ${manager.coin.ticker}",
|
||||||
|
// style: STextStyles.itemSubtitle,
|
||||||
|
// );
|
||||||
|
// } else {
|
||||||
|
// return AnimatedText(
|
||||||
|
// stringsToLoopThrough: const [
|
||||||
|
// "Loading balance",
|
||||||
|
// "Loading balance.",
|
||||||
|
// "Loading balance..",
|
||||||
|
// "Loading balance..."
|
||||||
|
// ],
|
||||||
|
// style: STextStyles.itemSubtitle,
|
||||||
|
// );
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
width: 20,
|
||||||
|
child: Radio(
|
||||||
|
activeColor: CFColors.link2,
|
||||||
|
value: manager.walletId,
|
||||||
|
groupValue: ref.watch(
|
||||||
|
prefsChangeNotifierProvider.select(
|
||||||
|
(value) => value.startupWalletId),
|
||||||
|
),
|
||||||
|
onChanged: (value) {
|
||||||
|
if (value is String) {
|
||||||
|
ref
|
||||||
|
.read(
|
||||||
|
prefsChangeNotifierProvider)
|
||||||
|
.startupWalletId = value;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -24,6 +24,9 @@ import 'package:stackwallet/providers/global/auto_swb_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
import 'package:stackwallet/providers/ui/transaction_filter_provider.dart';
|
||||||
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
|
import 'package:stackwallet/providers/ui/unread_notifications_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provider.dart';
|
||||||
|
import 'package:stackwallet/services/change_now/change_now_loading_service.dart';
|
||||||
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
import 'package:stackwallet/services/coins/firo/firo_wallet.dart';
|
||||||
import 'package:stackwallet/services/coins/manager.dart';
|
import 'package:stackwallet/services/coins/manager.dart';
|
||||||
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
|
import 'package:stackwallet/services/event_bus/events/global/node_connection_status_changed_event.dart';
|
||||||
|
@ -35,6 +38,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
|
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/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
||||||
|
@ -42,10 +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 '../../providers/wallet/public_private_balance_state_provider.dart';
|
|
||||||
import '../../providers/wallet/wallet_balance_toggle_state_provider.dart';
|
|
||||||
import '../../utilities/enums/wallet_balance_toggle_state.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({
|
||||||
|
@ -79,6 +79,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
||||||
late StreamSubscription<dynamic> _syncStatusSubscription;
|
late StreamSubscription<dynamic> _syncStatusSubscription;
|
||||||
late StreamSubscription<dynamic> _nodeStatusSubscription;
|
late StreamSubscription<dynamic> _nodeStatusSubscription;
|
||||||
|
|
||||||
|
final _cnLoadingService = ChangeNowLoadingService();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
walletId = widget.walletId;
|
walletId = widget.walletId;
|
||||||
|
@ -272,9 +274,10 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
||||||
|
|
||||||
unawaited(Navigator.of(context).pushNamed(
|
unawaited(Navigator.of(context).pushNamed(
|
||||||
WalletInitiatedExchangeView.routeName,
|
WalletInitiatedExchangeView.routeName,
|
||||||
arguments: Tuple2(
|
arguments: Tuple3(
|
||||||
walletId,
|
walletId,
|
||||||
coin,
|
coin,
|
||||||
|
_loadCNData,
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
@ -346,6 +349,11 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void _loadCNData() {
|
||||||
|
// unawaited future
|
||||||
|
_cnLoadingService.loadAll(ref, coin: ref.read(managerProvider).coin);
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
debugPrint("BUILD: $runtimeType");
|
debugPrint("BUILD: $runtimeType");
|
||||||
|
|
|
@ -56,6 +56,8 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart';
|
||||||
|
import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart';
|
||||||
|
import 'package:stackwallet/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/support_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/support_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart';
|
||||||
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart';
|
||||||
|
@ -224,6 +226,18 @@ class RouteGenerator {
|
||||||
builder: (_) => const SyncingPreferencesView(),
|
builder: (_) => const SyncingPreferencesView(),
|
||||||
settings: RouteSettings(name: settings.name));
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
|
case StartupPreferencesView.routeName:
|
||||||
|
return getRoute(
|
||||||
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
builder: (_) => const StartupPreferencesView(),
|
||||||
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
|
case StartupWalletSelectionView.routeName:
|
||||||
|
return getRoute(
|
||||||
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
builder: (_) => const StartupWalletSelectionView(),
|
||||||
|
settings: RouteSettings(name: settings.name));
|
||||||
|
|
||||||
case ManageNodesView.routeName:
|
case ManageNodesView.routeName:
|
||||||
return getRoute(
|
return getRoute(
|
||||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
|
@ -719,7 +733,7 @@ class RouteGenerator {
|
||||||
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
return _routeError("${settings.name} invalid args: ${args.toString()}");
|
||||||
|
|
||||||
case WalletInitiatedExchangeView.routeName:
|
case WalletInitiatedExchangeView.routeName:
|
||||||
if (args is Tuple2<String, Coin>) {
|
if (args is Tuple3<String, Coin, VoidCallback>) {
|
||||||
return getRoute(
|
return getRoute(
|
||||||
shouldUseMaterialRoute: useMaterialPageRoute,
|
shouldUseMaterialRoute: useMaterialPageRoute,
|
||||||
builder: (_) => Stack(
|
builder: (_) => Stack(
|
||||||
|
@ -728,7 +742,9 @@ class RouteGenerator {
|
||||||
walletId: args.item1,
|
walletId: args.item1,
|
||||||
coin: args.item2,
|
coin: args.item2,
|
||||||
),
|
),
|
||||||
const ExchangeLoadingOverlayView(),
|
ExchangeLoadingOverlayView(
|
||||||
|
unawaitedLoad: args.item3,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
settings: RouteSettings(
|
settings: RouteSettings(
|
||||||
|
|
140
lib/services/change_now/change_now_loading_service.dart
Normal file
140
lib/services/change_now/change_now_loading_service.dart
Normal file
|
@ -0,0 +1,140 @@
|
||||||
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/available_currencies_state_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/available_floating_rate_pairs_state_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/change_now_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/estimate_rate_exchange_form_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/fixed_rate_exchange_form_provider.dart';
|
||||||
|
import 'package:stackwallet/providers/exchange/fixed_rate_market_pairs_provider.dart';
|
||||||
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
|
|
||||||
|
class ChangeNowLoadingService {
|
||||||
|
Future<void> loadAll(WidgetRef ref, {Coin? coin}) async {
|
||||||
|
try {
|
||||||
|
await Future.wait([
|
||||||
|
_loadFixedRateMarkets(ref, coin: coin),
|
||||||
|
_loadChangeNowStandardCurrencies(ref, coin: coin),
|
||||||
|
]);
|
||||||
|
} catch (e, s) {
|
||||||
|
Logging.instance.log("ChangeNowLoadingService.loadAll failed: $e\n$s",
|
||||||
|
level: LogLevel.Error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _loadFixedRateMarkets(WidgetRef ref, {Coin? coin}) async {
|
||||||
|
if (ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state ==
|
||||||
|
ChangeNowLoadStatus.loading) {
|
||||||
|
// already in progress so just
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.loading;
|
||||||
|
|
||||||
|
final response3 =
|
||||||
|
await ref.read(changeNowProvider).getAvailableFixedRateMarkets();
|
||||||
|
if (response3.value != null) {
|
||||||
|
ref.read(fixedRateMarketPairsStateProvider.state).state =
|
||||||
|
response3.value!;
|
||||||
|
|
||||||
|
if (ref.read(fixedRateExchangeFormProvider).market == null) {
|
||||||
|
String fromTicker = "btc";
|
||||||
|
String toTicker = "xmr";
|
||||||
|
|
||||||
|
if (coin != null) {
|
||||||
|
fromTicker = coin.ticker.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
final matchingMarkets = response3.value!
|
||||||
|
.where((e) => e.to == toTicker && e.from == fromTicker);
|
||||||
|
if (matchingMarkets.isNotEmpty) {
|
||||||
|
await ref
|
||||||
|
.read(fixedRateExchangeFormProvider)
|
||||||
|
.updateMarket(matchingMarkets.first, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Logging.instance.log(
|
||||||
|
"Failed to load changeNOW fixed rate markets: ${response3.exception?.errorMessage}",
|
||||||
|
level: LogLevel.Error);
|
||||||
|
|
||||||
|
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.failed;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref.read(changeNowFixedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.success;
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<void> _loadChangeNowStandardCurrencies(WidgetRef ref,
|
||||||
|
{Coin? coin}) async {
|
||||||
|
if (ref
|
||||||
|
.read(changeNowEstimatedInitialLoadStatusStateProvider.state)
|
||||||
|
.state ==
|
||||||
|
ChangeNowLoadStatus.loading) {
|
||||||
|
// already in progress so just
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.loading;
|
||||||
|
|
||||||
|
final response = await ref.read(changeNowProvider).getAvailableCurrencies();
|
||||||
|
final response2 =
|
||||||
|
await ref.read(changeNowProvider).getAvailableFloatingRatePairs();
|
||||||
|
if (response.value != null) {
|
||||||
|
ref.read(availableChangeNowCurrenciesStateProvider.state).state =
|
||||||
|
response.value!;
|
||||||
|
if (response2.value != null) {
|
||||||
|
ref.read(availableFloatingRatePairsStateProvider.state).state =
|
||||||
|
response2.value!;
|
||||||
|
|
||||||
|
String fromTicker = "btc";
|
||||||
|
String toTicker = "xmr";
|
||||||
|
|
||||||
|
if (coin != null) {
|
||||||
|
fromTicker = coin.ticker.toLowerCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (response.value!.length > 1) {
|
||||||
|
if (ref.read(estimatedRateExchangeFormProvider).from == null) {
|
||||||
|
if (response.value!
|
||||||
|
.where((e) => e.ticker == fromTicker)
|
||||||
|
.isNotEmpty) {
|
||||||
|
await ref.read(estimatedRateExchangeFormProvider).updateFrom(
|
||||||
|
response.value!.firstWhere((e) => e.ticker == fromTicker),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (ref.read(estimatedRateExchangeFormProvider).to == null) {
|
||||||
|
if (response.value!.where((e) => e.ticker == toTicker).isNotEmpty) {
|
||||||
|
await ref.read(estimatedRateExchangeFormProvider).updateTo(
|
||||||
|
response.value!.firstWhere((e) => e.ticker == toTicker),
|
||||||
|
false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Logging.instance.log(
|
||||||
|
"Failed to load changeNOW available floating rate pairs: ${response2.exception?.errorMessage}",
|
||||||
|
level: LogLevel.Error);
|
||||||
|
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.failed;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Logging.instance.log(
|
||||||
|
"Failed to load changeNOW currencies: ${response.exception?.errorMessage}",
|
||||||
|
level: LogLevel.Error);
|
||||||
|
await Future<void>.delayed(const Duration(seconds: 3));
|
||||||
|
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.failed;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ref.read(changeNowEstimatedInitialLoadStatusStateProvider.state).state =
|
||||||
|
ChangeNowLoadStatus.success;
|
||||||
|
}
|
||||||
|
}
|
|
@ -418,7 +418,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
"index: $index, \t GapCounter $account ${type.name}: $gapCounter",
|
"index: $index, \t GapCounter $account ${type.name}: $gapCounter",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
final ID = "k_$index";
|
final _id = "k_$index";
|
||||||
Map<String, String> txCountCallArgs = {};
|
Map<String, String> txCountCallArgs = {};
|
||||||
final Map<String, dynamic> receivingNodes = {};
|
final Map<String, dynamic> receivingNodes = {};
|
||||||
|
|
||||||
|
@ -463,13 +463,13 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
throw Exception("No Path type $type exists");
|
throw Exception("No Path type $type exists");
|
||||||
}
|
}
|
||||||
receivingNodes.addAll({
|
receivingNodes.addAll({
|
||||||
"${ID}_$j": {
|
"${_id}_$j": {
|
||||||
"node": node,
|
"node": node,
|
||||||
"address": address,
|
"address": address,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
txCountCallArgs.addAll({
|
txCountCallArgs.addAll({
|
||||||
"${ID}_$j": address,
|
"${_id}_$j": address,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -478,9 +478,9 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
|
|
||||||
// check and add appropriate addresses
|
// check and add appropriate addresses
|
||||||
for (int k = 0; k < txCountBatchSize; k++) {
|
for (int k = 0; k < txCountBatchSize; k++) {
|
||||||
int count = counts["${ID}_$k"]!;
|
int count = counts["${_id}_$k"]!;
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
final node = receivingNodes["${ID}_$k"];
|
final node = receivingNodes["${_id}_$k"];
|
||||||
// add address to array
|
// add address to array
|
||||||
addressArray.add(node["address"] as String);
|
addressArray.add(node["address"] as String);
|
||||||
iterationsAddressArray.add(node["address"] as String);
|
iterationsAddressArray.add(node["address"] as String);
|
||||||
|
@ -526,7 +526,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -568,25 +568,25 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
// receiving addresses
|
// receiving addresses
|
||||||
Logging.instance
|
Logging.instance
|
||||||
.log("checking receiving addresses...", level: LogLevel.Info);
|
.log("checking receiving addresses...", level: LogLevel.Info);
|
||||||
Future resultReceive44 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultReceive44 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 0);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 0);
|
||||||
|
|
||||||
Future resultReceive49 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultReceive49 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip49, 0);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip49, 0);
|
||||||
|
|
||||||
Future resultReceive84 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultReceive84 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip84, 0);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip84, 0);
|
||||||
|
|
||||||
Logging.instance
|
Logging.instance
|
||||||
.log("checking change addresses...", level: LogLevel.Info);
|
.log("checking change addresses...", level: LogLevel.Info);
|
||||||
// change addresses
|
// change addresses
|
||||||
Future resultChange44 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultChange44 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 1);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 1);
|
||||||
|
|
||||||
Future resultChange49 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultChange49 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip49, 1);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip49, 1);
|
||||||
|
|
||||||
Future resultChange84 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultChange84 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip84, 1);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip84, 1);
|
||||||
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
|
@ -851,7 +851,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
// notify on unconfirmed transactions
|
// notify on unconfirmed transactions
|
||||||
for (final tx in unconfirmedTxnsToNotifyPending) {
|
for (final tx in unconfirmedTxnsToNotifyPending) {
|
||||||
if (tx.txType == "Received") {
|
if (tx.txType == "Received") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Incoming transaction",
|
title: "Incoming transaction",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -862,10 +862,10 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
txid: tx.txid,
|
txid: tx.txid,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedPending(tx.txid);
|
await txTracker.addNotifiedPending(tx.txid);
|
||||||
} else if (tx.txType == "Sent") {
|
} else if (tx.txType == "Sent") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Sending transaction",
|
title: "Sending transaction",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -876,7 +876,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
txid: tx.txid,
|
txid: tx.txid,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedPending(tx.txid);
|
await txTracker.addNotifiedPending(tx.txid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -884,7 +884,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
// notify on confirmed
|
// notify on confirmed
|
||||||
for (final tx in unconfirmedTxnsToNotifyConfirmed) {
|
for (final tx in unconfirmedTxnsToNotifyConfirmed) {
|
||||||
if (tx.txType == "Received") {
|
if (tx.txType == "Received") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Incoming transaction confirmed",
|
title: "Incoming transaction confirmed",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -892,10 +892,10 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
|
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
|
||||||
shouldWatchForUpdates: false,
|
shouldWatchForUpdates: false,
|
||||||
coinName: coin.name,
|
coinName: coin.name,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedConfirmed(tx.txid);
|
await txTracker.addNotifiedConfirmed(tx.txid);
|
||||||
} else if (tx.txType == "Sent") {
|
} else if (tx.txType == "Sent") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Outgoing transaction confirmed",
|
title: "Outgoing transaction confirmed",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -903,7 +903,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
|
date: DateTime.fromMillisecondsSinceEpoch(tx.timestamp * 1000),
|
||||||
shouldWatchForUpdates: false,
|
shouldWatchForUpdates: false,
|
||||||
coinName: coin.name,
|
coinName: coin.name,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedConfirmed(tx.txid);
|
await txTracker.addNotifiedConfirmed(tx.txid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -970,15 +970,15 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
if (currentHeight != storedHeight) {
|
if (currentHeight != storedHeight) {
|
||||||
if (currentHeight != -1) {
|
if (currentHeight != -1) {
|
||||||
// -1 failed to fetch current height
|
// -1 failed to fetch current height
|
||||||
updateStoredChainHeight(newHeight: currentHeight);
|
unawaited(updateStoredChainHeight(newHeight: currentHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId));
|
||||||
Future changeAddressForTransactions =
|
final changeAddressForTransactions =
|
||||||
_checkChangeAddressForTransactions(DerivePathType.bip84);
|
_checkChangeAddressForTransactions(DerivePathType.bip84);
|
||||||
|
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.3, walletId));
|
||||||
Future currentReceivingAddressesForTransactions =
|
final currentReceivingAddressesForTransactions =
|
||||||
_checkCurrentReceivingAddressesForTransactions();
|
_checkCurrentReceivingAddressesForTransactions();
|
||||||
|
|
||||||
final newTxData = _fetchTransactionData();
|
final newTxData = _fetchTransactionData();
|
||||||
|
@ -999,7 +999,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
GlobalEventBus.instance
|
GlobalEventBus.instance
|
||||||
.fire(RefreshPercentChangedEvent(0.80, walletId));
|
.fire(RefreshPercentChangedEvent(0.80, walletId));
|
||||||
|
|
||||||
Future allTxsToWatch = getAllTxsToWatch(await newTxData);
|
final allTxsToWatch = getAllTxsToWatch(await newTxData);
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
newTxData,
|
newTxData,
|
||||||
changeAddressForTransactions,
|
changeAddressForTransactions,
|
||||||
|
@ -1358,7 +1358,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (shouldRefresh) {
|
if (shouldRefresh) {
|
||||||
refresh();
|
unawaited(refresh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -251,7 +251,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> updateStoredChainHeight({required int newHeight}) async {
|
Future<void> updateStoredChainHeight({required int newHeight}) async {
|
||||||
DB.instance.put<dynamic>(
|
await DB.instance.put<dynamic>(
|
||||||
boxName: walletId, key: "storedChainHeight", value: newHeight);
|
boxName: walletId, key: "storedChainHeight", value: newHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -365,7 +365,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
"index: $index, \t GapCounter $account ${type.name}: $gapCounter",
|
"index: $index, \t GapCounter $account ${type.name}: $gapCounter",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
|
|
||||||
final ID = "k_$index";
|
final _id = "k_$index";
|
||||||
Map<String, String> txCountCallArgs = {};
|
Map<String, String> txCountCallArgs = {};
|
||||||
final Map<String, dynamic> receivingNodes = {};
|
final Map<String, dynamic> receivingNodes = {};
|
||||||
|
|
||||||
|
@ -392,13 +392,13 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
throw Exception("No Path type $type exists");
|
throw Exception("No Path type $type exists");
|
||||||
}
|
}
|
||||||
receivingNodes.addAll({
|
receivingNodes.addAll({
|
||||||
"${ID}_$j": {
|
"${_id}_$j": {
|
||||||
"node": node,
|
"node": node,
|
||||||
"address": address,
|
"address": address,
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
txCountCallArgs.addAll({
|
txCountCallArgs.addAll({
|
||||||
"${ID}_$j": address,
|
"${_id}_$j": address,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -407,9 +407,9 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
|
|
||||||
// check and add appropriate addresses
|
// check and add appropriate addresses
|
||||||
for (int k = 0; k < txCountBatchSize; k++) {
|
for (int k = 0; k < txCountBatchSize; k++) {
|
||||||
int count = counts["${ID}_$k"]!;
|
int count = counts["${_id}_$k"]!;
|
||||||
if (count > 0) {
|
if (count > 0) {
|
||||||
final node = receivingNodes["${ID}_$k"];
|
final node = receivingNodes["${_id}_$k"];
|
||||||
// add address to array
|
// add address to array
|
||||||
addressArray.add(node["address"] as String);
|
addressArray.add(node["address"] as String);
|
||||||
iterationsAddressArray.add(node["address"] as String);
|
iterationsAddressArray.add(node["address"] as String);
|
||||||
|
@ -455,7 +455,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e, s) {
|
} catch (e) {
|
||||||
//
|
//
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -485,13 +485,13 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
// receiving addresses
|
// receiving addresses
|
||||||
Logging.instance
|
Logging.instance
|
||||||
.log("checking receiving addresses...", level: LogLevel.Info);
|
.log("checking receiving addresses...", level: LogLevel.Info);
|
||||||
Future resultReceive44 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultReceive44 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 0);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 0);
|
||||||
|
|
||||||
Logging.instance
|
Logging.instance
|
||||||
.log("checking change addresses...", level: LogLevel.Info);
|
.log("checking change addresses...", level: LogLevel.Info);
|
||||||
// change addresses
|
// change addresses
|
||||||
Future resultChange44 = _checkGaps(maxNumberOfIndexesToCheck,
|
final resultChange44 = _checkGaps(maxNumberOfIndexesToCheck,
|
||||||
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 1);
|
maxUnusedAddressGap, txCountBatchSize, root, DerivePathType.bip44, 1);
|
||||||
|
|
||||||
await Future.wait([
|
await Future.wait([
|
||||||
|
@ -653,7 +653,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
// notify on new incoming transaction
|
// notify on new incoming transaction
|
||||||
for (final tx in unconfirmedTxnsToNotifyPending) {
|
for (final tx in unconfirmedTxnsToNotifyPending) {
|
||||||
if (tx.txType == "Received") {
|
if (tx.txType == "Received") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Incoming transaction",
|
title: "Incoming transaction",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -664,10 +664,10 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
txid: tx.txid,
|
txid: tx.txid,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedPending(tx.txid);
|
await txTracker.addNotifiedPending(tx.txid);
|
||||||
} else if (tx.txType == "Sent") {
|
} else if (tx.txType == "Sent") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Sending transaction",
|
title: "Sending transaction",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -678,7 +678,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
txid: tx.txid,
|
txid: tx.txid,
|
||||||
confirmations: tx.confirmations,
|
confirmations: tx.confirmations,
|
||||||
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
requiredConfirmations: MINIMUM_CONFIRMATIONS,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedPending(tx.txid);
|
await txTracker.addNotifiedPending(tx.txid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -686,7 +686,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
// notify on confirmed
|
// notify on confirmed
|
||||||
for (final tx in unconfirmedTxnsToNotifyConfirmed) {
|
for (final tx in unconfirmedTxnsToNotifyConfirmed) {
|
||||||
if (tx.txType == "Received") {
|
if (tx.txType == "Received") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Incoming transaction confirmed",
|
title: "Incoming transaction confirmed",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -694,11 +694,11 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
date: DateTime.now(),
|
date: DateTime.now(),
|
||||||
shouldWatchForUpdates: false,
|
shouldWatchForUpdates: false,
|
||||||
coinName: coin.name,
|
coinName: coin.name,
|
||||||
);
|
));
|
||||||
|
|
||||||
await txTracker.addNotifiedConfirmed(tx.txid);
|
await txTracker.addNotifiedConfirmed(tx.txid);
|
||||||
} else if (tx.txType == "Sent") {
|
} else if (tx.txType == "Sent") {
|
||||||
NotificationApi.showNotification(
|
unawaited(NotificationApi.showNotification(
|
||||||
title: "Outgoing transaction confirmed",
|
title: "Outgoing transaction confirmed",
|
||||||
body: walletName,
|
body: walletName,
|
||||||
walletId: walletId,
|
walletId: walletId,
|
||||||
|
@ -706,7 +706,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
date: DateTime.now(),
|
date: DateTime.now(),
|
||||||
shouldWatchForUpdates: false,
|
shouldWatchForUpdates: false,
|
||||||
coinName: coin.name,
|
coinName: coin.name,
|
||||||
);
|
));
|
||||||
await txTracker.addNotifiedConfirmed(tx.txid);
|
await txTracker.addNotifiedConfirmed(tx.txid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -770,7 +770,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
if (currentHeight != storedHeight) {
|
if (currentHeight != storedHeight) {
|
||||||
if (currentHeight != -1) {
|
if (currentHeight != -1) {
|
||||||
// -1 failed to fetch current height
|
// -1 failed to fetch current height
|
||||||
updateStoredChainHeight(newHeight: currentHeight);
|
unawaited(updateStoredChainHeight(newHeight: currentHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.2, walletId));
|
||||||
|
@ -1127,7 +1127,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (shouldRefresh) {
|
if (shouldRefresh) {
|
||||||
refresh();
|
unawaited(refresh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2796,7 +2796,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
);
|
);
|
||||||
|
|
||||||
// clear cache
|
// clear cache
|
||||||
_cachedElectrumXClient.clearSharedTransactionCache(coin: coin);
|
await _cachedElectrumXClient.clearSharedTransactionCache(coin: coin);
|
||||||
|
|
||||||
// back up data
|
// back up data
|
||||||
await _rescanBackup();
|
await _rescanBackup();
|
||||||
|
@ -3062,6 +3062,7 @@ class DogecoinWallet extends CoinServiceAPI {
|
||||||
return available - estimatedFee;
|
return available - estimatedFee;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
Future<bool> generateNewAddress() async {
|
Future<bool> generateNewAddress() async {
|
||||||
try {
|
try {
|
||||||
await _incrementAddressIndexForChain(
|
await _incrementAddressIndexForChain(
|
||||||
|
|
|
@ -225,7 +225,7 @@ Future<void> executeNative(Map<String, dynamic> arguments) async {
|
||||||
sendPort
|
sendPort
|
||||||
.send("Error An error was thrown in this isolate $function: $e\n$s");
|
.send("Error An error was thrown in this isolate $function: $e\n$s");
|
||||||
} finally {
|
} finally {
|
||||||
Logging.instance.isar?.close();
|
await Logging.instance.isar?.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -539,7 +539,7 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
// TODO notify ui/ fire event for node changed?
|
// TODO notify ui/ fire event for node changed?
|
||||||
|
|
||||||
if (shouldRefresh) {
|
if (shouldRefresh) {
|
||||||
refresh();
|
unawaited(refresh());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -705,7 +705,7 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
try {
|
try {
|
||||||
result = await cancelPendingTransaction(tx_slate_id);
|
result = await cancelPendingTransaction(tx_slate_id);
|
||||||
Logging.instance.log("result?: $result", level: LogLevel.Info);
|
Logging.instance.log("result?: $result", level: LogLevel.Info);
|
||||||
if (result != null && !(result.toLowerCase().contains("error"))) {
|
if (!(result.toLowerCase().contains("error"))) {
|
||||||
await postCancel(
|
await postCancel(
|
||||||
receiveAddress, tx_slate_id, signature, sendersAddress);
|
receiveAddress, tx_slate_id, signature, sendersAddress);
|
||||||
}
|
}
|
||||||
|
@ -1180,10 +1180,10 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
transactionFees = message['result'] as String;
|
transactionFees = message['result'] as String;
|
||||||
});
|
});
|
||||||
debugPrint(transactionFees);
|
debugPrint(transactionFees);
|
||||||
var decodeData;
|
dynamic decodeData;
|
||||||
try {
|
try {
|
||||||
decodeData = json.decode(transactionFees!);
|
decodeData = json.decode(transactionFees!);
|
||||||
} catch (e, s) {
|
} catch (e) {
|
||||||
if (ifErrorEstimateFee) {
|
if (ifErrorEstimateFee) {
|
||||||
//Error Not enough funds. Required: 0.56500000, Available: 0.56200000
|
//Error Not enough funds. Required: 0.56500000, Available: 0.56200000
|
||||||
if (transactionFees!.contains("Required")) {
|
if (transactionFees!.contains("Required")) {
|
||||||
|
@ -1705,7 +1705,7 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final String response = message['result'] as String;
|
final String response = message['result'] as String;
|
||||||
if (response == null || response == "") {
|
if (response == "") {
|
||||||
Logging.instance.log("response: ${response.runtimeType}",
|
Logging.instance.log("response: ${response.runtimeType}",
|
||||||
level: LogLevel.Info);
|
level: LogLevel.Info);
|
||||||
await deleteSlate(currentAddress,
|
await deleteSlate(currentAddress,
|
||||||
|
@ -1921,7 +1921,7 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
if (currentHeight != storedHeight) {
|
if (currentHeight != storedHeight) {
|
||||||
if (currentHeight != -1) {
|
if (currentHeight != -1) {
|
||||||
// -1 failed to fetch current height
|
// -1 failed to fetch current height
|
||||||
updateStoredChainHeight(newHeight: currentHeight);
|
unawaited(updateStoredChainHeight(newHeight: currentHeight));
|
||||||
}
|
}
|
||||||
|
|
||||||
final newTxData = _fetchTransactionData();
|
final newTxData = _fetchTransactionData();
|
||||||
|
@ -2288,7 +2288,7 @@ class EpicCashWallet extends CoinServiceAPI {
|
||||||
timer?.cancel();
|
timer?.cancel();
|
||||||
timer = null;
|
timer = null;
|
||||||
if (isActive) {
|
if (isActive) {
|
||||||
startSync();
|
unawaited(startSync());
|
||||||
} else {
|
} else {
|
||||||
for (final isolate in isolates.values) {
|
for (final isolate in isolates.values) {
|
||||||
isolate.kill(priority: Isolate.immediate);
|
isolate.kill(priority: Isolate.immediate);
|
||||||
|
|
|
@ -1127,7 +1127,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final balance =
|
final balance =
|
||||||
Format.decimalAmountToSatoshis(await availablePrivateBalance());
|
Format.decimalAmountToSatoshis(await availablePrivateBalance());
|
||||||
if (satoshiAmount == balance) {
|
if (satoshiAmount == balance) {
|
||||||
print("is send all");
|
// print("is send all");
|
||||||
isSendAll = true;
|
isSendAll = true;
|
||||||
}
|
}
|
||||||
dynamic txHexOrError =
|
dynamic txHexOrError =
|
||||||
|
@ -2796,18 +2796,18 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final listTxData = txData.getAllTransactions();
|
final listTxData = txData.getAllTransactions();
|
||||||
listTxData.forEach((key, value) {
|
listTxData.forEach((key, value) {
|
||||||
// ignore change addresses
|
// ignore change addresses
|
||||||
bool hasAtLeastOneReceive = false;
|
// bool hasAtLeastOneReceive = false;
|
||||||
// int howManyReceiveInputs = 0;
|
// int howManyReceiveInputs = 0;
|
||||||
for (var element in value.inputs) {
|
// for (var element in value.inputs) {
|
||||||
if (listLelantusTxData.containsKey(element.txid) &&
|
// if (listLelantusTxData.containsKey(element.txid) &&
|
||||||
listLelantusTxData[element.txid]!.txType == "Received"
|
// listLelantusTxData[element.txid]!.txType == "Received"
|
||||||
// &&
|
// // &&
|
||||||
// listLelantusTxData[element.txid].subType != "mint"
|
// // listLelantusTxData[element.txid].subType != "mint"
|
||||||
) {
|
// ) {
|
||||||
hasAtLeastOneReceive = true;
|
// // hasAtLeastOneReceive = true;
|
||||||
// howManyReceiveInputs++;
|
// // howManyReceiveInputs++;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (value.txType == "Received" && value.subType != "mint") {
|
if (value.txType == "Received" && value.subType != "mint") {
|
||||||
// Every receive other than a mint should be shown. Mints will be collected and shown from the send side
|
// Every receive other than a mint should be shown. Mints will be collected and shown from the send side
|
||||||
|
@ -4238,7 +4238,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
Future<void> _restore(int latestSetId, Map<dynamic, dynamic> setDataMap,
|
Future<void> _restore(int latestSetId, Map<dynamic, dynamic> setDataMap,
|
||||||
dynamic usedSerialNumbers) async {
|
dynamic usedSerialNumbers) async {
|
||||||
final mnemonic = await _secureStore.read(key: '${_walletId}_mnemonic');
|
final mnemonic = await _secureStore.read(key: '${_walletId}_mnemonic');
|
||||||
Future data = _txnData;
|
final dataFuture = _txnData;
|
||||||
final String currency = _prefs.currency;
|
final String currency = _prefs.currency;
|
||||||
final Decimal currentPrice = await firoPrice;
|
final Decimal currentPrice = await firoPrice;
|
||||||
|
|
||||||
|
@ -4252,7 +4252,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
"network": _network,
|
"network": _network,
|
||||||
});
|
});
|
||||||
|
|
||||||
await Future.wait([data]);
|
await Future.wait([dataFuture]);
|
||||||
var result = await receivePort.first;
|
var result = await receivePort.first;
|
||||||
if (result is String) {
|
if (result is String) {
|
||||||
Logging.instance
|
Logging.instance
|
||||||
|
@ -4263,8 +4263,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
stop(receivePort);
|
stop(receivePort);
|
||||||
|
|
||||||
final message = await staticProcessRestore(
|
final message = await staticProcessRestore(
|
||||||
(await data) as models.TransactionData,
|
(await dataFuture), result as Map<dynamic, dynamic>);
|
||||||
result as Map<dynamic, dynamic>);
|
|
||||||
|
|
||||||
await DB.instance.put<dynamic>(
|
await DB.instance.put<dynamic>(
|
||||||
boxName: walletId, key: 'mintIndex', value: message['mintIndex']);
|
boxName: walletId, key: 'mintIndex', value: message['mintIndex']);
|
||||||
|
@ -4305,7 +4304,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
final latestSetId = await getLatestSetId();
|
final latestSetId = await getLatestSetId();
|
||||||
|
|
||||||
final List<Map<String, dynamic>> sets = [];
|
final List<Map<String, dynamic>> sets = [];
|
||||||
List<Future> anonFutures = [];
|
List<Future<Map<String, dynamic>>> anonFutures = [];
|
||||||
for (int i = 1; i <= latestSetId; i++) {
|
for (int i = 1; i <= latestSetId; i++) {
|
||||||
final set = cachedElectrumXClient.getAnonymitySet(
|
final set = cachedElectrumXClient.getAnonymitySet(
|
||||||
groupId: "$i",
|
groupId: "$i",
|
||||||
|
@ -4315,8 +4314,7 @@ class FiroWallet extends CoinServiceAPI {
|
||||||
}
|
}
|
||||||
await Future.wait(anonFutures);
|
await Future.wait(anonFutures);
|
||||||
for (int i = 1; i <= latestSetId; i++) {
|
for (int i = 1; i <= latestSetId; i++) {
|
||||||
Map<String, dynamic> set =
|
Map<String, dynamic> set = (await anonFutures[i - 1]);
|
||||||
(await anonFutures[i - 1]) as Map<String, dynamic>;
|
|
||||||
set["setId"] = i;
|
set["setId"] = i;
|
||||||
sets.add(set);
|
sets.add(set);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,8 @@ class Prefs extends ChangeNotifier {
|
||||||
_backupFrequencyType = await _getBackupFrequencyType();
|
_backupFrequencyType = await _getBackupFrequencyType();
|
||||||
_lastAutoBackup = await _getLastAutoBackup();
|
_lastAutoBackup = await _getLastAutoBackup();
|
||||||
_hideBlockExplorerWarning = await _getHideBlockExplorerWarning();
|
_hideBlockExplorerWarning = await _getHideBlockExplorerWarning();
|
||||||
|
_gotoWalletOnStartup = await _getGotoWalletOnStartup();
|
||||||
|
_startupWalletId = await _getStartupWalletId();
|
||||||
|
|
||||||
_initialized = true;
|
_initialized = true;
|
||||||
}
|
}
|
||||||
|
@ -468,8 +470,6 @@ class Prefs extends ChangeNotifier {
|
||||||
boxName: DB.boxNamePrefs, key: "autoBackupFileUri") as DateTime?;
|
boxName: DB.boxNamePrefs, key: "autoBackupFileUri") as DateTime?;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// auto backup
|
// auto backup
|
||||||
|
|
||||||
bool _hideBlockExplorerWarning = false;
|
bool _hideBlockExplorerWarning = false;
|
||||||
|
@ -492,7 +492,56 @@ class Prefs extends ChangeNotifier {
|
||||||
|
|
||||||
Future<bool> _getHideBlockExplorerWarning() async {
|
Future<bool> _getHideBlockExplorerWarning() async {
|
||||||
return await DB.instance.get<dynamic>(
|
return await DB.instance.get<dynamic>(
|
||||||
boxName: DB.boxNamePrefs, key: "hideBlockExplorerWarning") as bool? ??
|
boxName: DB.boxNamePrefs,
|
||||||
|
key: "hideBlockExplorerWarning") as bool? ??
|
||||||
false;
|
false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// auto backup
|
||||||
|
|
||||||
|
bool _gotoWalletOnStartup = false;
|
||||||
|
|
||||||
|
bool get gotoWalletOnStartup => _gotoWalletOnStartup;
|
||||||
|
|
||||||
|
set gotoWalletOnStartup(bool gotoWalletOnStartup) {
|
||||||
|
if (_gotoWalletOnStartup != gotoWalletOnStartup) {
|
||||||
|
DB.instance
|
||||||
|
.put<dynamic>(
|
||||||
|
boxName: DB.boxNamePrefs,
|
||||||
|
key: "gotoWalletOnStartup",
|
||||||
|
value: gotoWalletOnStartup)
|
||||||
|
.then((_) {
|
||||||
|
_gotoWalletOnStartup = gotoWalletOnStartup;
|
||||||
|
notifyListeners();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<bool> _getGotoWalletOnStartup() async {
|
||||||
|
return await DB.instance.get<dynamic>(
|
||||||
|
boxName: DB.boxNamePrefs, key: "gotoWalletOnStartup") as bool? ??
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// startup wallet id
|
||||||
|
|
||||||
|
String? _startupWalletId;
|
||||||
|
|
||||||
|
String? get startupWalletId => _startupWalletId;
|
||||||
|
|
||||||
|
set startupWalletId(String? startupWalletId) {
|
||||||
|
if (this.startupWalletId != startupWalletId) {
|
||||||
|
DB.instance.put<dynamic>(
|
||||||
|
boxName: DB.boxNamePrefs,
|
||||||
|
key: "startupWalletId",
|
||||||
|
value: startupWalletId);
|
||||||
|
_startupWalletId = startupWalletId;
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<String?> _getStartupWalletId() async {
|
||||||
|
return await DB.instance.get<dynamic>(
|
||||||
|
boxName: DB.boxNamePrefs, key: "startupWalletId") as String?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -358,6 +358,28 @@ class MockPrefs extends _i1.Mock implements _i5.Prefs {
|
||||||
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
@override
|
@override
|
||||||
|
bool get hideBlockExplorerWarning =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#hideBlockExplorerWarning),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) =>
|
||||||
|
super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#hideBlockExplorerWarning, hideBlockExplorerWarning),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
bool get gotoWalletOnStartup =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#gotoWalletOnStartup),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod(
|
||||||
|
Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
set startupWalletId(String? startupWalletId) =>
|
||||||
|
super.noSuchMethod(Invocation.setter(#startupWalletId, startupWalletId),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
bool get hasListeners =>
|
bool get hasListeners =>
|
||||||
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
||||||
as bool);
|
as bool);
|
||||||
|
|
|
@ -207,6 +207,28 @@ class MockPrefs extends _i1.Mock implements _i4.Prefs {
|
||||||
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
@override
|
@override
|
||||||
|
bool get hideBlockExplorerWarning =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#hideBlockExplorerWarning),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) =>
|
||||||
|
super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#hideBlockExplorerWarning, hideBlockExplorerWarning),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
bool get gotoWalletOnStartup =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#gotoWalletOnStartup),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod(
|
||||||
|
Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
set startupWalletId(String? startupWalletId) =>
|
||||||
|
super.noSuchMethod(Invocation.setter(#startupWalletId, startupWalletId),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
bool get hasListeners =>
|
bool get hasListeners =>
|
||||||
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
||||||
as bool);
|
as bool);
|
||||||
|
|
|
@ -8,18 +8,20 @@ import 'package:decimal/decimal.dart' as _i7;
|
||||||
import 'package:http/http.dart' as _i4;
|
import 'package:http/http.dart' as _i4;
|
||||||
import 'package:mockito/mockito.dart' as _i1;
|
import 'package:mockito/mockito.dart' as _i1;
|
||||||
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
||||||
as _i12;
|
as _i13;
|
||||||
import 'package:stackwallet/models/exchange/change_now/change_now_response.dart'
|
import 'package:stackwallet/models/exchange/change_now/change_now_response.dart'
|
||||||
as _i2;
|
as _i2;
|
||||||
|
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
|
||||||
|
as _i9;
|
||||||
import 'package:stackwallet/models/exchange/change_now/currency.dart' as _i6;
|
import 'package:stackwallet/models/exchange/change_now/currency.dart' as _i6;
|
||||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||||
as _i8;
|
as _i8;
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||||
as _i10;
|
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
|
||||||
as _i11;
|
as _i11;
|
||||||
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||||
|
as _i12;
|
||||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||||
as _i9;
|
as _i10;
|
||||||
import 'package:stackwallet/services/change_now/change_now.dart' as _i3;
|
import 'package:stackwallet/services/change_now/change_now.dart' as _i3;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
|
@ -98,38 +100,42 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNow {
|
||||||
as _i5
|
as _i5
|
||||||
.Future<_i2.ChangeNowResponse<_i8.EstimatedExchangeAmount>>);
|
.Future<_i2.ChangeNowResponse<_i8.EstimatedExchangeAmount>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<_i8.EstimatedExchangeAmount>>
|
_i5.Future<_i2.ChangeNowResponse<_i9.CNExchangeEstimate>>
|
||||||
getEstimatedFixedRateExchangeAmount(
|
getEstimatedExchangeAmountV2(
|
||||||
{String? fromTicker,
|
{String? fromTicker,
|
||||||
String? toTicker,
|
String? toTicker,
|
||||||
_i7.Decimal? fromAmount,
|
_i9.CNEstimateType? fromOrTo,
|
||||||
bool? useRateId = true,
|
_i7.Decimal? amount,
|
||||||
|
String? fromNetwork,
|
||||||
|
String? toNetwork,
|
||||||
|
_i9.CNFlowType? flow = _i9.CNFlowType.standard,
|
||||||
String? apiKey}) =>
|
String? apiKey}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(#getEstimatedFixedRateExchangeAmount, [], {
|
Invocation.method(#getEstimatedExchangeAmountV2, [], {
|
||||||
#fromTicker: fromTicker,
|
#fromTicker: fromTicker,
|
||||||
#toTicker: toTicker,
|
#toTicker: toTicker,
|
||||||
#fromAmount: fromAmount,
|
#fromOrTo: fromOrTo,
|
||||||
#useRateId: useRateId,
|
#amount: amount,
|
||||||
|
#fromNetwork: fromNetwork,
|
||||||
|
#toNetwork: toNetwork,
|
||||||
|
#flow: flow,
|
||||||
#apiKey: apiKey
|
#apiKey: apiKey
|
||||||
}),
|
}),
|
||||||
returnValue: Future<
|
returnValue: Future<
|
||||||
_i2.ChangeNowResponse<
|
_i2.ChangeNowResponse<_i9.CNExchangeEstimate>>.value(
|
||||||
_i8.EstimatedExchangeAmount>>.value(
|
_FakeChangeNowResponse_0<_i9.CNExchangeEstimate>()))
|
||||||
_FakeChangeNowResponse_0<_i8.EstimatedExchangeAmount>()))
|
as _i5.Future<_i2.ChangeNowResponse<_i9.CNExchangeEstimate>>);
|
||||||
as _i5
|
|
||||||
.Future<_i2.ChangeNowResponse<_i8.EstimatedExchangeAmount>>);
|
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<List<_i9.FixedRateMarket>>>
|
_i5.Future<_i2.ChangeNowResponse<List<_i10.FixedRateMarket>>>
|
||||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<List<_i9.FixedRateMarket>>>.value(
|
Future<_i2.ChangeNowResponse<List<_i10.FixedRateMarket>>>.value(
|
||||||
_FakeChangeNowResponse_0<List<_i9.FixedRateMarket>>())) as _i5
|
_FakeChangeNowResponse_0<List<_i10.FixedRateMarket>>())) as _i5
|
||||||
.Future<_i2.ChangeNowResponse<List<_i9.FixedRateMarket>>>);
|
.Future<_i2.ChangeNowResponse<List<_i10.FixedRateMarket>>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>
|
_i5.Future<_i2.ChangeNowResponse<_i11.ExchangeTransaction>>
|
||||||
createStandardExchangeTransaction(
|
createStandardExchangeTransaction(
|
||||||
{String? fromTicker,
|
{String? fromTicker,
|
||||||
String? toTicker,
|
String? toTicker,
|
||||||
|
@ -155,11 +161,11 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNow {
|
||||||
#apiKey: apiKey
|
#apiKey: apiKey
|
||||||
}),
|
}),
|
||||||
returnValue: Future<
|
returnValue: Future<
|
||||||
_i2.ChangeNowResponse<_i10.ExchangeTransaction>>.value(
|
_i2.ChangeNowResponse<_i11.ExchangeTransaction>>.value(
|
||||||
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) as _i5
|
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>())) as _i5
|
||||||
.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>);
|
.Future<_i2.ChangeNowResponse<_i11.ExchangeTransaction>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>
|
_i5.Future<_i2.ChangeNowResponse<_i11.ExchangeTransaction>>
|
||||||
createFixedRateExchangeTransaction(
|
createFixedRateExchangeTransaction(
|
||||||
{String? fromTicker,
|
{String? fromTicker,
|
||||||
String? toTicker,
|
String? toTicker,
|
||||||
|
@ -187,26 +193,26 @@ class MockChangeNow extends _i1.Mock implements _i3.ChangeNow {
|
||||||
#apiKey: apiKey
|
#apiKey: apiKey
|
||||||
}),
|
}),
|
||||||
returnValue: Future<
|
returnValue: Future<
|
||||||
_i2.ChangeNowResponse<_i10.ExchangeTransaction>>.value(
|
_i2.ChangeNowResponse<_i11.ExchangeTransaction>>.value(
|
||||||
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) as _i5
|
_FakeChangeNowResponse_0<_i11.ExchangeTransaction>())) as _i5
|
||||||
.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>);
|
.Future<_i2.ChangeNowResponse<_i11.ExchangeTransaction>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<_i11.ExchangeTransactionStatus>>
|
_i5.Future<_i2.ChangeNowResponse<_i12.ExchangeTransactionStatus>>
|
||||||
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<_i11.ExchangeTransactionStatus>>.value(
|
Future<_i2.ChangeNowResponse<_i12.ExchangeTransactionStatus>>.value(
|
||||||
_FakeChangeNowResponse_0<_i11.ExchangeTransactionStatus>())) as _i5
|
_FakeChangeNowResponse_0<_i12.ExchangeTransactionStatus>())) as _i5
|
||||||
.Future<_i2.ChangeNowResponse<_i11.ExchangeTransactionStatus>>);
|
.Future<_i2.ChangeNowResponse<_i12.ExchangeTransactionStatus>>);
|
||||||
@override
|
@override
|
||||||
_i5.Future<_i2.ChangeNowResponse<List<_i12.AvailableFloatingRatePair>>>
|
_i5.Future<_i2.ChangeNowResponse<List<_i13.AvailableFloatingRatePair>>>
|
||||||
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
||||||
.noSuchMethod(
|
.noSuchMethod(
|
||||||
Invocation.method(#getAvailableFloatingRatePairs, [],
|
Invocation.method(#getAvailableFloatingRatePairs, [],
|
||||||
{#includePartners: includePartners}),
|
{#includePartners: includePartners}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<List<_i12.AvailableFloatingRatePair>>>.value(
|
Future<_i2.ChangeNowResponse<List<_i13.AvailableFloatingRatePair>>>.value(
|
||||||
_FakeChangeNowResponse_0<List<_i12.AvailableFloatingRatePair>>())) as _i5
|
_FakeChangeNowResponse_0<List<_i13.AvailableFloatingRatePair>>())) as _i5
|
||||||
.Future<_i2.ChangeNowResponse<List<_i12.AvailableFloatingRatePair>>>);
|
.Future<_i2.ChangeNowResponse<List<_i13.AvailableFloatingRatePair>>>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -334,6 +334,10 @@ class MockManager extends _i1.Mock implements _i11.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i10.VoidCallback? listener) =>
|
void addListener(_i10.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -315,6 +315,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -313,6 +313,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -9,18 +9,20 @@ import 'package:decimal/decimal.dart' as _i15;
|
||||||
import 'package:http/http.dart' as _i13;
|
import 'package:http/http.dart' as _i13;
|
||||||
import 'package:mockito/mockito.dart' as _i1;
|
import 'package:mockito/mockito.dart' as _i1;
|
||||||
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
import 'package:stackwallet/models/exchange/change_now/available_floating_rate_pair.dart'
|
||||||
as _i19;
|
as _i20;
|
||||||
import 'package:stackwallet/models/exchange/change_now/change_now_response.dart'
|
import 'package:stackwallet/models/exchange/change_now/change_now_response.dart'
|
||||||
as _i2;
|
as _i2;
|
||||||
|
import 'package:stackwallet/models/exchange/change_now/cn_exchange_estimate.dart'
|
||||||
|
as _i17;
|
||||||
import 'package:stackwallet/models/exchange/change_now/currency.dart' as _i14;
|
import 'package:stackwallet/models/exchange/change_now/currency.dart' as _i14;
|
||||||
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
import 'package:stackwallet/models/exchange/change_now/estimated_exchange_amount.dart'
|
||||||
as _i16;
|
as _i16;
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'
|
||||||
as _i10;
|
as _i10;
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'
|
||||||
as _i18;
|
as _i19;
|
||||||
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'
|
||||||
as _i17;
|
as _i18;
|
||||||
import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'
|
import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'
|
||||||
as _i5;
|
as _i5;
|
||||||
import 'package:stackwallet/services/change_now/change_now.dart' as _i12;
|
import 'package:stackwallet/services/change_now/change_now.dart' as _i12;
|
||||||
|
@ -183,6 +185,28 @@ class MockPrefs extends _i1.Mock implements _i3.Prefs {
|
||||||
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
super.noSuchMethod(Invocation.setter(#lastAutoBackup, lastAutoBackup),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
@override
|
@override
|
||||||
|
bool get hideBlockExplorerWarning =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#hideBlockExplorerWarning),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set hideBlockExplorerWarning(bool? hideBlockExplorerWarning) =>
|
||||||
|
super.noSuchMethod(
|
||||||
|
Invocation.setter(
|
||||||
|
#hideBlockExplorerWarning, hideBlockExplorerWarning),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
bool get gotoWalletOnStartup =>
|
||||||
|
(super.noSuchMethod(Invocation.getter(#gotoWalletOnStartup),
|
||||||
|
returnValue: false) as bool);
|
||||||
|
@override
|
||||||
|
set gotoWalletOnStartup(bool? gotoWalletOnStartup) => super.noSuchMethod(
|
||||||
|
Invocation.setter(#gotoWalletOnStartup, gotoWalletOnStartup),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
|
set startupWalletId(String? startupWalletId) =>
|
||||||
|
super.noSuchMethod(Invocation.setter(#startupWalletId, startupWalletId),
|
||||||
|
returnValueForMissingStub: null);
|
||||||
|
@override
|
||||||
bool get hasListeners =>
|
bool get hasListeners =>
|
||||||
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
(super.noSuchMethod(Invocation.getter(#hasListeners), returnValue: false)
|
||||||
as bool);
|
as bool);
|
||||||
|
@ -386,36 +410,40 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNow {
|
||||||
as _i7
|
as _i7
|
||||||
.Future<_i2.ChangeNowResponse<_i16.EstimatedExchangeAmount>>);
|
.Future<_i2.ChangeNowResponse<_i16.EstimatedExchangeAmount>>);
|
||||||
@override
|
@override
|
||||||
_i7.Future<_i2.ChangeNowResponse<_i16.EstimatedExchangeAmount>>
|
_i7.Future<_i2.ChangeNowResponse<_i17.CNExchangeEstimate>>
|
||||||
getEstimatedFixedRateExchangeAmount(
|
getEstimatedExchangeAmountV2(
|
||||||
{String? fromTicker,
|
{String? fromTicker,
|
||||||
String? toTicker,
|
String? toTicker,
|
||||||
_i15.Decimal? fromAmount,
|
_i17.CNEstimateType? fromOrTo,
|
||||||
bool? useRateId = true,
|
_i15.Decimal? amount,
|
||||||
|
String? fromNetwork,
|
||||||
|
String? toNetwork,
|
||||||
|
_i17.CNFlowType? flow = _i17.CNFlowType.standard,
|
||||||
String? apiKey}) =>
|
String? apiKey}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
Invocation.method(#getEstimatedFixedRateExchangeAmount, [], {
|
Invocation.method(#getEstimatedExchangeAmountV2, [], {
|
||||||
#fromTicker: fromTicker,
|
#fromTicker: fromTicker,
|
||||||
#toTicker: toTicker,
|
#toTicker: toTicker,
|
||||||
#fromAmount: fromAmount,
|
#fromOrTo: fromOrTo,
|
||||||
#useRateId: useRateId,
|
#amount: amount,
|
||||||
|
#fromNetwork: fromNetwork,
|
||||||
|
#toNetwork: toNetwork,
|
||||||
|
#flow: flow,
|
||||||
#apiKey: apiKey
|
#apiKey: apiKey
|
||||||
}),
|
}),
|
||||||
returnValue: Future<
|
returnValue: Future<
|
||||||
_i2.ChangeNowResponse<
|
_i2.ChangeNowResponse<_i17.CNExchangeEstimate>>.value(
|
||||||
_i16.EstimatedExchangeAmount>>.value(
|
_FakeChangeNowResponse_0<_i17.CNExchangeEstimate>()))
|
||||||
_FakeChangeNowResponse_0<_i16.EstimatedExchangeAmount>()))
|
as _i7.Future<_i2.ChangeNowResponse<_i17.CNExchangeEstimate>>);
|
||||||
as _i7
|
|
||||||
.Future<_i2.ChangeNowResponse<_i16.EstimatedExchangeAmount>>);
|
|
||||||
@override
|
@override
|
||||||
_i7.Future<_i2.ChangeNowResponse<List<_i17.FixedRateMarket>>>
|
_i7.Future<_i2.ChangeNowResponse<List<_i18.FixedRateMarket>>>
|
||||||
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
getAvailableFixedRateMarkets({String? apiKey}) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
#getAvailableFixedRateMarkets, [], {#apiKey: apiKey}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<List<_i17.FixedRateMarket>>>.value(
|
Future<_i2.ChangeNowResponse<List<_i18.FixedRateMarket>>>.value(
|
||||||
_FakeChangeNowResponse_0<List<_i17.FixedRateMarket>>())) as _i7
|
_FakeChangeNowResponse_0<List<_i18.FixedRateMarket>>())) as _i7
|
||||||
.Future<_i2.ChangeNowResponse<List<_i17.FixedRateMarket>>>);
|
.Future<_i2.ChangeNowResponse<List<_i18.FixedRateMarket>>>);
|
||||||
@override
|
@override
|
||||||
_i7.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>
|
_i7.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>
|
||||||
createStandardExchangeTransaction(
|
createStandardExchangeTransaction(
|
||||||
|
@ -479,22 +507,22 @@ class MockChangeNow extends _i1.Mock implements _i12.ChangeNow {
|
||||||
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) as _i7
|
_FakeChangeNowResponse_0<_i10.ExchangeTransaction>())) as _i7
|
||||||
.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>);
|
.Future<_i2.ChangeNowResponse<_i10.ExchangeTransaction>>);
|
||||||
@override
|
@override
|
||||||
_i7.Future<_i2.ChangeNowResponse<_i18.ExchangeTransactionStatus>>
|
_i7.Future<_i2.ChangeNowResponse<_i19.ExchangeTransactionStatus>>
|
||||||
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
getTransactionStatus({String? id, String? apiKey}) => (super.noSuchMethod(
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
#getTransactionStatus, [], {#id: id, #apiKey: apiKey}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<_i18.ExchangeTransactionStatus>>.value(
|
Future<_i2.ChangeNowResponse<_i19.ExchangeTransactionStatus>>.value(
|
||||||
_FakeChangeNowResponse_0<_i18.ExchangeTransactionStatus>())) as _i7
|
_FakeChangeNowResponse_0<_i19.ExchangeTransactionStatus>())) as _i7
|
||||||
.Future<_i2.ChangeNowResponse<_i18.ExchangeTransactionStatus>>);
|
.Future<_i2.ChangeNowResponse<_i19.ExchangeTransactionStatus>>);
|
||||||
@override
|
@override
|
||||||
_i7.Future<_i2.ChangeNowResponse<List<_i19.AvailableFloatingRatePair>>>
|
_i7.Future<_i2.ChangeNowResponse<List<_i20.AvailableFloatingRatePair>>>
|
||||||
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
getAvailableFloatingRatePairs({bool? includePartners = false}) => (super
|
||||||
.noSuchMethod(
|
.noSuchMethod(
|
||||||
Invocation.method(#getAvailableFloatingRatePairs, [],
|
Invocation.method(#getAvailableFloatingRatePairs, [],
|
||||||
{#includePartners: includePartners}),
|
{#includePartners: includePartners}),
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<_i2.ChangeNowResponse<List<_i19.AvailableFloatingRatePair>>>.value(
|
Future<_i2.ChangeNowResponse<List<_i20.AvailableFloatingRatePair>>>.value(
|
||||||
_FakeChangeNowResponse_0<List<_i19.AvailableFloatingRatePair>>())) as _i7
|
_FakeChangeNowResponse_0<List<_i20.AvailableFloatingRatePair>>())) as _i7
|
||||||
.Future<_i2.ChangeNowResponse<List<_i19.AvailableFloatingRatePair>>>);
|
.Future<_i2.ChangeNowResponse<List<_i20.AvailableFloatingRatePair>>>);
|
||||||
}
|
}
|
||||||
|
|
|
@ -483,6 +483,10 @@ class MockManager extends _i1.Mock implements _i12.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i9.VoidCallback? listener) =>
|
void addListener(_i9.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -373,6 +373,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -373,6 +373,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -373,6 +373,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -371,6 +371,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -483,6 +483,10 @@ class MockManager extends _i1.Mock implements _i12.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i9.VoidCallback? listener) =>
|
void addListener(_i9.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -399,6 +399,10 @@ class MockManager extends _i1.Mock implements _i12.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i11.VoidCallback? listener) =>
|
void addListener(_i11.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -360,6 +360,10 @@ class MockManager extends _i1.Mock implements _i11.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i10.VoidCallback? listener) =>
|
void addListener(_i10.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -360,6 +360,10 @@ class MockManager extends _i1.Mock implements _i11.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i10.VoidCallback? listener) =>
|
void addListener(_i10.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -371,6 +371,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -527,6 +527,10 @@ class MockManager extends _i1.Mock implements _i15.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i14.VoidCallback? listener) =>
|
void addListener(_i14.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -371,6 +371,10 @@ class MockManager extends _i1.Mock implements _i9.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
returnValue: Future<int>.value(0)) as _i6.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i6.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i6.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -250,6 +250,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -249,6 +249,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -248,6 +248,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -270,6 +270,10 @@ class MockManager extends _i1.Mock implements _i8.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i10.VoidCallback? listener) =>
|
void addListener(_i10.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -250,6 +250,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
|
@ -232,6 +232,22 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
super.noSuchMethod(Invocation.method(#stopNetworkAlivePinging, []),
|
super.noSuchMethod(Invocation.method(#stopNetworkAlivePinging, []),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<Map<String, dynamic>> prepareSendPublic(
|
||||||
|
{String? address, int? satoshiAmount, Map<String, dynamic>? args}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(#prepareSendPublic, [], {
|
||||||
|
#address: address,
|
||||||
|
#satoshiAmount: satoshiAmount,
|
||||||
|
#args: args
|
||||||
|
}),
|
||||||
|
returnValue:
|
||||||
|
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
|
||||||
|
as _i8.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i8.Future<String> confirmSendPublic({dynamic txData}) => (super.noSuchMethod(
|
||||||
|
Invocation.method(#confirmSendPublic, [], {#txData: txData}),
|
||||||
|
returnValue: Future<String>.value('')) as _i8.Future<String>);
|
||||||
|
@override
|
||||||
_i8.Future<Map<String, dynamic>> prepareSend(
|
_i8.Future<Map<String, dynamic>> prepareSend(
|
||||||
{String? address, int? satoshiAmount, Map<String, dynamic>? args}) =>
|
{String? address, int? satoshiAmount, Map<String, dynamic>? args}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
|
@ -257,6 +273,47 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
#send, [], {#toAddress: toAddress, #amount: amount, #args: args}),
|
#send, [], {#toAddress: toAddress, #amount: amount, #args: args}),
|
||||||
returnValue: Future<String>.value('')) as _i8.Future<String>);
|
returnValue: Future<String>.value('')) as _i8.Future<String>);
|
||||||
@override
|
@override
|
||||||
|
int estimateTxFee({int? vSize, int? feeRatePerKB}) => (super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#estimateTxFee, [], {#vSize: vSize, #feeRatePerKB: feeRatePerKB}),
|
||||||
|
returnValue: 0) as int);
|
||||||
|
@override
|
||||||
|
dynamic coinSelection(int? satoshiAmountToSend, int? selectedTxFeeRate,
|
||||||
|
String? _recipientAddress, bool? isSendAll,
|
||||||
|
{int? additionalOutputs = 0, List<_i4.UtxoObject>? utxos}) =>
|
||||||
|
super.noSuchMethod(Invocation.method(#coinSelection, [
|
||||||
|
satoshiAmountToSend,
|
||||||
|
selectedTxFeeRate,
|
||||||
|
_recipientAddress,
|
||||||
|
isSendAll
|
||||||
|
], {
|
||||||
|
#additionalOutputs: additionalOutputs,
|
||||||
|
#utxos: utxos
|
||||||
|
}));
|
||||||
|
@override
|
||||||
|
_i8.Future<Map<String, dynamic>> fetchBuildTxData(
|
||||||
|
List<_i4.UtxoObject>? utxosToUse) =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#fetchBuildTxData, [utxosToUse]),
|
||||||
|
returnValue:
|
||||||
|
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
|
||||||
|
as _i8.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
|
_i8.Future<Map<String, dynamic>> buildTransaction(
|
||||||
|
{List<_i4.UtxoObject>? utxosToUse,
|
||||||
|
Map<String, dynamic>? utxoSigningData,
|
||||||
|
List<String>? recipients,
|
||||||
|
List<int>? satoshiAmounts}) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(#buildTransaction, [], {
|
||||||
|
#utxosToUse: utxosToUse,
|
||||||
|
#utxoSigningData: utxoSigningData,
|
||||||
|
#recipients: recipients,
|
||||||
|
#satoshiAmounts: satoshiAmounts
|
||||||
|
}),
|
||||||
|
returnValue:
|
||||||
|
Future<Map<String, dynamic>>.value(<String, dynamic>{}))
|
||||||
|
as _i8.Future<Map<String, dynamic>>);
|
||||||
|
@override
|
||||||
_i8.Future<void> updateNode(bool? shouldRefresh) =>
|
_i8.Future<void> updateNode(bool? shouldRefresh) =>
|
||||||
(super.noSuchMethod(Invocation.method(#updateNode, [shouldRefresh]),
|
(super.noSuchMethod(Invocation.method(#updateNode, [shouldRefresh]),
|
||||||
returnValue: Future<void>.value(),
|
returnValue: Future<void>.value(),
|
||||||
|
@ -293,8 +350,8 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
returnValue: <Map<dynamic, _i10.LelantusCoin>>[])
|
returnValue: <Map<dynamic, _i10.LelantusCoin>>[])
|
||||||
as List<Map<dynamic, _i10.LelantusCoin>>);
|
as List<Map<dynamic, _i10.LelantusCoin>>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<void> autoMint() =>
|
_i8.Future<void> anonymizeAllPublicFunds() =>
|
||||||
(super.noSuchMethod(Invocation.method(#autoMint, []),
|
(super.noSuchMethod(Invocation.method(#anonymizeAllPublicFunds, []),
|
||||||
returnValue: Future<void>.value(),
|
returnValue: Future<void>.value(),
|
||||||
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
@ -325,6 +382,11 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
returnValue: Future<void>.value(),
|
returnValue: Future<void>.value(),
|
||||||
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<void> checkChangeAddressForTransactions() => (super.noSuchMethod(
|
||||||
|
Invocation.method(#checkChangeAddressForTransactions, []),
|
||||||
|
returnValue: Future<void>.value(),
|
||||||
|
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
||||||
|
@override
|
||||||
_i8.Future<void> fillAddresses(String? suppliedMnemonic,
|
_i8.Future<void> fillAddresses(String? suppliedMnemonic,
|
||||||
{int? perBatch = 50, int? numberOfThreads = 4}) =>
|
{int? perBatch = 50, int? numberOfThreads = 4}) =>
|
||||||
(super.noSuchMethod(
|
(super.noSuchMethod(
|
||||||
|
@ -367,6 +429,11 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
returnValue: Future<void>.value(),
|
returnValue: Future<void>.value(),
|
||||||
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<Map<int, dynamic>> getSetDataMap(int? latestSetId) =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#getSetDataMap, [latestSetId]),
|
||||||
|
returnValue: Future<Map<int, dynamic>>.value(<int, dynamic>{}))
|
||||||
|
as _i8.Future<Map<int, dynamic>>);
|
||||||
|
@override
|
||||||
_i8.Future<List<Map<String, dynamic>>> fetchAnonymitySets() =>
|
_i8.Future<List<Map<String, dynamic>>> fetchAnonymitySets() =>
|
||||||
(super.noSuchMethod(Invocation.method(#fetchAnonymitySets, []),
|
(super.noSuchMethod(Invocation.method(#fetchAnonymitySets, []),
|
||||||
returnValue: Future<List<Map<String, dynamic>>>.value(
|
returnValue: Future<List<Map<String, dynamic>>>.value(
|
||||||
|
@ -387,11 +454,11 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
returnValueForMissingStub: Future<void>.value()) as _i8.Future<void>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<dynamic> getCoinsToJoinSplit(int? required) =>
|
_i8.Future<dynamic> getCoinsToJoinSplit(int? required) =>
|
||||||
(super.noSuchMethod(Invocation.method(#GetCoinsToJoinSplit, [required]),
|
(super.noSuchMethod(Invocation.method(#getCoinsToJoinSplit, [required]),
|
||||||
returnValue: Future<dynamic>.value()) as _i8.Future<dynamic>);
|
returnValue: Future<dynamic>.value()) as _i8.Future<dynamic>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<int> estimateJoinSplitFee(int? spendAmount) => (super.noSuchMethod(
|
_i8.Future<int> estimateJoinSplitFee(int? spendAmount) => (super.noSuchMethod(
|
||||||
Invocation.method(#EstimateJoinSplitFee, [spendAmount]),
|
Invocation.method(#estimateJoinSplitFee, [spendAmount]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<int> estimateFeeFor(int? satoshiAmount, int? feeRate) =>
|
_i8.Future<int> estimateFeeFor(int? satoshiAmount, int? feeRate) =>
|
||||||
|
@ -399,6 +466,27 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i8.Future<int> estimateFeeForPublic(int? satoshiAmount, int? feeRate) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(#estimateFeeForPublic, [satoshiAmount, feeRate]),
|
||||||
|
returnValue: Future<int>.value(0)) as _i8.Future<int>);
|
||||||
|
@override
|
||||||
|
int roughFeeEstimate(int? inputCount, int? outputCount, int? feeRatePerKB) =>
|
||||||
|
(super.noSuchMethod(
|
||||||
|
Invocation.method(
|
||||||
|
#roughFeeEstimate, [inputCount, outputCount, feeRatePerKB]),
|
||||||
|
returnValue: 0) as int);
|
||||||
|
@override
|
||||||
|
int sweepAllEstimate(int? feeRate) =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#sweepAllEstimate, [feeRate]),
|
||||||
|
returnValue: 0) as int);
|
||||||
|
@override
|
||||||
|
_i8.Future<List<Map<String, dynamic>>> fastFetch(List<String>? allTxHashes) =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#fastFetch, [allTxHashes]),
|
||||||
|
returnValue: Future<List<Map<String, dynamic>>>.value(
|
||||||
|
<Map<String, dynamic>>[]))
|
||||||
|
as _i8.Future<List<Map<String, dynamic>>>);
|
||||||
|
@override
|
||||||
_i8.Future<List<_i4.Transaction>> getJMintTransactions(
|
_i8.Future<List<_i4.Transaction>> getJMintTransactions(
|
||||||
_i6.CachedElectrumX? cachedClient,
|
_i6.CachedElectrumX? cachedClient,
|
||||||
List<String>? transactions,
|
List<String>? transactions,
|
||||||
|
@ -418,6 +506,20 @@ class MockFiroWallet extends _i1.Mock implements _i7.FiroWallet {
|
||||||
returnValue:
|
returnValue:
|
||||||
Future<List<_i4.Transaction>>.value(<_i4.Transaction>[]))
|
Future<List<_i4.Transaction>>.value(<_i4.Transaction>[]))
|
||||||
as _i8.Future<List<_i4.Transaction>>);
|
as _i8.Future<List<_i4.Transaction>>);
|
||||||
|
@override
|
||||||
|
_i8.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i8.Future<bool>);
|
||||||
|
@override
|
||||||
|
_i8.Future<_i3.Decimal> availablePrivateBalance() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#availablePrivateBalance, []),
|
||||||
|
returnValue: Future<_i3.Decimal>.value(_FakeDecimal_1()))
|
||||||
|
as _i8.Future<_i3.Decimal>);
|
||||||
|
@override
|
||||||
|
_i8.Future<_i3.Decimal> availablePublicBalance() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#availablePublicBalance, []),
|
||||||
|
returnValue: Future<_i3.Decimal>.value(_FakeDecimal_1()))
|
||||||
|
as _i8.Future<_i3.Decimal>);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A class which mocks [ElectrumX].
|
/// A class which mocks [ElectrumX].
|
||||||
|
|
|
@ -250,6 +250,10 @@ class MockManager extends _i1.Mock implements _i5.Manager {
|
||||||
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
Invocation.method(#estimateFeeFor, [satoshiAmount, feeRate]),
|
||||||
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
returnValue: Future<int>.value(0)) as _i7.Future<int>);
|
||||||
@override
|
@override
|
||||||
|
_i7.Future<bool> generateNewAddress() =>
|
||||||
|
(super.noSuchMethod(Invocation.method(#generateNewAddress, []),
|
||||||
|
returnValue: Future<bool>.value(false)) as _i7.Future<bool>);
|
||||||
|
@override
|
||||||
void addListener(_i8.VoidCallback? listener) =>
|
void addListener(_i8.VoidCallback? listener) =>
|
||||||
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
super.noSuchMethod(Invocation.method(#addListener, [listener]),
|
||||||
returnValueForMissingStub: null);
|
returnValueForMissingStub: null);
|
||||||
|
|
Loading…
Reference in a new issue