mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-11 13:24:51 +00:00
save
This commit is contained in:
parent
5aa8fd401d
commit
79089b3038
1 changed files with 17 additions and 3 deletions
|
@ -19,11 +19,21 @@ enum DerivationType {
|
||||||
StandardBIP44Legacy
|
StandardBIP44Legacy
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class DerivationInfo {
|
||||||
|
DerivationInfo(this.balance, this.address, this.height, this.derivationType, this.derivationPath);
|
||||||
|
|
||||||
|
final String balance;
|
||||||
|
final String address;
|
||||||
|
final int height;
|
||||||
|
final DerivationType derivationType;
|
||||||
|
final String? derivationPath;
|
||||||
|
}
|
||||||
|
|
||||||
@HiveType(typeId: WalletInfo.typeId)
|
@HiveType(typeId: WalletInfo.typeId)
|
||||||
class WalletInfo extends HiveObject {
|
class WalletInfo extends HiveObject {
|
||||||
WalletInfo(this.id, this.name, this.type, this.isRecovery, this.restoreHeight,
|
WalletInfo(this.id, this.name, this.type, this.isRecovery, this.restoreHeight,
|
||||||
this.timestamp, this.dirPath, this.path, this.address, this.yatEid,
|
this.timestamp, this.dirPath, this.path, this.address, this.yatEid,
|
||||||
this.yatLastUsedAddressRaw, this.showIntroCakePayCard, this.derivationType)
|
this.yatLastUsedAddressRaw, this.showIntroCakePayCard, this.derivationType, this.derivationPath)
|
||||||
: _yatLastUsedAddressController = StreamController<String>.broadcast();
|
: _yatLastUsedAddressController = StreamController<String>.broadcast();
|
||||||
|
|
||||||
factory WalletInfo.external(
|
factory WalletInfo.external(
|
||||||
|
@ -39,10 +49,11 @@ class WalletInfo extends HiveObject {
|
||||||
bool? showIntroCakePayCard,
|
bool? showIntroCakePayCard,
|
||||||
String yatEid = '',
|
String yatEid = '',
|
||||||
String yatLastUsedAddressRaw = '',
|
String yatLastUsedAddressRaw = '',
|
||||||
DerivationType? derivationType}) {
|
DerivationType? derivationType,
|
||||||
|
String? derivationPath,}) {
|
||||||
return WalletInfo(id, name, type, isRecovery, restoreHeight,
|
return WalletInfo(id, name, type, isRecovery, restoreHeight,
|
||||||
date.millisecondsSinceEpoch, dirPath, path, address,
|
date.millisecondsSinceEpoch, dirPath, path, address,
|
||||||
yatEid, yatLastUsedAddressRaw, showIntroCakePayCard, derivationType);
|
yatEid, yatLastUsedAddressRaw, showIntroCakePayCard, derivationType, derivationPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const typeId = WALLET_INFO_TYPE_ID;
|
static const typeId = WALLET_INFO_TYPE_ID;
|
||||||
|
@ -90,6 +101,9 @@ class WalletInfo extends HiveObject {
|
||||||
@HiveField(14)
|
@HiveField(14)
|
||||||
DerivationType? derivationType;
|
DerivationType? derivationType;
|
||||||
|
|
||||||
|
@HiveField(15)
|
||||||
|
String? derivationPath;
|
||||||
|
|
||||||
String get yatLastUsedAddress => yatLastUsedAddressRaw ?? '';
|
String get yatLastUsedAddress => yatLastUsedAddressRaw ?? '';
|
||||||
|
|
||||||
set yatLastUsedAddress(String address) {
|
set yatLastUsedAddress(String address) {
|
||||||
|
|
Loading…
Reference in a new issue