mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-22 10:34:17 +01:00
TMP
This commit is contained in:
@@ -108,18 +108,6 @@ class BitcoinWallet extends Wallet {
|
||||
wallet: wallet);
|
||||
wallet.history = history;
|
||||
await history.init();
|
||||
|
||||
// await wallet.connectToNode(
|
||||
// node: Node(uri: 'https://electrum2.hodlister.co:50002'));
|
||||
|
||||
// final transactions = await history.fetchTransactions();
|
||||
|
||||
// final balance = await wallet.fetchBalance();
|
||||
|
||||
// print('balance\n$balance');
|
||||
|
||||
// transactions.forEach((tx) => print(tx.id));
|
||||
|
||||
await wallet.updateInfo();
|
||||
|
||||
return wallet;
|
||||
@@ -160,10 +148,20 @@ class BitcoinWallet extends Wallet {
|
||||
|
||||
@override
|
||||
Future<PendingTransaction> createTransaction(
|
||||
TransactionCreationCredentials credentials) {
|
||||
final txb = TransactionBuilder(network: bitcoin.bitcoin);
|
||||
TransactionCreationCredentials credentials) async {
|
||||
final txb = bitcoin.TransactionBuilder(network: bitcoin.bitcoin);
|
||||
final transactions = history.transactionsAll;
|
||||
history.transactionsAll.sort((q, w) => q.height.compareTo(w.height));
|
||||
final prevTx = transactions.first;
|
||||
|
||||
// TODO: implement createTransaction
|
||||
txb.setVersion(1);
|
||||
txb.addInput(prevTx, 0);
|
||||
txb.addOutput('address', 112);
|
||||
txb.sign(vin: null, keyPair: null);
|
||||
|
||||
final hex = txb.build().toHex();
|
||||
|
||||
// broadcast transaction to electrum
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,297 @@
|
||||
import 'package:cake_wallet/src/domain/common/wallet_type.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
|
||||
/*
|
||||
*
|
||||
* WalletCredentials
|
||||
*
|
||||
* */
|
||||
|
||||
abstract class WalletCredentials {
|
||||
const WalletCredentials({this.name, this.password});
|
||||
|
||||
final String name;
|
||||
final String password;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* WalletListService
|
||||
*
|
||||
* */
|
||||
|
||||
abstract class WalletListService<N extends WalletCredentials,
|
||||
RFS extends WalletCredentials, RFK extends WalletCredentials> {
|
||||
Future<void> create(N credentials);
|
||||
|
||||
Future<void> restoreFromSeed(RFS credentials);
|
||||
|
||||
Future<void> restoreFromKeys(RFK credentials);
|
||||
|
||||
Future<void> openWallet(String name, String password);
|
||||
|
||||
Future<bool> isWalletExit(String name);
|
||||
|
||||
Future<void> remove(String wallet);
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* BitcoinRestoreWalletFromSeedCredentials
|
||||
*
|
||||
* */
|
||||
|
||||
class BitcoinNewWalletCredentials extends WalletCredentials {}
|
||||
|
||||
/*
|
||||
*
|
||||
* BitcoinRestoreWalletFromSeedCredentials
|
||||
*
|
||||
* */
|
||||
|
||||
class BitcoinRestoreWalletFromSeedCredentials extends WalletCredentials {
|
||||
const BitcoinRestoreWalletFromSeedCredentials(
|
||||
{String name, String password, this.mnemonic})
|
||||
: super(name: name, password: password);
|
||||
|
||||
final String mnemonic;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* BitcoinRestoreWalletFromWIFCredentials
|
||||
*
|
||||
* */
|
||||
|
||||
class BitcoinRestoreWalletFromWIFCredentials extends WalletCredentials {
|
||||
const BitcoinRestoreWalletFromWIFCredentials(
|
||||
{String name, String password, this.wif})
|
||||
: super(name: name, password: password);
|
||||
|
||||
final String wif;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* BitcoinWalletListService
|
||||
*
|
||||
* */
|
||||
|
||||
class BitcoinWalletListService extends WalletListService<
|
||||
BitcoinNewWalletCredentials,
|
||||
BitcoinRestoreWalletFromSeedCredentials,
|
||||
BitcoinRestoreWalletFromWIFCredentials> {
|
||||
@override
|
||||
Future<void> create(BitcoinNewWalletCredentials credentials) async {
|
||||
// TODO: implement create
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isWalletExit(String name) async {
|
||||
// TODO: implement isWalletExit
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> openWallet(String name, String password) async {
|
||||
// TODO: implement openWallet
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
Future<void> remove(String wallet) {
|
||||
// TODO: implement remove
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restoreFromKeys(
|
||||
BitcoinRestoreWalletFromWIFCredentials credentials) async {
|
||||
// TODO: implement restoreFromKeys
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restoreFromSeed(
|
||||
BitcoinRestoreWalletFromSeedCredentials credentials) async {
|
||||
// TODO: implement restoreFromSeed
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* BitcoinWalletListService
|
||||
*
|
||||
* */
|
||||
|
||||
class MoneroWalletListService extends WalletListService<
|
||||
BitcoinNewWalletCredentials,
|
||||
BitcoinRestoreWalletFromSeedCredentials,
|
||||
BitcoinRestoreWalletFromWIFCredentials> {
|
||||
@override
|
||||
Future<void> create(BitcoinNewWalletCredentials credentials) async {
|
||||
// TODO: implement create
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> isWalletExit(String name) async {
|
||||
// TODO: implement isWalletExit
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> openWallet(String name, String password) async {
|
||||
// TODO: implement openWallet
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
Future<void> remove(String wallet) {
|
||||
// TODO: implement remove
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restoreFromKeys(
|
||||
BitcoinRestoreWalletFromWIFCredentials credentials) async {
|
||||
// TODO: implement restoreFromKeys
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> restoreFromSeed(
|
||||
BitcoinRestoreWalletFromSeedCredentials credentials) async {
|
||||
// TODO: implement restoreFromSeed
|
||||
throw UnimplementedError();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* SignUpState
|
||||
*
|
||||
* */
|
||||
|
||||
abstract class WalletCreationState {}
|
||||
|
||||
class WalletCreating extends WalletCreationState {}
|
||||
|
||||
class WalletCreatedSuccessfully extends WalletCreationState {}
|
||||
|
||||
class WalletCreationFailure extends WalletCreationState {
|
||||
WalletCreationFailure({@required this.error});
|
||||
|
||||
final String error;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* WalletCreationService
|
||||
*
|
||||
* */
|
||||
|
||||
class WalletCreationService {
|
||||
WalletCreationState state;
|
||||
WalletListService _service;
|
||||
|
||||
void changeWalletType({@required WalletType type}) {
|
||||
switch (type) {
|
||||
case WalletType.monero:
|
||||
_service = MoneroWalletListService();
|
||||
break;
|
||||
case WalletType.bitcoin:
|
||||
_service = BitcoinWalletListService();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> create(WalletCredentials credentials) async {
|
||||
try {
|
||||
state = WalletCreating();
|
||||
await _service.create(credentials);
|
||||
state = WalletCreatedSuccessfully();
|
||||
} catch (e) {
|
||||
state = WalletCreationFailure(error: e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> restoreFromKeys(WalletCredentials credentials) async {
|
||||
try {
|
||||
state = WalletCreating();
|
||||
await _service.create(credentials);
|
||||
state = WalletCreatedSuccessfully();
|
||||
} catch (e) {
|
||||
state = WalletCreationFailure(error: e.toString());
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> restoreFromSeed(WalletCredentials credentials) async {
|
||||
try {
|
||||
state = WalletCreating();
|
||||
await _service.create(credentials);
|
||||
state = WalletCreatedSuccessfully();
|
||||
} catch (e) {
|
||||
state = WalletCreationFailure(error: e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* AuthService
|
||||
*
|
||||
* */
|
||||
|
||||
//abstract class LoginState {}
|
||||
|
||||
abstract class SetupPinCodeState {}
|
||||
|
||||
class InitialSetupPinCodeState extends SetupPinCodeState {}
|
||||
|
||||
class SetupPinCodeInProgress extends SetupPinCodeState {}
|
||||
|
||||
class SetupPinCodeFinishedSuccessfully extends SetupPinCodeState {}
|
||||
|
||||
class SetupPinCodeFinishedFailure extends SetupPinCodeState {
|
||||
SetupPinCodeFinishedFailure({@required this.error});
|
||||
|
||||
final String error;
|
||||
}
|
||||
|
||||
class AuthService {
|
||||
SetupPinCodeState setupPinCodeState;
|
||||
|
||||
Future<void> setupPinCode({@required String pin}) async {}
|
||||
|
||||
Future<bool> authenticate({@required String pin}) async {
|
||||
return false;
|
||||
}
|
||||
|
||||
void resetSetupPinCodeState() =>
|
||||
setupPinCodeState = InitialSetupPinCodeState();
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* SignUpService
|
||||
*
|
||||
* */
|
||||
|
||||
class SignUpService {
|
||||
SignUpService(
|
||||
{@required this.walletCreationService, @required this.authService});
|
||||
|
||||
WalletCreationService walletCreationService;
|
||||
AuthService authService;
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* AppService
|
||||
*
|
||||
* */
|
||||
|
||||
class AppService {}
|
||||
+6
-47
@@ -1,7 +1,3 @@
|
||||
import 'package:cake_wallet/bitcoin/api.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet.dart';
|
||||
import 'package:cake_wallet/bitcoin/bitcoin_wallet.manager.dart';
|
||||
import 'package:cake_wallet/bitcoin/key.dart';
|
||||
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@@ -40,7 +36,6 @@ import 'package:cake_wallet/src/domain/services/wallet_service.dart';
|
||||
import 'package:cake_wallet/generated/i18n.dart';
|
||||
import 'package:cake_wallet/src/domain/common/language.dart';
|
||||
import 'package:cake_wallet/src/stores/seed_language/seed_language_store.dart';
|
||||
import 'package:cake_wallet/bitcoin/electrum.dart';
|
||||
|
||||
|
||||
void main() async {
|
||||
@@ -48,12 +43,12 @@ void main() async {
|
||||
|
||||
final appDir = await getApplicationDocumentsDirectory();
|
||||
Hive.init(appDir.path);
|
||||
Hive.registerAdapter(ContactAdapter(), 0);
|
||||
Hive.registerAdapter(NodeAdapter(), 1);
|
||||
Hive.registerAdapter(TransactionDescriptionAdapter(), 2);
|
||||
Hive.registerAdapter(TradeAdapter(), 3);
|
||||
Hive.registerAdapter(WalletInfoAdapter(), 4);
|
||||
Hive.registerAdapter(WalletTypeAdapter(), 5);
|
||||
Hive.registerAdapter(ContactAdapter());
|
||||
Hive.registerAdapter(NodeAdapter());
|
||||
Hive.registerAdapter(TransactionDescriptionAdapter());
|
||||
Hive.registerAdapter(TradeAdapter());
|
||||
Hive.registerAdapter(WalletInfoAdapter());
|
||||
Hive.registerAdapter(WalletTypeAdapter());
|
||||
|
||||
final secureStorage = FlutterSecureStorage();
|
||||
final transactionDescriptionsBoxKey = await getEncryptionKey(
|
||||
@@ -117,42 +112,6 @@ void main() async {
|
||||
authenticationStore: authenticationStore,
|
||||
loginStore: loginStore);
|
||||
|
||||
// final addresses = await fetchAllAddresses(xpub: '6CUGRUonZSQ4TWtTMmzXdrXDtypWKiKrhko4egpiMZbpiaQL2jkwSB1icqYh2cfDfVxdx4df189oLKnC5fSwqPfgyP3hooxujYzAu3fDVmz');
|
||||
// print(addresses);
|
||||
|
||||
final eclient = ElectrumClient();
|
||||
await eclient.connect(host: "electrum2.hodlister.co", port: 50002);
|
||||
await eclient.getMerkle(hash: '3780302c523831311afaccd883f04c814bc13c3ad7c2c13810bb5bfe2c3fa621', height: 629341);
|
||||
print(await eclient.getHeader(height: 629341));
|
||||
// final version = await eclient.version();
|
||||
// print('version $version');
|
||||
|
||||
// eclient.banner();
|
||||
// eclient.headersSubscribe();
|
||||
|
||||
// final history = await eclient.getHistory(address: '1QEWnc4mSxUoP1fWPs32eZNRtc9zX55TwE');
|
||||
// print('history $history');
|
||||
|
||||
// final balance = await eclient.getBalance(address: '1QEWnc4mSxUoP1fWPs32eZNRtc9zX55TwE');
|
||||
// print('balance $balance');
|
||||
|
||||
// final estimateFee = await eclient.estimatefee(p: 6);
|
||||
// print('estimateFee $estimateFee');
|
||||
|
||||
// final walletManager = BitcoinWalletManager();
|
||||
// final key = "zLEjJ96r4WPzlc8rWbuaP2HgxoNfec6sbWjKAcNwqTjzBfiE62A8/0Wp5P3a8Ryo3GUIs/GDG7KfwkoI1FpyuhzWZNU1P8sMN/fp88sB9ktffU5V4B9GZJU5ufSblQOKsvZxqxLJWA8nhL7iaUGcifr9TkwbpqHxBTZDlQxlZXAf/DlRUFEF2LLwo8EJ0HcCn+iPVsnqeGtgtjmOG6l7puP31AErKzaLX4yEgXaKxrdqo0ljS4g7fn4UUXpipv7ry83ZId9ZhpkcdqMRnzu84Msyg/UGGg3BX7VTtbO/ko7ojIBoyzEaF355Tg+sgbfwYAY0CNvOJqPpIhDwu+sq4mhb5H592JP426rDTcy9KV1JbZWbnbbWcqcb04vE2zvXN0x37bd4WfO77qkdoGN5m1XZB2+F2wzNUxvf25WPp5L/nvPZFk/rJGGFoy6X8mASnmIXcq5bRzwC+F2zkZSbXoRFx3yXxlaRnzltVDjWlLUrh8S01TV2llUJEFQhefzR3Xz7mgmHRXANIqRztb1AmjD7eVZid84OfedhD2Lfg9rzFcXeMTcBlaKR36ChIY5zw+ljpnqAm86pSwcJXOAJVKcQ0fJLT6dYbHYkOQqdiSs4cJQMdr/xshrkFd1raVDyL8CTNznfxSvWqSrCUqxbuvylGfrWgHzJfK5CB0oLZnA=WBZ/TzHfP4A=";
|
||||
// await walletManager.openWallet('name', password)
|
||||
// print(await walletManager.isWalletExit('qwerty'));
|
||||
// final wallet = await walletManager.openWallet('green', key);
|
||||
// final keys = await wallet.getKeys();
|
||||
// final seed = await wallet.getSeed();
|
||||
// final address = await wallet.getAddress();
|
||||
|
||||
// print('key $key');
|
||||
// print('keys $keys');
|
||||
// print('seed $seed');
|
||||
// print('address $address');
|
||||
|
||||
runApp(MultiProvider(providers: [
|
||||
Provider(create: (_) => sharedPreferences),
|
||||
Provider(create: (_) => walletService),
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:cake_wallet/src/domain/common/crypto_currency.dart';
|
||||
|
||||
part 'contact.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 0)
|
||||
class Contact extends HiveObject {
|
||||
Contact({@required this.name, @required this.address, CryptoCurrency type})
|
||||
: raw = type?.raw;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'crypto_currency.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 0)
|
||||
class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||
const CryptoCurrency({final String title, final int raw})
|
||||
: super(title: title, raw: raw);
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:cake_wallet/src/domain/common/digest_request.dart';
|
||||
|
||||
part 'node.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 1)
|
||||
class Node extends HiveObject {
|
||||
Node({@required this.uri, this.login, this.password});
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ Future<String> presentQRScanner() async {
|
||||
try {
|
||||
final result = await BarcodeScanner.scan();
|
||||
isQrScannerShown = false;
|
||||
return result;
|
||||
return result.rawContent;
|
||||
} catch (e) {
|
||||
isQrScannerShown = false;
|
||||
rethrow;
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'wallet_info.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 4)
|
||||
class WalletInfo extends HiveObject {
|
||||
WalletInfo(
|
||||
{this.id, this.name, this.type, this.isRecovery, this.restoreHeight});
|
||||
|
||||
@@ -4,7 +4,7 @@ part 'wallet_type.g.dart';
|
||||
|
||||
const walletTypes = [WalletType.monero, WalletType.bitcoin];
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 5)
|
||||
enum WalletType {
|
||||
@HiveField(0)
|
||||
monero,
|
||||
|
||||
@@ -6,7 +6,7 @@ import 'package:cake_wallet/src/domain/common/format_amount.dart';
|
||||
|
||||
part 'trade.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 3)
|
||||
class Trade extends HiveObject {
|
||||
Trade(
|
||||
{this.id,
|
||||
|
||||
@@ -2,7 +2,7 @@ import 'package:hive/hive.dart';
|
||||
|
||||
part 'transaction_description.g.dart';
|
||||
|
||||
@HiveType()
|
||||
@HiveType(typeId: 2)
|
||||
class TransactionDescription extends HiveObject {
|
||||
TransactionDescription({this.id, this.recipientAddress});
|
||||
|
||||
|
||||
@@ -41,16 +41,16 @@ abstract class AcountListStoreBase with Store {
|
||||
StreamSubscription<Wallet> _onWalletChangeSubscription;
|
||||
StreamSubscription<List<Account>> _onAccountsChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onAccountsChangeSubscription != null) {
|
||||
_onAccountsChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountsChangeSubscription != null) {
|
||||
// _onAccountsChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
void updateAccountList() {
|
||||
_accountList.refresh();
|
||||
|
||||
@@ -155,21 +155,21 @@ abstract class ActionListBase with Store {
|
||||
StreamSubscription<BoxEvent> _onTransactionDescriptions;
|
||||
StreamSubscription<BoxEvent> _onTradesChanged;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onTransactionsChangeSubscription != null) {
|
||||
_onTransactionsChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onTransactionsChangeSubscription != null) {
|
||||
// _onTransactionsChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onTransactionDescriptions?.cancel();
|
||||
_onWalletChangeSubscription.cancel();
|
||||
_onTradesChanged?.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onTransactionDescriptions?.cancel();
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// _onTradesChanged?.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
@action
|
||||
Future updateTradeList() async => this.trades =
|
||||
|
||||
@@ -76,16 +76,16 @@ abstract class BalanceStoreBase with Store {
|
||||
SettingsStore _settingsStore;
|
||||
PriceStore _priceStore;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onBalanceChangeSubscription != null) {
|
||||
_onBalanceChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onBalanceChangeSubscription != null) {
|
||||
// _onBalanceChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future _onBalanceChange(Balance balance) async {
|
||||
if (balance is MoneroBalance) {
|
||||
|
||||
@@ -48,14 +48,14 @@ abstract class ExchangeTradeStoreBase with Store {
|
||||
|
||||
Timer _timer;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
|
||||
if (_timer != null) {
|
||||
_timer.cancel();
|
||||
}
|
||||
}
|
||||
// if (_timer != null) {
|
||||
// _timer.cancel();
|
||||
// }
|
||||
// }
|
||||
|
||||
@action
|
||||
Future<void> _updateTrade() async {
|
||||
|
||||
@@ -29,14 +29,14 @@ abstract class NodeListBase with Store {
|
||||
|
||||
StreamSubscription<BoxEvent> _onNodesChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
super.dispose();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// super.dispose();
|
||||
|
||||
if (_onNodesChangeSubscription != null) {
|
||||
_onNodesChangeSubscription.cancel();
|
||||
}
|
||||
}
|
||||
// if (_onNodesChangeSubscription != null) {
|
||||
// _onNodesChangeSubscription.cancel();
|
||||
// }
|
||||
// }
|
||||
|
||||
@action
|
||||
void update() =>
|
||||
|
||||
@@ -39,16 +39,16 @@ abstract class SubadrressCreationStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
Account _account;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
// @override
|
||||
// void dispose() {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future<void> add({String label}) async {
|
||||
try {
|
||||
|
||||
@@ -33,19 +33,19 @@ abstract class SubaddressListStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
Account _account;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onSubaddressesChangeSubscription != null) {
|
||||
_onSubaddressesChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onSubaddressesChangeSubscription != null) {
|
||||
// _onSubaddressesChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onWalletChangeSubscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
Future<void> _updateSubaddressList({int accountIndex}) async {
|
||||
await _subaddressList.refresh(accountIndex: accountIndex);
|
||||
|
||||
@@ -29,15 +29,15 @@ abstract class SyncStoreBase with Store {
|
||||
StreamSubscription<Wallet> _onWalletChangeSubscription;
|
||||
StreamSubscription<SyncStatus> _onSyncStatusChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onSyncStatusChangeSubscription != null) {
|
||||
_onSyncStatusChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onSyncStatusChangeSubscription != null) {
|
||||
// _onSyncStatusChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
_onWalletChangeSubscription.cancel();
|
||||
super.dispose();
|
||||
}
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
void _onWalletChanged(Wallet wallet) {
|
||||
if (_onSyncStatusChangeSubscription != null) {
|
||||
|
||||
@@ -63,22 +63,22 @@ abstract class WalletStoreBase with Store {
|
||||
StreamSubscription<Account> _onAccountChangeSubscription;
|
||||
StreamSubscription<Subaddress> _onSubaddressChangeSubscription;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
if (_onWalletChangeSubscription != null) {
|
||||
_onWalletChangeSubscription.cancel();
|
||||
}
|
||||
// @override
|
||||
// void dispose() {
|
||||
// if (_onWalletChangeSubscription != null) {
|
||||
// _onWalletChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onAccountChangeSubscription != null) {
|
||||
_onAccountChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onAccountChangeSubscription != null) {
|
||||
// _onAccountChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
if (_onSubaddressChangeSubscription != null) {
|
||||
_onSubaddressChangeSubscription.cancel();
|
||||
}
|
||||
// if (_onSubaddressChangeSubscription != null) {
|
||||
// _onSubaddressChangeSubscription.cancel();
|
||||
// }
|
||||
|
||||
super.dispose();
|
||||
}
|
||||
// super.dispose();
|
||||
// }
|
||||
|
||||
@action
|
||||
void setAccount(Account account) {
|
||||
|
||||
Reference in New Issue
Block a user