mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-23 20:19:25 +00:00
37 lines
824 B
Dart
37 lines
824 B
Dart
|
import 'dart:developer';
|
||
|
|
||
|
import 'package:cw_core/wallet_addresses.dart';
|
||
|
import 'package:cw_core/wallet_info.dart';
|
||
|
import 'package:mobx/mobx.dart';
|
||
|
|
||
|
part 'tron_wallet_addresses.g.dart';
|
||
|
|
||
|
class TronWalletAddresses = TronWalletAddressesBase with _$TronWalletAddresses;
|
||
|
|
||
|
abstract class TronWalletAddressesBase extends WalletAddresses with Store {
|
||
|
TronWalletAddressesBase(WalletInfo walletInfo)
|
||
|
: address = '',
|
||
|
super(walletInfo);
|
||
|
|
||
|
@override
|
||
|
@observable
|
||
|
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) {
|
||
|
log(e.toString());
|
||
|
}
|
||
|
}
|
||
|
}
|