cake_wallet/cw_core/lib/wallet_addresses.dart

31 lines
589 B
Dart
Raw Normal View History

import 'package:cw_core/wallet_info.dart';
abstract class WalletAddresses {
2022-10-12 17:09:57 +00:00
WalletAddresses(this.walletInfo)
: addressesMap = {};
final WalletInfo walletInfo;
String get address;
set address(String address);
Map<String, String> addressesMap;
Future<void> init();
Future<void> updateAddressesInBox();
Future<void> saveAddressesInBox() async {
try {
walletInfo.address = address;
walletInfo.addresses = addressesMap;
if (walletInfo.isInBox) {
await walletInfo.save();
}
} catch (e) {
print(e.toString());
}
}
}