cake_wallet/cw_decred/lib/wallet_addresses.dart
Wisdom Arerosuoghene 2b808ad50a cw_decred: add libdcrwallet dependency and link library for android, ios and macos (#1240)
* change cw_decred from package to plugin

* add libdcrwallet dependency and link library for android, ios and macos

* remove spvwallet, make some libdcrwallet fns async, light refactor

* libdcrwallet: use json payload returns

* use specific libwallet commit hash

* decred: fix Rename wallet.

---------

Co-authored-by: JoeGruff <joegruffins@gmail.com>
2024-12-26 14:12:12 +09:00

34 lines
919 B
Dart

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