mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-17 17:57:36 +00:00
36 lines
650 B
Dart
36 lines
650 B
Dart
|
import 'package:cw_core/wallet_info.dart';
|
||
|
|
||
|
abstract class WalletAddresses {
|
||
|
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 {
|
||
|
if (walletInfo == null) {
|
||
|
return;
|
||
|
}
|
||
|
|
||
|
walletInfo.address = address;
|
||
|
walletInfo.addresses = addressesMap;
|
||
|
|
||
|
if (walletInfo.isInBox) {
|
||
|
await walletInfo.save();
|
||
|
}
|
||
|
} catch (e) {
|
||
|
print(e.toString());
|
||
|
}
|
||
|
}
|
||
|
}
|