2023-12-22 11:59:02 +00:00
|
|
|
import 'package:cw_core/wallet_addresses.dart';
|
|
|
|
import 'package:cw_core/wallet_info.dart';
|
2024-03-06 02:32:15 +00:00
|
|
|
import 'package:cw_decred/api/libdcrwallet.dart' as libdcrwallet;
|
2023-12-22 11:59:02 +00:00
|
|
|
|
|
|
|
class DecredWalletAddresses extends WalletAddresses {
|
2024-03-06 02:32:15 +00:00
|
|
|
DecredWalletAddresses(WalletInfo walletInfo) : super(walletInfo);
|
2023-12-22 11:59:02 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String get address {
|
2024-03-06 02:32:15 +00:00
|
|
|
return libdcrwallet.currentReceiveAddress(walletInfo.name) ?? '';
|
2023-12-22 11:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
String generateNewAddress() {
|
2024-03-06 02:32:15 +00:00
|
|
|
// TODO: generate new external address with libdcrwallet.
|
|
|
|
return "DsT4qJPPaYEuQRimfgvSKxKH3paysn1x3Nt";
|
2023-12-22 11:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
List<String> addresses() {
|
2024-03-06 02:32:15 +00:00
|
|
|
final currentAddress = libdcrwallet.currentReceiveAddress(walletInfo.name);
|
|
|
|
return currentAddress == null ? [] : [currentAddress];
|
2023-12-22 11:59:02 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
set address(String addr) {}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> init() async {}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> updateAddressesInBox() async {}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> saveAddressesInBox() async {}
|
|
|
|
}
|