cake_wallet/cw_nano/lib/nano_wallet_creation_credentials.dart

50 lines
1.3 KiB
Dart
Raw Normal View History

2023-07-24 20:23:09 +00:00
import 'package:cw_core/wallet_credentials.dart';
import 'package:cw_core/wallet_info.dart';
2023-09-06 14:12:36 +00:00
class NanoNewWalletCredentials extends WalletCredentials {
NanoNewWalletCredentials({
required String name,
String? password,
DerivationType? derivationType,
}) : super(
name: name,
password: password,
derivationInfo: DerivationInfo(derivationType: derivationType),
);
2023-09-06 14:12:36 +00:00
}
class NanoRestoreWalletFromSeedCredentials extends WalletCredentials {
NanoRestoreWalletFromSeedCredentials({
required String name,
required this.mnemonic,
String? password,
2023-10-09 21:19:58 +00:00
required DerivationType derivationType,
2023-09-06 14:12:36 +00:00
}) : super(
2023-10-09 21:19:58 +00:00
name: name,
password: password,
derivationInfo: DerivationInfo(derivationType: derivationType),
);
2023-09-06 14:12:36 +00:00
final String mnemonic;
}
class NanoWalletLoadingException implements Exception {
@override
String toString() => 'Failure to load the wallet.';
}
class NanoRestoreWalletFromKeysCredentials extends WalletCredentials {
NanoRestoreWalletFromKeysCredentials({
required String name,
required String password,
2023-10-09 21:19:58 +00:00
required DerivationType derivationType,
2023-09-06 14:12:36 +00:00
required this.seedKey,
2023-10-09 21:19:58 +00:00
}) : super(
name: name,
password: password,
derivationInfo: DerivationInfo(derivationType: derivationType),
);
2023-09-06 14:12:36 +00:00
final String seedKey;
}