mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
isar lelantus coin schema
This commit is contained in:
parent
6ff4c5d49a
commit
baa34ca9f2
3 changed files with 1647 additions and 0 deletions
|
@ -14,6 +14,7 @@ import 'package:isar/isar.dart';
|
|||
import 'package:stackwallet/exceptions/main_db/main_db_exception.dart';
|
||||
import 'package:stackwallet/models/isar/models/block_explorer.dart';
|
||||
import 'package:stackwallet/models/isar/models/contact_entry.dart';
|
||||
import 'package:stackwallet/models/isar/models/firo_specific/lelantus_coin.dart';
|
||||
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||
import 'package:stackwallet/models/isar/stack_theme.dart';
|
||||
import 'package:stackwallet/utilities/amount/amount.dart';
|
||||
|
@ -54,6 +55,7 @@ class MainDB {
|
|||
TransactionBlockExplorerSchema,
|
||||
StackThemeSchema,
|
||||
ContactEntrySchema,
|
||||
LelantusCoinSchema,
|
||||
],
|
||||
directory: (await StackFileSystem.applicationIsarDirectory()).path,
|
||||
// inspector: kDebugMode,
|
||||
|
|
75
lib/models/isar/models/firo_specific/lelantus_coin.dart
Normal file
75
lib/models/isar/models/firo_specific/lelantus_coin.dart
Normal file
|
@ -0,0 +1,75 @@
|
|||
import 'package:isar/isar.dart';
|
||||
|
||||
part 'lelantus_coin.g.dart';
|
||||
|
||||
@collection
|
||||
class LelantusCoin {
|
||||
Id id = Isar.autoIncrement;
|
||||
|
||||
@Index()
|
||||
final String walletId;
|
||||
|
||||
@Index(
|
||||
unique: true,
|
||||
composite: [
|
||||
CompositeIndex("walletId"),
|
||||
CompositeIndex("txid"),
|
||||
],
|
||||
replace: false,
|
||||
)
|
||||
final String publicCoin;
|
||||
|
||||
final String txid;
|
||||
|
||||
final String value; // can't use BigInt in isar :shrug:
|
||||
|
||||
final int index;
|
||||
|
||||
final int anonymitySetId;
|
||||
|
||||
final bool isUsed;
|
||||
|
||||
LelantusCoin({
|
||||
required this.walletId,
|
||||
required this.publicCoin,
|
||||
required this.txid,
|
||||
required this.value,
|
||||
required this.index,
|
||||
required this.anonymitySetId,
|
||||
required this.isUsed,
|
||||
});
|
||||
|
||||
LelantusCoin copyWith({
|
||||
String? walletId,
|
||||
String? publicCoin,
|
||||
String? txid,
|
||||
String? value,
|
||||
int? index,
|
||||
int? anonymitySetId,
|
||||
bool? isUsed,
|
||||
}) {
|
||||
return LelantusCoin(
|
||||
walletId: walletId ?? this.walletId,
|
||||
publicCoin: publicCoin ?? this.publicCoin,
|
||||
txid: txid ?? this.txid,
|
||||
value: value ?? this.value,
|
||||
index: index ?? this.index,
|
||||
anonymitySetId: anonymitySetId ?? this.anonymitySetId,
|
||||
isUsed: isUsed ?? this.isUsed,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LelantusCoin{'
|
||||
'id: $id, '
|
||||
'walletId: $walletId, '
|
||||
'publicCoin: $publicCoin, '
|
||||
'txid: $txid, '
|
||||
'value: $value, '
|
||||
'index: $index, '
|
||||
'anonymitySetId: $anonymitySetId, '
|
||||
'isUsed: $isUsed'
|
||||
'}';
|
||||
}
|
||||
}
|
1570
lib/models/isar/models/firo_specific/lelantus_coin.g.dart
Normal file
1570
lib/models/isar/models/firo_specific/lelantus_coin.g.dart
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue