> allOffsets,
+) {
+ final object = SentToAddress(
+ label: reader.readStringOrNull(offsets[0]) ?? "",
+ txid: reader.readString(offsets[1]),
+ value: reader.readString(offsets[2]),
+ walletId: reader.readString(offsets[3]),
+ );
+ object.id = id;
+ return object;
+}
+
+P _sentToAddressDeserializeProp(
+ IsarReader reader,
+ int propertyId,
+ int offset,
+ Map> allOffsets,
+) {
+ switch (propertyId) {
+ case 0:
+ return (reader.readStringOrNull(offset) ?? "") as P;
+ case 1:
+ return (reader.readString(offset)) as P;
+ case 2:
+ return (reader.readString(offset)) as P;
+ case 3:
+ return (reader.readString(offset)) as P;
+ default:
+ throw IsarError('Unknown property with id $propertyId');
+ }
+}
+
+Id _sentToAddressGetId(SentToAddress object) {
+ return object.id;
+}
+
+List> _sentToAddressGetLinks(SentToAddress object) {
+ return [];
+}
+
+void _sentToAddressAttach(
+ IsarCollection col, Id id, SentToAddress object) {
+ object.id = id;
+}
+
+extension SentToAddressByIndex on IsarCollection {
+ Future getByTxidWalletId(String txid, String walletId) {
+ return getByIndex(r'txid_walletId', [txid, walletId]);
+ }
+
+ SentToAddress? getByTxidWalletIdSync(String txid, String walletId) {
+ return getByIndexSync(r'txid_walletId', [txid, walletId]);
+ }
+
+ Future deleteByTxidWalletId(String txid, String walletId) {
+ return deleteByIndex(r'txid_walletId', [txid, walletId]);
+ }
+
+ bool deleteByTxidWalletIdSync(String txid, String walletId) {
+ return deleteByIndexSync(r'txid_walletId', [txid, walletId]);
+ }
+
+ Future> getAllByTxidWalletId(
+ List txidValues, List walletIdValues) {
+ final len = txidValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([txidValues[i], walletIdValues[i]]);
+ }
+
+ return getAllByIndex(r'txid_walletId', values);
+ }
+
+ List getAllByTxidWalletIdSync(
+ List txidValues, List walletIdValues) {
+ final len = txidValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([txidValues[i], walletIdValues[i]]);
+ }
+
+ return getAllByIndexSync(r'txid_walletId', values);
+ }
+
+ Future deleteAllByTxidWalletId(
+ List txidValues, List walletIdValues) {
+ final len = txidValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([txidValues[i], walletIdValues[i]]);
+ }
+
+ return deleteAllByIndex(r'txid_walletId', values);
+ }
+
+ int deleteAllByTxidWalletIdSync(
+ List txidValues, List walletIdValues) {
+ final len = txidValues.length;
+ assert(walletIdValues.length == len,
+ 'All index values must have the same length');
+ final values = >[];
+ for (var i = 0; i < len; i++) {
+ values.add([txidValues[i], walletIdValues[i]]);
+ }
+
+ return deleteAllByIndexSync(r'txid_walletId', values);
+ }
+
+ Future putByTxidWalletId(SentToAddress object) {
+ return putByIndex(r'txid_walletId', object);
+ }
+
+ Id putByTxidWalletIdSync(SentToAddress object, {bool saveLinks = true}) {
+ return putByIndexSync(r'txid_walletId', object, saveLinks: saveLinks);
+ }
+
+ Future> putAllByTxidWalletId(List objects) {
+ return putAllByIndex(r'txid_walletId', objects);
+ }
+
+ List putAllByTxidWalletIdSync(List objects,
+ {bool saveLinks = true}) {
+ return putAllByIndexSync(r'txid_walletId', objects, saveLinks: saveLinks);
+ }
+}
+
+extension SentToAddressQueryWhereSort
+ on QueryBuilder {
+ QueryBuilder anyId() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(const IdWhereClause.any());
+ });
+ }
+}
+
+extension SentToAddressQueryWhere
+ 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
+ txidEqualToAnyWalletId(String txid) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'txid_walletId',
+ value: [txid],
+ ));
+ });
+ }
+
+ QueryBuilder
+ txidNotEqualToAnyWalletId(String txid) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [],
+ upper: [txid],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid],
+ includeLower: false,
+ upper: [],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid],
+ includeLower: false,
+ upper: [],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [],
+ upper: [txid],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+
+ QueryBuilder
+ txidWalletIdEqualTo(String txid, String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addWhereClause(IndexWhereClause.equalTo(
+ indexName: r'txid_walletId',
+ value: [txid, walletId],
+ ));
+ });
+ }
+
+ QueryBuilder
+ txidEqualToWalletIdNotEqualTo(String txid, String walletId) {
+ return QueryBuilder.apply(this, (query) {
+ if (query.whereSort == Sort.asc) {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid],
+ upper: [txid, walletId],
+ includeUpper: false,
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid, walletId],
+ includeLower: false,
+ upper: [txid],
+ ));
+ } else {
+ return query
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid, walletId],
+ includeLower: false,
+ upper: [txid],
+ ))
+ .addWhereClause(IndexWhereClause.between(
+ indexName: r'txid_walletId',
+ lower: [txid],
+ upper: [txid, walletId],
+ includeUpper: false,
+ ));
+ }
+ });
+ }
+}
+
+extension SentToAddressQueryFilter
+ on QueryBuilder {
+ QueryBuilder idEqualTo(
+ Id value) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'id',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder
+ idGreaterThan(
+ Id value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'id',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder idLessThan(
+ Id value, {
+ bool include = false,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'id',
+ value: value,
+ ));
+ });
+ }
+
+ QueryBuilder idBetween(
+ Id lower,
+ Id upper, {
+ bool includeLower = true,
+ bool includeUpper = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.between(
+ property: r'id',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelEqualTo(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelGreaterThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ include: include,
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelLessThan(
+ String value, {
+ bool include = false,
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.lessThan(
+ include: include,
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelBetween(
+ 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'label',
+ lower: lower,
+ includeLower: includeLower,
+ upper: upper,
+ includeUpper: includeUpper,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelStartsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.startsWith(
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelEndsWith(
+ String value, {
+ bool caseSensitive = true,
+ }) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.endsWith(
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelContains(String value, {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.contains(
+ property: r'label',
+ value: value,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelMatches(String pattern, {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.matches(
+ property: r'label',
+ wildcard: pattern,
+ caseSensitive: caseSensitive,
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelIsEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.equalTo(
+ property: r'label',
+ value: '',
+ ));
+ });
+ }
+
+ QueryBuilder
+ labelIsNotEmpty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addFilterCondition(FilterCondition.greaterThan(
+ property: r'label',
+ 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 SentToAddressQueryObject
+ on QueryBuilder {}
+
+extension SentToAddressQueryLinks
+ on QueryBuilder {}
+
+extension SentToAddressQuerySortBy
+ on QueryBuilder {
+ QueryBuilder sortByLabel() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'label', Sort.asc);
+ });
+ }
+
+ QueryBuilder sortByLabelDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'label', 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 SentToAddressQuerySortThenBy
+ on QueryBuilder {
+ QueryBuilder thenById() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'id', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByIdDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'id', Sort.desc);
+ });
+ }
+
+ QueryBuilder thenByLabel() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'label', Sort.asc);
+ });
+ }
+
+ QueryBuilder thenByLabelDesc() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addSortBy(r'label', 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 SentToAddressQueryWhereDistinct
+ on QueryBuilder {
+ QueryBuilder distinctByLabel(
+ {bool caseSensitive = true}) {
+ return QueryBuilder.apply(this, (query) {
+ return query.addDistinctBy(r'label', 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 SentToAddressQueryProperty
+ on QueryBuilder {
+ QueryBuilder idProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'id');
+ });
+ }
+
+ QueryBuilder labelProperty() {
+ return QueryBuilder.apply(this, (query) {
+ return query.addPropertyName(r'label');
+ });
+ }
+
+ 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/transaction_note.g.dart b/lib/models/isar/models/transaction_note.g.dart
index 152070328..67af8cdca 100644
--- a/lib/models/isar/models/transaction_note.g.dart
+++ b/lib/models/isar/models/transaction_note.g.dart
@@ -7,7 +7,7 @@ part of 'transaction_note.dart';
// **************************************************************************
// coverage:ignore-file
-// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters
+// 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, always_specify_types
extension GetTransactionNoteCollection on Isar {
IsarCollection get transactionNotes => this.collection();
@@ -76,7 +76,7 @@ const TransactionNoteSchema = CollectionSchema(
getId: _transactionNoteGetId,
getLinks: _transactionNoteGetLinks,
attach: _transactionNoteAttach,
- version: '3.0.5',
+ version: '3.1.8',
);
int _transactionNoteEstimateSize(
diff --git a/lib/models/isar/ordinal.g.dart b/lib/models/isar/ordinal.g.dart
index 89c967cb0..5c23e11bb 100644
--- a/lib/models/isar/ordinal.g.dart
+++ b/lib/models/isar/ordinal.g.dart
@@ -7,7 +7,7 @@ part of 'ordinal.dart';
// **************************************************************************
// coverage:ignore-file
-// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters
+// 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, always_specify_types
extension GetOrdinalCollection on Isar {
IsarCollection get ordinals => this.collection();
@@ -83,7 +83,7 @@ const OrdinalSchema = CollectionSchema(
getId: _ordinalGetId,
getLinks: _ordinalGetLinks,
attach: _ordinalAttach,
- version: '3.0.5',
+ version: '3.1.8',
);
int _ordinalEstimateSize(
diff --git a/lib/models/isar/stack_theme.g.dart b/lib/models/isar/stack_theme.g.dart
index 03c543ff0..c77d979f5 100644
--- a/lib/models/isar/stack_theme.g.dart
+++ b/lib/models/isar/stack_theme.g.dart
@@ -7,7 +7,7 @@ part of 'stack_theme.dart';
// **************************************************************************
// coverage:ignore-file
-// ignore_for_file: duplicate_ignore, non_constant_identifier_names, constant_identifier_names, invalid_use_of_protected_member, unnecessary_cast, prefer_const_constructors, lines_longer_than_80_chars, require_trailing_commas, inference_failure_on_function_invocation, unnecessary_parenthesis, unnecessary_raw_strings, unnecessary_null_checks, join_return_with_assignment, prefer_final_locals, avoid_js_rounded_ints, avoid_positional_boolean_parameters
+// 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, always_specify_types
extension GetStackThemeCollection on Isar {
IsarCollection get stackThemes => this.collection();
@@ -860,7 +860,7 @@ const StackThemeSchema = CollectionSchema(
getId: _stackThemeGetId,
getLinks: _stackThemeGetLinks,
attach: _stackThemeAttach,
- version: '3.0.5',
+ version: '3.1.8',
);
int _stackThemeEstimateSize(
@@ -18012,7 +18012,7 @@ extension StackThemeQueryProperty
// **************************************************************************
// 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
+// 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, always_specify_types
const ThemeAssetsSchema = Schema(
name: r'ThemeAssets',
@@ -25833,7 +25833,7 @@ extension ThemeAssetsQueryObject
on QueryBuilder {}
// 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
+// 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, always_specify_types
const ThemeAssetsV2Schema = Schema(
name: r'ThemeAssetsV2',
@@ -29441,7 +29441,7 @@ extension ThemeAssetsV2QueryObject
on QueryBuilder {}
// 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
+// 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, always_specify_types
const ThemeAssetsV3Schema = Schema(
name: r'ThemeAssetsV3',
diff --git a/lib/models/keys/view_only_wallet_data.dart b/lib/models/keys/view_only_wallet_data.dart
new file mode 100644
index 000000000..92c23b082
--- /dev/null
+++ b/lib/models/keys/view_only_wallet_data.dart
@@ -0,0 +1,164 @@
+import 'dart:convert';
+
+import '../../wallets/wallet/wallet_mixin_interfaces/extended_keys_interface.dart';
+import 'key_data_interface.dart';
+
+// do not remove or change the order of these enum values
+enum ViewOnlyWalletType {
+ cryptonote,
+ addressOnly,
+ xPub;
+}
+
+sealed class ViewOnlyWalletData with KeyDataInterface {
+ @override
+ final String walletId;
+
+ ViewOnlyWalletType get type;
+
+ ViewOnlyWalletData({
+ required this.walletId,
+ });
+
+ static ViewOnlyWalletData fromJsonEncodedString(
+ String jsonEncodedString, {
+ required String walletId,
+ }) {
+ final map = jsonDecode(jsonEncodedString) as Map;
+ final json = Map.from(map);
+ final type = ViewOnlyWalletType.values[json["type"] as int];
+
+ switch (type) {
+ case ViewOnlyWalletType.cryptonote:
+ return CryptonoteViewOnlyWalletData.fromJsonEncodedString(
+ jsonEncodedString,
+ walletId: walletId,
+ );
+
+ case ViewOnlyWalletType.addressOnly:
+ return AddressViewOnlyWalletData.fromJsonEncodedString(
+ jsonEncodedString,
+ walletId: walletId,
+ );
+
+ case ViewOnlyWalletType.xPub:
+ return ExtendedKeysViewOnlyWalletData.fromJsonEncodedString(
+ jsonEncodedString,
+ walletId: walletId,
+ );
+ }
+ }
+
+ String toJsonEncodedString();
+}
+
+class CryptonoteViewOnlyWalletData extends ViewOnlyWalletData {
+ @override
+ final type = ViewOnlyWalletType.cryptonote;
+
+ final String address;
+ final String privateViewKey;
+
+ CryptonoteViewOnlyWalletData({
+ required super.walletId,
+ required this.address,
+ required this.privateViewKey,
+ });
+
+ static CryptonoteViewOnlyWalletData fromJsonEncodedString(
+ String jsonEncodedString, {
+ required String walletId,
+ }) {
+ final map = jsonDecode(jsonEncodedString) as Map;
+ final json = Map.from(map);
+
+ return CryptonoteViewOnlyWalletData(
+ walletId: walletId,
+ address: json["address"] as String,
+ privateViewKey: json["privateViewKey"] as String,
+ );
+ }
+
+ @override
+ String toJsonEncodedString() => jsonEncode({
+ "type": type.index,
+ "address": address,
+ "privateViewKey": privateViewKey,
+ });
+}
+
+class AddressViewOnlyWalletData extends ViewOnlyWalletData {
+ @override
+ final type = ViewOnlyWalletType.addressOnly;
+
+ final String address;
+
+ AddressViewOnlyWalletData({
+ required super.walletId,
+ required this.address,
+ });
+
+ static AddressViewOnlyWalletData fromJsonEncodedString(
+ String jsonEncodedString, {
+ required String walletId,
+ }) {
+ final map = jsonDecode(jsonEncodedString) as Map;
+ final json = Map.from(map);
+
+ return AddressViewOnlyWalletData(
+ walletId: walletId,
+ address: json["address"] as String,
+ );
+ }
+
+ @override
+ String toJsonEncodedString() => jsonEncode({
+ "type": type.index,
+ "address": address,
+ });
+}
+
+class ExtendedKeysViewOnlyWalletData extends ViewOnlyWalletData {
+ @override
+ final type = ViewOnlyWalletType.xPub;
+
+ final List xPubs;
+
+ ExtendedKeysViewOnlyWalletData({
+ required super.walletId,
+ required List xPubs,
+ }) : xPubs = List.unmodifiable(xPubs);
+
+ static ExtendedKeysViewOnlyWalletData fromJsonEncodedString(
+ String jsonEncodedString, {
+ required String walletId,
+ }) {
+ final map = jsonDecode(jsonEncodedString) as Map;
+ final json = Map.from(map);
+
+ return ExtendedKeysViewOnlyWalletData(
+ walletId: walletId,
+ xPubs: List