mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-18 08:34:31 +00:00
consistent wallet mixin interface naming
This commit is contained in:
parent
20d78d617a
commit
185cfd26e2
54 changed files with 157 additions and 145 deletions
|
@ -31,7 +31,7 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
@ -553,7 +553,7 @@ class _NewWalletRecoveryPhraseWarningViewState
|
||||||
NewWalletRecoveryPhraseView.routeName,
|
NewWalletRecoveryPhraseView.routeName,
|
||||||
arguments: Tuple2(
|
arguments: Tuple2(
|
||||||
wallet,
|
wallet,
|
||||||
await (wallet as MnemonicBasedWallet)
|
await (wallet as MnemonicInterface)
|
||||||
.getMnemonicAsWords(),
|
.getMnemonicAsWords(),
|
||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
|
@ -26,7 +26,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.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';
|
||||||
|
@ -65,7 +65,7 @@ class _CashFusionViewState extends ConsumerState<CashFusionView> {
|
||||||
|
|
||||||
Future<void> _startFusion() async {
|
Future<void> _startFusion() async {
|
||||||
final fusionWallet =
|
final fusionWallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fusionWallet.uiState = ref.read(
|
fusionWallet.uiState = ref.read(
|
||||||
|
|
|
@ -22,7 +22,7 @@ import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.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/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
@ -71,7 +71,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
|
||||||
|
|
||||||
if (shouldCancel == true && mounted) {
|
if (shouldCancel == true && mounted) {
|
||||||
final fusionWallet =
|
final fusionWallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||||
|
|
||||||
await showLoading(
|
await showLoading(
|
||||||
whileFuture: Future.wait([
|
whileFuture: Future.wait([
|
||||||
|
@ -233,7 +233,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
|
||||||
/// Fuse again.
|
/// Fuse again.
|
||||||
void _fuseAgain() async {
|
void _fuseAgain() async {
|
||||||
final fusionWallet =
|
final fusionWallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||||
|
|
||||||
final fusionInfo =
|
final fusionInfo =
|
||||||
ref.read(prefsChangeNotifierProvider).getFusionServerInfo(coin);
|
ref.read(prefsChangeNotifierProvider).getFusionServerInfo(coin);
|
||||||
|
|
|
@ -32,7 +32,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/paynym_follow_toggle_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/paynym_follow_toggle_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
|
|
@ -24,7 +24,7 @@ import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.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/desktop/desktop_app_bar.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||||
|
|
|
@ -30,7 +30,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/paynym_follow_toggle_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/paynym_follow_toggle_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
|
|
|
@ -21,7 +21,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
import 'package:stackwallet/widgets/rounded_white_container.dart';
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/multi_address.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.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';
|
||||||
|
@ -62,7 +62,7 @@ class _ReceiveViewState extends ConsumerState<ReceiveView> {
|
||||||
Future<void> generateNewAddress() async {
|
Future<void> generateNewAddress() async {
|
||||||
final wallet = ref.read(pWallets).getWallet(walletId);
|
final wallet = ref.read(pWallets).getWallet(walletId);
|
||||||
|
|
||||||
if (wallet is MultiAddress) {
|
if (wallet is MultiAddressInterface) {
|
||||||
bool shouldPop = false;
|
bool shouldPop = false;
|
||||||
unawaited(
|
unawaited(
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|
|
@ -51,7 +51,7 @@ import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/animated_text.dart';
|
import 'package:stackwallet/widgets/animated_text.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
|
|
@ -42,7 +42,7 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/prefs.dart';
|
import 'package:stackwallet/utilities/prefs.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/private_key_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/private_key_based_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
@ -293,7 +293,7 @@ abstract class SWB {
|
||||||
backupWallet['id'] = wallet.walletId;
|
backupWallet['id'] = wallet.walletId;
|
||||||
backupWallet['isFavorite'] = wallet.info.isFavourite;
|
backupWallet['isFavorite'] = wallet.info.isFavourite;
|
||||||
|
|
||||||
if (wallet is MnemonicBasedWallet) {
|
if (wallet is MnemonicInterface) {
|
||||||
backupWallet['mnemonic'] = await wallet.getMnemonic();
|
backupWallet['mnemonic'] = await wallet.getMnemonic();
|
||||||
backupWallet['mnemonicPassphrase'] =
|
backupWallet['mnemonicPassphrase'] =
|
||||||
await wallet.getMnemonicPassphrase();
|
await wallet.getMnemonicPassphrase();
|
||||||
|
|
|
@ -40,7 +40,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/show_loading.dart';
|
import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.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/desktop/secondary_button.dart';
|
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||||
|
@ -236,7 +236,7 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
|
||||||
.read(pWallets)
|
.read(pWallets)
|
||||||
.getWallet(widget.walletId);
|
.getWallet(widget.walletId);
|
||||||
// TODO: [prio=high] take wallets that don't have amnemonic into account
|
// TODO: [prio=high] take wallets that don't have amnemonic into account
|
||||||
if (wallet is MnemonicBasedWallet) {
|
if (wallet is MnemonicInterface) {
|
||||||
final mnemonic =
|
final mnemonic =
|
||||||
await wallet.getMnemonicAsWords();
|
await wallet.getMnemonicAsWords();
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/show_loading.dart';
|
import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/nano_based.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
@ -66,7 +66,7 @@ class _ChangeRepresentativeViewState
|
||||||
Future<String> loadRepresentative() async {
|
Future<String> loadRepresentative() async {
|
||||||
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
||||||
|
|
||||||
if (wallet is NanoBased) {
|
if (wallet is NanoInterface) {
|
||||||
return wallet.getCurrentRepresentative();
|
return wallet.getCurrentRepresentative();
|
||||||
} else {
|
} else {
|
||||||
throw Exception("Unsupported wallet attempted to show representative!");
|
throw Exception("Unsupported wallet attempted to show representative!");
|
||||||
|
@ -74,7 +74,8 @@ class _ChangeRepresentativeViewState
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _save() async {
|
Future<void> _save() async {
|
||||||
final wallet = ref.read(pWallets).getWallet(widget.walletId) as NanoBased;
|
final wallet =
|
||||||
|
ref.read(pWallets).getWallet(widget.walletId) as NanoInterface;
|
||||||
|
|
||||||
final changeFuture = wallet.changeRepresentative;
|
final changeFuture = wallet.changeRepresentative;
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_set
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/themes/stack_colors.dart';
|
import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.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/rounded_container.dart';
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||||
|
@ -100,8 +100,8 @@ class DeleteWalletWarningView extends ConsumerWidget {
|
||||||
.getPrimaryEnabledButtonStyle(context),
|
.getPrimaryEnabledButtonStyle(context),
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
final wallet = ref.read(pWallets).getWallet(walletId);
|
final wallet = ref.read(pWallets).getWallet(walletId);
|
||||||
final mnemonic = await (wallet as MnemonicBasedWallet)
|
final mnemonic =
|
||||||
.getMnemonicAsWords();
|
await (wallet as MnemonicInterface).getMnemonicAsWords();
|
||||||
if (context.mounted) {
|
if (context.mounted) {
|
||||||
await Navigator.of(context).pushNamed(
|
await Navigator.of(context).pushNamed(
|
||||||
DeleteWalletRecoveryPhraseView.routeName,
|
DeleteWalletRecoveryPhraseView.routeName,
|
||||||
|
|
|
@ -13,7 +13,7 @@ import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
@ -259,7 +259,7 @@ class _FiroRescanRecoveryErrorViewState
|
||||||
final wallet =
|
final wallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId);
|
ref.read(pWallets).getWallet(widget.walletId);
|
||||||
// TODO: [prio=high] take wallets that don't have amnemonic into account
|
// TODO: [prio=high] take wallets that don't have amnemonic into account
|
||||||
if (wallet is MnemonicBasedWallet) {
|
if (wallet is MnemonicInterface) {
|
||||||
final mnemonic = await wallet.getMnemonicAsWords();
|
final mnemonic = await wallet.getMnemonicAsWords();
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|
|
@ -69,8 +69,8 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/show_loading.dart';
|
import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/background.dart';
|
import 'package:stackwallet/widgets/background.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||||
|
@ -1121,7 +1121,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
||||||
),
|
),
|
||||||
if (ref.watch(
|
if (ref.watch(
|
||||||
pWallets.select(
|
pWallets.select(
|
||||||
(value) => value.getWallet(widget.walletId) is CashFusion,
|
(value) => value.getWallet(widget.walletId)
|
||||||
|
is CashFusionInterface,
|
||||||
),
|
),
|
||||||
))
|
))
|
||||||
WalletNavigationBarItemData(
|
WalletNavigationBarItemData(
|
||||||
|
|
|
@ -28,7 +28,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.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';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||||
|
@ -69,7 +69,7 @@ class _DesktopCashFusion extends ConsumerState<DesktopCashFusionView> {
|
||||||
|
|
||||||
Future<void> _startFusion() async {
|
Future<void> _startFusion() async {
|
||||||
final fusionWallet =
|
final fusionWallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
fusionWallet.uiState = ref.read(
|
fusionWallet.uiState = ref.read(
|
||||||
|
|
|
@ -11,7 +11,7 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/show_loading.dart';
|
import 'package:stackwallet/utilities/show_loading.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
@ -123,8 +123,8 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (shouldCancel == true && mounted) {
|
if (shouldCancel == true && mounted) {
|
||||||
final fusionWallet =
|
final fusionWallet = ref.read(pWallets).getWallet(widget.walletId)
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
as CashFusionInterface;
|
||||||
|
|
||||||
await showLoading(
|
await showLoading(
|
||||||
whileFuture: Future.wait([
|
whileFuture: Future.wait([
|
||||||
|
@ -292,7 +292,7 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
|
||||||
/// Fuse again.
|
/// Fuse again.
|
||||||
void _fuseAgain() async {
|
void _fuseAgain() async {
|
||||||
final fusionWallet =
|
final fusionWallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||||
|
|
||||||
final fusionInfo =
|
final fusionInfo =
|
||||||
ref.read(prefsChangeNotifierProvider).getFusionServerInfo(coin);
|
ref.read(prefsChangeNotifierProvider).getFusionServerInfo(coin);
|
||||||
|
|
|
@ -14,7 +14,7 @@ import 'package:stackwallet/pages_desktop_specific/my_stack_view/wallet_view/sub
|
||||||
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
import 'package:stackwallet/providers/global/wallets_provider.dart';
|
||||||
import 'package:stackwallet/themes/stack_colors.dart';
|
import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
@ -114,7 +114,7 @@ class _DesktopAttentionDeleteWallet
|
||||||
final wallet =
|
final wallet =
|
||||||
ref.read(pWallets).getWallet(widget.walletId);
|
ref.read(pWallets).getWallet(widget.walletId);
|
||||||
// TODO: [prio=high] handle other types wallet deletion
|
// TODO: [prio=high] handle other types wallet deletion
|
||||||
if (wallet is MnemonicBasedWallet) {
|
if (wallet is MnemonicInterface) {
|
||||||
final words = await wallet.getMnemonicAsWords();
|
final words = await wallet.getMnemonicAsWords();
|
||||||
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
|
|
|
@ -50,7 +50,7 @@ import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/animated_text.dart';
|
import 'package:stackwallet/widgets/animated_text.dart';
|
||||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||||
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
import 'package:stackwallet/widgets/custom_buttons/blue_text_button.dart';
|
||||||
|
|
|
@ -40,8 +40,8 @@ import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
import 'package:stackwallet/widgets/custom_loading_overlay.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
@ -361,7 +361,7 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
|
||||||
// manager.hasWhirlpoolSupport ||
|
// manager.hasWhirlpoolSupport ||
|
||||||
coin == Coin.banano ||
|
coin == Coin.banano ||
|
||||||
wallet is OrdinalsInterface ||
|
wallet is OrdinalsInterface ||
|
||||||
wallet is CashFusion;
|
wallet is CashFusionInterface;
|
||||||
|
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
|
|
|
@ -19,8 +19,8 @@ import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||||
|
@ -129,7 +129,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
|
||||||
iconAsset: Assets.svg.monkey,
|
iconAsset: Assets.svg.monkey,
|
||||||
onPressed: () => widget.onMonkeyPressed?.call(),
|
onPressed: () => widget.onMonkeyPressed?.call(),
|
||||||
),
|
),
|
||||||
if (wallet is CashFusion)
|
if (wallet is CashFusionInterface)
|
||||||
_MoreFeaturesItem(
|
_MoreFeaturesItem(
|
||||||
label: "Fusion",
|
label: "Fusion",
|
||||||
detail: "Decentralized mixing protocol",
|
detail: "Decentralized mixing protocol",
|
||||||
|
|
|
@ -21,7 +21,7 @@ import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
import 'package:stackwallet/widgets/desktop/desktop_dialog_close_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
|
@ -82,7 +82,7 @@ class _UnlockWalletKeysDesktopState
|
||||||
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
||||||
|
|
||||||
// TODO: [prio=high] handle wallets that don't have a mnemonic
|
// TODO: [prio=high] handle wallets that don't have a mnemonic
|
||||||
if (wallet is! MnemonicBasedWallet) {
|
if (wallet is! MnemonicInterface) {
|
||||||
throw Exception("FIXME ~= see todo in code");
|
throw Exception("FIXME ~= see todo in code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ class _UnlockWalletKeysDesktopState
|
||||||
ref.read(pWallets).getWallet(widget.walletId);
|
ref.read(pWallets).getWallet(widget.walletId);
|
||||||
|
|
||||||
// TODO: [prio=high] handle wallets that don't have a mnemonic
|
// TODO: [prio=high] handle wallets that don't have a mnemonic
|
||||||
if (wallet is! MnemonicBasedWallet) {
|
if (wallet is! MnemonicInterface) {
|
||||||
throw Exception("FIXME ~= see todo in code");
|
throw Exception("FIXME ~= see todo in code");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart' as util;
|
import 'package:stackwallet/utilities/util.dart' as util;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
mixin ElectrumXParsing {
|
mixin ElectrumXParsing {
|
||||||
|
|
|
@ -20,7 +20,7 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/enums/languages_enum.dart';
|
import 'package:stackwallet/utilities/enums/languages_enum.dart';
|
||||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
|
import 'package:stackwallet/utilities/enums/sync_type_enum.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
class Prefs extends ChangeNotifier {
|
class Prefs extends ChangeNotifier {
|
||||||
|
|
|
@ -3,9 +3,9 @@ import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/intermediate/nano_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/nano_currency.dart';
|
||||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/nano_based.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart';
|
||||||
|
|
||||||
class BananoWallet extends Bip39Wallet<NanoCurrency> with NanoBased {
|
class BananoWallet extends Bip39Wallet<NanoCurrency> with NanoInterface {
|
||||||
BananoWallet(CryptoCurrencyNetwork network) : super(Banano(network));
|
BananoWallet(CryptoCurrencyNetwork network) : super(Banano(network));
|
||||||
|
|
||||||
Future<void> updateMonkeyImageBytes(List<int> bytes) async {
|
Future<void> updateMonkeyImageBytes(List<int> bytes) async {
|
||||||
|
|
|
@ -5,13 +5,13 @@ import 'package:stackwallet/utilities/extensions/extensions.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoin.dart';
|
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoin.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class BitcoinWallet extends Bip39HDWallet
|
class BitcoinWallet extends Bip39HDWallet
|
||||||
with ElectrumX, CoinControl, PaynymInterface {
|
with ElectrumXInterface, CoinControlInterface, PaynymInterface {
|
||||||
@override
|
@override
|
||||||
int get isarTransactionVersion => 1; // TODO actually set this to 2
|
int get isarTransactionVersion => 1; // TODO actually set this to 2
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,12 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoincash.dart';
|
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoincash.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
|
|
||||||
class BitcoincashWallet extends Bip39HDWallet
|
class BitcoincashWallet extends Bip39HDWallet
|
||||||
with ElectrumX, CoinControl, CashFusion {
|
with ElectrumXInterface, CoinControlInterface, CashFusionInterface {
|
||||||
@override
|
@override
|
||||||
int get isarTransactionVersion => 2;
|
int get isarTransactionVersion => 2;
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,12 @@ import 'package:stackwallet/utilities/extensions/extensions.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/coins/dogecoin.dart';
|
import 'package:stackwallet/wallets/crypto_currency/coins/dogecoin.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class DogecoinWallet extends Bip39HDWallet with ElectrumX, CoinControl {
|
class DogecoinWallet extends Bip39HDWallet
|
||||||
|
with ElectrumXInterface, CoinControlInterface {
|
||||||
DogecoinWallet(CryptoCurrencyNetwork network) : super(Dogecoin(network));
|
DogecoinWallet(CryptoCurrencyNetwork network) : super(Dogecoin(network));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -16,12 +16,12 @@ import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/coins/ecash.dart';
|
import 'package:stackwallet/wallets/crypto_currency/coins/ecash.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
|
|
||||||
class EcashWallet extends Bip39HDWallet
|
class EcashWallet extends Bip39HDWallet
|
||||||
with ElectrumX, CoinControl, CashFusion {
|
with ElectrumXInterface, CoinControlInterface, CashFusionInterface {
|
||||||
@override
|
@override
|
||||||
int get isarTransactionVersion => 2;
|
int get isarTransactionVersion => 2;
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,12 @@ import 'package:stackwallet/utilities/amount/amount.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/coins/firo.dart';
|
import 'package:stackwallet/wallets/crypto_currency/coins/firo.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/lelantus_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/lelantus_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/spark_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart';
|
||||||
|
|
||||||
class FiroWallet extends Bip39HDWallet
|
class FiroWallet extends Bip39HDWallet
|
||||||
with ElectrumX, LelantusInterface, SparkInterface {
|
with ElectrumXInterface, LelantusInterface, SparkInterface {
|
||||||
FiroWallet(CryptoCurrencyNetwork network) : super(Firo(network));
|
FiroWallet(CryptoCurrencyNetwork network) : super(Firo(network));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -2,8 +2,8 @@ import 'package:stackwallet/wallets/crypto_currency/coins/nano.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/intermediate/nano_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/nano_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/nano_based.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/nano_interface.dart';
|
||||||
|
|
||||||
class NanoWallet extends Bip39Wallet<NanoCurrency> with NanoBased {
|
class NanoWallet extends Bip39Wallet<NanoCurrency> with NanoInterface {
|
||||||
NanoWallet(CryptoCurrencyNetwork network) : super(Nano(network));
|
NanoWallet(CryptoCurrencyNetwork network) : super(Nano(network));
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,10 +42,10 @@ import 'package:stackwallet/wallets/crypto_currency/coins/wownero.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/cryptonote_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/cryptonote_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/multi_address.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class WowneroWallet extends CryptonoteWallet with MultiAddress {
|
class WowneroWallet extends CryptonoteWallet with MultiAddressInterface {
|
||||||
WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network));
|
WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network));
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
|
@ -7,10 +7,10 @@ import 'package:stackwallet/utilities/amount/amount.dart';
|
||||||
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
|
import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/intermediate/bip39_hd_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/bip39_hd_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/multi_address.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart';
|
||||||
|
|
||||||
abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
abstract class Bip39HDWallet<T extends Bip39HDCurrency> extends Bip39Wallet<T>
|
||||||
with MultiAddress<T> {
|
with MultiAddressInterface<T> {
|
||||||
Bip39HDWallet(T cryptoCurrency) : super(cryptoCurrency);
|
Bip39HDWallet(T cryptoCurrency) : super(cryptoCurrency);
|
||||||
|
|
||||||
Future<coinlib.HDPrivateKey> getRootHDNode() async {
|
Future<coinlib.HDPrivateKey> getRootHDNode() async {
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
import 'package:isar/isar.dart';
|
import 'package:isar/isar.dart';
|
||||||
import 'package:stackwallet/models/isar/models/blockchain_data/address.dart';
|
import 'package:stackwallet/models/isar/models/blockchain_data/address.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/intermediate/bip39_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/bip39_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
|
|
||||||
abstract class Bip39Wallet<T extends Bip39Currency> extends Wallet<T>
|
abstract class Bip39Wallet<T extends Bip39Currency> extends Wallet<T>
|
||||||
with MnemonicBasedWallet {
|
with MnemonicInterface {
|
||||||
Bip39Wallet(T currency) : super(currency);
|
Bip39Wallet(T currency) : super(currency);
|
||||||
|
|
||||||
List<FilterOperation> get standardReceivingAddressFilters => [
|
List<FilterOperation> get standardReceivingAddressFilters => [
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
import 'package:stackwallet/wallets/crypto_currency/intermediate/cryptonote_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/intermediate/cryptonote_currency.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
|
|
||||||
abstract class CryptonoteWallet<T extends CryptonoteCurrency> extends Wallet<T>
|
abstract class CryptonoteWallet<T extends CryptonoteCurrency> extends Wallet<T>
|
||||||
with MnemonicBasedWallet<T> {
|
with MnemonicInterface<T> {
|
||||||
CryptonoteWallet(T currency) : super(currency);
|
CryptonoteWallet(T currency) : super(currency);
|
||||||
|
|
||||||
// ========== Overrides ======================================================
|
// ========== Overrides ======================================================
|
||||||
|
|
|
@ -31,9 +31,9 @@ import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/impl/firo_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/impl/firo_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/impl/nano_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/impl/nano_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/impl/wownero_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/impl/wownero_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/multi_address.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/private_key_based_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/private_key_based_wallet.dart';
|
||||||
|
|
||||||
abstract class Wallet<T extends CryptoCurrency> {
|
abstract class Wallet<T extends CryptoCurrency> {
|
||||||
|
@ -132,7 +132,7 @@ abstract class Wallet<T extends CryptoCurrency> {
|
||||||
prefs: prefs,
|
prefs: prefs,
|
||||||
);
|
);
|
||||||
|
|
||||||
if (wallet is MnemonicBasedWallet) {
|
if (wallet is MnemonicInterface) {
|
||||||
await secureStorageInterface.write(
|
await secureStorageInterface.write(
|
||||||
key: mnemonicKey(walletId: walletInfo.walletId),
|
key: mnemonicKey(walletId: walletInfo.walletId),
|
||||||
value: mnemonic!,
|
value: mnemonic!,
|
||||||
|
@ -225,7 +225,7 @@ abstract class Wallet<T extends CryptoCurrency> {
|
||||||
wallet.prefs = prefs;
|
wallet.prefs = prefs;
|
||||||
wallet.nodeService = nodeService;
|
wallet.nodeService = nodeService;
|
||||||
|
|
||||||
if (wallet is ElectrumX) {
|
if (wallet is ElectrumXInterface) {
|
||||||
// initialize electrumx instance
|
// initialize electrumx instance
|
||||||
await wallet.updateNode();
|
await wallet.updateNode();
|
||||||
}
|
}
|
||||||
|
@ -413,13 +413,15 @@ abstract class Wallet<T extends CryptoCurrency> {
|
||||||
await fetchFuture;
|
await fetchFuture;
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId));
|
||||||
|
|
||||||
if (this is MultiAddress) {
|
if (this is MultiAddressInterface) {
|
||||||
await (this as MultiAddress).checkReceivingAddressForTransactions();
|
await (this as MultiAddressInterface)
|
||||||
|
.checkReceivingAddressForTransactions();
|
||||||
}
|
}
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId));
|
||||||
|
|
||||||
if (this is MultiAddress) {
|
if (this is MultiAddressInterface) {
|
||||||
await (this as MultiAddress).checkChangeAddressForTransactions();
|
await (this as MultiAddressInterface)
|
||||||
|
.checkChangeAddressForTransactions();
|
||||||
}
|
}
|
||||||
// await getAllTxsToWatch();
|
// await getAllTxsToWatch();
|
||||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.90, walletId));
|
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.90, walletId));
|
||||||
|
|
|
@ -14,8 +14,8 @@ import 'package:stackwallet/services/fusion_tor_service.dart';
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/utilities/stack_file_system.dart';
|
import 'package:stackwallet/utilities/stack_file_system.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
|
|
||||||
const String kReservedFusionAddress = "reserved_fusion_address";
|
const String kReservedFusionAddress = "reserved_fusion_address";
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class FusionInfo {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mixin CashFusion on CoinControl, ElectrumX {
|
mixin CashFusionInterface on CoinControlInterface, ElectrumXInterface {
|
||||||
final _torService = FusionTorService.sharedInstance;
|
final _torService = FusionTorService.sharedInstance;
|
||||||
|
|
||||||
// setting values on this should notify any listeners (the GUI)
|
// setting values on this should notify any listeners (the GUI)
|
|
@ -1,6 +1,6 @@
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
|
|
||||||
mixin CoinControl on Bip39HDWallet {
|
mixin CoinControlInterface on Bip39HDWallet {
|
||||||
// any required here?
|
// any required here?
|
||||||
// currently only used to id which wallets support coin control
|
// currently only used to id which wallets support coin control
|
||||||
}
|
}
|
|
@ -18,10 +18,10 @@ import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:uuid/uuid.dart';
|
import 'package:uuid/uuid.dart';
|
||||||
|
|
||||||
mixin ElectrumX on Bip39HDWallet {
|
mixin ElectrumXInterface on Bip39HDWallet {
|
||||||
late ElectrumXClient electrumXClient;
|
late ElectrumXClient electrumXClient;
|
||||||
late CachedElectrumXClient electrumXCachedClient;
|
late CachedElectrumXClient electrumXCachedClient;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
|
|
||||||
mixin LelantusInterface on Bip39HDWallet, ElectrumX {
|
mixin LelantusInterface on Bip39HDWallet, ElectrumXInterface {
|
||||||
Future<TxData> prepareSendLelantus({
|
Future<TxData> prepareSendLelantus({
|
||||||
required TxData txData,
|
required TxData txData,
|
||||||
}) async {
|
}) async {
|
|
@ -2,7 +2,7 @@ import 'package:stackwallet/exceptions/sw_exception.dart';
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
|
|
||||||
mixin MnemonicBasedWallet<T extends CryptoCurrency> on Wallet<T> {
|
mixin MnemonicInterface<T extends CryptoCurrency> on Wallet<T> {
|
||||||
Future<String> getMnemonic() async {
|
Future<String> getMnemonic() async {
|
||||||
final mnemonic = await secureStorageInterface.read(
|
final mnemonic = await secureStorageInterface.read(
|
||||||
key: Wallet.mnemonicKey(walletId: info.walletId),
|
key: Wallet.mnemonicKey(walletId: info.walletId),
|
|
@ -1,7 +1,7 @@
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||||
|
|
||||||
mixin MultiAddress<T extends CryptoCurrency> on Wallet<T> {
|
mixin MultiAddressInterface<T extends CryptoCurrency> on Wallet<T> {
|
||||||
Future<void> generateNewReceivingAddress();
|
Future<void> generateNewReceivingAddress();
|
||||||
Future<void> checkReceivingAddressForTransactions();
|
Future<void> checkReceivingAddressForTransactions();
|
||||||
Future<void> generateNewChangeAddress();
|
Future<void> generateNewChangeAddress();
|
|
@ -24,7 +24,7 @@ import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
const _kWorkServer = "https://rpc.nano.to";
|
const _kWorkServer = "https://rpc.nano.to";
|
||||||
|
|
||||||
mixin NanoBased<T extends NanoCurrency> on Bip39Wallet<T> {
|
mixin NanoInterface<T extends NanoCurrency> on Bip39Wallet<T> {
|
||||||
// since nano based coins only have a single address/account we can cache
|
// since nano based coins only have a single address/account we can cache
|
||||||
// the address instead of fetching from db every time we need it in certain
|
// the address instead of fetching from db every time we need it in certain
|
||||||
// cases
|
// cases
|
|
@ -22,7 +22,7 @@ import 'package:stackwallet/utilities/format.dart';
|
||||||
import 'package:stackwallet/utilities/logger.dart';
|
import 'package:stackwallet/utilities/logger.dart';
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
import 'package:tuple/tuple.dart';
|
import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
const String kPCodeKeyPrefix = "pCode_key_";
|
const String kPCodeKeyPrefix = "pCode_key_";
|
||||||
|
@ -43,7 +43,7 @@ String _sendPaynymAddressDerivationPath(
|
||||||
}) =>
|
}) =>
|
||||||
"${_basePaynymDerivePath(testnet: testnet)}/0/$index";
|
"${_basePaynymDerivePath(testnet: testnet)}/0/$index";
|
||||||
|
|
||||||
mixin PaynymInterface on Bip39HDWallet, ElectrumX {
|
mixin PaynymInterface on Bip39HDWallet, ElectrumXInterface {
|
||||||
Amount get _dustLimitP2PKH => Amount(
|
Amount get _dustLimitP2PKH => Amount(
|
||||||
rawValue: BigInt.from(546),
|
rawValue: BigInt.from(546),
|
||||||
fractionDigits: cryptoCurrency.fractionDigits,
|
fractionDigits: cryptoCurrency.fractionDigits,
|
|
@ -1,8 +1,8 @@
|
||||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||||
|
|
||||||
mixin SparkInterface on Bip39HDWallet, ElectrumX {
|
mixin SparkInterface on Bip39HDWallet, ElectrumXInterface {
|
||||||
Future<TxData> prepareSendSpark({
|
Future<TxData> prepareSendSpark({
|
||||||
required TxData txData,
|
required TxData txData,
|
||||||
}) async {
|
}) async {
|
|
@ -22,7 +22,7 @@ import 'package:stackwallet/providers/wallet/my_paynym_account_state_provider.da
|
||||||
import 'package:stackwallet/themes/stack_colors.dart';
|
import 'package:stackwallet/themes/stack_colors.dart';
|
||||||
import 'package:stackwallet/utilities/assets.dart';
|
import 'package:stackwallet/utilities/assets.dart';
|
||||||
import 'package:stackwallet/utilities/util.dart';
|
import 'package:stackwallet/utilities/util.dart';
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||||
import 'package:stackwallet/widgets/loading_indicator.dart';
|
import 'package:stackwallet/widgets/loading_indicator.dart';
|
||||||
|
|
|
@ -14,7 +14,8 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i8;
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
||||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i7;
|
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i7;
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i6;
|
import 'package:stackwallet/utilities/prefs.dart' as _i6;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i3;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i3;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
// ignore_for_file: avoid_redundant_argument_values
|
// ignore_for_file: avoid_redundant_argument_values
|
||||||
|
|
|
@ -17,7 +17,8 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i8;
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
||||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i7;
|
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i7;
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i6;
|
import 'package:stackwallet/utilities/prefs.dart' as _i6;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i3;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i3;
|
||||||
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i14;
|
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i14;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
|
|
|
@ -31,7 +31,8 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i14;
|
import 'package:stackwallet/utilities/prefs.dart' as _i14;
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i8;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i8;
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
|
|
|
@ -35,7 +35,8 @@ import 'package:stackwallet/utilities/enums/backup_frequency_type.dart' as _i7;
|
||||||
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
import 'package:stackwallet/utilities/enums/coin_enum.dart' as _i10;
|
||||||
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i6;
|
import 'package:stackwallet/utilities/enums/sync_type_enum.dart' as _i6;
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i5;
|
import 'package:stackwallet/utilities/prefs.dart' as _i5;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i2;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i2;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
// ignore_for_file: avoid_redundant_argument_values
|
// ignore_for_file: avoid_redundant_argument_values
|
||||||
|
@ -1105,8 +1106,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
[],
|
[],
|
||||||
{#apiKey: apiKey},
|
{#apiKey: apiKey},
|
||||||
),
|
),
|
||||||
returnValue: _i8
|
returnValue: _i8.Future<
|
||||||
.Future<_i4.ExchangeResponse<List<_i21.FixedRateMarket>>>.value(
|
_i4.ExchangeResponse<List<_i21.FixedRateMarket>>>.value(
|
||||||
_FakeExchangeResponse_2<List<_i21.FixedRateMarket>>(
|
_FakeExchangeResponse_2<List<_i21.FixedRateMarket>>(
|
||||||
this,
|
this,
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
@ -1147,8 +1148,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
#apiKey: apiKey,
|
#apiKey: apiKey,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
returnValue: _i8
|
returnValue: _i8.Future<
|
||||||
.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||||
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
||||||
this,
|
this,
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
@ -1204,8 +1205,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
#apiKey: apiKey,
|
#apiKey: apiKey,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
returnValue: _i8
|
returnValue: _i8.Future<
|
||||||
.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||||
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
||||||
this,
|
this,
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
@ -1229,9 +1230,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
)),
|
)),
|
||||||
) as _i8.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>);
|
) as _i8.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<
|
_i8.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>
|
||||||
_i4
|
getTransactionStatus({
|
||||||
.ExchangeResponse<_i23.ExchangeTransactionStatus>> getTransactionStatus({
|
|
||||||
required String? id,
|
required String? id,
|
||||||
String? apiKey,
|
String? apiKey,
|
||||||
}) =>
|
}) =>
|
||||||
|
@ -1244,8 +1244,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
#apiKey: apiKey,
|
#apiKey: apiKey,
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
returnValue: _i8
|
returnValue: _i8.Future<
|
||||||
.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>.value(
|
_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>.value(
|
||||||
_FakeExchangeResponse_2<_i23.ExchangeTransactionStatus>(
|
_FakeExchangeResponse_2<_i23.ExchangeTransactionStatus>(
|
||||||
this,
|
this,
|
||||||
Invocation.method(
|
Invocation.method(
|
||||||
|
@ -1257,7 +1257,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
)),
|
)),
|
||||||
) as _i8.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>);
|
) as _i8
|
||||||
|
.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>);
|
||||||
@override
|
@override
|
||||||
_i8.Future<_i4.ExchangeResponse<List<_i24.Pair>>>
|
_i8.Future<_i4.ExchangeResponse<List<_i24.Pair>>>
|
||||||
getAvailableFloatingRatePairs({bool? includePartners = false}) =>
|
getAvailableFloatingRatePairs({bool? includePartners = false}) =>
|
||||||
|
|
|
@ -31,7 +31,8 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i14;
|
import 'package:stackwallet/utilities/prefs.dart' as _i14;
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i7;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i7;
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
||||||
|
|
||||||
// ignore_for_file: type=lint
|
// ignore_for_file: type=lint
|
||||||
|
|
|
@ -24,7 +24,8 @@ import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'
|
||||||
import 'package:stackwallet/utilities/prefs.dart' as _i11;
|
import 'package:stackwallet/utilities/prefs.dart' as _i11;
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i6;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i6;
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
||||||
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i20;
|
import 'package:tor_ffi_plugin/tor_ffi_plugin.dart' as _i20;
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,8 @@ import 'package:stackwallet/utilities/prefs.dart' as _i19;
|
||||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart'
|
||||||
as _i4;
|
as _i4;
|
||||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart' as _i35;
|
import 'package:stackwallet/wallets/isar/models/wallet_info.dart' as _i35;
|
||||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart' as _i12;
|
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart'
|
||||||
|
as _i12;
|
||||||
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
import 'package:stackwallet/wallets/wallet/wallet.dart' as _i5;
|
||||||
import 'package:tuple/tuple.dart' as _i13;
|
import 'package:tuple/tuple.dart' as _i13;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue