fix all own addresses query

This commit is contained in:
julian 2023-01-18 17:20:23 -06:00
parent 575cce1a7d
commit 0a3c001845
7 changed files with 50 additions and 21 deletions

View file

@ -1319,9 +1319,13 @@ class BitcoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// final List<String> allAddresses = [];
// final receivingAddresses = DB.instance.get<dynamic>(

View file

@ -1274,9 +1274,13 @@ class BitcoinCashWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// for (var i = 0; i < receivingAddressesP2PKH.length; i++) {

View file

@ -1152,9 +1152,13 @@ class DogecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
return allAddresses;
}

View file

@ -3232,9 +3232,13 @@ class FiroWallet extends CoinServiceAPI with WalletCache, WalletDB, FiroHive {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// final List<String> allAddresses = [];
// final receivingAddresses =

View file

@ -1335,9 +1335,13 @@ class LitecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// final List<String> allAddresses = [];
// final receivingAddresses = DB.instance.get<dynamic>(

View file

@ -1324,9 +1324,13 @@ class NamecoinWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// final List<String> allAddresses = [];
// final receivingAddresses = DB.instance.get<dynamic>(

View file

@ -1255,10 +1255,15 @@ class ParticlWallet extends CoinServiceAPI with WalletCache, WalletDB {
final allAddresses = await db
.getAddresses(walletId)
.filter()
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change)
.not()
.typeEqualTo(isar_models.AddressType.nonWallet)
.and()
.group((q) => q
.subTypeEqualTo(isar_models.AddressSubType.receiving)
.or()
.subTypeEqualTo(isar_models.AddressSubType.change))
.findAll();
// final List<String> allAddresses = [];
// final receivingAddresses = DB.instance.get<dynamic>(
// boxName: walletId, key: 'receivingAddressesP2WPKH') as List<dynamic>;