mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-02 02:17:39 +00:00
32 lines
No EOL
911 B
Dart
32 lines
No EOL
911 B
Dart
import 'package:cake_wallet/bitcoin/electrum_wallet_addresses_credentials.dart';
|
|
import 'package:cake_wallet/entities/wallet_addresses.dart';
|
|
import 'package:cake_wallet/entities/wallet_addresses_credentials.dart';
|
|
import 'package:cake_wallet/entities/wallet_info.dart';
|
|
|
|
class ElectrumWalletAddresses extends WalletAddresses {
|
|
ElectrumWalletAddresses(WalletInfo walletInfo) : super(walletInfo);
|
|
|
|
@override
|
|
Future<void> update(WalletAddressesCredentials credentials) async {
|
|
try {
|
|
if (credentials == null) {
|
|
return;
|
|
}
|
|
|
|
final _credentials = credentials as ElectrumWalletAddressesCredentials;
|
|
final _address = _credentials.address;
|
|
final _label = '';
|
|
|
|
if (_address == null || _address.isEmpty) {
|
|
return;
|
|
}
|
|
|
|
addresses.clear();
|
|
addresses[_address] = _label;
|
|
|
|
await save();
|
|
} catch (e) {
|
|
print(e.toString());
|
|
}
|
|
}
|
|
} |