(
- 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]);
+ object.isBlocked = reader.readBool(offsets[4]);
+ object.isCoinbase = reader.readBool(offsets[5]);
+ object.name = reader.readString(offsets[6]);
+ object.txid = reader.readString(offsets[7]);
+ object.value = reader.readLong(offsets[8]);
+ object.vout = reader.readLong(offsets[9]);
return object;
}
@@ -145,25 +179,24 @@ P _uTXODeserializeProp(
) {
switch (propertyId) {
case 0:
- return (reader.readBool(offset)) as P;
- case 1:
return (reader.readStringOrNull(offset)) as P;
+ case 1:
+ return (reader.readLongOrNull(offset)) as P;
case 2:
- return (reader.readBool(offset)) as P;
+ return (reader.readLongOrNull(offset)) as P;
case 3:
- return (reader.readObjectOrNull(
- offset,
- StatusSchema.deserialize,
- allOffsets,
- ) ??
- Status()) as P;
+ return (reader.readStringOrNull(offset)) as P;
case 4:
- return (reader.readString(offset)) as P;
+ return (reader.readBool(offset)) as P;
case 5:
- return (reader.readString(offset)) as P;
+ return (reader.readBool(offset)) as P;
case 6:
- return (reader.readLong(offset)) as P;
+ return (reader.readString(offset)) as P;
case 7:
+ return (reader.readString(offset)) as P;
+ case 8:
+ return (reader.readLong(offset)) as P;
+ case 9:
return (reader.readLong(offset)) as P;
default:
throw IsarError('Unknown property with id $propertyId');
@@ -182,12 +215,74 @@ void _uTXOAttach(IsarCollection col, Id id, UTXO object) {
object.id = id;
}
+extension UTXOByIndex on IsarCollection {
+ Future getByTxid(String txid) {
+ return getByIndex(r'txid', [txid]);
+ }
+
+ UTXO? getByTxidSync(String txid) {
+ return getByIndexSync(r'txid', [txid]);
+ }
+
+ Future deleteByTxid(String txid) {
+ return deleteByIndex(r'txid', [txid]);
+ }
+
+ bool deleteByTxidSync(String txid) {
+ return deleteByIndexSync(r'txid', [txid]);
+ }
+
+ Future> getAllByTxid(List txidValues) {
+ final values = txidValues.map((e) => [e]).toList();
+ return getAllByIndex(r'txid', values);
+ }
+
+ List getAllByTxidSync(List txidValues) {
+ final values = txidValues.map((e) => [e]).toList();
+ return getAllByIndexSync(r'txid', values);
+ }
+
+ Future deleteAllByTxid(List txidValues) {
+ final values = txidValues.map((e) => [e]).toList();
+ return deleteAllByIndex(r'txid', values);
+ }
+
+ int deleteAllByTxidSync(List txidValues) {
+ final values = txidValues.map((e) => [e]).toList();
+ return deleteAllByIndexSync(r'txid', values);
+ }
+
+ Future putByTxid(UTXO object) {
+ return putByIndex(r'txid', object);
+ }
+
+ Id putByTxidSync(UTXO object, {bool saveLinks = true}) {
+ return putByIndexSync(r'txid', object, saveLinks: saveLinks);
+ }
+
+ Future> putAllByTxid(List objects) {
+ return putAllByIndex(r'txid', objects);
+ }
+
+ List putAllByTxidSync(List objects, {bool saveLinks = true}) {
+ return putAllByIndexSync(r'txid', objects, saveLinks: saveLinks);
+ }
+}
+
extension UTXOQueryWhereSort on QueryBuilder {
QueryBuilder anyId() {
return QueryBuilder.apply(this, (query) {
return query.addWhereClause(const IdWhereClause.any());
});
}
+
+ QueryBuilder anyIsBlocked() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(
+ const IndexWhereClause.any(indexName: r'isBlocked'),
+ );
+ });
+ }
}
extension UTXOQueryWhere on QueryBuilder {
@@ -255,14 +350,375 @@ extension UTXOQueryWhere on QueryBuilder {
));
});
}
+
+ QueryBuilder txidEqualTo(String txid) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'txid',
+ value: [txid],
+ ));
+ });
+ }
+
+ QueryBuilder txidNotEqualTo(String txid) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid',
+ lower: [],
+ upper: [txid],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid',
+ lower: [txid],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid',
+ lower: [txid],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid',
+ lower: [],
+ upper: [txid],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder isBlockedEqualTo(bool isBlocked) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'isBlocked',
+ value: [isBlocked],
+ ));
+ });
+ }
+
+ QueryBuilder isBlockedNotEqualTo(
+ bool isBlocked) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isBlocked',
+ lower: [],
+ upper: [isBlocked],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isBlocked',
+ lower: [isBlocked],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isBlocked',
+ lower: [isBlocked],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isBlocked',
+ lower: [],
+ upper: [isBlocked],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
}
extension UTXOQueryFilter on QueryBuilder {
- QueryBuilder blockedEqualTo(bool value) {
+ QueryBuilder blockHashIsNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNull(
+ property: r'blockHash',
+ ));
+ });
+ }
+
+ QueryBuilder blockHashIsNotNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNotNull(
+ property: r'blockHash',
+ ));
+ });
+ }
+
+ QueryBuilder blockHashEqualTo(
+ String? value, {
+ bool caseSensitive = true,
+ }) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
- property: r'blocked',
+ 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 blockHeightIsNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNull(
+ property: r'blockHeight',
+ ));
+ });
+ }
+
+ QueryBuilder blockHeightIsNotNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNotNull(
+ property: r'blockHeight',
+ ));
+ });
+ }
+
+ 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 blockTimeIsNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNull(
+ property: r'blockTime',
+ ));
+ });
+ }
+
+ QueryBuilder blockTimeIsNotNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNotNull(
+ property: r'blockTime',
+ ));
+ });
+ }
+
+ 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,
));
});
}
@@ -465,6 +921,15 @@ extension UTXOQueryFilter on QueryBuilder {
});
}
+ QueryBuilder isBlockedEqualTo(bool value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'isBlocked',
+ value: value,
+ ));
+ });
+ }
+
QueryBuilder isCoinbaseEqualTo(
bool value) {
return QueryBuilder.apply(this, (query) {
@@ -475,20 +940,20 @@ extension UTXOQueryFilter on QueryBuilder {
});
}
- QueryBuilder txNameEqualTo(
+ QueryBuilder nameEqualTo(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameGreaterThan(
+ QueryBuilder nameGreaterThan(
String value, {
bool include = false,
bool caseSensitive = true,
@@ -496,14 +961,14 @@ extension UTXOQueryFilter on QueryBuilder {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
include: include,
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameLessThan(
+ QueryBuilder nameLessThan(
String value, {
bool include = false,
bool caseSensitive = true,
@@ -511,14 +976,14 @@ extension UTXOQueryFilter on QueryBuilder {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.lessThan(
include: include,
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameBetween(
+ QueryBuilder nameBetween(
String lower,
String upper, {
bool includeLower = true,
@@ -527,7 +992,7 @@ extension UTXOQueryFilter on QueryBuilder {
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.between(
- property: r'txName',
+ property: r'name',
lower: lower,
includeLower: includeLower,
upper: upper,
@@ -537,67 +1002,67 @@ extension UTXOQueryFilter on QueryBuilder {
});
}
- QueryBuilder txNameStartsWith(
+ QueryBuilder nameStartsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.startsWith(
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameEndsWith(
+ QueryBuilder nameEndsWith(
String value, {
bool caseSensitive = true,
}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.endsWith(
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameContains(String value,
+ QueryBuilder nameContains(String value,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.contains(
- property: r'txName',
+ property: r'name',
value: value,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameMatches(String pattern,
+ QueryBuilder nameMatches(String pattern,
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.matches(
- property: r'txName',
+ property: r'name',
wildcard: pattern,
caseSensitive: caseSensitive,
));
});
}
- QueryBuilder txNameIsEmpty() {
+ QueryBuilder nameIsEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.equalTo(
- property: r'txName',
+ property: r'name',
value: '',
));
});
}
- QueryBuilder txNameIsNotEmpty() {
+ QueryBuilder nameIsNotEmpty() {
return QueryBuilder.apply(this, (query) {
return query.addFilterCondition(FilterCondition.greaterThan(
- property: r'txName',
+ property: r'name',
value: '',
));
});
@@ -836,27 +1301,44 @@ extension UTXOQueryFilter on QueryBuilder {
}
}
-extension UTXOQueryObject on QueryBuilder {
- QueryBuilder status(
- FilterQuery q) {
- return QueryBuilder.apply(this, (query) {
- return query.object(q, r'status');
- });
- }
-}
+extension UTXOQueryObject on QueryBuilder {}
extension UTXOQueryLinks on QueryBuilder {}
extension UTXOQuerySortBy on QueryBuilder {
- QueryBuilder sortByBlocked() {
+ QueryBuilder sortByBlockHash() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'blocked', Sort.asc);
+ return query.addSortBy(r'blockHash', Sort.asc);
});
}
- QueryBuilder sortByBlockedDesc() {
+ QueryBuilder sortByBlockHashDesc() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'blocked', Sort.desc);
+ return query.addSortBy(r'blockHash', Sort.desc);
+ });
+ }
+
+ QueryBuilder sortByBlockHeight() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockHeight', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByBlockHeightDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockHeight', Sort.desc);
+ });
+ }
+
+ QueryBuilder sortByBlockTime() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockTime', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByBlockTimeDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockTime', Sort.desc);
});
}
@@ -872,6 +1354,18 @@ extension UTXOQuerySortBy on QueryBuilder {
});
}
+ QueryBuilder sortByIsBlocked() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isBlocked', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByIsBlockedDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isBlocked', Sort.desc);
+ });
+ }
+
QueryBuilder sortByIsCoinbase() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'isCoinbase', Sort.asc);
@@ -884,15 +1378,15 @@ extension UTXOQuerySortBy on QueryBuilder {
});
}
- QueryBuilder sortByTxName() {
+ QueryBuilder sortByName() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'txName', Sort.asc);
+ return query.addSortBy(r'name', Sort.asc);
});
}
- QueryBuilder sortByTxNameDesc() {
+ QueryBuilder sortByNameDesc() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'txName', Sort.desc);
+ return query.addSortBy(r'name', Sort.desc);
});
}
@@ -934,15 +1428,39 @@ extension UTXOQuerySortBy on QueryBuilder {
}
extension UTXOQuerySortThenBy on QueryBuilder {
- QueryBuilder thenByBlocked() {
+ QueryBuilder thenByBlockHash() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'blocked', Sort.asc);
+ return query.addSortBy(r'blockHash', Sort.asc);
});
}
- QueryBuilder thenByBlockedDesc() {
+ QueryBuilder thenByBlockHashDesc() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'blocked', Sort.desc);
+ return query.addSortBy(r'blockHash', Sort.desc);
+ });
+ }
+
+ QueryBuilder thenByBlockHeight() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockHeight', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByBlockHeightDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockHeight', Sort.desc);
+ });
+ }
+
+ QueryBuilder thenByBlockTime() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockTime', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByBlockTimeDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'blockTime', Sort.desc);
});
}
@@ -970,6 +1488,18 @@ extension UTXOQuerySortThenBy on QueryBuilder {
});
}
+ QueryBuilder thenByIsBlocked() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isBlocked', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByIsBlockedDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isBlocked', Sort.desc);
+ });
+ }
+
QueryBuilder thenByIsCoinbase() {
return QueryBuilder.apply(this, (query) {
return query.addSortBy(r'isCoinbase', Sort.asc);
@@ -982,15 +1512,15 @@ extension UTXOQuerySortThenBy on QueryBuilder {
});
}
- QueryBuilder thenByTxName() {
+ QueryBuilder thenByName() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'txName', Sort.asc);
+ return query.addSortBy(r'name', Sort.asc);
});
}
- QueryBuilder thenByTxNameDesc() {
+ QueryBuilder thenByNameDesc() {
return QueryBuilder.apply(this, (query) {
- return query.addSortBy(r'txName', Sort.desc);
+ return query.addSortBy(r'name', Sort.desc);
});
}
@@ -1032,9 +1562,22 @@ extension UTXOQuerySortThenBy on QueryBuilder {
}
extension UTXOQueryWhereDistinct on QueryBuilder {
- QueryBuilder distinctByBlocked() {
+ QueryBuilder distinctByBlockHash(
+ {bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
- return query.addDistinctBy(r'blocked');
+ return query.addDistinctBy(r'blockHash', caseSensitive: caseSensitive);
+ });
+ }
+
+ QueryBuilder distinctByBlockHeight() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'blockHeight');
+ });
+ }
+
+ QueryBuilder distinctByBlockTime() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'blockTime');
});
}
@@ -1046,16 +1589,22 @@ extension UTXOQueryWhereDistinct on QueryBuilder {
});
}
+ QueryBuilder distinctByIsBlocked() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'isBlocked');
+ });
+ }
+
QueryBuilder distinctByIsCoinbase() {
return QueryBuilder.apply(this, (query) {
return query.addDistinctBy(r'isCoinbase');
});
}
- QueryBuilder distinctByTxName(
+ QueryBuilder distinctByName(
{bool caseSensitive = true}) {
return QueryBuilder.apply(this, (query) {
- return query.addDistinctBy(r'txName', caseSensitive: caseSensitive);
+ return query.addDistinctBy(r'name', caseSensitive: caseSensitive);
});
}
@@ -1086,9 +1635,21 @@ extension UTXOQueryProperty on QueryBuilder {
});
}
- QueryBuilder blockedProperty() {
+ QueryBuilder blockHashProperty() {
return QueryBuilder.apply(this, (query) {
- return query.addPropertyName(r'blocked');
+ return query.addPropertyName(r'blockHash');
+ });
+ }
+
+ QueryBuilder blockHeightProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'blockHeight');
+ });
+ }
+
+ QueryBuilder blockTimeProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'blockTime');
});
}
@@ -1098,21 +1659,21 @@ extension UTXOQueryProperty on QueryBuilder {
});
}
+ QueryBuilder isBlockedProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'isBlocked');
+ });
+ }
+
QueryBuilder isCoinbaseProperty() {
return QueryBuilder.apply(this, (query) {
return query.addPropertyName(r'isCoinbase');
});
}
- QueryBuilder statusProperty() {
+ QueryBuilder nameProperty() {
return QueryBuilder.apply(this, (query) {
- return query.addPropertyName(r'status');
- });
- }
-
- QueryBuilder txNameProperty() {
- return QueryBuilder.apply(this, (query) {
- return query.addPropertyName(r'txName');
+ return query.addPropertyName(r'name');
});
}
@@ -1134,328 +1695,3 @@ extension UTXOQueryProperty on QueryBuilder {
});
}
}
-
-// **************************************************************************
-// 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,
- )
- },
- 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);
-}
-
-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]);
- 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;
- 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,
- ));
- });
- }
-}
-
-extension StatusQueryObject on QueryBuilder {}