2023-09-14 23:34:01 +00:00
|
|
|
import 'package:stackwallet/exceptions/sw_exception.dart';
|
|
|
|
import 'package:stackwallet/wallets/models/tx_data.dart';
|
|
|
|
import 'package:stackwallet/wallets/wallet/wallet.dart';
|
|
|
|
|
2023-09-18 21:28:31 +00:00
|
|
|
abstract class PrivateKeyBasedWallet extends Wallet {
|
2023-09-14 23:34:01 +00:00
|
|
|
PrivateKeyBasedWallet(super.cryptoCurrency);
|
|
|
|
|
|
|
|
Future<String> getPrivateKey() async {
|
|
|
|
final privateKey = await secureStorageInterface.read(
|
2023-11-03 19:46:55 +00:00
|
|
|
key: Wallet.privateKeyKey(walletId: info.walletId),
|
2023-09-14 23:34:01 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
if (privateKey == null) {
|
|
|
|
throw SWException("privateKey has not been set");
|
|
|
|
}
|
|
|
|
|
|
|
|
return privateKey;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ========== Overrides ======================================================
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<TxData> confirmSend({required TxData txData}) {
|
|
|
|
// TODO: implement confirmSend
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
Future<TxData> prepareSend({required TxData txData}) {
|
|
|
|
// TODO: implement prepareSend
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
2023-09-18 21:28:31 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
Future<void> recover({required bool isRescan}) {
|
|
|
|
// TODO: implement recover
|
|
|
|
throw UnimplementedError();
|
|
|
|
}
|
2023-09-14 23:34:01 +00:00
|
|
|
}
|