veilidchat/lib/repositories/local_account_repository.dart
Christien Rioux 20bdf07f24 checkpoint
2023-07-19 00:09:57 -04:00

29 lines
879 B
Dart

import 'package:veilid/veilid.dart';
import 'package:riverpod_annotation/riverpod_annotation.dart';
import '../entities/entities.dart';
import '../entities/proto.dart' as proto;
import 'local_account_repository_impl.dart';
part 'local_account_repository.g.dart';
// Local account manager
abstract class LocalAccountRepository {
/// Creates a new master identity and returns it with its secrets
Future<IdentityMasterWithSecrets> newIdentityMaster();
/// Creates a new account associated with master identity
Future<LocalAccount> newAccount(
IdentityMaster identityMaster,
SecretKey identitySecret,
EncryptionKeyType encryptionKeyType,
String encryptionKey,
proto.Account account);
}
@riverpod
Future<LocalAccountRepository> localAccountManager(
LocalAccountManagerRef ref) async {
return await LocalAccountRepositoryImpl.open();
}