mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2025-01-22 02:24:30 +00:00
price service token tweaks
This commit is contained in:
parent
af460b54a6
commit
61894c9e8e
3 changed files with 18 additions and 7 deletions
|
@ -23,7 +23,7 @@ import 'package:stackwallet/db/isar/main_db.dart';
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart';
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart';
|
||||||
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart';
|
import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart';
|
||||||
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
import 'package:stackwallet/models/exchange/response_objects/trade.dart';
|
||||||
import 'package:stackwallet/models/isar/models/log.dart';
|
import 'package:stackwallet/models/isar/models/isar_models.dart';
|
||||||
import 'package:stackwallet/models/models.dart';
|
import 'package:stackwallet/models/models.dart';
|
||||||
import 'package:stackwallet/models/node_model.dart';
|
import 'package:stackwallet/models/node_model.dart';
|
||||||
import 'package:stackwallet/models/notification_model.dart';
|
import 'package:stackwallet/models/notification_model.dart';
|
||||||
|
@ -251,6 +251,12 @@ class _MaterialAppWithThemeState extends ConsumerState<MaterialAppWithTheme>
|
||||||
await ref.read(storageCryptoHandlerProvider).hasPassword();
|
await ref.read(storageCryptoHandlerProvider).hasPassword();
|
||||||
}
|
}
|
||||||
await MainDB.instance.initMainDB();
|
await MainDB.instance.initMainDB();
|
||||||
|
ref
|
||||||
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
|
.tokenContractAddressesToCheck
|
||||||
|
.addAll(
|
||||||
|
await MainDB.instance.getEthContracts().addressProperty().findAll(),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> load() async {
|
Future<void> load() async {
|
||||||
|
|
|
@ -5,7 +5,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
import 'package:stackwallet/notifications/show_flush_bar.dart';
|
||||||
import 'package:stackwallet/providers/global/debug_service_provider.dart';
|
import 'package:stackwallet/providers/global/debug_service_provider.dart';
|
||||||
import 'package:stackwallet/providers/providers.dart';
|
import 'package:stackwallet/providers/providers.dart';
|
||||||
import 'package:stackwallet/services/price_service.dart';
|
|
||||||
import 'package:stackwallet/utilities/constants.dart';
|
import 'package:stackwallet/utilities/constants.dart';
|
||||||
import 'package:stackwallet/utilities/text_styles.dart';
|
import 'package:stackwallet/utilities/text_styles.dart';
|
||||||
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
import 'package:stackwallet/utilities/theme/stack_colors.dart';
|
||||||
|
@ -164,10 +163,16 @@ class HiddenSettings extends StatelessWidget {
|
||||||
Consumer(builder: (_, ref, __) {
|
Consumer(builder: (_, ref, __) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
PriceService.tokenContractAddressesToCheck.add(
|
ref
|
||||||
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48");
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
PriceService.tokenContractAddressesToCheck.add(
|
.tokenContractAddressesToCheck
|
||||||
"0xdAC17F958D2ee523a2206206994597C13D831ec7");
|
.add(
|
||||||
|
"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48");
|
||||||
|
ref
|
||||||
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
|
.tokenContractAddressesToCheck
|
||||||
|
.add(
|
||||||
|
"0xdAC17F958D2ee523a2206206994597C13D831ec7");
|
||||||
await ref
|
await ref
|
||||||
.read(priceAnd24hChangeNotifierProvider)
|
.read(priceAnd24hChangeNotifierProvider)
|
||||||
.updatePrice();
|
.updatePrice();
|
||||||
|
|
|
@ -9,7 +9,7 @@ import 'package:tuple/tuple.dart';
|
||||||
|
|
||||||
class PriceService extends ChangeNotifier {
|
class PriceService extends ChangeNotifier {
|
||||||
late final String baseTicker;
|
late final String baseTicker;
|
||||||
static Set<String> tokenContractAddressesToCheck = {};
|
final Set<String> tokenContractAddressesToCheck = {};
|
||||||
final Duration updateInterval = const Duration(seconds: 60);
|
final Duration updateInterval = const Duration(seconds: 60);
|
||||||
|
|
||||||
Timer? _timer;
|
Timer? _timer;
|
||||||
|
|
Loading…
Reference in a new issue