mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-27 05:59:38 +00:00
36 lines
No EOL
915 B
Dart
36 lines
No EOL
915 B
Dart
import 'package:cw_core/wallet_addresses.dart';
|
|
import 'package:cw_core/wallet_info.dart';
|
|
import 'package:cw_core/account.dart';
|
|
import 'package:cw_nano/nano_account_list.dart';
|
|
import 'package:cw_core/subaddress.dart';
|
|
import 'package:mobx/mobx.dart';
|
|
|
|
part 'nano_wallet_addresses.g.dart';
|
|
|
|
class NanoWalletAddresses = NanoWalletAddressesBase with _$NanoWalletAddresses;
|
|
|
|
abstract class NanoWalletAddressesBase extends WalletAddresses with Store {
|
|
NanoWalletAddressesBase(WalletInfo walletInfo)
|
|
: address = '',
|
|
super(walletInfo);
|
|
|
|
@override
|
|
String address;
|
|
|
|
@override
|
|
Future<void> init() async {
|
|
address = walletInfo.address;
|
|
await updateAddressesInBox();
|
|
}
|
|
|
|
@override
|
|
Future<void> updateAddressesInBox() async {
|
|
try {
|
|
addressesMap.clear();
|
|
addressesMap[address] = '';
|
|
await saveAddressesInBox();
|
|
} catch (e) {
|
|
print(e.toString());
|
|
}
|
|
}
|
|
} |