stack_wallet/lib/models/wallet_restore_state.dart

65 lines
1.6 KiB
Dart
Raw Normal View History

2023-05-26 21:21:16 +00:00
/*
* This file is part of Stack Wallet.
*
* Copyright (c) 2023 Cypher Stack
* All Rights Reserved.
* The code is distributed under GPLv3 license, see LICENSE file for details.
* Generated by Cypher Stack on 2023-05-26
*
*/
import 'package:flutter/material.dart';
import '../utilities/enums/stack_restoring_status.dart';
import '../wallets/crypto_currency/crypto_currency.dart';
import '../wallets/wallet/wallet.dart';
2022-08-26 08:11:35 +00:00
class WalletRestoreState extends ChangeNotifier {
final String walletId;
final String walletName;
2024-05-15 21:20:45 +00:00
final CryptoCurrency coin;
2022-08-26 08:11:35 +00:00
late StackRestoringStatus _restoringStatus;
Wallet? wallet;
2022-08-26 08:11:35 +00:00
String? address;
String? mnemonic;
String? mnemonicPassphrase;
2022-08-26 08:11:35 +00:00
int? height;
StackRestoringStatus get restoringState => _restoringStatus;
set restoringState(StackRestoringStatus restoringStatus) {
_restoringStatus = restoringStatus;
notifyListeners();
}
WalletRestoreState({
required this.walletId,
required this.walletName,
required this.coin,
required StackRestoringStatus restoringStatus,
this.wallet,
2022-08-26 08:11:35 +00:00
this.address,
this.mnemonic,
this.mnemonicPassphrase,
2022-08-26 08:11:35 +00:00
this.height,
}) {
_restoringStatus = restoringStatus;
}
WalletRestoreState copyWith({
StackRestoringStatus? restoringStatus,
String? address,
int? height,
}) {
return WalletRestoreState(
walletId: walletId,
walletName: walletName,
coin: coin,
restoringStatus: restoringStatus ?? _restoringStatus,
wallet: wallet,
2022-08-26 08:11:35 +00:00
address: this.address,
mnemonic: mnemonic,
mnemonicPassphrase: mnemonicPassphrase,
2022-08-26 08:11:35 +00:00
height: this.height,
);
}
}