mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
TMP 3
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import 'package:mobx/mobx.dart';
|
||||
import 'package:cake_wallet/core/auth_service.dart';
|
||||
import 'package:cake_wallet/core/wallet_base.dart';
|
||||
import 'package:cake_wallet/core/wallet_creation_service.dart';
|
||||
|
||||
part 'app_service.g.dart';
|
||||
|
||||
class AppService = AppServiceBase with _$AppService;
|
||||
|
||||
abstract class AppServiceBase with Store {
|
||||
AppServiceBase({this.walletCreationService, this.authService, this.wallet});
|
||||
|
||||
WalletCreationService walletCreationService;
|
||||
AuthService authService;
|
||||
WalletBase wallet;
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
import 'package:mobx/mobx.dart';
|
||||
|
||||
part 'app_store.g.dart';
|
||||
|
||||
class AppStore = AppStoreBase with _$AppStore;
|
||||
|
||||
abstract class AppStoreBase with Store {
|
||||
// Sign Up
|
||||
// Auth
|
||||
// Wallet
|
||||
// Settings
|
||||
}
|
||||
@@ -24,7 +24,7 @@ part 'bitcoin_wallet.g.dart';
|
||||
class BitcoinWallet = BitcoinWalletBase with _$BitcoinWallet;
|
||||
|
||||
abstract class BitcoinWalletBase extends WalletBase<BitcoinBalance> with Store {
|
||||
static Future<BitcoinWallet> load(
|
||||
static Future<BitcoinWalletBase> load(
|
||||
{@required String name, @required String password}) async {
|
||||
final walletDirPath =
|
||||
await pathForWalletDir(name: name, type: WalletType.bitcoin);
|
||||
@@ -37,7 +37,7 @@ abstract class BitcoinWalletBase extends WalletBase<BitcoinBalance> with Store {
|
||||
? 0
|
||||
: int.parse(jsoned['account_index'] as String);
|
||||
|
||||
return BitcoinWallet.build(
|
||||
return BitcoinWalletBase.build(
|
||||
mnemonic: mnemonic,
|
||||
password: password,
|
||||
name: name,
|
||||
|
||||
@@ -16,9 +16,13 @@ abstract class WalletCreationServiceBase with Store {
|
||||
@observable
|
||||
WalletCreationState state;
|
||||
|
||||
WalletType type;
|
||||
|
||||
WalletListService _service;
|
||||
|
||||
void changeWalletType({@required WalletType type}) {
|
||||
this.type = type;
|
||||
|
||||
switch (type) {
|
||||
case WalletType.monero:
|
||||
_service = MoneroWalletListService();
|
||||
|
||||
Reference in New Issue
Block a user