diff --git a/lib/models/isar/models/blockchain_data/input.dart b/lib/models/isar/models/blockchain_data/input.dart index be19cc082..0be374b81 100644 --- a/lib/models/isar/models/blockchain_data/input.dart +++ b/lib/models/isar/models/blockchain_data/input.dart @@ -2,6 +2,8 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/output.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +part 'input.g.dart'; + @Collection() class Input { Id id = Isar.autoIncrement; diff --git a/lib/models/isar/models/blockchain_data/input.g.dart b/lib/models/isar/models/blockchain_data/input.g.dart new file mode 100644 index 000000000..b4a9c2865 --- /dev/null +++ b/lib/models/isar/models/blockchain_data/input.g.dart @@ -0,0 +1,1347 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'input.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +extension GetInputCollection on Isar { + IsarCollection get inputs => this.collection(); +} + +const InputSchema = CollectionSchema( + name: r'Input', + id: 1962449150546623042, + properties: { + r'innerRedeemScriptAsm': PropertySchema( + id: 0, + name: r'innerRedeemScriptAsm', + type: IsarType.string, + ), + r'isCoinbase': PropertySchema( + id: 1, + name: r'isCoinbase', + type: IsarType.bool, + ), + r'scriptSig': PropertySchema( + id: 2, + name: r'scriptSig', + type: IsarType.string, + ), + r'scriptSigAsm': PropertySchema( + id: 3, + name: r'scriptSigAsm', + type: IsarType.string, + ), + r'sequence': PropertySchema( + id: 4, + name: r'sequence', + type: IsarType.long, + ), + r'txid': PropertySchema( + id: 5, + name: r'txid', + type: IsarType.string, + ), + r'vout': PropertySchema( + id: 6, + name: r'vout', + type: IsarType.long, + ) + }, + estimateSize: _inputEstimateSize, + serialize: _inputSerialize, + deserialize: _inputDeserialize, + deserializeProp: _inputDeserializeProp, + idName: r'id', + indexes: {}, + links: { + r'prevOut': LinkSchema( + id: 2963704715567457192, + name: r'prevOut', + target: r'Output', + single: true, + ), + r'transaction': LinkSchema( + id: -7488914266019463608, + name: r'transaction', + target: r'Transaction', + single: true, + linkName: r'inputs', + ) + }, + embeddedSchemas: {}, + getId: _inputGetId, + getLinks: _inputGetLinks, + attach: _inputAttach, + version: '3.0.5', +); + +int _inputEstimateSize( + Input object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.innerRedeemScriptAsm; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.scriptSig; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.scriptSigAsm; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.txid.length * 3; + return bytesCount; +} + +void _inputSerialize( + Input object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.innerRedeemScriptAsm); + writer.writeBool(offsets[1], object.isCoinbase); + writer.writeString(offsets[2], object.scriptSig); + writer.writeString(offsets[3], object.scriptSigAsm); + writer.writeLong(offsets[4], object.sequence); + writer.writeString(offsets[5], object.txid); + writer.writeLong(offsets[6], object.vout); +} + +Input _inputDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Input(); + object.id = id; + object.innerRedeemScriptAsm = reader.readStringOrNull(offsets[0]); + object.isCoinbase = reader.readBoolOrNull(offsets[1]); + object.scriptSig = reader.readStringOrNull(offsets[2]); + object.scriptSigAsm = reader.readStringOrNull(offsets[3]); + object.sequence = reader.readLongOrNull(offsets[4]); + object.txid = reader.readString(offsets[5]); + object.vout = reader.readLong(offsets[6]); + return object; +} + +P _inputDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readStringOrNull(offset)) as P; + case 1: + return (reader.readBoolOrNull(offset)) as P; + case 2: + return (reader.readStringOrNull(offset)) as P; + case 3: + return (reader.readStringOrNull(offset)) as P; + case 4: + return (reader.readLongOrNull(offset)) as P; + case 5: + return (reader.readString(offset)) as P; + case 6: + return (reader.readLong(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _inputGetId(Input object) { + return object.id; +} + +List> _inputGetLinks(Input object) { + return [object.prevOut, object.transaction]; +} + +void _inputAttach(IsarCollection col, Id id, Input object) { + object.id = id; + object.prevOut.attach(col, col.isar.collection(), r'prevOut', id); + object.transaction + .attach(col, col.isar.collection(), r'transaction', id); +} + +extension InputQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension InputQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension InputQueryFilter on QueryBuilder { + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'innerRedeemScriptAsm', + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'innerRedeemScriptAsm', + )); + }); + } + + QueryBuilder innerRedeemScriptAsmEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder innerRedeemScriptAsmBetween( + 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'innerRedeemScriptAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'innerRedeemScriptAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder innerRedeemScriptAsmMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'innerRedeemScriptAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'innerRedeemScriptAsm', + value: '', + )); + }); + } + + QueryBuilder + innerRedeemScriptAsmIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'innerRedeemScriptAsm', + value: '', + )); + }); + } + + QueryBuilder isCoinbaseIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'isCoinbase', + )); + }); + } + + QueryBuilder isCoinbaseIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'isCoinbase', + )); + }); + } + + QueryBuilder isCoinbaseEqualTo( + bool? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'isCoinbase', + value: value, + )); + }); + } + + QueryBuilder scriptSigIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'scriptSig', + )); + }); + } + + QueryBuilder scriptSigIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'scriptSig', + )); + }); + } + + QueryBuilder scriptSigEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigBetween( + 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'scriptSig', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptSig', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptSig', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptSig', + value: '', + )); + }); + } + + QueryBuilder scriptSigIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptSig', + value: '', + )); + }); + } + + QueryBuilder scriptSigAsmIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'scriptSigAsm', + )); + }); + } + + QueryBuilder scriptSigAsmIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'scriptSigAsm', + )); + }); + } + + QueryBuilder scriptSigAsmEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmBetween( + 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'scriptSigAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptSigAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptSigAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptSigAsmIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptSigAsm', + value: '', + )); + }); + } + + QueryBuilder scriptSigAsmIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptSigAsm', + value: '', + )); + }); + } + + QueryBuilder sequenceIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'sequence', + )); + }); + } + + QueryBuilder sequenceIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'sequence', + )); + }); + } + + QueryBuilder sequenceEqualTo( + int? value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'sequence', + value: value, + )); + }); + } + + QueryBuilder sequenceGreaterThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'sequence', + value: value, + )); + }); + } + + QueryBuilder sequenceLessThan( + int? value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'sequence', + value: value, + )); + }); + } + + QueryBuilder sequenceBetween( + int? lower, + int? upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'sequence', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder txidEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidBetween( + 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'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder txidIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder voutEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'vout', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } +} + +extension InputQueryObject on QueryBuilder {} + +extension InputQueryLinks on QueryBuilder { + QueryBuilder prevOut( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'prevOut'); + }); + } + + QueryBuilder prevOutIsNull() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'prevOut', 0, true, 0, true); + }); + } + + QueryBuilder transaction( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'transaction'); + }); + } + + QueryBuilder transactionIsNull() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'transaction', 0, true, 0, true); + }); + } +} + +extension InputQuerySortBy on QueryBuilder { + QueryBuilder sortByInnerRedeemScriptAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'innerRedeemScriptAsm', Sort.asc); + }); + } + + QueryBuilder sortByInnerRedeemScriptAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'innerRedeemScriptAsm', Sort.desc); + }); + } + + QueryBuilder sortByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.asc); + }); + } + + QueryBuilder sortByIsCoinbaseDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.desc); + }); + } + + QueryBuilder sortByScriptSig() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSig', Sort.asc); + }); + } + + QueryBuilder sortByScriptSigDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSig', Sort.desc); + }); + } + + QueryBuilder sortByScriptSigAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSigAsm', Sort.asc); + }); + } + + QueryBuilder sortByScriptSigAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSigAsm', Sort.desc); + }); + } + + QueryBuilder sortBySequence() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'sequence', Sort.asc); + }); + } + + QueryBuilder sortBySequenceDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'sequence', Sort.desc); + }); + } + + QueryBuilder sortByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder sortByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder sortByVout() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.asc); + }); + } + + QueryBuilder sortByVoutDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.desc); + }); + } +} + +extension InputQuerySortThenBy on QueryBuilder { + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByInnerRedeemScriptAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'innerRedeemScriptAsm', Sort.asc); + }); + } + + QueryBuilder thenByInnerRedeemScriptAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'innerRedeemScriptAsm', Sort.desc); + }); + } + + QueryBuilder thenByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.asc); + }); + } + + QueryBuilder thenByIsCoinbaseDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.desc); + }); + } + + QueryBuilder thenByScriptSig() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSig', Sort.asc); + }); + } + + QueryBuilder thenByScriptSigDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSig', Sort.desc); + }); + } + + QueryBuilder thenByScriptSigAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSigAsm', Sort.asc); + }); + } + + QueryBuilder thenByScriptSigAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptSigAsm', Sort.desc); + }); + } + + QueryBuilder thenBySequence() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'sequence', Sort.asc); + }); + } + + QueryBuilder thenBySequenceDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'sequence', Sort.desc); + }); + } + + QueryBuilder thenByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder thenByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder thenByVout() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.asc); + }); + } + + QueryBuilder thenByVoutDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.desc); + }); + } +} + +extension InputQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByInnerRedeemScriptAsm( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'innerRedeemScriptAsm', + caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'isCoinbase'); + }); + } + + QueryBuilder distinctByScriptSig( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptSig', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByScriptSigAsm( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptSigAsm', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctBySequence() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'sequence'); + }); + } + + QueryBuilder distinctByTxid( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByVout() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'vout'); + }); + } +} + +extension InputQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder + innerRedeemScriptAsmProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'innerRedeemScriptAsm'); + }); + } + + QueryBuilder isCoinbaseProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'isCoinbase'); + }); + } + + QueryBuilder scriptSigProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptSig'); + }); + } + + QueryBuilder scriptSigAsmProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptSigAsm'); + }); + } + + QueryBuilder sequenceProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'sequence'); + }); + } + + QueryBuilder txidProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'txid'); + }); + } + + QueryBuilder voutProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'vout'); + }); + } +} diff --git a/lib/models/isar/models/blockchain_data/output.dart b/lib/models/isar/models/blockchain_data/output.dart index 5c34800ad..0e4361a15 100644 --- a/lib/models/isar/models/blockchain_data/output.dart +++ b/lib/models/isar/models/blockchain_data/output.dart @@ -1,6 +1,8 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +part 'output.g.dart'; + @Collection() class Output { Id id = Isar.autoIncrement; diff --git a/lib/models/isar/models/blockchain_data/output.g.dart b/lib/models/isar/models/blockchain_data/output.g.dart new file mode 100644 index 000000000..086fd0684 --- /dev/null +++ b/lib/models/isar/models/blockchain_data/output.g.dart @@ -0,0 +1,1152 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'output.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +extension GetOutputCollection on Isar { + IsarCollection get outputs => this.collection(); +} + +const OutputSchema = CollectionSchema( + name: r'Output', + id: 3359341097909611106, + properties: { + r'scriptPubKey': PropertySchema( + id: 0, + name: r'scriptPubKey', + type: IsarType.string, + ), + r'scriptPubKeyAddress': PropertySchema( + id: 1, + name: r'scriptPubKeyAddress', + type: IsarType.string, + ), + r'scriptPubKeyAsm': PropertySchema( + id: 2, + name: r'scriptPubKeyAsm', + type: IsarType.string, + ), + r'scriptPubKeyType': PropertySchema( + id: 3, + name: r'scriptPubKeyType', + type: IsarType.string, + ), + r'value': PropertySchema( + id: 4, + name: r'value', + type: IsarType.long, + ) + }, + estimateSize: _outputEstimateSize, + serialize: _outputSerialize, + deserialize: _outputDeserialize, + deserializeProp: _outputDeserializeProp, + idName: r'id', + indexes: {}, + links: { + r'transaction': LinkSchema( + id: -2089310750171432135, + name: r'transaction', + target: r'Transaction', + single: true, + linkName: r'outputs', + ) + }, + embeddedSchemas: {}, + getId: _outputGetId, + getLinks: _outputGetLinks, + attach: _outputAttach, + version: '3.0.5', +); + +int _outputEstimateSize( + Output object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + { + final value = object.scriptPubKey; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.scriptPubKeyAddress.length * 3; + { + final value = object.scriptPubKeyAsm; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.scriptPubKeyType; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + return bytesCount; +} + +void _outputSerialize( + Output object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.scriptPubKey); + writer.writeString(offsets[1], object.scriptPubKeyAddress); + writer.writeString(offsets[2], object.scriptPubKeyAsm); + writer.writeString(offsets[3], object.scriptPubKeyType); + writer.writeLong(offsets[4], object.value); +} + +Output _outputDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Output(); + object.id = id; + object.scriptPubKey = reader.readStringOrNull(offsets[0]); + object.scriptPubKeyAddress = reader.readString(offsets[1]); + object.scriptPubKeyAsm = reader.readStringOrNull(offsets[2]); + object.scriptPubKeyType = reader.readStringOrNull(offsets[3]); + object.value = reader.readLong(offsets[4]); + return object; +} + +P _outputDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readStringOrNull(offset)) as P; + case 1: + return (reader.readString(offset)) as P; + case 2: + return (reader.readStringOrNull(offset)) as P; + case 3: + return (reader.readStringOrNull(offset)) as P; + case 4: + return (reader.readLong(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _outputGetId(Output object) { + return object.id; +} + +List> _outputGetLinks(Output object) { + return [object.transaction]; +} + +void _outputAttach(IsarCollection col, Id id, Output object) { + object.id = id; + object.transaction + .attach(col, col.isar.collection(), r'transaction', id); +} + +extension OutputQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension OutputQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension OutputQueryFilter on QueryBuilder { + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder scriptPubKeyIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'scriptPubKey', + )); + }); + } + + QueryBuilder scriptPubKeyIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'scriptPubKey', + )); + }); + } + + QueryBuilder scriptPubKeyEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyBetween( + 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'scriptPubKey', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptPubKey', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptPubKey', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKey', + value: '', + )); + }); + } + + QueryBuilder scriptPubKeyIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptPubKey', + value: '', + )); + }); + } + + QueryBuilder + scriptPubKeyAddressEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressBetween( + 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'scriptPubKeyAddress', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptPubKeyAddress', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptPubKeyAddress', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAddressIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyAddress', + value: '', + )); + }); + } + + QueryBuilder + scriptPubKeyAddressIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptPubKeyAddress', + value: '', + )); + }); + } + + QueryBuilder scriptPubKeyAsmIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'scriptPubKeyAsm', + )); + }); + } + + QueryBuilder + scriptPubKeyAsmIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'scriptPubKeyAsm', + )); + }); + } + + QueryBuilder scriptPubKeyAsmEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyAsmGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmBetween( + 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'scriptPubKeyAsm', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptPubKeyAsm', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptPubKeyAsm', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyAsmIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyAsm', + value: '', + )); + }); + } + + QueryBuilder + scriptPubKeyAsmIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptPubKeyAsm', + value: '', + )); + }); + } + + QueryBuilder scriptPubKeyTypeIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'scriptPubKeyType', + )); + }); + } + + QueryBuilder + scriptPubKeyTypeIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'scriptPubKeyType', + )); + }); + } + + QueryBuilder scriptPubKeyTypeEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyTypeGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyTypeLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyTypeBetween( + 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'scriptPubKeyType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyTypeStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyTypeEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyTypeContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'scriptPubKeyType', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder scriptPubKeyTypeMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'scriptPubKeyType', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + scriptPubKeyTypeIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'scriptPubKeyType', + value: '', + )); + }); + } + + QueryBuilder + scriptPubKeyTypeIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'scriptPubKeyType', + value: '', + )); + }); + } + + QueryBuilder valueEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } +} + +extension OutputQueryObject on QueryBuilder {} + +extension OutputQueryLinks on QueryBuilder { + QueryBuilder transaction( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'transaction'); + }); + } + + QueryBuilder transactionIsNull() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'transaction', 0, true, 0, true); + }); + } +} + +extension OutputQuerySortBy on QueryBuilder { + QueryBuilder sortByScriptPubKey() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKey', Sort.asc); + }); + } + + QueryBuilder sortByScriptPubKeyDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKey', Sort.desc); + }); + } + + QueryBuilder sortByScriptPubKeyAddress() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAddress', Sort.asc); + }); + } + + QueryBuilder sortByScriptPubKeyAddressDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAddress', Sort.desc); + }); + } + + QueryBuilder sortByScriptPubKeyAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAsm', Sort.asc); + }); + } + + QueryBuilder sortByScriptPubKeyAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAsm', Sort.desc); + }); + } + + QueryBuilder sortByScriptPubKeyType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyType', Sort.asc); + }); + } + + QueryBuilder sortByScriptPubKeyTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyType', Sort.desc); + }); + } + + QueryBuilder sortByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder sortByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } +} + +extension OutputQuerySortThenBy on QueryBuilder { + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByScriptPubKey() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKey', Sort.asc); + }); + } + + QueryBuilder thenByScriptPubKeyDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKey', Sort.desc); + }); + } + + QueryBuilder thenByScriptPubKeyAddress() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAddress', Sort.asc); + }); + } + + QueryBuilder thenByScriptPubKeyAddressDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAddress', Sort.desc); + }); + } + + QueryBuilder thenByScriptPubKeyAsm() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAsm', Sort.asc); + }); + } + + QueryBuilder thenByScriptPubKeyAsmDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyAsm', Sort.desc); + }); + } + + QueryBuilder thenByScriptPubKeyType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyType', Sort.asc); + }); + } + + QueryBuilder thenByScriptPubKeyTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'scriptPubKeyType', Sort.desc); + }); + } + + QueryBuilder thenByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder thenByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } +} + +extension OutputQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByScriptPubKey( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptPubKey', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByScriptPubKeyAddress( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptPubKeyAddress', + caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByScriptPubKeyAsm( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptPubKeyAsm', + caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByScriptPubKeyType( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'scriptPubKeyType', + caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByValue() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'value'); + }); + } +} + +extension OutputQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder scriptPubKeyProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptPubKey'); + }); + } + + QueryBuilder scriptPubKeyAddressProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptPubKeyAddress'); + }); + } + + QueryBuilder scriptPubKeyAsmProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptPubKeyAsm'); + }); + } + + QueryBuilder scriptPubKeyTypeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'scriptPubKeyType'); + }); + } + + QueryBuilder valueProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'value'); + }); + } +} diff --git a/lib/models/isar/models/blockchain_data/transaction.dart b/lib/models/isar/models/blockchain_data/transaction.dart index 522b30730..e5c4abd6a 100644 --- a/lib/models/isar/models/blockchain_data/transaction.dart +++ b/lib/models/isar/models/blockchain_data/transaction.dart @@ -3,6 +3,8 @@ import 'package:stackwallet/models/isar/models/blockchain_data/input.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/output.dart'; import 'package:stackwallet/models/isar/models/transaction_note.dart'; +part 'transaction.g.dart'; + @Collection() class Transaction { Id id = Isar.autoIncrement; @@ -15,8 +17,10 @@ class Transaction { late int timestamp; + @enumerated late TransactionType txType; + @enumerated late TransactionSubType subType; late int amount; @@ -47,25 +51,21 @@ class Transaction { // Used in Isar db and stored there as int indexes so adding/removing values // in this definition should be done extremely carefully in production -enum TransactionType with IsarEnum { +enum TransactionType { // TODO: add more types before prod release? outgoing, incoming, sendToSelf, // should we keep this? anonymize; // firo specific - @override - int get value => index; } // Used in Isar db and stored there as int indexes so adding/removing values // in this definition should be done extremely carefully in production -enum TransactionSubType with IsarEnum { +enum TransactionSubType { // TODO: add more types before prod release? none, bip47Notification, // bip47 payment code notification transaction flag mint; // firo specific - @override - int get value => index; } diff --git a/lib/models/isar/models/blockchain_data/transaction.g.dart b/lib/models/isar/models/blockchain_data/transaction.g.dart new file mode 100644 index 000000000..0e968227d --- /dev/null +++ b/lib/models/isar/models/blockchain_data/transaction.g.dart @@ -0,0 +1,2213 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'transaction.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +extension GetTransactionCollection on Isar { + IsarCollection get transactions => this.collection(); +} + +const TransactionSchema = CollectionSchema( + name: r'Transaction', + id: 5320225499417954855, + properties: { + r'address': PropertySchema( + id: 0, + name: r'address', + type: IsarType.string, + ), + r'amount': PropertySchema( + id: 1, + name: r'amount', + type: IsarType.long, + ), + r'cancelled': PropertySchema( + id: 2, + name: r'cancelled', + type: IsarType.bool, + ), + r'confirmations': PropertySchema( + id: 3, + name: r'confirmations', + type: IsarType.long, + ), + r'confirmed': PropertySchema( + id: 4, + name: r'confirmed', + type: IsarType.bool, + ), + r'fee': PropertySchema( + id: 5, + name: r'fee', + type: IsarType.long, + ), + r'height': PropertySchema( + id: 6, + name: r'height', + type: IsarType.long, + ), + r'otherData': PropertySchema( + id: 7, + name: r'otherData', + type: IsarType.string, + ), + r'slateId': PropertySchema( + id: 8, + name: r'slateId', + type: IsarType.string, + ), + r'subType': PropertySchema( + id: 9, + name: r'subType', + type: IsarType.byte, + enumMap: _TransactionsubTypeEnumValueMap, + ), + r'timestamp': PropertySchema( + id: 10, + name: r'timestamp', + type: IsarType.long, + ), + r'txType': PropertySchema( + id: 11, + name: r'txType', + type: IsarType.byte, + enumMap: _TransactiontxTypeEnumValueMap, + ), + r'txid': PropertySchema( + id: 12, + name: r'txid', + type: IsarType.string, + ), + r'worthAtBlockTimestamp': PropertySchema( + id: 13, + name: r'worthAtBlockTimestamp', + type: IsarType.string, + ) + }, + estimateSize: _transactionEstimateSize, + serialize: _transactionSerialize, + deserialize: _transactionDeserialize, + deserializeProp: _transactionDeserializeProp, + idName: r'id', + indexes: {}, + links: { + r'inputs': LinkSchema( + id: 4634425919890543640, + name: r'inputs', + target: r'Input', + single: false, + ), + r'outputs': LinkSchema( + id: 1341997944984495532, + name: r'outputs', + target: r'Output', + single: false, + ), + r'note': LinkSchema( + id: 1009915346265072213, + name: r'note', + target: r'TransactionNote', + single: true, + ) + }, + embeddedSchemas: {}, + getId: _transactionGetId, + getLinks: _transactionGetLinks, + attach: _transactionAttach, + version: '3.0.5', +); + +int _transactionEstimateSize( + Transaction object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + bytesCount += 3 + object.address.length * 3; + { + final value = object.otherData; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + { + final value = object.slateId; + if (value != null) { + bytesCount += 3 + value.length * 3; + } + } + bytesCount += 3 + object.txid.length * 3; + bytesCount += 3 + object.worthAtBlockTimestamp.length * 3; + return bytesCount; +} + +void _transactionSerialize( + Transaction object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.address); + writer.writeLong(offsets[1], object.amount); + writer.writeBool(offsets[2], object.cancelled); + writer.writeLong(offsets[3], object.confirmations); + writer.writeBool(offsets[4], object.confirmed); + writer.writeLong(offsets[5], object.fee); + writer.writeLong(offsets[6], object.height); + writer.writeString(offsets[7], object.otherData); + writer.writeString(offsets[8], object.slateId); + writer.writeByte(offsets[9], object.subType.index); + writer.writeLong(offsets[10], object.timestamp); + writer.writeByte(offsets[11], object.txType.index); + writer.writeString(offsets[12], object.txid); + writer.writeString(offsets[13], object.worthAtBlockTimestamp); +} + +Transaction _transactionDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Transaction(); + object.address = reader.readString(offsets[0]); + object.amount = reader.readLong(offsets[1]); + object.cancelled = reader.readBool(offsets[2]); + object.confirmations = reader.readLong(offsets[3]); + object.confirmed = reader.readBool(offsets[4]); + object.fee = reader.readLong(offsets[5]); + object.height = reader.readLong(offsets[6]); + object.id = id; + object.otherData = reader.readStringOrNull(offsets[7]); + object.slateId = reader.readStringOrNull(offsets[8]); + object.subType = + _TransactionsubTypeValueEnumMap[reader.readByteOrNull(offsets[9])] ?? + TransactionSubType.none; + object.timestamp = reader.readLong(offsets[10]); + object.txType = + _TransactiontxTypeValueEnumMap[reader.readByteOrNull(offsets[11])] ?? + TransactionType.outgoing; + object.txid = reader.readString(offsets[12]); + object.worthAtBlockTimestamp = reader.readString(offsets[13]); + return object; +} + +P _transactionDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readString(offset)) as P; + case 1: + return (reader.readLong(offset)) as P; + case 2: + return (reader.readBool(offset)) as P; + case 3: + return (reader.readLong(offset)) as P; + case 4: + return (reader.readBool(offset)) as P; + case 5: + return (reader.readLong(offset)) as P; + case 6: + return (reader.readLong(offset)) as P; + case 7: + return (reader.readStringOrNull(offset)) as P; + case 8: + return (reader.readStringOrNull(offset)) as P; + case 9: + return (_TransactionsubTypeValueEnumMap[reader.readByteOrNull(offset)] ?? + TransactionSubType.none) as P; + case 10: + return (reader.readLong(offset)) as P; + case 11: + return (_TransactiontxTypeValueEnumMap[reader.readByteOrNull(offset)] ?? + TransactionType.outgoing) as P; + case 12: + return (reader.readString(offset)) as P; + case 13: + return (reader.readString(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +const _TransactionsubTypeEnumValueMap = { + 'none': 0, + 'bip47Notification': 1, + 'mint': 2, +}; +const _TransactionsubTypeValueEnumMap = { + 0: TransactionSubType.none, + 1: TransactionSubType.bip47Notification, + 2: TransactionSubType.mint, +}; +const _TransactiontxTypeEnumValueMap = { + 'outgoing': 0, + 'incoming': 1, + 'sendToSelf': 2, + 'anonymize': 3, +}; +const _TransactiontxTypeValueEnumMap = { + 0: TransactionType.outgoing, + 1: TransactionType.incoming, + 2: TransactionType.sendToSelf, + 3: TransactionType.anonymize, +}; + +Id _transactionGetId(Transaction object) { + return object.id; +} + +List> _transactionGetLinks(Transaction object) { + return [object.inputs, object.outputs, object.note]; +} + +void _transactionAttach( + IsarCollection col, Id id, Transaction object) { + object.id = id; + object.inputs.attach(col, col.isar.collection(), r'inputs', id); + object.outputs.attach(col, col.isar.collection(), r'outputs', id); + object.note.attach(col, col.isar.collection(), r'note', id); +} + +extension TransactionQueryWhereSort + on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension TransactionQueryWhere + on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo( + Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension TransactionQueryFilter + on QueryBuilder { + QueryBuilder addressEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + addressGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder addressLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder addressBetween( + 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'address', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + addressStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder addressEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder addressContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'address', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder addressMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'address', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + addressIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'address', + value: '', + )); + }); + } + + QueryBuilder + addressIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'address', + value: '', + )); + }); + } + + QueryBuilder amountEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'amount', + value: value, + )); + }); + } + + QueryBuilder + amountGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'amount', + value: value, + )); + }); + } + + QueryBuilder amountLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'amount', + value: value, + )); + }); + } + + QueryBuilder amountBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'amount', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + cancelledEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'cancelled', + value: value, + )); + }); + } + + QueryBuilder + confirmationsEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder + confirmationsGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder + confirmationsLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder + confirmationsBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'confirmations', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + confirmedEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'confirmed', + value: value, + )); + }); + } + + QueryBuilder feeEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'fee', + value: value, + )); + }); + } + + QueryBuilder feeGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'fee', + value: value, + )); + }); + } + + QueryBuilder feeLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'fee', + value: value, + )); + }); + } + + QueryBuilder feeBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'fee', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder heightEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'height', + value: value, + )); + }); + } + + QueryBuilder + heightGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'height', + value: value, + )); + }); + } + + QueryBuilder heightLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'height', + value: value, + )); + }); + } + + QueryBuilder heightBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'height', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder idEqualTo( + Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + otherDataIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'otherData', + )); + }); + } + + QueryBuilder + otherDataIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'otherData', + )); + }); + } + + QueryBuilder + otherDataEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataBetween( + 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'otherData', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'otherData', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'otherData', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + otherDataIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'otherData', + value: '', + )); + }); + } + + QueryBuilder + otherDataIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'otherData', + value: '', + )); + }); + } + + QueryBuilder + slateIdIsNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNull( + property: r'slateId', + )); + }); + } + + QueryBuilder + slateIdIsNotNull() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(const FilterCondition.isNotNull( + property: r'slateId', + )); + }); + } + + QueryBuilder slateIdEqualTo( + String? value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + slateIdGreaterThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder slateIdLessThan( + String? value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder slateIdBetween( + 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'slateId', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + slateIdStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder slateIdEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder slateIdContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'slateId', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder slateIdMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'slateId', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + slateIdIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'slateId', + value: '', + )); + }); + } + + QueryBuilder + slateIdIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'slateId', + value: '', + )); + }); + } + + QueryBuilder subTypeEqualTo( + TransactionSubType value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'subType', + value: value, + )); + }); + } + + QueryBuilder + subTypeGreaterThan( + TransactionSubType value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'subType', + value: value, + )); + }); + } + + QueryBuilder subTypeLessThan( + TransactionSubType value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'subType', + value: value, + )); + }); + } + + QueryBuilder subTypeBetween( + TransactionSubType lower, + TransactionSubType upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'subType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + timestampEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'timestamp', + value: value, + )); + }); + } + + QueryBuilder + timestampGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'timestamp', + value: value, + )); + }); + } + + QueryBuilder + timestampLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'timestamp', + value: value, + )); + }); + } + + QueryBuilder + timestampBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'timestamp', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder txTypeEqualTo( + TransactionType value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txType', + value: value, + )); + }); + } + + QueryBuilder + txTypeGreaterThan( + TransactionType value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txType', + value: value, + )); + }); + } + + QueryBuilder txTypeLessThan( + TransactionType value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txType', + value: value, + )); + }); + } + + QueryBuilder txTypeBetween( + TransactionType lower, + TransactionType upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'txType', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder txidEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidBetween( + 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'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder + txidIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder + worthAtBlockTimestampEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampBetween( + 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'worthAtBlockTimestamp', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'worthAtBlockTimestamp', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'worthAtBlockTimestamp', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + worthAtBlockTimestampIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'worthAtBlockTimestamp', + value: '', + )); + }); + } + + QueryBuilder + worthAtBlockTimestampIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'worthAtBlockTimestamp', + value: '', + )); + }); + } +} + +extension TransactionQueryObject + on QueryBuilder {} + +extension TransactionQueryLinks + on QueryBuilder { + QueryBuilder inputs( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'inputs'); + }); + } + + QueryBuilder + inputsLengthEqualTo(int length) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'inputs', length, true, length, true); + }); + } + + QueryBuilder + inputsIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'inputs', 0, true, 0, true); + }); + } + + QueryBuilder + inputsIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'inputs', 0, false, 999999, true); + }); + } + + QueryBuilder + inputsLengthLessThan( + int length, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'inputs', 0, true, length, include); + }); + } + + QueryBuilder + inputsLengthGreaterThan( + int length, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'inputs', length, include, 999999, true); + }); + } + + QueryBuilder + inputsLengthBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength( + r'inputs', lower, includeLower, upper, includeUpper); + }); + } + + QueryBuilder outputs( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'outputs'); + }); + } + + QueryBuilder + outputsLengthEqualTo(int length) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'outputs', length, true, length, true); + }); + } + + QueryBuilder + outputsIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'outputs', 0, true, 0, true); + }); + } + + QueryBuilder + outputsIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'outputs', 0, false, 999999, true); + }); + } + + QueryBuilder + outputsLengthLessThan( + int length, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'outputs', 0, true, length, include); + }); + } + + QueryBuilder + outputsLengthGreaterThan( + int length, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'outputs', length, include, 999999, true); + }); + } + + QueryBuilder + outputsLengthBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.linkLength( + r'outputs', lower, includeLower, upper, includeUpper); + }); + } + + QueryBuilder note( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'note'); + }); + } + + QueryBuilder noteIsNull() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'note', 0, true, 0, true); + }); + } +} + +extension TransactionQuerySortBy + on QueryBuilder { + QueryBuilder sortByAddress() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'address', Sort.asc); + }); + } + + QueryBuilder sortByAddressDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'address', Sort.desc); + }); + } + + QueryBuilder sortByAmount() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'amount', Sort.asc); + }); + } + + QueryBuilder sortByAmountDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'amount', Sort.desc); + }); + } + + QueryBuilder sortByCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'cancelled', Sort.asc); + }); + } + + QueryBuilder sortByCancelledDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'cancelled', Sort.desc); + }); + } + + QueryBuilder sortByConfirmations() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmations', Sort.asc); + }); + } + + QueryBuilder + sortByConfirmationsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmations', Sort.desc); + }); + } + + QueryBuilder sortByConfirmed() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmed', Sort.asc); + }); + } + + QueryBuilder sortByConfirmedDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmed', Sort.desc); + }); + } + + QueryBuilder sortByFee() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fee', Sort.asc); + }); + } + + QueryBuilder sortByFeeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fee', Sort.desc); + }); + } + + QueryBuilder sortByHeight() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'height', Sort.asc); + }); + } + + QueryBuilder sortByHeightDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'height', Sort.desc); + }); + } + + QueryBuilder sortByOtherData() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'otherData', Sort.asc); + }); + } + + QueryBuilder sortByOtherDataDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'otherData', Sort.desc); + }); + } + + QueryBuilder sortBySlateId() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'slateId', Sort.asc); + }); + } + + QueryBuilder sortBySlateIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'slateId', Sort.desc); + }); + } + + QueryBuilder sortBySubType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'subType', Sort.asc); + }); + } + + QueryBuilder sortBySubTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'subType', Sort.desc); + }); + } + + QueryBuilder sortByTimestamp() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'timestamp', Sort.asc); + }); + } + + QueryBuilder sortByTimestampDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'timestamp', Sort.desc); + }); + } + + QueryBuilder sortByTxType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txType', Sort.asc); + }); + } + + QueryBuilder sortByTxTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txType', Sort.desc); + }); + } + + QueryBuilder sortByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder sortByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder + sortByWorthAtBlockTimestamp() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'worthAtBlockTimestamp', Sort.asc); + }); + } + + QueryBuilder + sortByWorthAtBlockTimestampDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'worthAtBlockTimestamp', Sort.desc); + }); + } +} + +extension TransactionQuerySortThenBy + on QueryBuilder { + QueryBuilder thenByAddress() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'address', Sort.asc); + }); + } + + QueryBuilder thenByAddressDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'address', Sort.desc); + }); + } + + QueryBuilder thenByAmount() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'amount', Sort.asc); + }); + } + + QueryBuilder thenByAmountDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'amount', Sort.desc); + }); + } + + QueryBuilder thenByCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'cancelled', Sort.asc); + }); + } + + QueryBuilder thenByCancelledDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'cancelled', Sort.desc); + }); + } + + QueryBuilder thenByConfirmations() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmations', Sort.asc); + }); + } + + QueryBuilder + thenByConfirmationsDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmations', Sort.desc); + }); + } + + QueryBuilder thenByConfirmed() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmed', Sort.asc); + }); + } + + QueryBuilder thenByConfirmedDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'confirmed', Sort.desc); + }); + } + + QueryBuilder thenByFee() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fee', Sort.asc); + }); + } + + QueryBuilder thenByFeeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fee', Sort.desc); + }); + } + + QueryBuilder thenByHeight() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'height', Sort.asc); + }); + } + + QueryBuilder thenByHeightDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'height', Sort.desc); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByOtherData() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'otherData', Sort.asc); + }); + } + + QueryBuilder thenByOtherDataDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'otherData', Sort.desc); + }); + } + + QueryBuilder thenBySlateId() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'slateId', Sort.asc); + }); + } + + QueryBuilder thenBySlateIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'slateId', Sort.desc); + }); + } + + QueryBuilder thenBySubType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'subType', Sort.asc); + }); + } + + QueryBuilder thenBySubTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'subType', Sort.desc); + }); + } + + QueryBuilder thenByTimestamp() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'timestamp', Sort.asc); + }); + } + + QueryBuilder thenByTimestampDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'timestamp', Sort.desc); + }); + } + + QueryBuilder thenByTxType() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txType', Sort.asc); + }); + } + + QueryBuilder thenByTxTypeDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txType', Sort.desc); + }); + } + + QueryBuilder thenByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder thenByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder + thenByWorthAtBlockTimestamp() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'worthAtBlockTimestamp', Sort.asc); + }); + } + + QueryBuilder + thenByWorthAtBlockTimestampDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'worthAtBlockTimestamp', Sort.desc); + }); + } +} + +extension TransactionQueryWhereDistinct + on QueryBuilder { + QueryBuilder distinctByAddress( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'address', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByAmount() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'amount'); + }); + } + + QueryBuilder distinctByCancelled() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'cancelled'); + }); + } + + QueryBuilder distinctByConfirmations() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'confirmations'); + }); + } + + QueryBuilder distinctByConfirmed() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'confirmed'); + }); + } + + QueryBuilder distinctByFee() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'fee'); + }); + } + + QueryBuilder distinctByHeight() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'height'); + }); + } + + QueryBuilder distinctByOtherData( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctBySlateId( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'slateId', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctBySubType() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'subType'); + }); + } + + QueryBuilder distinctByTimestamp() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'timestamp'); + }); + } + + QueryBuilder distinctByTxType() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'txType'); + }); + } + + QueryBuilder distinctByTxid( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); + }); + } + + QueryBuilder + distinctByWorthAtBlockTimestamp({bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'worthAtBlockTimestamp', + caseSensitive: caseSensitive); + }); + } +} + +extension TransactionQueryProperty + on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder addressProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'address'); + }); + } + + QueryBuilder amountProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'amount'); + }); + } + + QueryBuilder cancelledProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'cancelled'); + }); + } + + QueryBuilder confirmationsProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'confirmations'); + }); + } + + QueryBuilder confirmedProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'confirmed'); + }); + } + + QueryBuilder feeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'fee'); + }); + } + + QueryBuilder heightProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'height'); + }); + } + + QueryBuilder otherDataProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'otherData'); + }); + } + + QueryBuilder slateIdProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'slateId'); + }); + } + + QueryBuilder + subTypeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'subType'); + }); + } + + QueryBuilder timestampProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'timestamp'); + }); + } + + QueryBuilder + txTypeProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'txType'); + }); + } + + QueryBuilder txidProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'txid'); + }); + } + + QueryBuilder + worthAtBlockTimestampProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'worthAtBlockTimestamp'); + }); + } +} diff --git a/lib/models/isar/models/blockchain_data/utxo.dart b/lib/models/isar/models/blockchain_data/utxo.dart index 6539ea2cb..5882d0b61 100644 --- a/lib/models/isar/models/blockchain_data/utxo.dart +++ b/lib/models/isar/models/blockchain_data/utxo.dart @@ -1,5 +1,7 @@ import 'package:isar/isar.dart'; +part 'utxo.g.dart'; + @Collection() class UTXO { Id id = Isar.autoIncrement; @@ -23,8 +25,6 @@ class UTXO { @Embedded() class Status { - Id id = Isar.autoIncrement; - late bool confirmed; late int confirmations; diff --git a/lib/models/isar/models/blockchain_data/utxo.g.dart b/lib/models/isar/models/blockchain_data/utxo.g.dart new file mode 100644 index 000000000..7511b11df --- /dev/null +++ b/lib/models/isar/models/blockchain_data/utxo.g.dart @@ -0,0 +1,1520 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'utxo.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +extension GetUTXOCollection on Isar { + IsarCollection get uTXOs => this.collection(); +} + +const UTXOSchema = CollectionSchema( + name: r'UTXO', + id: 5934032492047519621, + properties: { + r'blocked': PropertySchema( + id: 0, + name: r'blocked', + type: IsarType.bool, + ), + r'fiatWorth': PropertySchema( + id: 1, + name: r'fiatWorth', + type: IsarType.string, + ), + r'isCoinbase': PropertySchema( + id: 2, + name: r'isCoinbase', + type: IsarType.bool, + ), + r'status': PropertySchema( + id: 3, + name: r'status', + type: IsarType.object, + target: r'Status', + ), + r'txName': PropertySchema( + id: 4, + name: r'txName', + type: IsarType.string, + ), + r'txid': PropertySchema( + id: 5, + name: r'txid', + type: IsarType.string, + ), + r'value': PropertySchema( + id: 6, + name: r'value', + type: IsarType.long, + ), + r'vout': PropertySchema( + id: 7, + name: r'vout', + type: IsarType.long, + ) + }, + estimateSize: _uTXOEstimateSize, + serialize: _uTXOSerialize, + deserialize: _uTXODeserialize, + deserializeProp: _uTXODeserializeProp, + idName: r'id', + indexes: {}, + links: {}, + embeddedSchemas: {r'Status': StatusSchema}, + getId: _uTXOGetId, + getLinks: _uTXOGetLinks, + attach: _uTXOAttach, + version: '3.0.5', +); + +int _uTXOEstimateSize( + UTXO object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + bytesCount += 3 + object.fiatWorth.length * 3; + bytesCount += 3 + + StatusSchema.estimateSize(object.status, allOffsets[Status]!, allOffsets); + bytesCount += 3 + object.txName.length * 3; + bytesCount += 3 + object.txid.length * 3; + return bytesCount; +} + +void _uTXOSerialize( + UTXO object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeBool(offsets[0], object.blocked); + writer.writeString(offsets[1], object.fiatWorth); + writer.writeBool(offsets[2], object.isCoinbase); + writer.writeObject( + offsets[3], + allOffsets, + StatusSchema.serialize, + object.status, + ); + writer.writeString(offsets[4], object.txName); + writer.writeString(offsets[5], object.txid); + writer.writeLong(offsets[6], object.value); + writer.writeLong(offsets[7], object.vout); +} + +UTXO _uTXODeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = UTXO(); + object.blocked = reader.readBool(offsets[0]); + object.fiatWorth = reader.readString(offsets[1]); + object.id = id; + object.isCoinbase = reader.readBool(offsets[2]); + object.status = reader.readObjectOrNull( + offsets[3], + StatusSchema.deserialize, + allOffsets, + ) ?? + Status(); + object.txName = reader.readString(offsets[4]); + object.txid = reader.readString(offsets[5]); + object.value = reader.readLong(offsets[6]); + object.vout = reader.readLong(offsets[7]); + return object; +} + +P _uTXODeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readBool(offset)) as P; + case 1: + return (reader.readString(offset)) as P; + case 2: + return (reader.readBool(offset)) as P; + case 3: + return (reader.readObjectOrNull( + offset, + StatusSchema.deserialize, + allOffsets, + ) ?? + Status()) as P; + case 4: + return (reader.readString(offset)) as P; + case 5: + return (reader.readString(offset)) as P; + case 6: + return (reader.readLong(offset)) as P; + case 7: + return (reader.readLong(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _uTXOGetId(UTXO object) { + return object.id; +} + +List> _uTXOGetLinks(UTXO object) { + return []; +} + +void _uTXOAttach(IsarCollection col, Id id, UTXO object) { + object.id = id; +} + +extension UTXOQueryWhereSort on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension UTXOQueryWhere on QueryBuilder { + QueryBuilder idEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder idGreaterThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan(Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension UTXOQueryFilter on QueryBuilder { + QueryBuilder blockedEqualTo(bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'blocked', + value: value, + )); + }); + } + + QueryBuilder fiatWorthEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthBetween( + 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'fiatWorth', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'fiatWorth', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'fiatWorth', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder fiatWorthIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'fiatWorth', + value: '', + )); + }); + } + + QueryBuilder fiatWorthIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'fiatWorth', + value: '', + )); + }); + } + + QueryBuilder idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder isCoinbaseEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'isCoinbase', + value: value, + )); + }); + } + + QueryBuilder txNameEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameBetween( + 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'txName', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txName', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txName', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txNameIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txName', + value: '', + )); + }); + } + + QueryBuilder txNameIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txName', + value: '', + )); + }); + } + + QueryBuilder txidEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidBetween( + 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'txid', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidContains(String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'txid', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidMatches(String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'txid', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder txidIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder txidIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'txid', + value: '', + )); + }); + } + + QueryBuilder valueEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + )); + }); + } + + QueryBuilder valueBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder voutEqualTo(int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'vout', + value: value, + )); + }); + } + + QueryBuilder voutBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'vout', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } +} + +extension UTXOQueryObject on QueryBuilder { + QueryBuilder status( + FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.object(q, r'status'); + }); + } +} + +extension UTXOQueryLinks on QueryBuilder {} + +extension UTXOQuerySortBy on QueryBuilder { + QueryBuilder sortByBlocked() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'blocked', Sort.asc); + }); + } + + QueryBuilder sortByBlockedDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'blocked', Sort.desc); + }); + } + + QueryBuilder sortByFiatWorth() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fiatWorth', Sort.asc); + }); + } + + QueryBuilder sortByFiatWorthDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fiatWorth', Sort.desc); + }); + } + + QueryBuilder sortByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.asc); + }); + } + + QueryBuilder sortByIsCoinbaseDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.desc); + }); + } + + QueryBuilder sortByTxName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txName', Sort.asc); + }); + } + + QueryBuilder sortByTxNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txName', Sort.desc); + }); + } + + QueryBuilder sortByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder sortByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder sortByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder sortByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } + + QueryBuilder sortByVout() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.asc); + }); + } + + QueryBuilder sortByVoutDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.desc); + }); + } +} + +extension UTXOQuerySortThenBy on QueryBuilder { + QueryBuilder thenByBlocked() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'blocked', Sort.asc); + }); + } + + QueryBuilder thenByBlockedDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'blocked', Sort.desc); + }); + } + + QueryBuilder thenByFiatWorth() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fiatWorth', Sort.asc); + }); + } + + QueryBuilder thenByFiatWorthDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'fiatWorth', Sort.desc); + }); + } + + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.asc); + }); + } + + QueryBuilder thenByIsCoinbaseDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'isCoinbase', Sort.desc); + }); + } + + QueryBuilder thenByTxName() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txName', Sort.asc); + }); + } + + QueryBuilder thenByTxNameDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txName', Sort.desc); + }); + } + + QueryBuilder thenByTxid() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.asc); + }); + } + + QueryBuilder thenByTxidDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'txid', Sort.desc); + }); + } + + QueryBuilder thenByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder thenByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } + + QueryBuilder thenByVout() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.asc); + }); + } + + QueryBuilder thenByVoutDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'vout', Sort.desc); + }); + } +} + +extension UTXOQueryWhereDistinct on QueryBuilder { + QueryBuilder distinctByBlocked() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'blocked'); + }); + } + + QueryBuilder distinctByFiatWorth( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'fiatWorth', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByIsCoinbase() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'isCoinbase'); + }); + } + + QueryBuilder distinctByTxName( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'txName', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByTxid( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'txid', caseSensitive: caseSensitive); + }); + } + + QueryBuilder distinctByValue() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'value'); + }); + } + + QueryBuilder distinctByVout() { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'vout'); + }); + } +} + +extension UTXOQueryProperty on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder blockedProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'blocked'); + }); + } + + QueryBuilder fiatWorthProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'fiatWorth'); + }); + } + + QueryBuilder isCoinbaseProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'isCoinbase'); + }); + } + + QueryBuilder statusProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'status'); + }); + } + + QueryBuilder txNameProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'txName'); + }); + } + + QueryBuilder txidProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'txid'); + }); + } + + QueryBuilder valueProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'value'); + }); + } + + QueryBuilder voutProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'vout'); + }); + } +} + +// ************************************************************************** +// IsarEmbeddedGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +const StatusSchema = Schema( + name: r'Status', + id: -8158262482337811485, + properties: { + r'blockHash': PropertySchema( + id: 0, + name: r'blockHash', + type: IsarType.string, + ), + r'blockHeight': PropertySchema( + id: 1, + name: r'blockHeight', + type: IsarType.long, + ), + r'blockTime': PropertySchema( + id: 2, + name: r'blockTime', + type: IsarType.long, + ), + r'confirmations': PropertySchema( + id: 3, + name: r'confirmations', + type: IsarType.long, + ), + r'confirmed': PropertySchema( + id: 4, + name: r'confirmed', + type: IsarType.bool, + ) + }, + estimateSize: _statusEstimateSize, + serialize: _statusSerialize, + deserialize: _statusDeserialize, + deserializeProp: _statusDeserializeProp, +); + +int _statusEstimateSize( + Status object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + bytesCount += 3 + object.blockHash.length * 3; + return bytesCount; +} + +void _statusSerialize( + Status object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.blockHash); + writer.writeLong(offsets[1], object.blockHeight); + writer.writeLong(offsets[2], object.blockTime); + writer.writeLong(offsets[3], object.confirmations); + writer.writeBool(offsets[4], object.confirmed); +} + +Status _statusDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = Status(); + object.blockHash = reader.readString(offsets[0]); + object.blockHeight = reader.readLong(offsets[1]); + object.blockTime = reader.readLong(offsets[2]); + object.confirmations = reader.readLong(offsets[3]); + object.confirmed = reader.readBool(offsets[4]); + return object; +} + +P _statusDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readString(offset)) as P; + case 1: + return (reader.readLong(offset)) as P; + case 2: + return (reader.readLong(offset)) as P; + case 3: + return (reader.readLong(offset)) as P; + case 4: + return (reader.readBool(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +extension StatusQueryFilter on QueryBuilder { + QueryBuilder blockHashEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashBetween( + 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'blockHash', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashContains( + String value, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'blockHash', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashMatches( + String pattern, + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'blockHash', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder blockHashIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'blockHash', + value: '', + )); + }); + } + + QueryBuilder blockHashIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'blockHash', + value: '', + )); + }); + } + + QueryBuilder blockHeightEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'blockHeight', + value: value, + )); + }); + } + + QueryBuilder blockHeightGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'blockHeight', + value: value, + )); + }); + } + + QueryBuilder blockHeightLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'blockHeight', + value: value, + )); + }); + } + + QueryBuilder blockHeightBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'blockHeight', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder blockTimeEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'blockTime', + value: value, + )); + }); + } + + QueryBuilder blockTimeGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'blockTime', + value: value, + )); + }); + } + + QueryBuilder blockTimeLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'blockTime', + value: value, + )); + }); + } + + QueryBuilder blockTimeBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'blockTime', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder confirmationsEqualTo( + int value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder confirmationsGreaterThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder confirmationsLessThan( + int value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'confirmations', + value: value, + )); + }); + } + + QueryBuilder confirmationsBetween( + int lower, + int upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'confirmations', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder confirmedEqualTo( + bool value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'confirmed', + value: value, + )); + }); + } +} + +extension StatusQueryObject on QueryBuilder {} diff --git a/lib/models/isar/models/encrypted_string_value.g.dart b/lib/models/isar/models/encrypted_string_value.g.dart index 2315c5d85..fdfe5527a 100644 --- a/lib/models/isar/models/encrypted_string_value.g.dart +++ b/lib/models/isar/models/encrypted_string_value.g.dart @@ -7,7 +7,7 @@ part of 'encrypted_string_value.dart'; // ************************************************************************** // coverage:ignore-file -// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, join_return_with_assignment, avoid_js_rounded_ints, prefer_final_locals +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters extension GetEncryptedStringValueCollection on Isar { IsarCollection get encryptedStringValues => @@ -30,12 +30,9 @@ const EncryptedStringValueSchema = CollectionSchema( ) }, estimateSize: _encryptedStringValueEstimateSize, - serializeNative: _encryptedStringValueSerializeNative, - deserializeNative: _encryptedStringValueDeserializeNative, - deserializePropNative: _encryptedStringValueDeserializePropNative, - serializeWeb: _encryptedStringValueSerializeWeb, - deserializeWeb: _encryptedStringValueDeserializeWeb, - deserializePropWeb: _encryptedStringValueDeserializePropWeb, + serialize: _encryptedStringValueSerialize, + deserialize: _encryptedStringValueDeserialize, + deserializeProp: _encryptedStringValueDeserializeProp, idName: r'id', indexes: { r'key': IndexSchema( @@ -57,7 +54,7 @@ const EncryptedStringValueSchema = CollectionSchema( getId: _encryptedStringValueGetId, getLinks: _encryptedStringValueGetLinks, attach: _encryptedStringValueAttach, - version: 5, + version: '3.0.5', ); int _encryptedStringValueEstimateSize( @@ -71,20 +68,19 @@ int _encryptedStringValueEstimateSize( return bytesCount; } -int _encryptedStringValueSerializeNative( +void _encryptedStringValueSerialize( EncryptedStringValue object, - IsarBinaryWriter writer, + IsarWriter writer, List offsets, Map> allOffsets, ) { writer.writeString(offsets[0], object.key); writer.writeString(offsets[1], object.value); - return writer.usedBytes; } -EncryptedStringValue _encryptedStringValueDeserializeNative( - int id, - IsarBinaryReader reader, +EncryptedStringValue _encryptedStringValueDeserialize( + Id id, + IsarReader reader, List offsets, Map> allOffsets, ) { @@ -95,9 +91,8 @@ EncryptedStringValue _encryptedStringValueDeserializeNative( return object; } -P _encryptedStringValueDeserializePropNative

( - Id id, - IsarBinaryReader reader, +P _encryptedStringValueDeserializeProp

( + IsarReader reader, int propertyId, int offset, Map> allOffsets, @@ -112,33 +107,8 @@ P _encryptedStringValueDeserializePropNative

( } } -Object _encryptedStringValueSerializeWeb( - IsarCollection collection, - EncryptedStringValue object) { - /*final jsObj = IsarNative.newJsObject();*/ throw UnimplementedError(); -} - -EncryptedStringValue _encryptedStringValueDeserializeWeb( - IsarCollection collection, Object jsObj) { - /*final object = EncryptedStringValue();object.id = IsarNative.jsObjectGet(jsObj, r'id') ?? (double.negativeInfinity as int);object.key = IsarNative.jsObjectGet(jsObj, r'key') ?? '';object.value = IsarNative.jsObjectGet(jsObj, r'value') ?? '';*/ - //return object; - throw UnimplementedError(); -} - -P _encryptedStringValueDeserializePropWeb

( - Object jsObj, String propertyName) { - switch (propertyName) { - default: - throw IsarError('Illegal propertyName'); - } -} - -int? _encryptedStringValueGetId(EncryptedStringValue object) { - if (object.id == Isar.autoIncrement) { - return null; - } else { - return object.id; - } +Id _encryptedStringValueGetId(EncryptedStringValue object) { + return object.id; } List> _encryptedStringValueGetLinks( @@ -188,19 +158,19 @@ extension EncryptedStringValueByIndex on IsarCollection { return deleteAllByIndexSync(r'key', values); } - Future putByKey(EncryptedStringValue object) { + Future putByKey(EncryptedStringValue object) { return putByIndex(r'key', object); } - int putByKeySync(EncryptedStringValue object, {bool saveLinks = true}) { + Id putByKeySync(EncryptedStringValue object, {bool saveLinks = true}) { return putByIndexSync(r'key', object, saveLinks: saveLinks); } - Future> putAllByKey(List objects) { + Future> putAllByKey(List objects) { return putAllByIndex(r'key', objects); } - List putAllByKeySync(List objects, + List putAllByKeySync(List objects, {bool saveLinks = true}) { return putAllByIndexSync(r'key', objects, saveLinks: saveLinks); } @@ -219,7 +189,7 @@ extension EncryptedStringValueQueryWhereSort extension EncryptedStringValueQueryWhere on QueryBuilder { QueryBuilder - idEqualTo(int id) { + idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { return query.addWhereClause(IdWhereClause.between( lower: id, @@ -229,7 +199,7 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idNotEqualTo(int id) { + idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -252,7 +222,7 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idGreaterThan(int id, {bool include = false}) { + idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.greaterThan(lower: id, includeLower: include), @@ -261,7 +231,7 @@ extension EncryptedStringValueQueryWhere } QueryBuilder - idLessThan(int id, {bool include = false}) { + idLessThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( IdWhereClause.lessThan(upper: id, includeUpper: include), @@ -271,8 +241,8 @@ extension EncryptedStringValueQueryWhere QueryBuilder idBetween( - int lowerId, - int upperId, { + Id lowerId, + Id upperId, { bool includeLower = true, bool includeUpper = true, }) { @@ -335,7 +305,7 @@ extension EncryptedStringValueQueryWhere extension EncryptedStringValueQueryFilter on QueryBuilder { QueryBuilder idEqualTo(int value) { + QAfterFilterCondition> idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'id', @@ -346,7 +316,7 @@ extension EncryptedStringValueQueryFilter on QueryBuilder idGreaterThan( - int value, { + Id value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { @@ -360,7 +330,7 @@ extension EncryptedStringValueQueryFilter on QueryBuilder idLessThan( - int value, { + Id value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { @@ -374,8 +344,8 @@ extension EncryptedStringValueQueryFilter on QueryBuilder idBetween( - int lower, - int upper, { + Id lower, + Id upper, { bool includeLower = true, bool includeUpper = true, }) { @@ -508,6 +478,26 @@ extension EncryptedStringValueQueryFilter on QueryBuilder keyIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'key', + value: '', + )); + }); + } + + QueryBuilder keyIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'key', + value: '', + )); + }); + } + QueryBuilder valueEqualTo( String value, { @@ -625,6 +615,26 @@ extension EncryptedStringValueQueryFilter on QueryBuilder valueIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'value', + value: '', + )); + }); + } + + QueryBuilder valueIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'value', + value: '', + )); + }); + } } extension EncryptedStringValueQueryObject on QueryBuilder get logs => this.collection(); @@ -21,6 +21,7 @@ const LogSchema = CollectionSchema( id: 0, name: r'logLevel', type: IsarType.string, + enumMap: _LoglogLevelEnumValueMap, ), r'message': PropertySchema( id: 1, @@ -34,12 +35,9 @@ const LogSchema = CollectionSchema( ) }, estimateSize: _logEstimateSize, - serializeNative: _logSerializeNative, - deserializeNative: _logDeserializeNative, - deserializePropNative: _logDeserializePropNative, - serializeWeb: _logSerializeWeb, - deserializeWeb: _logDeserializeWeb, - deserializePropWeb: _logDeserializePropWeb, + serialize: _logSerialize, + deserialize: _logDeserialize, + deserializeProp: _logDeserializeProp, idName: r'id', indexes: { r'timestampInMillisUTC': IndexSchema( @@ -61,7 +59,7 @@ const LogSchema = CollectionSchema( getId: _logGetId, getLinks: _logGetLinks, attach: _logAttach, - version: 5, + version: '3.0.5', ); int _logEstimateSize( @@ -70,49 +68,48 @@ int _logEstimateSize( Map> allOffsets, ) { var bytesCount = offsets.last; - bytesCount += 3 + object.logLevel.value.length * 3; + bytesCount += 3 + object.logLevel.name.length * 3; bytesCount += 3 + object.message.length * 3; return bytesCount; } -int _logSerializeNative( +void _logSerialize( Log object, - IsarBinaryWriter writer, + IsarWriter writer, List offsets, Map> allOffsets, ) { - writer.writeString(offsets[0], object.logLevel.value); + writer.writeString(offsets[0], object.logLevel.name); writer.writeString(offsets[1], object.message); writer.writeLong(offsets[2], object.timestampInMillisUTC); - return writer.usedBytes; } -Log _logDeserializeNative( - int id, - IsarBinaryReader reader, +Log _logDeserialize( + Id id, + IsarReader reader, List offsets, Map> allOffsets, ) { final object = Log(); object.id = id; object.logLevel = - _LogLogLevelMap[reader.readStringOrNull(offsets[0])] ?? LogLevel.Info; + _LoglogLevelValueEnumMap[reader.readStringOrNull(offsets[0])] ?? + LogLevel.Info; object.message = reader.readString(offsets[1]); object.timestampInMillisUTC = reader.readLong(offsets[2]); return object; } -P _logDeserializePropNative

( - Id id, - IsarBinaryReader reader, +P _logDeserializeProp

( + IsarReader reader, int propertyId, int offset, Map> allOffsets, ) { switch (propertyId) { case 0: - return (_LogLogLevelMap[reader.readStringOrNull(offset)] ?? LogLevel.Info) - as P; + return (_LoglogLevelValueEnumMap[reader.readStringOrNull(offset)] ?? + LogLevel.Info) as P; case 1: return (reader.readString(offset)) as P; case 2: @@ -122,36 +119,21 @@ P _logDeserializePropNative

( } } -Object _logSerializeWeb(IsarCollection collection, Log object) { - /*final jsObj = IsarNative.newJsObject();*/ throw UnimplementedError(); -} - -Log _logDeserializeWeb(IsarCollection collection, Object jsObj) { - /*final object = Log();object.id = IsarNative.jsObjectGet(jsObj, r'id') ?? (double.negativeInfinity as int);object.logLevel = IsarNative.jsObjectGet(jsObj, r'logLevel') ?? LogLevel.Info;object.message = IsarNative.jsObjectGet(jsObj, r'message') ?? '';object.timestampInMillisUTC = IsarNative.jsObjectGet(jsObj, r'timestampInMillisUTC') ?? (double.negativeInfinity as int);*/ - //return object; - throw UnimplementedError(); -} - -P _logDeserializePropWeb

(Object jsObj, String propertyName) { - switch (propertyName) { - default: - throw IsarError('Illegal propertyName'); - } -} - -final _LogLogLevelMap = { - LogLevel.Info.value: LogLevel.Info, - LogLevel.Warning.value: LogLevel.Warning, - LogLevel.Error.value: LogLevel.Error, - LogLevel.Fatal.value: LogLevel.Fatal, +const _LoglogLevelEnumValueMap = { + r'Info': r'Info', + r'Warning': r'Warning', + r'Error': r'Error', + r'Fatal': r'Fatal', +}; +const _LoglogLevelValueEnumMap = { + r'Info': LogLevel.Info, + r'Warning': LogLevel.Warning, + r'Error': LogLevel.Error, + r'Fatal': LogLevel.Fatal, }; -int? _logGetId(Log object) { - if (object.id == Isar.autoIncrement) { - return null; - } else { - return object.id; - } +Id _logGetId(Log object) { + return object.id; } List> _logGetLinks(Log object) { @@ -179,7 +161,7 @@ extension LogQueryWhereSort on QueryBuilder { } extension LogQueryWhere on QueryBuilder { - QueryBuilder idEqualTo(int id) { + QueryBuilder idEqualTo(Id id) { return QueryBuilder.apply(this, (query) { return query.addWhereClause(IdWhereClause.between( lower: id, @@ -188,7 +170,7 @@ extension LogQueryWhere on QueryBuilder { }); } - QueryBuilder idNotEqualTo(int id) { + QueryBuilder idNotEqualTo(Id id) { return QueryBuilder.apply(this, (query) { if (query.whereSort == Sort.asc) { return query @@ -210,7 +192,7 @@ extension LogQueryWhere on QueryBuilder { }); } - QueryBuilder idGreaterThan(int id, + QueryBuilder idGreaterThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( @@ -219,7 +201,7 @@ extension LogQueryWhere on QueryBuilder { }); } - QueryBuilder idLessThan(int id, + QueryBuilder idLessThan(Id id, {bool include = false}) { return QueryBuilder.apply(this, (query) { return query.addWhereClause( @@ -229,8 +211,8 @@ extension LogQueryWhere on QueryBuilder { } QueryBuilder idBetween( - int lowerId, - int upperId, { + Id lowerId, + Id upperId, { bool includeLower = true, bool includeUpper = true, }) { @@ -336,7 +318,7 @@ extension LogQueryWhere on QueryBuilder { } extension LogQueryFilter on QueryBuilder { - QueryBuilder idEqualTo(int value) { + QueryBuilder idEqualTo(Id value) { return QueryBuilder.apply(this, (query) { return query.addFilterCondition(FilterCondition.equalTo( property: r'id', @@ -346,7 +328,7 @@ extension LogQueryFilter on QueryBuilder { } QueryBuilder idGreaterThan( - int value, { + Id value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { @@ -359,7 +341,7 @@ extension LogQueryFilter on QueryBuilder { } QueryBuilder idLessThan( - int value, { + Id value, { bool include = false, }) { return QueryBuilder.apply(this, (query) { @@ -372,8 +354,8 @@ extension LogQueryFilter on QueryBuilder { } QueryBuilder idBetween( - int lower, - int upper, { + Id lower, + Id upper, { bool includeLower = true, bool includeUpper = true, }) { @@ -498,6 +480,24 @@ extension LogQueryFilter on QueryBuilder { }); } + QueryBuilder logLevelIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'logLevel', + value: '', + )); + }); + } + + QueryBuilder logLevelIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'logLevel', + value: '', + )); + }); + } + QueryBuilder messageEqualTo( String value, { bool caseSensitive = true, @@ -608,6 +608,24 @@ extension LogQueryFilter on QueryBuilder { }); } + QueryBuilder messageIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'message', + value: '', + )); + }); + } + + QueryBuilder messageIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'message', + value: '', + )); + }); + } + QueryBuilder timestampInMillisUTCEqualTo( int value) { return QueryBuilder.apply(this, (query) { diff --git a/lib/models/isar/models/transaction_note.dart b/lib/models/isar/models/transaction_note.dart index 3dbd53e81..21faba2ee 100644 --- a/lib/models/isar/models/transaction_note.dart +++ b/lib/models/isar/models/transaction_note.dart @@ -1,6 +1,8 @@ import 'package:isar/isar.dart'; import 'package:stackwallet/models/isar/models/blockchain_data/transaction.dart'; +part 'transaction_note.g.dart'; + @Collection() class TransactionNote { Id id = Isar.autoIncrement; diff --git a/lib/models/isar/models/transaction_note.g.dart b/lib/models/isar/models/transaction_note.g.dart new file mode 100644 index 000000000..57ada578d --- /dev/null +++ b/lib/models/isar/models/transaction_note.g.dart @@ -0,0 +1,470 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'transaction_note.dart'; + +// ************************************************************************** +// IsarCollectionGenerator +// ************************************************************************** + +// coverage:ignore-file +// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters + +extension GetTransactionNoteCollection on Isar { + IsarCollection get transactionNotes => this.collection(); +} + +const TransactionNoteSchema = CollectionSchema( + name: r'TransactionNote', + id: 5128348263878806765, + properties: { + r'value': PropertySchema( + id: 0, + name: r'value', + type: IsarType.string, + ) + }, + estimateSize: _transactionNoteEstimateSize, + serialize: _transactionNoteSerialize, + deserialize: _transactionNoteDeserialize, + deserializeProp: _transactionNoteDeserializeProp, + idName: r'id', + indexes: {}, + links: { + r'transaction': LinkSchema( + id: -3227504867737807188, + name: r'transaction', + target: r'Transaction', + single: true, + linkName: r'note', + ) + }, + embeddedSchemas: {}, + getId: _transactionNoteGetId, + getLinks: _transactionNoteGetLinks, + attach: _transactionNoteAttach, + version: '3.0.5', +); + +int _transactionNoteEstimateSize( + TransactionNote object, + List offsets, + Map> allOffsets, +) { + var bytesCount = offsets.last; + bytesCount += 3 + object.value.length * 3; + return bytesCount; +} + +void _transactionNoteSerialize( + TransactionNote object, + IsarWriter writer, + List offsets, + Map> allOffsets, +) { + writer.writeString(offsets[0], object.value); +} + +TransactionNote _transactionNoteDeserialize( + Id id, + IsarReader reader, + List offsets, + Map> allOffsets, +) { + final object = TransactionNote(); + object.id = id; + object.value = reader.readString(offsets[0]); + return object; +} + +P _transactionNoteDeserializeProp

( + IsarReader reader, + int propertyId, + int offset, + Map> allOffsets, +) { + switch (propertyId) { + case 0: + return (reader.readString(offset)) as P; + default: + throw IsarError('Unknown property with id $propertyId'); + } +} + +Id _transactionNoteGetId(TransactionNote object) { + return object.id; +} + +List> _transactionNoteGetLinks(TransactionNote object) { + return [object.transaction]; +} + +void _transactionNoteAttach( + IsarCollection col, Id id, TransactionNote object) { + object.id = id; + object.transaction + .attach(col, col.isar.collection(), r'transaction', id); +} + +extension TransactionNoteQueryWhereSort + on QueryBuilder { + QueryBuilder anyId() { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(const IdWhereClause.any()); + }); + } +} + +extension TransactionNoteQueryWhere + on QueryBuilder { + QueryBuilder idEqualTo( + Id id) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: id, + upper: id, + )); + }); + } + + QueryBuilder + idNotEqualTo(Id id) { + return QueryBuilder.apply(this, (query) { + if (query.whereSort == Sort.asc) { + return query + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ) + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ); + } else { + return query + .addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: false), + ) + .addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: false), + ); + } + }); + } + + QueryBuilder + idGreaterThan(Id id, {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.greaterThan(lower: id, includeLower: include), + ); + }); + } + + QueryBuilder idLessThan( + Id id, + {bool include = false}) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause( + IdWhereClause.lessThan(upper: id, includeUpper: include), + ); + }); + } + + QueryBuilder idBetween( + Id lowerId, + Id upperId, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addWhereClause(IdWhereClause.between( + lower: lowerId, + includeLower: includeLower, + upper: upperId, + includeUpper: includeUpper, + )); + }); + } +} + +extension TransactionNoteQueryFilter + on QueryBuilder { + QueryBuilder + idEqualTo(Id value) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'id', + value: value, + )); + }); + } + + QueryBuilder + idGreaterThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder + idLessThan( + Id value, { + bool include = false, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'id', + value: value, + )); + }); + } + + QueryBuilder + idBetween( + Id lower, + Id upper, { + bool includeLower = true, + bool includeUpper = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.between( + property: r'id', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + )); + }); + } + + QueryBuilder + valueEqualTo( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueGreaterThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueLessThan( + String value, { + bool include = false, + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.lessThan( + include: include, + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueBetween( + 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'value', + lower: lower, + includeLower: includeLower, + upper: upper, + includeUpper: includeUpper, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueStartsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.startsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueEndsWith( + String value, { + bool caseSensitive = true, + }) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.endsWith( + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueContains(String value, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.contains( + property: r'value', + value: value, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueMatches(String pattern, {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.matches( + property: r'value', + wildcard: pattern, + caseSensitive: caseSensitive, + )); + }); + } + + QueryBuilder + valueIsEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.equalTo( + property: r'value', + value: '', + )); + }); + } + + QueryBuilder + valueIsNotEmpty() { + return QueryBuilder.apply(this, (query) { + return query.addFilterCondition(FilterCondition.greaterThan( + property: r'value', + value: '', + )); + }); + } +} + +extension TransactionNoteQueryObject + on QueryBuilder {} + +extension TransactionNoteQueryLinks + on QueryBuilder { + QueryBuilder + transaction(FilterQuery q) { + return QueryBuilder.apply(this, (query) { + return query.link(q, r'transaction'); + }); + } + + QueryBuilder + transactionIsNull() { + return QueryBuilder.apply(this, (query) { + return query.linkLength(r'transaction', 0, true, 0, true); + }); + } +} + +extension TransactionNoteQuerySortBy + on QueryBuilder { + QueryBuilder sortByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder + sortByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } +} + +extension TransactionNoteQuerySortThenBy + on QueryBuilder { + QueryBuilder thenById() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.asc); + }); + } + + QueryBuilder thenByIdDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'id', Sort.desc); + }); + } + + QueryBuilder thenByValue() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.asc); + }); + } + + QueryBuilder + thenByValueDesc() { + return QueryBuilder.apply(this, (query) { + return query.addSortBy(r'value', Sort.desc); + }); + } +} + +extension TransactionNoteQueryWhereDistinct + on QueryBuilder { + QueryBuilder distinctByValue( + {bool caseSensitive = true}) { + return QueryBuilder.apply(this, (query) { + return query.addDistinctBy(r'value', caseSensitive: caseSensitive); + }); + } +} + +extension TransactionNoteQueryProperty + on QueryBuilder { + QueryBuilder idProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'id'); + }); + } + + QueryBuilder valueProperty() { + return QueryBuilder.apply(this, (query) { + return query.addPropertyName(r'value'); + }); + } +} diff --git a/lib/utilities/enums/log_level_enum.dart b/lib/utilities/enums/log_level_enum.dart index d426adc3d..b9b5fd69f 100644 --- a/lib/utilities/enums/log_level_enum.dart +++ b/lib/utilities/enums/log_level_enum.dart @@ -1,13 +1,8 @@ -import 'package:isar/isar.dart'; - // Used in Isar db and stored there as int indexes so adding/removing values // in this definition should be done extremely carefully in production -enum LogLevel with IsarEnum { +enum LogLevel { Info, Warning, Error, Fatal; - - @override - String get value => name; } diff --git a/test/pages/send_view/send_view_test.mocks.dart b/test/pages/send_view/send_view_test.mocks.dart index b5a3e4e63..e83a5e292 100644 --- a/test/pages/send_view/send_view_test.mocks.dart +++ b/test/pages/send_view/send_view_test.mocks.dart @@ -281,6 +281,16 @@ class MockWallets extends _i1.Mock implements _i14.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i15.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i15.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/screen_tests/exchange/exchange_view_test.mocks.dart b/test/screen_tests/exchange/exchange_view_test.mocks.dart index 8c0d72f55..1133911a9 100644 --- a/test/screen_tests/exchange/exchange_view_test.mocks.dart +++ b/test/screen_tests/exchange/exchange_view_test.mocks.dart @@ -423,6 +423,11 @@ class MockTradesService extends _i1.Mock implements _i9.TradesService { returnValue: false, ) as bool); @override + _i10.Trade? get(String? tradeId) => (super.noSuchMethod(Invocation.method( + #get, + [tradeId], + )) as _i10.Trade?); + @override _i7.Future add({ required _i10.Trade? trade, required bool? shouldNotifyListeners, diff --git a/test/services/wallets_service_test.mocks.dart b/test/services/wallets_service_test.mocks.dart index 19d525196..bb3f74934 100644 --- a/test/services/wallets_service_test.mocks.dart +++ b/test/services/wallets_service_test.mocks.dart @@ -112,4 +112,29 @@ class MockSecureStorageWrapper extends _i1.Mock returnValue: _i3.Future.value(), returnValueForMissingStub: _i3.Future.value(), ) as _i3.Future); + @override + _i3.Future deleteAll({ + _i4.IOSOptions? iOptions, + _i4.AndroidOptions? aOptions, + _i4.LinuxOptions? lOptions, + _i4.WebOptions? webOptions, + _i4.MacOsOptions? mOptions, + _i4.WindowsOptions? wOptions, + }) => + (super.noSuchMethod( + Invocation.method( + #deleteAll, + [], + { + #iOptions: iOptions, + #aOptions: aOptions, + #lOptions: lOptions, + #webOptions: webOptions, + #mOptions: mOptions, + #wOptions: wOptions, + }, + ), + returnValue: _i3.Future.value(), + returnValueForMissingStub: _i3.Future.value(), + ) as _i3.Future); } diff --git a/test/widget_tests/managed_favorite_test.mocks.dart b/test/widget_tests/managed_favorite_test.mocks.dart index 117a810cf..2bdd631ba 100644 --- a/test/widget_tests/managed_favorite_test.mocks.dart +++ b/test/widget_tests/managed_favorite_test.mocks.dart @@ -277,6 +277,16 @@ class MockWallets extends _i1.Mock implements _i14.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i15.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i15.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/node_options_sheet_test.mocks.dart b/test/widget_tests/node_options_sheet_test.mocks.dart index 7e3e3a92d..23810fd96 100644 --- a/test/widget_tests/node_options_sheet_test.mocks.dart +++ b/test/widget_tests/node_options_sheet_test.mocks.dart @@ -177,6 +177,16 @@ class MockWallets extends _i1.Mock implements _i8.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i9.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i9.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/table_view/table_view_row_test.mocks.dart b/test/widget_tests/table_view/table_view_row_test.mocks.dart index 5a47436ff..48bcb2e2c 100644 --- a/test/widget_tests/table_view/table_view_row_test.mocks.dart +++ b/test/widget_tests/table_view/table_view_row_test.mocks.dart @@ -262,6 +262,16 @@ class MockWallets extends _i1.Mock implements _i13.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i14.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i14.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/transaction_card_test.mocks.dart b/test/widget_tests/transaction_card_test.mocks.dart index 2aa2e1dcb..3519f9080 100644 --- a/test/widget_tests/transaction_card_test.mocks.dart +++ b/test/widget_tests/transaction_card_test.mocks.dart @@ -280,6 +280,16 @@ class MockWallets extends _i1.Mock implements _i14.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i15.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i15.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/wallet_card_test.mocks.dart b/test/widget_tests/wallet_card_test.mocks.dart index e323911d4..722ad681b 100644 --- a/test/widget_tests/wallet_card_test.mocks.dart +++ b/test/widget_tests/wallet_card_test.mocks.dart @@ -251,6 +251,16 @@ class MockWallets extends _i1.Mock implements _i12.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i13.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i13.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart index fe5e0e8a2..e1dcf3c76 100644 --- a/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/sub_widgets/wallet_info_row_balance_future_test.mocks.dart @@ -276,6 +276,16 @@ class MockWallets extends _i1.Mock implements _i14.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i15.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i15.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod( diff --git a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart index 7f370eb9a..95d600267 100644 --- a/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart +++ b/test/widget_tests/wallet_info_row/wallet_info_row_test.mocks.dart @@ -276,6 +276,16 @@ class MockWallets extends _i1.Mock implements _i14.Wallets { List<_i5.ChangeNotifierProvider<_i6.Manager>>>{}, ) as Map<_i15.Coin, List<_i5.ChangeNotifierProvider<_i6.Manager>>>); @override + List<_i5.ChangeNotifierProvider<_i6.Manager>> getManagerProvidersForCoin( + _i15.Coin? coin) => + (super.noSuchMethod( + Invocation.method( + #getManagerProvidersForCoin, + [coin], + ), + returnValue: <_i5.ChangeNotifierProvider<_i6.Manager>>[], + ) as List<_i5.ChangeNotifierProvider<_i6.Manager>>); + @override _i5.ChangeNotifierProvider<_i6.Manager> getManagerProvider( String? walletId) => (super.noSuchMethod(