> allOffsets,
+) {
+ final object = LelantusCoin(
+ anonymitySetId: reader.readLong(offsets[0]),
+ isJMint: reader.readBool(offsets[1]),
+ isUsed: reader.readBool(offsets[2]),
+ mintIndex: reader.readLong(offsets[3]),
+ otherData: reader.readStringOrNull(offsets[4]),
+ txid: reader.readString(offsets[5]),
+ value: reader.readString(offsets[6]),
+ walletId: reader.readString(offsets[7]),
+ );
+ object.id = id;
+ return object;
+}
+
+P _lelantusCoinDeserializeProp(
+ IsarReader reader,
+ int propertyId,
+ int offset,
+ Map> allOffsets,
+) {
+ switch (propertyId) {
+ case 0:
+ return (reader.readLong(offset)) as P;
+ case 1:
+ return (reader.readBool(offset)) as P;
+ case 2:
+ return (reader.readBool(offset)) as P;
+ case 3:
+ return (reader.readLong(offset)) as P;
+ case 4:
+ return (reader.readStringOrNull(offset)) as P;
+ case 5:
+ return (reader.readString(offset)) as P;
+ case 6:
+ return (reader.readString(offset)) as P;
+ case 7:
+ return (reader.readString(offset)) as P;
+ default:
+ throw IsarError('Unknown property with id $propertyId');
+ }
+}
+
+Id _lelantusCoinGetId(LelantusCoin object) {
+ return object.id;
+}
+
+List> _lelantusCoinGetLinks(LelantusCoin object) {
+ return [];
+}
+
+void _lelantusCoinAttach(
+ IsarCollection col, Id id, LelantusCoin object) {
+ object.id = id;
+}
+
+extension LelantusCoinByIndex on IsarCollection {
+ Future getByMintIndexWalletId(int mintIndex, String walletId) {
+ return getByIndex(r'mintIndex_walletId', [mintIndex, walletId]);
+ }
+
+ LelantusCoin? getByMintIndexWalletIdSync(int mintIndex, String walletId) {
+ return getByIndexSync(r'mintIndex_walletId', [mintIndex, walletId]);
+ }
+
+ Future deleteByMintIndexWalletId(int mintIndex, String walletId) {
+ return deleteByIndex(r'mintIndex_walletId', [mintIndex, walletId]);
+ }
+
+ bool deleteByMintIndexWalletIdSync(int mintIndex, String walletId) {
+ return deleteByIndexSync(r'mintIndex_walletId', [mintIndex, walletId]);
+ }
+
+ Future> getAllByMintIndexWalletId(
+ List mintIndexValues, List walletIdValues) {
+ final len = mintIndexValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([mintIndexValues[i], walletIdValues[i]]);
+ }
+
+ return getAllByIndex(r'mintIndex_walletId', values);
+ }
+
+ List getAllByMintIndexWalletIdSync(
+ List mintIndexValues, List walletIdValues) {
+ final len = mintIndexValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([mintIndexValues[i], walletIdValues[i]]);
+ }
+
+ return getAllByIndexSync(r'mintIndex_walletId', values);
+ }
+
+ Future deleteAllByMintIndexWalletId(
+ List mintIndexValues, List walletIdValues) {
+ final len = mintIndexValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([mintIndexValues[i], walletIdValues[i]]);
+ }
+
+ return deleteAllByIndex(r'mintIndex_walletId', values);
+ }
+
+ int deleteAllByMintIndexWalletIdSync(
+ List mintIndexValues, List walletIdValues) {
+ final len = mintIndexValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([mintIndexValues[i], walletIdValues[i]]);
+ }
+
+ return deleteAllByIndexSync(r'mintIndex_walletId', values);
+ }
+
+ Future putByMintIndexWalletId(LelantusCoin object) {
+ return putByIndex(r'mintIndex_walletId', object);
+ }
+
+ Id putByMintIndexWalletIdSync(LelantusCoin object, {bool saveLinks = true}) {
+ return putByIndexSync(r'mintIndex_walletId', object, saveLinks: saveLinks);
+ }
+
+ Future> putAllByMintIndexWalletId(List objects) {
+ return putAllByIndex(r'mintIndex_walletId', objects);
+ }
+
+ List putAllByMintIndexWalletIdSync(List objects,
+ {bool saveLinks = true}) {
+ return putAllByIndexSync(r'mintIndex_walletId', objects,
+ saveLinks: saveLinks);
+ }
+}
+
+extension LelantusCoinQueryWhereSort
+ on QueryBuilder {
+ QueryBuilder anyId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(const IdWhereClause.any());
+ });
+ }
+}
+
+extension LelantusCoinQueryWhere
+ 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,
+ ));
+ });
+ }
+
+ QueryBuilder walletIdEqualTo(
+ String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'walletId',
+ value: [walletId],
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdNotEqualTo(String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'walletId',
+ lower: [],
+ upper: [walletId],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'walletId',
+ lower: [walletId],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'walletId',
+ lower: [walletId],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'walletId',
+ lower: [],
+ upper: [walletId],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ mintIndexEqualToAnyWalletId(int mintIndex) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'mintIndex_walletId',
+ value: [mintIndex],
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexNotEqualToAnyWalletId(int mintIndex) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [],
+ upper: [mintIndex],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [],
+ upper: [mintIndex],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ mintIndexGreaterThanAnyWalletId(
+ int mintIndex, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex],
+ includeLower: include,
+ upper: [],
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexLessThanAnyWalletId(
+ int mintIndex, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [],
+ upper: [mintIndex],
+ includeUpper: include,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexBetweenAnyWalletId(
+ int lowerMintIndex,
+ int upperMintIndex, {
+ bool includeLower = true,
+ bool includeUpper = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [lowerMintIndex],
+ includeLower: includeLower,
+ upper: [upperMintIndex],
+ includeUpper: includeUpper,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexWalletIdEqualTo(int mintIndex, String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'mintIndex_walletId',
+ value: [mintIndex, walletId],
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexEqualToWalletIdNotEqualTo(int mintIndex, String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex],
+ upper: [mintIndex, walletId],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex, walletId],
+ includeLower: false,
+ upper: [mintIndex],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex, walletId],
+ includeLower: false,
+ upper: [mintIndex],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'mintIndex_walletId',
+ lower: [mintIndex],
+ upper: [mintIndex, walletId],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+}
+
+extension LelantusCoinQueryFilter
+ on QueryBuilder {
+ QueryBuilder
+ anonymitySetIdEqualTo(int value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'anonymitySetId',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ anonymitySetIdGreaterThan(
+ int value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'anonymitySetId',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ anonymitySetIdLessThan(
+ int value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'anonymitySetId',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ anonymitySetIdBetween(
+ int lower,
+ int upper, {
+ bool includeLower = true,
+ bool includeUpper = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.between(
+ property: r'anonymitySetId',
+ 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
+ isJMintEqualTo(bool value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'isJMint',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder isUsedEqualTo(
+ bool value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'isUsed',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexEqualTo(int value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'mintIndex',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexGreaterThan(
+ int value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'mintIndex',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexLessThan(
+ int value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'mintIndex',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ mintIndexBetween(
+ int lower,
+ int upper, {
+ bool includeLower = true,
+ bool includeUpper = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.between(
+ property: r'mintIndex',
+ 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 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(
+ 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: '',
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdEqualTo(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdGreaterThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdLessThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdBetween(
+ 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'walletId',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdStartsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.startsWith(
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdEndsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.endsWith(
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdContains(String value, {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.contains(
+ property: r'walletId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdMatches(String pattern, {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.matches(
+ property: r'walletId',
+ wildcard: pattern,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdIsEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'walletId',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder
+ walletIdIsNotEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ property: r'walletId',
+ value: '',
+ ));
+ });
+ }
+}
+
+extension LelantusCoinQueryObject
+ on QueryBuilder {}
+
+extension LelantusCoinQueryLinks
+ on QueryBuilder {}
+
+extension LelantusCoinQuerySortBy
+ on QueryBuilder {
+ QueryBuilder
+ sortByAnonymitySetId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'anonymitySetId', Sort.asc);
+ });
+ }
+
+ QueryBuilder
+ sortByAnonymitySetIdDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'anonymitySetId', Sort.desc);
+ });
+ }
+
+ QueryBuilder sortByIsJMint() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isJMint', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByIsJMintDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isJMint', Sort.desc);
+ });
+ }
+
+ QueryBuilder sortByIsUsed() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isUsed', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByIsUsedDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isUsed', Sort.desc);
+ });
+ }
+
+ QueryBuilder sortByMintIndex() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'mintIndex', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByMintIndexDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'mintIndex', 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 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 sortByWalletId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'walletId', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByWalletIdDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'walletId', Sort.desc);
+ });
+ }
+}
+
+extension LelantusCoinQuerySortThenBy
+ on QueryBuilder {
+ QueryBuilder
+ thenByAnonymitySetId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'anonymitySetId', Sort.asc);
+ });
+ }
+
+ QueryBuilder
+ thenByAnonymitySetIdDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'anonymitySetId', 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 thenByIsJMint() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isJMint', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByIsJMintDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isJMint', Sort.desc);
+ });
+ }
+
+ QueryBuilder thenByIsUsed() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isUsed', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByIsUsedDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'isUsed', Sort.desc);
+ });
+ }
+
+ QueryBuilder thenByMintIndex() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'mintIndex', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByMintIndexDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'mintIndex', 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 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 thenByWalletId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'walletId', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByWalletIdDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'walletId', Sort.desc);
+ });
+ }
+}
+
+extension LelantusCoinQueryWhereDistinct
+ on QueryBuilder {
+ QueryBuilder
+ distinctByAnonymitySetId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'anonymitySetId');
+ });
+ }
+
+ QueryBuilder distinctByIsJMint() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'isJMint');
+ });
+ }
+
+ QueryBuilder distinctByIsUsed() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'isUsed');
+ });
+ }
+
+ QueryBuilder distinctByMintIndex() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'mintIndex');
+ });
+ }
+
+ QueryBuilder distinctByOtherData(
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'otherData', caseSensitive: caseSensitive);
+ });
+ }
+
+ QueryBuilder distinctByTxid(
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'txid', caseSensitive: caseSensitive);
+ });
+ }
+
+ QueryBuilder distinctByValue(
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'value', caseSensitive: caseSensitive);
+ });
+ }
+
+ QueryBuilder distinctByWalletId(
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'walletId', caseSensitive: caseSensitive);
+ });
+ }
+}
+
+extension LelantusCoinQueryProperty
+ on QueryBuilder {
+ QueryBuilder idProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'id');
+ });
+ }
+
+ QueryBuilder anonymitySetIdProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'anonymitySetId');
+ });
+ }
+
+ QueryBuilder isJMintProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'isJMint');
+ });
+ }
+
+ QueryBuilder isUsedProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'isUsed');
+ });
+ }
+
+ QueryBuilder mintIndexProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'mintIndex');
+ });
+ }
+
+ QueryBuilder otherDataProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'otherData');
+ });
+ }
+
+ 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 walletIdProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'walletId');
+ });
+ }
+}
diff --git a/lib/models/isar/models/isar_models.dart b/lib/models/isar/models/isar_models.dart
index ce7652a46..9de91fc84 100644
--- a/lib/models/isar/models/isar_models.dart
+++ b/lib/models/isar/models/isar_models.dart
@@ -15,5 +15,6 @@ export 'blockchain_data/output.dart';
export 'blockchain_data/transaction.dart';
export 'blockchain_data/utxo.dart';
export 'ethereum/eth_contract.dart';
+export 'firo_specific/lelantus_coin.dart';
export 'log.dart';
export 'transaction_note.dart';
diff --git a/lib/models/isar/ordinal.dart b/lib/models/isar/ordinal.dart
new file mode 100644
index 000000000..06ba52ef5
--- /dev/null
+++ b/lib/models/isar/ordinal.dart
@@ -0,0 +1,89 @@
+import 'package:isar/isar.dart';
+import 'package:stackwallet/db/isar/main_db.dart';
+import 'package:stackwallet/dto/ordinals/inscription_data.dart';
+import 'package:stackwallet/models/isar/models/isar_models.dart';
+
+part 'ordinal.g.dart';
+
+@collection
+class Ordinal {
+ Id id = Isar.autoIncrement;
+
+ final String walletId;
+
+ @Index(unique: true, replace: true, composite: [
+ CompositeIndex("utxoTXID"),
+ CompositeIndex("utxoVOUT"),
+ ])
+ final String inscriptionId;
+
+ final int inscriptionNumber;
+
+ final String content;
+
+ // following two are used to look up the UTXO object in isar combined w/ walletId
+ final String utxoTXID;
+ final int utxoVOUT;
+
+ Ordinal({
+ required this.walletId,
+ required this.inscriptionId,
+ required this.inscriptionNumber,
+ required this.content,
+ required this.utxoTXID,
+ required this.utxoVOUT,
+ });
+
+ factory Ordinal.fromInscriptionData(InscriptionData data, String walletId) {
+ return Ordinal(
+ walletId: walletId,
+ inscriptionId: data.inscriptionId,
+ inscriptionNumber: data.inscriptionNumber,
+ content: data.content,
+ utxoTXID: data.output.split(':')[
+ 0], // "output": "062f32e21aa04246b8873b5d9a929576addd0339881e1ea478b406795d6b6c47:0"
+ utxoVOUT: int.parse(data.output.split(':')[1]),
+ );
+ }
+
+ Ordinal copyWith({
+ String? walletId,
+ String? inscriptionId,
+ int? inscriptionNumber,
+ String? content,
+ String? utxoTXID,
+ int? utxoVOUT,
+ }) {
+ return Ordinal(
+ walletId: walletId ?? this.walletId,
+ inscriptionId: inscriptionId ?? this.inscriptionId,
+ inscriptionNumber: inscriptionNumber ?? this.inscriptionNumber,
+ content: content ?? this.content,
+ utxoTXID: utxoTXID ?? this.utxoTXID,
+ utxoVOUT: utxoVOUT ?? this.utxoVOUT,
+ );
+ }
+
+ UTXO? getUTXO(MainDB db) {
+ return db.isar.utxos
+ .where()
+ .walletIdEqualTo(walletId)
+ .filter()
+ .txidEqualTo(utxoTXID)
+ .and()
+ .voutEqualTo(utxoVOUT)
+ .findFirstSync();
+ }
+
+ @override
+ String toString() {
+ return 'Ordinal {'
+ ' walletId: $walletId,'
+ ' inscriptionId: $inscriptionId,'
+ ' inscriptionNumber: $inscriptionNumber,'
+ ' content: $content,'
+ ' utxoTXID: $utxoTXID,'
+ ' utxoVOUT: $utxoVOUT'
+ ' }';
+ }
+}
diff --git a/lib/models/isar/ordinal.g.dart b/lib/models/isar/ordinal.g.dart
new file mode 100644
index 000000000..89c967cb0
--- /dev/null
+++ b/lib/models/isar/ordinal.g.dart
@@ -0,0 +1,1489 @@
+// GENERATED CODE - DO NOT MODIFY BY HAND
+
+part of 'ordinal.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 GetOrdinalCollection on Isar {
+ IsarCollection get ordinals => this.collection();
+}
+
+const OrdinalSchema = CollectionSchema(
+ name: r'Ordinal',
+ id: -7772149326141951436,
+ properties: {
+ r'content': PropertySchema(
+ id: 0,
+ name: r'content',
+ type: IsarType.string,
+ ),
+ r'inscriptionId': PropertySchema(
+ id: 1,
+ name: r'inscriptionId',
+ type: IsarType.string,
+ ),
+ r'inscriptionNumber': PropertySchema(
+ id: 2,
+ name: r'inscriptionNumber',
+ type: IsarType.long,
+ ),
+ r'utxoTXID': PropertySchema(
+ id: 3,
+ name: r'utxoTXID',
+ type: IsarType.string,
+ ),
+ r'utxoVOUT': PropertySchema(
+ id: 4,
+ name: r'utxoVOUT',
+ type: IsarType.long,
+ ),
+ r'walletId': PropertySchema(
+ id: 5,
+ name: r'walletId',
+ type: IsarType.string,
+ )
+ },
+ estimateSize: _ordinalEstimateSize,
+ serialize: _ordinalSerialize,
+ deserialize: _ordinalDeserialize,
+ deserializeProp: _ordinalDeserializeProp,
+ idName: r'id',
+ indexes: {
+ r'inscriptionId_utxoTXID_utxoVOUT': IndexSchema(
+ id: 2138008085066605381,
+ name: r'inscriptionId_utxoTXID_utxoVOUT',
+ unique: true,
+ replace: true,
+ properties: [
+ IndexPropertySchema(
+ name: r'inscriptionId',
+ type: IndexType.hash,
+ caseSensitive: true,
+ ),
+ IndexPropertySchema(
+ name: r'utxoTXID',
+ type: IndexType.hash,
+ caseSensitive: true,
+ ),
+ IndexPropertySchema(
+ name: r'utxoVOUT',
+ type: IndexType.value,
+ caseSensitive: false,
+ )
+ ],
+ )
+ },
+ links: {},
+ embeddedSchemas: {},
+ getId: _ordinalGetId,
+ getLinks: _ordinalGetLinks,
+ attach: _ordinalAttach,
+ version: '3.0.5',
+);
+
+int _ordinalEstimateSize(
+ Ordinal object,
+ List offsets,
+ Map> allOffsets,
+) {
+ var bytesCount = offsets.last;
+ bytesCount += 3 + object.content.length * 3;
+ bytesCount += 3 + object.inscriptionId.length * 3;
+ bytesCount += 3 + object.utxoTXID.length * 3;
+ bytesCount += 3 + object.walletId.length * 3;
+ return bytesCount;
+}
+
+void _ordinalSerialize(
+ Ordinal object,
+ IsarWriter writer,
+ List offsets,
+ Map> allOffsets,
+) {
+ writer.writeString(offsets[0], object.content);
+ writer.writeString(offsets[1], object.inscriptionId);
+ writer.writeLong(offsets[2], object.inscriptionNumber);
+ writer.writeString(offsets[3], object.utxoTXID);
+ writer.writeLong(offsets[4], object.utxoVOUT);
+ writer.writeString(offsets[5], object.walletId);
+}
+
+Ordinal _ordinalDeserialize(
+ Id id,
+ IsarReader reader,
+ List offsets,
+ Map> allOffsets,
+) {
+ final object = Ordinal(
+ content: reader.readString(offsets[0]),
+ inscriptionId: reader.readString(offsets[1]),
+ inscriptionNumber: reader.readLong(offsets[2]),
+ utxoTXID: reader.readString(offsets[3]),
+ utxoVOUT: reader.readLong(offsets[4]),
+ walletId: reader.readString(offsets[5]),
+ );
+ object.id = id;
+ return object;
+}
+
+P _ordinalDeserializeProp(
+ IsarReader reader,
+ int propertyId,
+ int offset,
+ Map> allOffsets,
+) {
+ switch (propertyId) {
+ case 0:
+ return (reader.readString(offset)) as P;
+ case 1:
+ return (reader.readString(offset)) as P;
+ case 2:
+ return (reader.readLong(offset)) as P;
+ case 3:
+ return (reader.readString(offset)) as P;
+ case 4:
+ return (reader.readLong(offset)) as P;
+ case 5:
+ return (reader.readString(offset)) as P;
+ default:
+ throw IsarError('Unknown property with id $propertyId');
+ }
+}
+
+Id _ordinalGetId(Ordinal object) {
+ return object.id;
+}
+
+List> _ordinalGetLinks(Ordinal object) {
+ return [];
+}
+
+void _ordinalAttach(IsarCollection col, Id id, Ordinal object) {
+ object.id = id;
+}
+
+extension OrdinalByIndex on IsarCollection {
+ Future getByInscriptionIdUtxoTXIDUtxoVOUT(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return getByIndex(r'inscriptionId_utxoTXID_utxoVOUT',
+ [inscriptionId, utxoTXID, utxoVOUT]);
+ }
+
+ Ordinal? getByInscriptionIdUtxoTXIDUtxoVOUTSync(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return getByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT',
+ [inscriptionId, utxoTXID, utxoVOUT]);
+ }
+
+ Future deleteByInscriptionIdUtxoTXIDUtxoVOUT(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return deleteByIndex(r'inscriptionId_utxoTXID_utxoVOUT',
+ [inscriptionId, utxoTXID, utxoVOUT]);
+ }
+
+ bool deleteByInscriptionIdUtxoTXIDUtxoVOUTSync(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return deleteByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT',
+ [inscriptionId, utxoTXID, utxoVOUT]);
+ }
+
+ Future> getAllByInscriptionIdUtxoTXIDUtxoVOUT(
+ List inscriptionIdValues,
+ List utxoTXIDValues,
+ List utxoVOUTValues) {
+ final len = inscriptionIdValues.length;
+ assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values
+ .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]);
+ }
+
+ return getAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', values);
+ }
+
+ List getAllByInscriptionIdUtxoTXIDUtxoVOUTSync(
+ List inscriptionIdValues,
+ List utxoTXIDValues,
+ List utxoVOUTValues) {
+ final len = inscriptionIdValues.length;
+ assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values
+ .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]);
+ }
+
+ return getAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', values);
+ }
+
+ Future deleteAllByInscriptionIdUtxoTXIDUtxoVOUT(
+ List inscriptionIdValues,
+ List utxoTXIDValues,
+ List utxoVOUTValues) {
+ final len = inscriptionIdValues.length;
+ assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values
+ .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]);
+ }
+
+ return deleteAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', values);
+ }
+
+ int deleteAllByInscriptionIdUtxoTXIDUtxoVOUTSync(
+ List inscriptionIdValues,
+ List utxoTXIDValues,
+ List utxoVOUTValues) {
+ final len = inscriptionIdValues.length;
+ assert(utxoTXIDValues.length == len && utxoVOUTValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values
+ .add([inscriptionIdValues[i], utxoTXIDValues[i], utxoVOUTValues[i]]);
+ }
+
+ return deleteAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', values);
+ }
+
+ Future putByInscriptionIdUtxoTXIDUtxoVOUT(Ordinal object) {
+ return putByIndex(r'inscriptionId_utxoTXID_utxoVOUT', object);
+ }
+
+ Id putByInscriptionIdUtxoTXIDUtxoVOUTSync(Ordinal object,
+ {bool saveLinks = true}) {
+ return putByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', object,
+ saveLinks: saveLinks);
+ }
+
+ Future> putAllByInscriptionIdUtxoTXIDUtxoVOUT(
+ List objects) {
+ return putAllByIndex(r'inscriptionId_utxoTXID_utxoVOUT', objects);
+ }
+
+ List putAllByInscriptionIdUtxoTXIDUtxoVOUTSync(List objects,
+ {bool saveLinks = true}) {
+ return putAllByIndexSync(r'inscriptionId_utxoTXID_utxoVOUT', objects,
+ saveLinks: saveLinks);
+ }
+}
+
+extension OrdinalQueryWhereSort on QueryBuilder {
+ QueryBuilder anyId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(const IdWhereClause.any());
+ });
+ }
+}
+
+extension OrdinalQueryWhere 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,
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ value: [inscriptionId],
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdNotEqualToAnyUtxoTXIDUtxoVOUT(String inscriptionId) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [],
+ upper: [inscriptionId],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [],
+ upper: [inscriptionId],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDEqualToAnyUtxoVOUT(
+ String inscriptionId, String utxoTXID) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ value: [inscriptionId, utxoTXID],
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdEqualToUtxoTXIDNotEqualToAnyUtxoVOUT(
+ String inscriptionId, String utxoTXID) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId],
+ upper: [inscriptionId, utxoTXID],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID],
+ includeLower: false,
+ upper: [inscriptionId],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID],
+ includeLower: false,
+ upper: [inscriptionId],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId],
+ upper: [inscriptionId, utxoTXID],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDUtxoVOUTEqualTo(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ value: [inscriptionId, utxoTXID, utxoVOUT],
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDEqualToUtxoVOUTNotEqualTo(
+ String inscriptionId, String utxoTXID, int utxoVOUT) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID],
+ upper: [inscriptionId, utxoTXID, utxoVOUT],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID, utxoVOUT],
+ includeLower: false,
+ upper: [inscriptionId, utxoTXID],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID, utxoVOUT],
+ includeLower: false,
+ upper: [inscriptionId, utxoTXID],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID],
+ upper: [inscriptionId, utxoTXID, utxoVOUT],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDEqualToUtxoVOUTGreaterThan(
+ String inscriptionId,
+ String utxoTXID,
+ int utxoVOUT, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID, utxoVOUT],
+ includeLower: include,
+ upper: [inscriptionId, utxoTXID],
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDEqualToUtxoVOUTLessThan(
+ String inscriptionId,
+ String utxoTXID,
+ int utxoVOUT, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID],
+ upper: [inscriptionId, utxoTXID, utxoVOUT],
+ includeUpper: include,
+ ));
+ });
+ }
+
+ QueryBuilder
+ inscriptionIdUtxoTXIDEqualToUtxoVOUTBetween(
+ String inscriptionId,
+ String utxoTXID,
+ int lowerUtxoVOUT,
+ int upperUtxoVOUT, {
+ bool includeLower = true,
+ bool includeUpper = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.between(
+ indexName: r'inscriptionId_utxoTXID_utxoVOUT',
+ lower: [inscriptionId, utxoTXID, lowerUtxoVOUT],
+ includeLower: includeLower,
+ upper: [inscriptionId, utxoTXID, upperUtxoVOUT],
+ includeUpper: includeUpper,
+ ));
+ });
+ }
+}
+
+extension OrdinalQueryFilter
+ on QueryBuilder