diff --git a/cw_core/lib/solana_rpc_http_service.dart b/cw_core/lib/solana_rpc_http_service.dart index 5d2d0afa8..56077dfe0 100644 --- a/cw_core/lib/solana_rpc_http_service.dart +++ b/cw_core/lib/solana_rpc_http_service.dart @@ -10,14 +10,11 @@ class SolanaRPCHTTPService implements SolanaJSONRPCService { final String url; final Duration defaultRequestTimeout; - final client = ProxyWrapper().getHttpIOClient(); - - @override Future> call(SolanaRequestDetails params, [Duration? timeout]) async { - final response = await client.post( - Uri.parse(url), - body: params.toRequestBody(), + final response = await ProxyWrapper().post( + clearnetUri: Uri.parse(url), + body: json.encode(params.toRequestBody()), headers: { 'Content-Type': 'application/json', }, diff --git a/cw_monero/lib/api/wallet.dart b/cw_monero/lib/api/wallet.dart index 2bb7d2c52..e98ba71ca 100644 --- a/cw_monero/lib/api/wallet.dart +++ b/cw_monero/lib/api/wallet.dart @@ -245,7 +245,7 @@ void storeSync({bool force = false}) async { return monero.Wallet_synchronized(Pointer.fromAddress(addr)); }); if (lastStorePointer == addr && - lastStoreHeight + 5000 > currentWallet!.blockChainHeight() && + lastStoreHeight + 75000 > currentWallet!.blockChainHeight() && !synchronized && !force) { return; diff --git a/cw_tron/lib/tron_http_provider.dart b/cw_tron/lib/tron_http_provider.dart index a0d8e8f58..420ff85b0 100644 --- a/cw_tron/lib/tron_http_provider.dart +++ b/cw_tron/lib/tron_http_provider.dart @@ -1,6 +1,5 @@ import 'dart:convert'; -import 'package:cw_core/utils/http_client.dart'; import 'package:cw_core/utils/proxy_wrapper.dart'; import 'package:on_chain/tron/tron.dart'; import '.secrets.g.dart' as secrets; diff --git a/lib/main.dart b/lib/main.dart index dddf519a2..709304939 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -202,8 +202,8 @@ Future initializeAppConfigs({bool loadWallet = true}) async { final powNodes = await CakeHive.openBox(Node.boxName + "pow"); // must be different from Node.boxName final transactionDescriptions = await CakeHive.openBox( - TransactionDescription.boxName, - encryptionKey: transactionDescriptionsBoxKey); + TransactionDescription.boxName, + encryptionKey: transactionDescriptionsBoxKey); final trades = await CakeHive.openBox(Trade.boxName, encryptionKey: tradesBoxKey); final orders = await CakeHive.openBox(Order.boxName, encryptionKey: ordersBoxKey); final walletInfoSource = await CakeHive.openBox(WalletInfo.boxName); @@ -306,25 +306,27 @@ class AppState extends State with SingleTickerProviderStateMixin { @override Widget build(BuildContext context) { return Observer(builder: (BuildContext context) { - final appStore = getIt.get(); - final authService = getIt.get(); - final linkViewModel = getIt.get(); - final tradeMonitor = getIt.get(); - final settingsStore = appStore.settingsStore; - final statusBarColor = Colors.transparent; - final authenticationStore = getIt.get(); - final initialRoute = authenticationStore.state == AuthenticationState.uninitialized - ? Routes.welcome - : settingsStore.currentBuiltinTor ? Routes.startTor : Routes.login; - final currentTheme = appStore.themeStore.currentTheme; - final statusBarBrightness = - currentTheme.type == ThemeType.dark ? Brightness.light : Brightness.dark; - final statusBarIconBrightness = - currentTheme.type == ThemeType.dark ? Brightness.light : Brightness.dark; - SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( - statusBarColor: statusBarColor, - statusBarBrightness: statusBarBrightness, - statusBarIconBrightness: statusBarIconBrightness)); + final appStore = getIt.get(); + final authService = getIt.get(); + final linkViewModel = getIt.get(); + final tradeMonitor = getIt.get(); + final settingsStore = appStore.settingsStore; + final statusBarColor = Colors.transparent; + final authenticationStore = getIt.get(); + final initialRoute = authenticationStore.state == AuthenticationState.uninitialized + ? Routes.welcome + : settingsStore.currentBuiltinTor ? Routes.startTor : Routes.login; + final currentTheme = appStore.themeStore.currentTheme; + final statusBarBrightness = currentTheme.type == currentTheme.isDark + ? Brightness.light + : Brightness.dark; + final statusBarIconBrightness = currentTheme.type == currentTheme.isDark + ? Brightness.light + : Brightness.dark; + SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle( + statusBarColor: statusBarColor, + statusBarBrightness: statusBarBrightness, + statusBarIconBrightness: statusBarIconBrightness)); return Root( key: widget.key ?? rootKey, @@ -336,7 +338,8 @@ class AppState extends State with SingleTickerProviderStateMixin { tradeMonitor: tradeMonitor, child: ThemeProvider( themeStore: appStore.themeStore, - materialAppBuilder: (context, theme, darkTheme, themeMode) => MaterialApp( + materialAppBuilder: (context, theme, darkTheme, themeMode) => + MaterialApp( navigatorObservers: [routeObserver], navigatorKey: navigatorKey, debugShowCheckedModeBanner: false, @@ -379,8 +382,10 @@ class _HomeState extends State<_Home> { SystemChrome.setPreferredOrientations( [DeviceOrientation.portraitUp, DeviceOrientation.portraitDown]); } else { - SystemChrome.setPreferredOrientations( - [DeviceOrientation.landscapeLeft, DeviceOrientation.landscapeRight]); + SystemChrome.setPreferredOrientations([ + DeviceOrientation.landscapeLeft, + DeviceOrientation.landscapeRight + ]); } } }