stack_wallet/lib/wallets/isar/models/frost_wallet_info.dart

42 lines
1,003 B
Dart
Raw Normal View History

2024-01-18 23:47:06 +00:00
import 'package:isar/isar.dart';
import '../isar_id_interface.dart';
2024-01-18 23:47:06 +00:00
part 'frost_wallet_info.g.dart';
@Collection(accessor: "frostWalletInfo", inheritance: false)
class FrostWalletInfo implements IsarId {
@override
Id id = Isar.autoIncrement;
@Index(unique: true, replace: false)
final String walletId;
final List<String> knownSalts;
2024-01-19 21:42:38 +00:00
final List<String> participants;
final String myName;
final int threshold;
2024-01-18 23:47:06 +00:00
FrostWalletInfo({
required this.walletId,
required this.knownSalts,
2024-01-19 21:42:38 +00:00
required this.participants,
required this.myName,
required this.threshold,
2024-01-18 23:47:06 +00:00
});
FrostWalletInfo copyWith({
List<String>? knownSalts,
2024-01-19 21:42:38 +00:00
List<String>? participants,
String? myName,
int? threshold,
2024-01-18 23:47:06 +00:00
}) {
return FrostWalletInfo(
walletId: walletId,
knownSalts: knownSalts ?? this.knownSalts,
2024-01-19 21:42:38 +00:00
participants: participants ?? this.participants,
myName: myName ?? this.myName,
threshold: threshold ?? this.threshold,
)..id = id;
2024-01-18 23:47:06 +00:00
}
}