expose wallet isar instance to Manager

This commit is contained in:
julian 2023-01-11 21:23:21 -06:00
parent 6adf1d3148
commit a73e18df75
12 changed files with 36 additions and 2 deletions

View file

@ -3571,4 +3571,7 @@ class BitcoinWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}

View file

@ -3276,6 +3276,9 @@ class BitcoinCashWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}
// Bitcoincash Network

View file

@ -1,3 +1,4 @@
import 'package:isar/isar.dart';
import 'package:stackwallet/electrumx_rpc/cached_electrumx.dart';
import 'package:stackwallet/electrumx_rpc/electrumx.dart';
import 'package:stackwallet/models/balance.dart';
@ -294,4 +295,6 @@ abstract class CoinServiceAPI {
Future<void> updateSentCachedTxData(Map<String, dynamic> txData);
int get storedChainHeight;
Isar get isarInstance;
}

View file

@ -2749,6 +2749,9 @@ class DogecoinWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}
// Dogecoin Network

View file

@ -2337,4 +2337,7 @@ class EpicCashWallet extends CoinServiceAPI {
@override
Future<List<isar_models.Transaction>> get transactions =>
isar.transactions.where().findAll();
@override
Isar get isarInstance => isar;
}

View file

@ -4873,11 +4873,12 @@ class FiroWallet extends CoinServiceAPI {
Balance? _balancePrivate;
@override
// TODO: implement utxos
Future<List<isar_models.UTXO>> get utxos => isar.utxos.where().findAll();
@override
// TODO: implement transactions
Future<List<isar_models.Transaction>> get transactions =>
isar.transactions.where().findAll();
@override
Isar get isarInstance => isar;
}

View file

@ -3623,6 +3623,9 @@ class LitecoinWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}
final litecoin = NetworkType(

View file

@ -2,6 +2,7 @@ import 'dart:async';
import 'package:event_bus/event_bus.dart';
import 'package:flutter/material.dart';
import 'package:isar/isar.dart';
import 'package:stackwallet/models/balance.dart';
import 'package:stackwallet/models/isar/models/isar_models.dart' as isar_models;
import 'package:stackwallet/models/models.dart';
@ -214,4 +215,6 @@ class Manager with ChangeNotifier {
}
int get currentHeight => _currentWallet.storedChainHeight;
Isar get db => _currentWallet.isarInstance;
}

View file

@ -1271,4 +1271,7 @@ class MoneroWallet extends CoinServiceAPI {
@override
// TODO: implement utxos
Future<List<isar_models.UTXO>> get utxos => throw UnimplementedError();
@override
Isar get isarInstance => isar;
}

View file

@ -3615,6 +3615,9 @@ class NamecoinWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}
// Namecoin Network

View file

@ -3384,6 +3384,9 @@ class ParticlWallet extends CoinServiceAPI {
return false;
}
}
@override
Isar get isarInstance => isar;
}
// Particl Network

View file

@ -1347,4 +1347,7 @@ class WowneroWallet extends CoinServiceAPI {
@override
// TODO: implement utxos
Future<List<isar_models.UTXO>> get utxos => throw UnimplementedError();
@override
Isar get isarInstance => isar;
}