From 016c44754083abaffa0804ba91dd0909cf1532fa Mon Sep 17 00:00:00 2001 From: julian Date: Tue, 14 Nov 2023 15:48:08 -0600 Subject: [PATCH] add coin control mixin --- lib/wallets/wallet/impl/bitcoin_wallet.dart | 3 ++- lib/wallets/wallet/impl/dogecoin_wallet.dart | 3 ++- lib/wallets/wallet/mixins/coin_control.dart | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 lib/wallets/wallet/mixins/coin_control.dart diff --git a/lib/wallets/wallet/impl/bitcoin_wallet.dart b/lib/wallets/wallet/impl/bitcoin_wallet.dart index 652437b5d..23ad82f7d 100644 --- a/lib/wallets/wallet/impl/bitcoin_wallet.dart +++ b/lib/wallets/wallet/impl/bitcoin_wallet.dart @@ -5,10 +5,11 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/extensions/extensions.dart'; import 'package:stackwallet/wallets/crypto_currency/coins/bitcoin.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:tuple/tuple.dart'; -class BitcoinWallet extends Bip39HDWallet with ElectrumX { +class BitcoinWallet extends Bip39HDWallet with ElectrumX, CoinControl { @override int get isarTransactionVersion => 1; // TODO actually set this to 2 diff --git a/lib/wallets/wallet/impl/dogecoin_wallet.dart b/lib/wallets/wallet/impl/dogecoin_wallet.dart index d5338bb46..2a0c08233 100644 --- a/lib/wallets/wallet/impl/dogecoin_wallet.dart +++ b/lib/wallets/wallet/impl/dogecoin_wallet.dart @@ -5,10 +5,11 @@ 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:tuple/tuple.dart'; -class DogecoinWallet extends Bip39HDWallet with ElectrumX { +class DogecoinWallet extends Bip39HDWallet with ElectrumX, CoinControl { DogecoinWallet(CryptoCurrencyNetwork network) : super(Dogecoin(network)); @override diff --git a/lib/wallets/wallet/mixins/coin_control.dart b/lib/wallets/wallet/mixins/coin_control.dart new file mode 100644 index 000000000..433add9d6 --- /dev/null +++ b/lib/wallets/wallet/mixins/coin_control.dart @@ -0,0 +1,6 @@ +import 'package:stackwallet/wallets/wallet/intermediate/bip39_hd_wallet.dart'; + +mixin CoinControl on Bip39HDWallet { + // any required here? + // currently only used to id which wallets support coin control +}