mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-22 19:39:22 +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/util.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/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -553,7 +553,7 @@ class _NewWalletRecoveryPhraseWarningViewState
|
|||
NewWalletRecoveryPhraseView.routeName,
|
||||
arguments: Tuple2(
|
||||
wallet,
|
||||
await (wallet as MnemonicBasedWallet)
|
||||
await (wallet as MnemonicInterface)
|
||||
.getMnemonicAsWords(),
|
||||
),
|
||||
));
|
||||
|
|
|
@ -26,7 +26,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
|||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/custom_buttons/app_bar_icon_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 {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||
|
||||
try {
|
||||
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/util.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/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
|
@ -71,7 +71,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
|
|||
|
||||
if (shouldCancel == true && mounted) {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||
|
||||
await showLoading(
|
||||
whileFuture: Future.wait([
|
||||
|
@ -233,7 +233,7 @@ class _FusionProgressViewState extends ConsumerState<FusionProgressView> {
|
|||
/// Fuse again.
|
||||
void _fuseAgain() async {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||
|
||||
final fusionInfo =
|
||||
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/wallets/isar/providers/wallet_info_provider.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/desktop/desktop_dialog.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/text_styles.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/custom_buttons/app_bar_icon_button.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/wallets/isar/providers/wallet_info_provider.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/paynym_follow_toggle_button.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/text_styles.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/rounded_white_container.dart';
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/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/text_styles.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/custom_buttons/app_bar_icon_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 {
|
||||
final wallet = ref.read(pWallets).getWallet(walletId);
|
||||
|
||||
if (wallet is MultiAddress) {
|
||||
if (wallet is MultiAddressInterface) {
|
||||
bool shouldPop = false;
|
||||
unawaited(
|
||||
showDialog(
|
||||
|
|
|
@ -51,7 +51,7 @@ import 'package:stackwallet/utilities/text_styles.dart';
|
|||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.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/background.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/util.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/wallet.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
@ -293,7 +293,7 @@ abstract class SWB {
|
|||
backupWallet['id'] = wallet.walletId;
|
||||
backupWallet['isFavorite'] = wallet.info.isFavourite;
|
||||
|
||||
if (wallet is MnemonicBasedWallet) {
|
||||
if (wallet is MnemonicInterface) {
|
||||
backupWallet['mnemonic'] = await wallet.getMnemonic();
|
||||
backupWallet['mnemonicPassphrase'] =
|
||||
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/text_styles.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/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/secondary_button.dart';
|
||||
|
@ -236,7 +236,7 @@ class _WalletSettingsViewState extends ConsumerState<WalletSettingsView> {
|
|||
.read(pWallets)
|
||||
.getWallet(widget.walletId);
|
||||
// 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();
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
|||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -66,7 +66,7 @@ class _ChangeRepresentativeViewState
|
|||
Future<String> loadRepresentative() async {
|
||||
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
||||
|
||||
if (wallet is NanoBased) {
|
||||
if (wallet is NanoInterface) {
|
||||
return wallet.getCurrentRepresentative();
|
||||
} else {
|
||||
throw Exception("Unsupported wallet attempted to show representative!");
|
||||
|
@ -74,7 +74,8 @@ class _ChangeRepresentativeViewState
|
|||
}
|
||||
|
||||
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;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_set
|
|||
import 'package:stackwallet/providers/providers.dart';
|
||||
import 'package:stackwallet/themes/stack_colors.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/custom_buttons/app_bar_icon_button.dart';
|
||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||
|
@ -100,8 +100,8 @@ class DeleteWalletWarningView extends ConsumerWidget {
|
|||
.getPrimaryEnabledButtonStyle(context),
|
||||
onPressed: () async {
|
||||
final wallet = ref.read(pWallets).getWallet(walletId);
|
||||
final mnemonic = await (wallet as MnemonicBasedWallet)
|
||||
.getMnemonicAsWords();
|
||||
final mnemonic =
|
||||
await (wallet as MnemonicInterface).getMnemonicAsWords();
|
||||
if (context.mounted) {
|
||||
await Navigator.of(context).pushNamed(
|
||||
DeleteWalletRecoveryPhraseView.routeName,
|
||||
|
|
|
@ -13,7 +13,7 @@ import 'package:stackwallet/utilities/assets.dart';
|
|||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/utilities/util.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/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -259,7 +259,7 @@ class _FiroRescanRecoveryErrorViewState
|
|||
final wallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId);
|
||||
// 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();
|
||||
|
||||
if (mounted) {
|
||||
|
|
|
@ -69,8 +69,8 @@ import 'package:stackwallet/utilities/logger.dart';
|
|||
import 'package:stackwallet/utilities/show_loading.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/mixins/paynym_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||
import 'package:stackwallet/widgets/background.dart';
|
||||
import 'package:stackwallet/widgets/conditional_parent.dart';
|
||||
import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart';
|
||||
|
@ -1121,7 +1121,8 @@ class _WalletViewState extends ConsumerState<WalletView> {
|
|||
),
|
||||
if (ref.watch(
|
||||
pWallets.select(
|
||||
(value) => value.getWallet(widget.walletId) is CashFusion,
|
||||
(value) => value.getWallet(widget.walletId)
|
||||
is CashFusionInterface,
|
||||
),
|
||||
))
|
||||
WalletNavigationBarItemData(
|
||||
|
|
|
@ -28,7 +28,7 @@ import 'package:stackwallet/utilities/constants.dart';
|
|||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.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/blue_text_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart';
|
||||
|
@ -69,7 +69,7 @@ class _DesktopCashFusion extends ConsumerState<DesktopCashFusionView> {
|
|||
|
||||
Future<void> _startFusion() async {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||
|
||||
try {
|
||||
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/text_styles.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_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
|
@ -123,8 +123,8 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
|
|||
);
|
||||
|
||||
if (shouldCancel == true && mounted) {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
final fusionWallet = ref.read(pWallets).getWallet(widget.walletId)
|
||||
as CashFusionInterface;
|
||||
|
||||
await showLoading(
|
||||
whileFuture: Future.wait([
|
||||
|
@ -292,7 +292,7 @@ class _FusionDialogViewState extends ConsumerState<FusionDialogView> {
|
|||
/// Fuse again.
|
||||
void _fuseAgain() async {
|
||||
final fusionWallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusion;
|
||||
ref.read(pWallets).getWallet(widget.walletId) as CashFusionInterface;
|
||||
|
||||
final fusionInfo =
|
||||
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/themes/stack_colors.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_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
|
@ -114,7 +114,7 @@ class _DesktopAttentionDeleteWallet
|
|||
final wallet =
|
||||
ref.read(pWallets).getWallet(widget.walletId);
|
||||
// TODO: [prio=high] handle other types wallet deletion
|
||||
if (wallet is MnemonicBasedWallet) {
|
||||
if (wallet is MnemonicInterface) {
|
||||
final words = await wallet.getMnemonicAsWords();
|
||||
|
||||
if (mounted) {
|
||||
|
|
|
@ -50,7 +50,7 @@ import 'package:stackwallet/utilities/text_styles.dart';
|
|||
import 'package:stackwallet/utilities/util.dart';
|
||||
import 'package:stackwallet/wallets/isar/providers/wallet_info_provider.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/conditional_parent.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/logger.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_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/desktop/desktop_dialog.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
|
@ -361,7 +361,7 @@ class _DesktopWalletFeaturesState extends ConsumerState<DesktopWalletFeatures> {
|
|||
// manager.hasWhirlpoolSupport ||
|
||||
coin == Coin.banano ||
|
||||
wallet is OrdinalsInterface ||
|
||||
wallet is CashFusion;
|
||||
wallet is CashFusionInterface;
|
||||
|
||||
return Row(
|
||||
children: [
|
||||
|
|
|
@ -19,8 +19,8 @@ import 'package:stackwallet/themes/stack_colors.dart';
|
|||
import 'package:stackwallet/utilities/assets.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
import 'package:stackwallet/utilities/text_styles.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/cash_fusion.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_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_close_button.dart';
|
||||
import 'package:stackwallet/widgets/rounded_container.dart';
|
||||
|
@ -129,7 +129,7 @@ class _MoreFeaturesDialogState extends ConsumerState<MoreFeaturesDialog> {
|
|||
iconAsset: Assets.svg.monkey,
|
||||
onPressed: () => widget.onMonkeyPressed?.call(),
|
||||
),
|
||||
if (wallet is CashFusion)
|
||||
if (wallet is CashFusionInterface)
|
||||
_MoreFeaturesItem(
|
||||
label: "Fusion",
|
||||
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/constants.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_close_button.dart';
|
||||
import 'package:stackwallet/widgets/desktop/primary_button.dart';
|
||||
|
@ -82,7 +82,7 @@ class _UnlockWalletKeysDesktopState
|
|||
final wallet = ref.read(pWallets).getWallet(widget.walletId);
|
||||
|
||||
// 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");
|
||||
}
|
||||
|
||||
|
@ -304,7 +304,7 @@ class _UnlockWalletKeysDesktopState
|
|||
ref.read(pWallets).getWallet(widget.walletId);
|
||||
|
||||
// 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");
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ import 'package:stackwallet/models/isar/models/isar_models.dart';
|
|||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
||||
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';
|
||||
|
||||
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/languages_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';
|
||||
|
||||
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/isar/models/wallet_info.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));
|
||||
|
||||
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/crypto_currency.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/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/paynym_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/paynym_interface.dart';
|
||||
import 'package:tuple/tuple.dart';
|
||||
|
||||
class BitcoinWallet extends Bip39HDWallet
|
||||
with ElectrumX, CoinControl, PaynymInterface {
|
||||
with ElectrumXInterface, CoinControlInterface, PaynymInterface {
|
||||
@override
|
||||
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/crypto_currency.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/mixins/coin_control.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
|
||||
class BitcoincashWallet extends Bip39HDWallet
|
||||
with ElectrumX, CoinControl, CashFusion {
|
||||
with ElectrumXInterface, CoinControlInterface, CashFusionInterface {
|
||||
@override
|
||||
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/crypto_currency.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/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.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));
|
||||
|
||||
@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/crypto_currency.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/mixins/coin_control.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/cash_fusion_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
|
||||
class EcashWallet extends Bip39HDWallet
|
||||
with ElectrumX, CoinControl, CashFusion {
|
||||
with ElectrumXInterface, CoinControlInterface, CashFusionInterface {
|
||||
@override
|
||||
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/crypto_currency.dart';
|
||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/lelantus_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/spark_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/lelantus_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/spark_interface.dart';
|
||||
|
||||
class FiroWallet extends Bip39HDWallet
|
||||
with ElectrumX, LelantusInterface, SparkInterface {
|
||||
with ElectrumXInterface, LelantusInterface, SparkInterface {
|
||||
FiroWallet(CryptoCurrencyNetwork network) : super(Firo(network));
|
||||
|
||||
@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/intermediate/nano_currency.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));
|
||||
}
|
||||
|
|
|
@ -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/models/tx_data.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';
|
||||
|
||||
class WowneroWallet extends CryptonoteWallet with MultiAddress {
|
||||
class WowneroWallet extends CryptonoteWallet with MultiAddressInterface {
|
||||
WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network));
|
||||
|
||||
@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/wallets/crypto_currency/intermediate/bip39_hd_currency.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>
|
||||
with MultiAddress<T> {
|
||||
with MultiAddressInterface<T> {
|
||||
Bip39HDWallet(T cryptoCurrency) : super(cryptoCurrency);
|
||||
|
||||
Future<coinlib.HDPrivateKey> getRootHDNode() async {
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import 'package:isar/isar.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/wallet/mixins/mnemonic_based_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
||||
|
||||
abstract class Bip39Wallet<T extends Bip39Currency> extends Wallet<T>
|
||||
with MnemonicBasedWallet {
|
||||
with MnemonicInterface {
|
||||
Bip39Wallet(T currency) : super(currency);
|
||||
|
||||
List<FilterOperation> get standardReceivingAddressFilters => [
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import 'package:stackwallet/wallets/crypto_currency/intermediate/cryptonote_currency.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';
|
||||
|
||||
abstract class CryptonoteWallet<T extends CryptonoteCurrency> extends Wallet<T>
|
||||
with MnemonicBasedWallet<T> {
|
||||
with MnemonicInterface<T> {
|
||||
CryptonoteWallet(T currency) : super(currency);
|
||||
|
||||
// ========== 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/nano_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/wownero_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/mnemonic_based_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/multi_address.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/mnemonic_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/multi_address_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/private_key_based_wallet.dart';
|
||||
|
||||
abstract class Wallet<T extends CryptoCurrency> {
|
||||
|
@ -132,7 +132,7 @@ abstract class Wallet<T extends CryptoCurrency> {
|
|||
prefs: prefs,
|
||||
);
|
||||
|
||||
if (wallet is MnemonicBasedWallet) {
|
||||
if (wallet is MnemonicInterface) {
|
||||
await secureStorageInterface.write(
|
||||
key: mnemonicKey(walletId: walletInfo.walletId),
|
||||
value: mnemonic!,
|
||||
|
@ -225,7 +225,7 @@ abstract class Wallet<T extends CryptoCurrency> {
|
|||
wallet.prefs = prefs;
|
||||
wallet.nodeService = nodeService;
|
||||
|
||||
if (wallet is ElectrumX) {
|
||||
if (wallet is ElectrumXInterface) {
|
||||
// initialize electrumx instance
|
||||
await wallet.updateNode();
|
||||
}
|
||||
|
@ -413,13 +413,15 @@ abstract class Wallet<T extends CryptoCurrency> {
|
|||
await fetchFuture;
|
||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.70, walletId));
|
||||
|
||||
if (this is MultiAddress) {
|
||||
await (this as MultiAddress).checkReceivingAddressForTransactions();
|
||||
if (this is MultiAddressInterface) {
|
||||
await (this as MultiAddressInterface)
|
||||
.checkReceivingAddressForTransactions();
|
||||
}
|
||||
GlobalEventBus.instance.fire(RefreshPercentChangedEvent(0.80, walletId));
|
||||
|
||||
if (this is MultiAddress) {
|
||||
await (this as MultiAddress).checkChangeAddressForTransactions();
|
||||
if (this is MultiAddressInterface) {
|
||||
await (this as MultiAddressInterface)
|
||||
.checkChangeAddressForTransactions();
|
||||
}
|
||||
// await getAllTxsToWatch();
|
||||
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/logger.dart';
|
||||
import 'package:stackwallet/utilities/stack_file_system.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/coin_control.dart';
|
||||
import 'package:stackwallet/wallets/wallet/mixins/electrumx.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/coin_control_interface.dart';
|
||||
import 'package:stackwallet/wallets/wallet/wallet_mixin_interfaces/electrumx_interface.dart';
|
||||
|
||||
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;
|
||||
|
||||
// setting values on this should notify any listeners (the GUI)
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart';
|
||||
|
||||
mixin CoinControl on Bip39HDWallet {
|
||||
mixin CoinControlInterface on Bip39HDWallet {
|
||||
// any required here?
|
||||
// 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/wallets/models/tx_data.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';
|
||||
|
||||
mixin ElectrumX on Bip39HDWallet {
|
||||
mixin ElectrumXInterface on Bip39HDWallet {
|
||||
late ElectrumXClient electrumXClient;
|
||||
late CachedElectrumXClient electrumXCachedClient;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:stackwallet/wallets/models/tx_data.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({
|
||||
required TxData txData,
|
||||
}) 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/wallet/wallet.dart';
|
||||
|
||||
mixin MnemonicBasedWallet<T extends CryptoCurrency> on Wallet<T> {
|
||||
mixin MnemonicInterface<T extends CryptoCurrency> on Wallet<T> {
|
||||
Future<String> getMnemonic() async {
|
||||
final mnemonic = await secureStorageInterface.read(
|
||||
key: Wallet.mnemonicKey(walletId: info.walletId),
|
|
@ -1,7 +1,7 @@
|
|||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.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> checkReceivingAddressForTransactions();
|
||||
Future<void> generateNewChangeAddress();
|
|
@ -24,7 +24,7 @@ import 'package:tuple/tuple.dart';
|
|||
|
||||
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
|
||||
// the address instead of fetching from db every time we need it in certain
|
||||
// cases
|
|
@ -22,7 +22,7 @@ import 'package:stackwallet/utilities/format.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/wallets/models/tx_data.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';
|
||||
|
||||
const String kPCodeKeyPrefix = "pCode_key_";
|
||||
|
@ -43,7 +43,7 @@ String _sendPaynymAddressDerivationPath(
|
|||
}) =>
|
||||
"${_basePaynymDerivePath(testnet: testnet)}/0/$index";
|
||||
|
||||
mixin PaynymInterface on Bip39HDWallet, ElectrumX {
|
||||
mixin PaynymInterface on Bip39HDWallet, ElectrumXInterface {
|
||||
Amount get _dustLimitP2PKH => Amount(
|
||||
rawValue: BigInt.from(546),
|
||||
fractionDigits: cryptoCurrency.fractionDigits,
|
|
@ -1,8 +1,8 @@
|
|||
import 'package:stackwallet/wallets/models/tx_data.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({
|
||||
required TxData txData,
|
||||
}) 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/utilities/assets.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/secondary_button.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/sync_type_enum.dart' as _i7;
|
||||
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: 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/sync_type_enum.dart' as _i7;
|
||||
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;
|
||||
|
||||
// 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/wallets/crypto_currency/crypto_currency.dart'
|
||||
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;
|
||||
|
||||
// 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/sync_type_enum.dart' as _i6;
|
||||
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: avoid_redundant_argument_values
|
||||
|
@ -1105,8 +1106,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
|||
[],
|
||||
{#apiKey: apiKey},
|
||||
),
|
||||
returnValue: _i8
|
||||
.Future<_i4.ExchangeResponse<List<_i21.FixedRateMarket>>>.value(
|
||||
returnValue: _i8.Future<
|
||||
_i4.ExchangeResponse<List<_i21.FixedRateMarket>>>.value(
|
||||
_FakeExchangeResponse_2<List<_i21.FixedRateMarket>>(
|
||||
this,
|
||||
Invocation.method(
|
||||
|
@ -1147,8 +1148,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i8
|
||||
.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||
returnValue: _i8.Future<
|
||||
_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
||||
this,
|
||||
Invocation.method(
|
||||
|
@ -1204,8 +1205,8 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
|||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i8
|
||||
.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||
returnValue: _i8.Future<
|
||||
_i4.ExchangeResponse<_i22.ExchangeTransaction>>.value(
|
||||
_FakeExchangeResponse_2<_i22.ExchangeTransaction>(
|
||||
this,
|
||||
Invocation.method(
|
||||
|
@ -1229,35 +1230,35 @@ class MockChangeNowAPI extends _i1.Mock implements _i15.ChangeNowAPI {
|
|||
)),
|
||||
) as _i8.Future<_i4.ExchangeResponse<_i22.ExchangeTransaction>>);
|
||||
@override
|
||||
_i8.Future<
|
||||
_i4
|
||||
.ExchangeResponse<_i23.ExchangeTransactionStatus>> getTransactionStatus({
|
||||
_i8.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>
|
||||
getTransactionStatus({
|
||||
required String? id,
|
||||
String? apiKey,
|
||||
}) =>
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i8
|
||||
.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_2<_i23.ExchangeTransactionStatus>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i8.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>);
|
||||
(super.noSuchMethod(
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
returnValue: _i8.Future<
|
||||
_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>.value(
|
||||
_FakeExchangeResponse_2<_i23.ExchangeTransactionStatus>(
|
||||
this,
|
||||
Invocation.method(
|
||||
#getTransactionStatus,
|
||||
[],
|
||||
{
|
||||
#id: id,
|
||||
#apiKey: apiKey,
|
||||
},
|
||||
),
|
||||
)),
|
||||
) as _i8
|
||||
.Future<_i4.ExchangeResponse<_i23.ExchangeTransactionStatus>>);
|
||||
@override
|
||||
_i8.Future<_i4.ExchangeResponse<List<_i24.Pair>>>
|
||||
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/wallets/crypto_currency/crypto_currency.dart'
|
||||
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;
|
||||
|
||||
// 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/wallets/crypto_currency/crypto_currency.dart'
|
||||
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: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'
|
||||
as _i4;
|
||||
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:tuple/tuple.dart' as _i13;
|
||||
|
||||
|
|
Loading…
Reference in a new issue