2023-03-01 21:52:13 +00:00
|
|
|
import 'package:stackwallet/db/hive/db.dart';
|
2023-01-12 21:20:57 +00:00
|
|
|
|
|
|
|
mixin FiroHive {
|
|
|
|
late final String _walletId;
|
|
|
|
|
|
|
|
void initFiroHive(String walletId) {
|
|
|
|
_walletId = walletId;
|
|
|
|
}
|
|
|
|
|
|
|
|
// jindex
|
|
|
|
List? firoGetJIndex() {
|
|
|
|
return DB.instance.get<dynamic>(boxName: _walletId, key: "jindex") as List?;
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> firoUpdateJIndex(List jIndex) async {
|
|
|
|
await DB.instance.put<dynamic>(
|
|
|
|
boxName: _walletId,
|
|
|
|
key: "jindex",
|
|
|
|
value: jIndex,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// _lelantus_coins
|
|
|
|
List? firoGetLelantusCoins() {
|
|
|
|
return DB.instance.get<dynamic>(boxName: _walletId, key: "_lelantus_coins")
|
|
|
|
as List?;
|
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> firoUpdateLelantusCoins(List lelantusCoins) async {
|
|
|
|
await DB.instance.put<dynamic>(
|
|
|
|
boxName: _walletId,
|
|
|
|
key: "_lelantus_coins",
|
|
|
|
value: lelantusCoins,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
// mintIndex
|
2023-05-23 16:43:08 +00:00
|
|
|
int firoGetMintIndex() {
|
2023-01-12 21:20:57 +00:00
|
|
|
return DB.instance.get<dynamic>(boxName: _walletId, key: "mintIndex")
|
2023-05-23 16:43:08 +00:00
|
|
|
as int? ??
|
|
|
|
0;
|
2023-01-12 21:20:57 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Future<void> firoUpdateMintIndex(int mintIndex) async {
|
|
|
|
await DB.instance.put<dynamic>(
|
|
|
|
boxName: _walletId,
|
|
|
|
key: "mintIndex",
|
|
|
|
value: mintIndex,
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|