mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 03:59:23 +00:00
fff5a1c419
* Add UI and setting logic for subaddresses * Enable auto generate subaddresses * Rename variable * Add comment to unused code * Fix issue with initial state change * Fix observable for isAppSecure * Filter sub account contacts * Fix select account use unused address * Use add address if last address is unused * Fix auto generate wallet issues * Fix button color * Add translation and refactored naming * Fix PR review * Remove unused code * Remove unused overrides in electrum * Fix address info null check * CW-228 Fix ContactListViewModel condition * CW-228 Fix Account Tile; Rework updateAddressesInBox; Fix _getAllUnusedAddresses * CW-228 Fix unintentional address_page.dart regression * CW-228 Fix Merge Conflicts * CW-228 Add more translation Tools * CW-228 More merge conflict fixes * CW-228 Fix Merge Conflicts * CW-228 Auto Translation improvements * CW-228 Resolve requested Changes --------- Co-authored-by: Konstantin Ullrich <konstantinullrich12@gmail.com>
39 lines
No EOL
841 B
Dart
39 lines
No EOL
841 B
Dart
import 'package:cw_core/address_info.dart';
|
|
import 'package:cw_core/wallet_info.dart';
|
|
|
|
abstract class WalletAddresses {
|
|
WalletAddresses(this.walletInfo)
|
|
: addressesMap = {},
|
|
addressInfos = {};
|
|
|
|
final WalletInfo walletInfo;
|
|
|
|
String get address;
|
|
|
|
set address(String address);
|
|
|
|
Map<String, String> addressesMap;
|
|
|
|
Map<int, List<AddressInfo>> addressInfos;
|
|
|
|
Set<String> usedAddresses = {};
|
|
|
|
Future<void> init();
|
|
|
|
Future<void> updateAddressesInBox();
|
|
|
|
Future<void> saveAddressesInBox() async {
|
|
try {
|
|
walletInfo.address = address;
|
|
walletInfo.addresses = addressesMap;
|
|
walletInfo.addressInfos = addressInfos;
|
|
walletInfo.usedAddresses = usedAddresses.toList();
|
|
|
|
if (walletInfo.isInBox) {
|
|
await walletInfo.save();
|
|
}
|
|
} catch (e) {
|
|
print(e.toString());
|
|
}
|
|
}
|
|
} |