From 79089b3038323fb9c5cf7760cf068cb664f99e3b Mon Sep 17 00:00:00 2001 From: fosse Date: Wed, 23 Aug 2023 08:38:07 -0400 Subject: [PATCH] save --- cw_core/lib/wallet_info.dart | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/cw_core/lib/wallet_info.dart b/cw_core/lib/wallet_info.dart index 3daf42b3e..e243fb414 100644 --- a/cw_core/lib/wallet_info.dart +++ b/cw_core/lib/wallet_info.dart @@ -19,11 +19,21 @@ enum DerivationType { 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) class WalletInfo extends HiveObject { WalletInfo(this.id, this.name, this.type, this.isRecovery, this.restoreHeight, 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.broadcast(); factory WalletInfo.external( @@ -39,10 +49,11 @@ class WalletInfo extends HiveObject { bool? showIntroCakePayCard, String yatEid = '', String yatLastUsedAddressRaw = '', - DerivationType? derivationType}) { + DerivationType? derivationType, + String? derivationPath,}) { return WalletInfo(id, name, type, isRecovery, restoreHeight, date.millisecondsSinceEpoch, dirPath, path, address, - yatEid, yatLastUsedAddressRaw, showIntroCakePayCard, derivationType); + yatEid, yatLastUsedAddressRaw, showIntroCakePayCard, derivationType, derivationPath); } static const typeId = WALLET_INFO_TYPE_ID; @@ -90,6 +101,9 @@ class WalletInfo extends HiveObject { @HiveField(14) DerivationType? derivationType; + @HiveField(15) + String? derivationPath; + String get yatLastUsedAddress => yatLastUsedAddressRaw ?? ''; set yatLastUsedAddress(String address) {