mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-09 12:19:24 +00:00
slight change to wallet constructors
This commit is contained in:
parent
ae03a9dd49
commit
8ba998af8f
6 changed files with 24 additions and 33 deletions
|
@ -4,6 +4,7 @@ import 'package:stackwallet/utilities/amount/amount.dart';
|
|||
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/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';
|
||||
|
@ -13,7 +14,7 @@ class BitcoinWallet extends Bip39HDWallet with ElectrumX, CoinControl {
|
|||
@override
|
||||
int get isarTransactionVersion => 1; // TODO actually set this to 2
|
||||
|
||||
BitcoinWallet(Bitcoin cryptoCurrency) : super(cryptoCurrency);
|
||||
BitcoinWallet(CryptoCurrencyNetwork network) : super(Bitcoin(network));
|
||||
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation =>
|
||||
|
|
|
@ -14,6 +14,7 @@ import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
|
|||
import 'package:stackwallet/utilities/extensions/extensions.dart';
|
||||
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';
|
||||
|
@ -24,7 +25,8 @@ class BitcoincashWallet extends Bip39HDWallet
|
|||
@override
|
||||
int get isarTransactionVersion => 2;
|
||||
|
||||
BitcoincashWallet(Bitcoincash cryptoCurrency) : super(cryptoCurrency);
|
||||
BitcoincashWallet(CryptoCurrencyNetwork network)
|
||||
: super(Bitcoincash(network));
|
||||
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation => FilterGroup.and(
|
||||
|
|
|
@ -14,6 +14,7 @@ import 'package:stackwallet/utilities/enums/derive_path_type_enum.dart';
|
|||
import 'package:stackwallet/utilities/extensions/extensions.dart';
|
||||
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';
|
||||
|
@ -24,7 +25,7 @@ class EcashWallet extends Bip39HDWallet
|
|||
@override
|
||||
int get isarTransactionVersion => 2;
|
||||
|
||||
EcashWallet(Ecash cryptoCurrency) : super(cryptoCurrency);
|
||||
EcashWallet(CryptoCurrencyNetwork network) : super(Ecash(network));
|
||||
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation => FilterGroup.and(
|
||||
|
|
|
@ -5,11 +5,12 @@ import 'package:stackwallet/utilities/amount/amount.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/test_epic_box_connection.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/epiccash.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||
import 'package:stackwallet/wallets/wallet/intermediate/bip39_wallet.dart';
|
||||
|
||||
class EpiccashWallet extends Bip39Wallet {
|
||||
EpiccashWallet(Epiccash cryptoCurrency) : super(cryptoCurrency);
|
||||
EpiccashWallet(CryptoCurrencyNetwork network) : super(Epiccash(network));
|
||||
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation =>
|
||||
|
|
|
@ -39,13 +39,14 @@ import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart';
|
|||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/stack_file_system.dart';
|
||||
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:tuple/tuple.dart';
|
||||
|
||||
class WowneroWallet extends CryptonoteWallet with MultiAddress {
|
||||
WowneroWallet(Wownero wownero) : super(wownero);
|
||||
WowneroWallet(CryptoCurrencyNetwork network) : super(Wownero(network));
|
||||
|
||||
@override
|
||||
FilterOperation? get changeAddressFilterOperation => null;
|
||||
|
|
|
@ -19,16 +19,12 @@ import 'package:stackwallet/utilities/enums/coin_enum.dart';
|
|||
import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart';
|
||||
import 'package:stackwallet/utilities/logger.dart';
|
||||
import 'package:stackwallet/utilities/prefs.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoin.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/bitcoincash.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/ecash.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/epiccash.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/coins/wownero.dart';
|
||||
import 'package:stackwallet/wallets/crypto_currency/crypto_currency.dart';
|
||||
import 'package:stackwallet/wallets/isar/models/wallet_info.dart';
|
||||
import 'package:stackwallet/wallets/models/tx_data.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/bitcoin_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/bitcoincash_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/dogecoin_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/ecash_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/epiccash_wallet.dart';
|
||||
import 'package:stackwallet/wallets/wallet/impl/wownero_wallet.dart';
|
||||
|
@ -243,39 +239,28 @@ abstract class Wallet<T extends CryptoCurrency> {
|
|||
}) {
|
||||
switch (walletInfo.coin) {
|
||||
case Coin.bitcoin:
|
||||
return BitcoinWallet(
|
||||
Bitcoin(CryptoCurrencyNetwork.main),
|
||||
);
|
||||
|
||||
return BitcoinWallet(CryptoCurrencyNetwork.main);
|
||||
case Coin.bitcoinTestNet:
|
||||
return BitcoinWallet(
|
||||
Bitcoin(CryptoCurrencyNetwork.test),
|
||||
);
|
||||
return BitcoinWallet(CryptoCurrencyNetwork.test);
|
||||
|
||||
case Coin.bitcoincash:
|
||||
return BitcoincashWallet(
|
||||
Bitcoincash(CryptoCurrencyNetwork.main),
|
||||
);
|
||||
|
||||
return BitcoincashWallet(CryptoCurrencyNetwork.main);
|
||||
case Coin.bitcoincashTestnet:
|
||||
return BitcoincashWallet(
|
||||
Bitcoincash(CryptoCurrencyNetwork.test),
|
||||
);
|
||||
return BitcoincashWallet(CryptoCurrencyNetwork.test);
|
||||
|
||||
case Coin.dogecoin:
|
||||
return DogecoinWallet(CryptoCurrencyNetwork.main);
|
||||
case Coin.dogecoinTestNet:
|
||||
return DogecoinWallet(CryptoCurrencyNetwork.test);
|
||||
|
||||
case Coin.eCash:
|
||||
return EcashWallet(
|
||||
Ecash(CryptoCurrencyNetwork.main),
|
||||
);
|
||||
return EcashWallet(CryptoCurrencyNetwork.main);
|
||||
|
||||
case Coin.epicCash:
|
||||
return EpiccashWallet(
|
||||
Epiccash(CryptoCurrencyNetwork.main),
|
||||
);
|
||||
return EpiccashWallet(CryptoCurrencyNetwork.main);
|
||||
|
||||
case Coin.wownero:
|
||||
return WowneroWallet(
|
||||
Wownero(CryptoCurrencyNetwork.main),
|
||||
);
|
||||
return WowneroWallet(CryptoCurrencyNetwork.main);
|
||||
|
||||
default:
|
||||
// should never hit in reality
|
||||
|
|
Loading…
Reference in a new issue