cake_wallet/cw_tron/lib/tron_wallet_addresses.dart
Serhii 5c2735be42
transaction description key id address (#1755)
* transaction description key id+address

* minor fix[skip ci]

* fix backward compatibility

* add monero primary address
2024-10-18 05:58:57 +03:00

39 lines
877 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
String get primaryAddress => 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());
}
}
}