> allOffsets,
+) {
+ final object = Currency(
+ exchangeName: reader.readString(offsets[0]),
+ externalId: reader.readStringOrNull(offsets[1]),
+ image: reader.readString(offsets[2]),
+ isAvailable: reader.readBoolOrNull(offsets[3]),
+ isFiat: reader.readBool(offsets[4]),
+ isStackCoin: reader.readBool(offsets[5]),
+ name: reader.readString(offsets[6]),
+ network: reader.readString(offsets[7]),
+ rateType:
+ _CurrencyrateTypeValueEnumMap[reader.readByteOrNull(offsets[8])] ??
+ SupportedRateType.fixed,
+ ticker: reader.readString(offsets[9]),
+ tokenContract: reader.readStringOrNull(offsets[10]),
+ );
+ object.id = id;
+ return object;
+}
+
+P _currencyDeserializeProp(
+ IsarReader reader,
+ int propertyId,
+ int offset,
+ Map> allOffsets,
+) {
+ switch (propertyId) {
+ case 0:
+ return (reader.readString(offset)) as P;
+ case 1:
+ return (reader.readStringOrNull(offset)) as P;
+ case 2:
+ return (reader.readString(offset)) as P;
+ case 3:
+ return (reader.readBoolOrNull(offset)) as P;
+ case 4:
+ return (reader.readBool(offset)) as P;
+ case 5:
+ return (reader.readBool(offset)) as P;
+ case 6:
+ return (reader.readString(offset)) as P;
+ case 7:
+ return (reader.readString(offset)) as P;
+ case 8:
+ return (_CurrencyrateTypeValueEnumMap[reader.readByteOrNull(offset)] ??
+ SupportedRateType.fixed) as P;
+ case 9:
+ return (reader.readString(offset)) as P;
+ case 10:
+ return (reader.readStringOrNull(offset)) as P;
+ default:
+ throw IsarError('Unknown property with id $propertyId');
+ }
+}
+
+const _CurrencyrateTypeEnumValueMap = {
+ 'fixed': 0,
+ 'estimated': 1,
+ 'both': 2,
+};
+const _CurrencyrateTypeValueEnumMap = {
+ 0: SupportedRateType.fixed,
+ 1: SupportedRateType.estimated,
+ 2: SupportedRateType.both,
+};
+
+Id _currencyGetId(Currency object) {
+ return object.id ?? Isar.autoIncrement;
+}
+
+List> _currencyGetLinks(Currency object) {
+ return [];
+}
+
+void _currencyAttach(IsarCollection col, Id id, Currency object) {
+ object.id = id;
+}
+
+extension CurrencyQueryWhereSort on QueryBuilder {
+ QueryBuilder anyId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(const IdWhereClause.any());
+ });
+ }
+
+ QueryBuilder anyIsStackCoin() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(
+ const IndexWhereClause.any(indexName: r'isStackCoin'),
+ );
+ });
+ }
+}
+
+extension CurrencyQueryWhere 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 exchangeNameEqualTo(
+ String exchangeName) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'exchangeName',
+ value: [exchangeName],
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameNotEqualTo(
+ String exchangeName) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'exchangeName',
+ lower: [],
+ upper: [exchangeName],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'exchangeName',
+ lower: [exchangeName],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'exchangeName',
+ lower: [exchangeName],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'exchangeName',
+ lower: [],
+ upper: [exchangeName],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ tickerEqualToAnyExchangeNameName(String ticker) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'ticker_exchangeName_name',
+ value: [ticker],
+ ));
+ });
+ }
+
+ QueryBuilder
+ tickerNotEqualToAnyExchangeNameName(String ticker) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [],
+ upper: [ticker],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [],
+ upper: [ticker],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ tickerExchangeNameEqualToAnyName(String ticker, String exchangeName) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'ticker_exchangeName_name',
+ value: [ticker, exchangeName],
+ ));
+ });
+ }
+
+ QueryBuilder
+ tickerEqualToExchangeNameNotEqualToAnyName(
+ String ticker, String exchangeName) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker],
+ upper: [ticker, exchangeName],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName],
+ includeLower: false,
+ upper: [ticker],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName],
+ includeLower: false,
+ upper: [ticker],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker],
+ upper: [ticker, exchangeName],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ tickerExchangeNameNameEqualTo(
+ String ticker, String exchangeName, String name) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'ticker_exchangeName_name',
+ value: [ticker, exchangeName, name],
+ ));
+ });
+ }
+
+ QueryBuilder
+ tickerExchangeNameEqualToNameNotEqualTo(
+ String ticker, String exchangeName, String name) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName],
+ upper: [ticker, exchangeName, name],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName, name],
+ includeLower: false,
+ upper: [ticker, exchangeName],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName, name],
+ includeLower: false,
+ upper: [ticker, exchangeName],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'ticker_exchangeName_name',
+ lower: [ticker, exchangeName],
+ upper: [ticker, exchangeName, name],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder isStackCoinEqualTo(
+ bool isStackCoin) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'isStackCoin',
+ value: [isStackCoin],
+ ));
+ });
+ }
+
+ QueryBuilder isStackCoinNotEqualTo(
+ bool isStackCoin) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isStackCoin',
+ lower: [],
+ upper: [isStackCoin],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isStackCoin',
+ lower: [isStackCoin],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isStackCoin',
+ lower: [isStackCoin],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'isStackCoin',
+ lower: [],
+ upper: [isStackCoin],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+}
+
+extension CurrencyQueryFilter
+ on QueryBuilder {
+ QueryBuilder exchangeNameEqualTo(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ exchangeNameGreaterThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameLessThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameBetween(
+ 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'exchangeName',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ exchangeNameStartsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.startsWith(
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameEndsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.endsWith(
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameContains(
+ String value,
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.contains(
+ property: r'exchangeName',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder exchangeNameMatches(
+ String pattern,
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.matches(
+ property: r'exchangeName',
+ wildcard: pattern,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ exchangeNameIsEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'exchangeName',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder
+ exchangeNameIsNotEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ property: r'exchangeName',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder externalIdIsNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNull(
+ property: r'externalId',
+ ));
+ });
+ }
+
+ QueryBuilder
+ externalIdIsNotNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNotNull(
+ property: r'externalId',
+ ));
+ });
+ }
+
+ QueryBuilder externalIdEqualTo(
+ String? value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdGreaterThan(
+ String? value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdLessThan(
+ String? value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdBetween(
+ 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'externalId',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdStartsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.startsWith(
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdEndsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.endsWith(
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdContains(
+ String value,
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.contains(
+ property: r'externalId',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdMatches(
+ String pattern,
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.matches(
+ property: r'externalId',
+ wildcard: pattern,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder externalIdIsEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'externalId',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder
+ externalIdIsNotEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ property: r'externalId',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder idIsNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNull(
+ property: r'id',
+ ));
+ });
+ }
+
+ QueryBuilder idIsNotNull() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(const FilterCondition.isNotNull(
+ property: r'id',
+ ));
+ });
+ }
+
+ 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 imageEqualTo(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageGreaterThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageLessThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageBetween(
+ 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'image',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageStartsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.startsWith(
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageEndsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.endsWith(
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder imageContains(
+ String value,
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.contains(
+ property: r'image',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder