mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-12-23 11:59:30 +00:00
expose wallet isar instance to Manager
This commit is contained in:
parent
6adf1d3148
commit
a73e18df75
12 changed files with 36 additions and 2 deletions
|
@ -3571,4 +3571,7 @@ class BitcoinWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
|
|
@ -3276,6 +3276,9 @@ class BitcoinCashWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
||||
// Bitcoincash Network
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -2749,6 +2749,9 @@ class DogecoinWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
||||
// Dogecoin Network
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -3623,6 +3623,9 @@ class LitecoinWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
||||
final litecoin = NetworkType(
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -3615,6 +3615,9 @@ class NamecoinWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
||||
// Namecoin Network
|
||||
|
|
|
@ -3384,6 +3384,9 @@ class ParticlWallet extends CoinServiceAPI {
|
|||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Isar get isarInstance => isar;
|
||||
}
|
||||
|
||||
// Particl Network
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue