wallet info cached balances change

This commit is contained in:
julian 2023-11-16 17:26:41 -06:00
parent 185cfd26e2
commit 089c1f9848
2 changed files with 535 additions and 59 deletions

View file

@ -32,6 +32,16 @@ class WalletInfo implements IsarId {
String? get cachedBalanceString => _cachedBalanceString; String? get cachedBalanceString => _cachedBalanceString;
String? _cachedBalanceString; String? _cachedBalanceString;
/// Only exposed for Isar. Use the [cachedBalanceSecondary] getter.
// Only exposed for isar as Amount cannot be stored in isar easily
String? get cachedBalanceSecondaryString => _cachedBalanceSecondaryString;
String? _cachedBalanceSecondaryString;
/// Only exposed for Isar. Use the [cachedBalanceTertiary] getter.
// Only exposed for isar as Amount cannot be stored in isar easily
String? get cachedBalanceTertiaryString => _cachedBalanceTertiaryString;
String? _cachedBalanceTertiaryString;
/// Only exposed for Isar. Use the [coin] getter. /// Only exposed for Isar. Use the [coin] getter.
// Only exposed for isar to avoid dealing with storing enums as Coin can change // Only exposed for isar to avoid dealing with storing enums as Coin can change
String get coinName => _coinName; String get coinName => _coinName;
@ -82,16 +92,23 @@ class WalletInfo implements IsarId {
} }
} }
/// Special case for coins such as firo /// Special case for coins such as firo lelantus
@ignore @ignore
Balance get cachedSecondaryBalance { Balance get cachedBalanceSecondary {
try { if (cachedBalanceSecondaryString == null) {
return Balance.fromJson(
otherData[WalletInfoKeys.cachedSecondaryBalance] as String? ?? "",
coin.decimals,
);
} catch (_) {
return Balance.zeroForCoin(coin: coin); return Balance.zeroForCoin(coin: coin);
} else {
return Balance.fromJson(cachedBalanceSecondaryString!, coin.decimals);
}
}
/// Special case for coins such as firo spark
@ignore
Balance get cachedBalanceTertiary {
if (cachedBalanceTertiaryString == null) {
return Balance.zeroForCoin(coin: coin);
} else {
return Balance.fromJson(cachedBalanceTertiaryString!, coin.decimals);
} }
} }
@ -115,7 +132,6 @@ class WalletInfo implements IsarId {
//============================================================================ //============================================================================
//============= Updaters ================================================ //============= Updaters ================================================
/// copies this with a new balance and updates the db
Future<void> updateBalance({ Future<void> updateBalance({
required Balance newBalance, required Balance newBalance,
required Isar isar, required Isar isar,
@ -133,6 +149,40 @@ class WalletInfo implements IsarId {
} }
} }
Future<void> updateBalanceSecondary({
required Balance newBalance,
required Isar isar,
}) async {
final newEncoded = newBalance.toJsonIgnoreCoin();
// only update if there were changes to the balance
if (cachedBalanceSecondaryString != newEncoded) {
_cachedBalanceSecondaryString = newEncoded;
await isar.writeTxn(() async {
await isar.walletInfo.deleteByWalletId(walletId);
await isar.walletInfo.put(this);
});
}
}
Future<void> updateBalanceTertiary({
required Balance newBalance,
required Isar isar,
}) async {
final newEncoded = newBalance.toJsonIgnoreCoin();
// only update if there were changes to the balance
if (cachedBalanceTertiaryString != newEncoded) {
_cachedBalanceTertiaryString = newEncoded;
await isar.writeTxn(() async {
await isar.walletInfo.deleteByWalletId(walletId);
await isar.walletInfo.put(this);
});
}
}
/// copies this with a new chain height and updates the db /// copies this with a new chain height and updates the db
Future<void> updateCachedChainHeight({ Future<void> updateCachedChainHeight({
required int newHeight, required int newHeight,

View file

@ -17,69 +17,79 @@ const WalletInfoSchema = CollectionSchema(
name: r'WalletInfo', name: r'WalletInfo',
id: -2861501434900022153, id: -2861501434900022153,
properties: { properties: {
r'cachedBalanceString': PropertySchema( r'cachedBalanceSecondaryString': PropertySchema(
id: 0, id: 0,
name: r'cachedBalanceSecondaryString',
type: IsarType.string,
),
r'cachedBalanceString': PropertySchema(
id: 1,
name: r'cachedBalanceString', name: r'cachedBalanceString',
type: IsarType.string, type: IsarType.string,
), ),
r'cachedBalanceTertiaryString': PropertySchema(
id: 2,
name: r'cachedBalanceTertiaryString',
type: IsarType.string,
),
r'cachedChainHeight': PropertySchema( r'cachedChainHeight': PropertySchema(
id: 1, id: 3,
name: r'cachedChainHeight', name: r'cachedChainHeight',
type: IsarType.long, type: IsarType.long,
), ),
r'cachedReceivingAddress': PropertySchema( r'cachedReceivingAddress': PropertySchema(
id: 2, id: 4,
name: r'cachedReceivingAddress', name: r'cachedReceivingAddress',
type: IsarType.string, type: IsarType.string,
), ),
r'coinName': PropertySchema( r'coinName': PropertySchema(
id: 3, id: 5,
name: r'coinName', name: r'coinName',
type: IsarType.string, type: IsarType.string,
), ),
r'favouriteOrderIndex': PropertySchema( r'favouriteOrderIndex': PropertySchema(
id: 4, id: 6,
name: r'favouriteOrderIndex', name: r'favouriteOrderIndex',
type: IsarType.long, type: IsarType.long,
), ),
r'isFavourite': PropertySchema( r'isFavourite': PropertySchema(
id: 5, id: 7,
name: r'isFavourite', name: r'isFavourite',
type: IsarType.bool, type: IsarType.bool,
), ),
r'isMnemonicVerified': PropertySchema( r'isMnemonicVerified': PropertySchema(
id: 6, id: 8,
name: r'isMnemonicVerified', name: r'isMnemonicVerified',
type: IsarType.bool, type: IsarType.bool,
), ),
r'mainAddressType': PropertySchema( r'mainAddressType': PropertySchema(
id: 7, id: 9,
name: r'mainAddressType', name: r'mainAddressType',
type: IsarType.byte, type: IsarType.byte,
enumMap: _WalletInfomainAddressTypeEnumValueMap, enumMap: _WalletInfomainAddressTypeEnumValueMap,
), ),
r'name': PropertySchema( r'name': PropertySchema(
id: 8, id: 10,
name: r'name', name: r'name',
type: IsarType.string, type: IsarType.string,
), ),
r'otherDataJsonString': PropertySchema( r'otherDataJsonString': PropertySchema(
id: 9, id: 11,
name: r'otherDataJsonString', name: r'otherDataJsonString',
type: IsarType.string, type: IsarType.string,
), ),
r'restoreHeight': PropertySchema( r'restoreHeight': PropertySchema(
id: 10, id: 12,
name: r'restoreHeight', name: r'restoreHeight',
type: IsarType.long, type: IsarType.long,
), ),
r'tokenContractAddresses': PropertySchema( r'tokenContractAddresses': PropertySchema(
id: 11, id: 13,
name: r'tokenContractAddresses', name: r'tokenContractAddresses',
type: IsarType.stringList, type: IsarType.stringList,
), ),
r'walletId': PropertySchema( r'walletId': PropertySchema(
id: 12, id: 14,
name: r'walletId', name: r'walletId',
type: IsarType.string, type: IsarType.string,
) )
@ -118,12 +128,24 @@ int _walletInfoEstimateSize(
Map<Type, List<int>> allOffsets, Map<Type, List<int>> allOffsets,
) { ) {
var bytesCount = offsets.last; var bytesCount = offsets.last;
{
final value = object.cachedBalanceSecondaryString;
if (value != null) {
bytesCount += 3 + value.length * 3;
}
}
{ {
final value = object.cachedBalanceString; final value = object.cachedBalanceString;
if (value != null) { if (value != null) {
bytesCount += 3 + value.length * 3; bytesCount += 3 + value.length * 3;
} }
} }
{
final value = object.cachedBalanceTertiaryString;
if (value != null) {
bytesCount += 3 + value.length * 3;
}
}
bytesCount += 3 + object.cachedReceivingAddress.length * 3; bytesCount += 3 + object.cachedReceivingAddress.length * 3;
bytesCount += 3 + object.coinName.length * 3; bytesCount += 3 + object.coinName.length * 3;
bytesCount += 3 + object.name.length * 3; bytesCount += 3 + object.name.length * 3;
@ -150,19 +172,21 @@ void _walletInfoSerialize(
List<int> offsets, List<int> offsets,
Map<Type, List<int>> allOffsets, Map<Type, List<int>> allOffsets,
) { ) {
writer.writeString(offsets[0], object.cachedBalanceString); writer.writeString(offsets[0], object.cachedBalanceSecondaryString);
writer.writeLong(offsets[1], object.cachedChainHeight); writer.writeString(offsets[1], object.cachedBalanceString);
writer.writeString(offsets[2], object.cachedReceivingAddress); writer.writeString(offsets[2], object.cachedBalanceTertiaryString);
writer.writeString(offsets[3], object.coinName); writer.writeLong(offsets[3], object.cachedChainHeight);
writer.writeLong(offsets[4], object.favouriteOrderIndex); writer.writeString(offsets[4], object.cachedReceivingAddress);
writer.writeBool(offsets[5], object.isFavourite); writer.writeString(offsets[5], object.coinName);
writer.writeBool(offsets[6], object.isMnemonicVerified); writer.writeLong(offsets[6], object.favouriteOrderIndex);
writer.writeByte(offsets[7], object.mainAddressType.index); writer.writeBool(offsets[7], object.isFavourite);
writer.writeString(offsets[8], object.name); writer.writeBool(offsets[8], object.isMnemonicVerified);
writer.writeString(offsets[9], object.otherDataJsonString); writer.writeByte(offsets[9], object.mainAddressType.index);
writer.writeLong(offsets[10], object.restoreHeight); writer.writeString(offsets[10], object.name);
writer.writeStringList(offsets[11], object.tokenContractAddresses); writer.writeString(offsets[11], object.otherDataJsonString);
writer.writeString(offsets[12], object.walletId); writer.writeLong(offsets[12], object.restoreHeight);
writer.writeStringList(offsets[13], object.tokenContractAddresses);
writer.writeString(offsets[14], object.walletId);
} }
WalletInfo _walletInfoDeserialize( WalletInfo _walletInfoDeserialize(
@ -172,19 +196,19 @@ WalletInfo _walletInfoDeserialize(
Map<Type, List<int>> allOffsets, Map<Type, List<int>> allOffsets,
) { ) {
final object = WalletInfo( final object = WalletInfo(
cachedBalanceString: reader.readStringOrNull(offsets[0]), cachedBalanceString: reader.readStringOrNull(offsets[1]),
cachedChainHeight: reader.readLongOrNull(offsets[1]) ?? 0, cachedChainHeight: reader.readLongOrNull(offsets[3]) ?? 0,
cachedReceivingAddress: reader.readStringOrNull(offsets[2]) ?? "", cachedReceivingAddress: reader.readStringOrNull(offsets[4]) ?? "",
coinName: reader.readString(offsets[3]), coinName: reader.readString(offsets[5]),
favouriteOrderIndex: reader.readLongOrNull(offsets[4]) ?? -1, favouriteOrderIndex: reader.readLongOrNull(offsets[6]) ?? -1,
isMnemonicVerified: reader.readBoolOrNull(offsets[6]) ?? false, isMnemonicVerified: reader.readBoolOrNull(offsets[8]) ?? false,
mainAddressType: _WalletInfomainAddressTypeValueEnumMap[ mainAddressType: _WalletInfomainAddressTypeValueEnumMap[
reader.readByteOrNull(offsets[7])] ?? reader.readByteOrNull(offsets[9])] ??
AddressType.p2pkh, AddressType.p2pkh,
name: reader.readString(offsets[8]), name: reader.readString(offsets[10]),
otherDataJsonString: reader.readStringOrNull(offsets[9]), otherDataJsonString: reader.readStringOrNull(offsets[11]),
restoreHeight: reader.readLongOrNull(offsets[10]) ?? 0, restoreHeight: reader.readLongOrNull(offsets[12]) ?? 0,
walletId: reader.readString(offsets[12]), walletId: reader.readString(offsets[14]),
); );
object.id = id; object.id = id;
return object; return object;
@ -200,30 +224,34 @@ P _walletInfoDeserializeProp<P>(
case 0: case 0:
return (reader.readStringOrNull(offset)) as P; return (reader.readStringOrNull(offset)) as P;
case 1: case 1:
return (reader.readLongOrNull(offset) ?? 0) as P; return (reader.readStringOrNull(offset)) as P;
case 2: case 2:
return (reader.readStringOrNull(offset) ?? "") as P; return (reader.readStringOrNull(offset)) as P;
case 3: case 3:
return (reader.readString(offset)) as P; return (reader.readLongOrNull(offset) ?? 0) as P;
case 4: case 4:
return (reader.readLongOrNull(offset) ?? -1) as P; return (reader.readStringOrNull(offset) ?? "") as P;
case 5: case 5:
return (reader.readBool(offset)) as P; return (reader.readString(offset)) as P;
case 6: case 6:
return (reader.readBoolOrNull(offset) ?? false) as P; return (reader.readLongOrNull(offset) ?? -1) as P;
case 7: case 7:
return (reader.readBool(offset)) as P;
case 8:
return (reader.readBoolOrNull(offset) ?? false) as P;
case 9:
return (_WalletInfomainAddressTypeValueEnumMap[ return (_WalletInfomainAddressTypeValueEnumMap[
reader.readByteOrNull(offset)] ?? reader.readByteOrNull(offset)] ??
AddressType.p2pkh) as P; AddressType.p2pkh) as P;
case 8:
return (reader.readString(offset)) as P;
case 9:
return (reader.readStringOrNull(offset)) as P;
case 10: case 10:
return (reader.readLongOrNull(offset) ?? 0) as P; return (reader.readString(offset)) as P;
case 11: case 11:
return (reader.readStringList(offset) ?? []) as P; return (reader.readStringOrNull(offset)) as P;
case 12: case 12:
return (reader.readLongOrNull(offset) ?? 0) as P;
case 13:
return (reader.readStringList(offset) ?? []) as P;
case 14:
return (reader.readString(offset)) as P; return (reader.readString(offset)) as P;
default: default:
throw IsarError('Unknown property with id $propertyId'); throw IsarError('Unknown property with id $propertyId');
@ -446,6 +474,162 @@ extension WalletInfoQueryWhere
extension WalletInfoQueryFilter extension WalletInfoQueryFilter
on QueryBuilder<WalletInfo, WalletInfo, QFilterCondition> { on QueryBuilder<WalletInfo, WalletInfo, QFilterCondition> {
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringIsNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const FilterCondition.isNull(
property: r'cachedBalanceSecondaryString',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringIsNotNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const FilterCondition.isNotNull(
property: r'cachedBalanceSecondaryString',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringEqualTo(
String? value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringGreaterThan(
String? value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringLessThan(
String? value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringBetween(
String? lower,
String? upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'cachedBalanceSecondaryString',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringContains(String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'cachedBalanceSecondaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringMatches(String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'cachedBalanceSecondaryString',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'cachedBalanceSecondaryString',
value: '',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceSecondaryStringIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'cachedBalanceSecondaryString',
value: '',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition> QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceStringIsNull() { cachedBalanceStringIsNull() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -600,6 +784,162 @@ extension WalletInfoQueryFilter
}); });
} }
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringIsNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const FilterCondition.isNull(
property: r'cachedBalanceTertiaryString',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringIsNotNull() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(const FilterCondition.isNotNull(
property: r'cachedBalanceTertiaryString',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringEqualTo(
String? value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringGreaterThan(
String? value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringLessThan(
String? value, {
bool include = false,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringBetween(
String? lower,
String? upper, {
bool includeLower = true,
bool includeUpper = true,
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
property: r'cachedBalanceTertiaryString',
lower: lower,
includeLower: includeLower,
upper: upper,
includeUpper: includeUpper,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringContains(String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
property: r'cachedBalanceTertiaryString',
value: value,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringMatches(String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
property: r'cachedBalanceTertiaryString',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
property: r'cachedBalanceTertiaryString',
value: '',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedBalanceTertiaryStringIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
property: r'cachedBalanceTertiaryString',
value: '',
));
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition> QueryBuilder<WalletInfo, WalletInfo, QAfterFilterCondition>
cachedChainHeightEqualTo(int value) { cachedChainHeightEqualTo(int value) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -1823,6 +2163,20 @@ extension WalletInfoQueryLinks
extension WalletInfoQuerySortBy extension WalletInfoQuerySortBy
on QueryBuilder<WalletInfo, WalletInfo, QSortBy> { on QueryBuilder<WalletInfo, WalletInfo, QSortBy> {
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
sortByCachedBalanceSecondaryString() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceSecondaryString', Sort.asc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
sortByCachedBalanceSecondaryStringDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceSecondaryString', Sort.desc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
sortByCachedBalanceString() { sortByCachedBalanceString() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -1837,6 +2191,20 @@ extension WalletInfoQuerySortBy
}); });
} }
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
sortByCachedBalanceTertiaryString() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceTertiaryString', Sort.asc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
sortByCachedBalanceTertiaryStringDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceTertiaryString', Sort.desc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> sortByCachedChainHeight() { QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> sortByCachedChainHeight() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedChainHeight', Sort.asc); return query.addSortBy(r'cachedChainHeight', Sort.asc);
@ -1982,6 +2350,20 @@ extension WalletInfoQuerySortBy
extension WalletInfoQuerySortThenBy extension WalletInfoQuerySortThenBy
on QueryBuilder<WalletInfo, WalletInfo, QSortThenBy> { on QueryBuilder<WalletInfo, WalletInfo, QSortThenBy> {
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
thenByCachedBalanceSecondaryString() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceSecondaryString', Sort.asc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
thenByCachedBalanceSecondaryStringDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceSecondaryString', Sort.desc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
thenByCachedBalanceString() { thenByCachedBalanceString() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -1996,6 +2378,20 @@ extension WalletInfoQuerySortThenBy
}); });
} }
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
thenByCachedBalanceTertiaryString() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceTertiaryString', Sort.asc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy>
thenByCachedBalanceTertiaryStringDesc() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedBalanceTertiaryString', Sort.desc);
});
}
QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> thenByCachedChainHeight() { QueryBuilder<WalletInfo, WalletInfo, QAfterSortBy> thenByCachedChainHeight() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'cachedChainHeight', Sort.asc); return query.addSortBy(r'cachedChainHeight', Sort.asc);
@ -2153,6 +2549,14 @@ extension WalletInfoQuerySortThenBy
extension WalletInfoQueryWhereDistinct extension WalletInfoQueryWhereDistinct
on QueryBuilder<WalletInfo, WalletInfo, QDistinct> { on QueryBuilder<WalletInfo, WalletInfo, QDistinct> {
QueryBuilder<WalletInfo, WalletInfo, QDistinct>
distinctByCachedBalanceSecondaryString({bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'cachedBalanceSecondaryString',
caseSensitive: caseSensitive);
});
}
QueryBuilder<WalletInfo, WalletInfo, QDistinct> distinctByCachedBalanceString( QueryBuilder<WalletInfo, WalletInfo, QDistinct> distinctByCachedBalanceString(
{bool caseSensitive = true}) { {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -2161,6 +2565,14 @@ extension WalletInfoQueryWhereDistinct
}); });
} }
QueryBuilder<WalletInfo, WalletInfo, QDistinct>
distinctByCachedBalanceTertiaryString({bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'cachedBalanceTertiaryString',
caseSensitive: caseSensitive);
});
}
QueryBuilder<WalletInfo, WalletInfo, QDistinct> QueryBuilder<WalletInfo, WalletInfo, QDistinct>
distinctByCachedChainHeight() { distinctByCachedChainHeight() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -2253,6 +2665,13 @@ extension WalletInfoQueryProperty
}); });
} }
QueryBuilder<WalletInfo, String?, QQueryOperations>
cachedBalanceSecondaryStringProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'cachedBalanceSecondaryString');
});
}
QueryBuilder<WalletInfo, String?, QQueryOperations> QueryBuilder<WalletInfo, String?, QQueryOperations>
cachedBalanceStringProperty() { cachedBalanceStringProperty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
@ -2260,6 +2679,13 @@ extension WalletInfoQueryProperty
}); });
} }
QueryBuilder<WalletInfo, String?, QQueryOperations>
cachedBalanceTertiaryStringProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'cachedBalanceTertiaryString');
});
}
QueryBuilder<WalletInfo, int, QQueryOperations> cachedChainHeightProperty() { QueryBuilder<WalletInfo, int, QQueryOperations> cachedChainHeightProperty() {
return QueryBuilder.apply(this, (query) { return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'cachedChainHeight'); return query.addPropertyName(r'cachedChainHeight');