Unify startup and resume, minor fixes
What changed, and why it matters
This commit is a routine refactor and UI cleanup. It merges the app's startup and resume service logic into a shared mixin, replaces hard-coded legal pages with shared components, removes an unused localization string, and fixes a small fiat-conversion edge case so a zero balance displays as zero instead of a placeholder while syncing. There is no indication of a security fix or vulnerability.
No security action required. Review as normal code-quality refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff shows non-security refactoring: (1) AppRoot now uses a WalletAppServices mixin to start Tor, fiat rates, and desktop announcements once, instead of inline _startedServices logic; (2) privacy_policy.dart and terms_of_service.dart are deleted and replaced by shared wallet_ui sub-page screens with chrome from home_shell.dart; (3) settings.dart now navigates to /open_source_licenses instead of calling showLicensePage; (4) route_policy.dart adds /open_source_licenses as unlocked; (5) syncFrequencyModeLabel is removed from localizations; (6) wallet_core_glue.dart removes attachFiatWalletManager and _ensureTorConnected helpers, delegating to WalletAppServices/TorSettingsService; (7) wallet_home.dart fixes fiat balance computation to show $0 when unlockedBalance is 0 and rate exists. No security-relevant changes are visible.
Changed components
lib/main.dartlib/wallet_core_glue.dartlib/screens/desktop/home_shell.dartlib/screens/settings.dartlib/screens/wallet_home.dartlib/route_policy.dartlib/l10n/*test/route_policy_test.dartInspect captured patch +43 / −538
### lib/l10n/app_en.arb
@@ -248,7 +248,6 @@
"settingsNotifyNewTxsDescription": "Show a notification when you receive a transaction. Increase the sync frequency setting to see them sooner.",
"settingsSyncFrequencyLabel": "Sync Frequency",
"syncFrequencySheetSubtitle": "How often Monero syncs while the app is closed.",
- "syncFrequencyModeLabel": "Frequency",
"syncFrequencyContinuous": "Continuous",
"syncFrequencyContinuousDesc": "Continuously sync Monero in the background so it's always up to date when you open the app. Uses more battery and requires a persistent notification.",
"syncFrequencyPeriodic": "Periodic",
### lib/l10n/app_localizations.dart
@@ -1329,12 +1329,6 @@ abstract class AppLocalizations {
/// **'How often Monero syncs while the app is closed.'**
String get syncFrequencySheetSubtitle;
- /// No description provided for @syncFrequencyModeLabel.
- ///
- /// In en, this message translates to:
- /// **'Frequency'**
- String get syncFrequencyModeLabel;
-
/// No description provided for @syncFrequencyContinuous.
///
/// In en, this message translates to:
### lib/l10n/app_localizations_en.dart
@@ -683,9 +683,6 @@ class AppLocalizationsEn extends AppLocalizations {
@override
String get syncFrequencySheetSubtitle => 'How often Monero syncs while the app is closed.';
- @override
- String get syncFrequencyModeLabel => 'Frequency';
-
@override
String get syncFrequencyContinuous => 'Continuous';
### lib/l10n/app_localizations_pt.dart
@@ -687,9 +687,6 @@ class AppLocalizationsPt extends AppLocalizations {
String get syncFrequencySheetSubtitle =>
'Com que frequência o Monero sincroniza enquanto o app está fechado.';
- @override
- String get syncFrequencyModeLabel => 'Frequência';
-
@override
String get syncFrequencyContinuous => 'Contínua';
### lib/l10n/app_pt.arb
@@ -242,7 +242,6 @@
"settingsNotifyNewTxsDescription": "Mostrar uma notificação quando você receber uma transação. Aumente a frequência de sincronização para vê-las mais cedo.",
"settingsSyncFrequencyLabel": "Frequência de sincronização",
"syncFrequencySheetSubtitle": "Com que frequência o Monero sincroniza enquanto o app está fechado.",
- "syncFrequencyModeLabel": "Frequência",
"syncFrequencyContinuous": "Contínua",
"syncFrequencyContinuousDesc": "Sincroniza o Monero continuamente em segundo plano para que esteja sempre atualizado ao abrir o app. Usa mais bateria e exige uma notificação persistente.",
"syncFrequencyPeriodic": "Periódica",
### lib/main.dart
@@ -8,17 +8,14 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:skylight_wallet/models/fiat_rate_model.dart';
import 'package:skylight_wallet/models/contact_model.dart';
-import 'package:skylight_wallet/services/tor_settings_service.dart';
import 'package:skylight_wallet/screens/lws_details.dart';
import 'package:skylight_wallet/screens/lws_keys.dart';
import 'package:skylight_wallet/screens/scan_qr.dart';
import 'package:skylight_wallet/screens/secret_keys.dart';
-import 'package:skylight_wallet/services/tor_service.dart';
import 'package:skylight_wallet/models/language_model.dart';
import 'package:skylight_wallet/models/theme_model.dart';
import 'package:skylight_wallet/l10n/app_localizations.dart';
import 'package:skylight_wallet/screens/settings.dart';
-import 'package:skylight_wallet/models/app_wallet.dart';
import 'package:skylight_wallet/screens/connection_setup.dart';
import 'package:skylight_wallet/screens/fiat_api_setup_screen.dart';
import 'package:skylight_wallet/screens/generate_seed.dart';
@@ -32,9 +29,8 @@ import 'package:skylight_wallet/screens/wallet_home.dart';
import 'package:skylight_wallet/screens/welcome.dart';
import 'package:skylight_wallet/screens/tor_settings.dart';
import 'package:skylight_wallet/screens/address_book.dart';
+import 'package:skylight_wallet/screens/desktop/home_shell.dart' show subPageChrome;
import 'package:skylight_wallet/screens/history.dart';
-import 'package:skylight_wallet/screens/privacy_policy.dart';
-import 'package:skylight_wallet/screens/terms_of_service.dart';
import 'package:skylight_wallet/screens/unlock.dart';
import 'package:skylight_wallet/services/notifications_service.dart';
import 'package:skylight_wallet/services/shared_preferences_service.dart';
@@ -142,17 +138,12 @@ class _AppRoot extends StatefulWidget {
}
class _AppRootState extends State<_AppRoot>
- with WidgetsBindingObserver, AppLockLifecycle<_AppRoot> {
+ with WidgetsBindingObserver, AppLockLifecycle<_AppRoot>, WalletAppServices<_AppRoot> {
// Started once, on the first build. Building it inside the builder would
// re-run it on every theme/language change, opening the wallet again — a
// second wallet on the same file, with its own sync loop, while the first is
// left running.
Future<List<Object>>? _startup;
- // Services that must fire once the startup work is done, not on every build.
- var _startedServices = false;
- // Desktop-only foreground announce: listens for tx-history growth (see below).
- AppWallet? _announceWallet;
- int _lastAnnouncedTxCount = 0;
// Brightness-flip repaint: screens read BrandColors globally (not via
// Theme.of), so a theme change doesn't dirty cached routes on its own. On an
@@ -208,8 +199,18 @@ class _AppRootState extends State<_AppRoot>
'/receive': (context) => ReceiveScreen(),
'/address_book': (context) => AddressBookScreen(),
'/history': (context) => const HistoryScreen(),
- '/terms_of_service': (context) => TermsOfService(),
- '/privacy_policy': (context) => PrivacyPolicy(),
+ '/terms_of_service': (context) => TermsOfServiceScreen(
+ title: AppLocalizations.of(context)!.welcomeTermsLink,
+ chrome: subPageChrome(context),
+ ),
+ '/privacy_policy': (context) => PrivacyPolicyScreen(
+ title: AppLocalizations.of(context)!.welcomePrivacyLink,
+ chrome: subPageChrome(context),
+ ),
+ '/open_source_licenses': (context) => OpenSourceLicensesScreen(
+ title: AppLocalizations.of(context)!.settingsLicensesLabel,
+ chrome: subPageChrome(context),
+ ),
};
Route<dynamic>? _onGenerateRoute(RouteSettings settings) {
@@ -256,10 +257,16 @@ class _AppRootState extends State<_AppRoot>
WidgetsBinding.instance.removeObserver(this);
WidgetsBinding.instance.removeObserver(_routeLinkBlocker);
_paymentLinks.dispose();
- _announceWallet?.removeListener(_announceNewTxsOnGrowth);
super.dispose();
}
+ // The services beside the screens (WalletAppServices) use the app's own.
+ @override
+ WalletManager get appWalletManager => Provider.of<WalletManager>(context, listen: false);
+
+ @override
+ FiatRateModel get appFiatRates => Provider.of<FiatRateModel>(context, listen: false);
+
/// Opens the Send form for a payment link the gate let through: the user is
/// past every lock and on a screen behind them. It only pre-fills the form,
/// which reviews and confirms the payment as always.
@@ -310,23 +317,7 @@ class _AppRootState extends State<_AppRoot>
/// announce. Marks only synced history (hash-based), so an unsynced
/// receipt is still announced later.
@override
- void onMobilePaused() {
- unawaited(appWalletOf(context, listen: false).notifyNewIncomingTxs(announce: false));
- }
-
- // Desktop has no background isolate to announce incoming txs, so the
- // foreground announces when the wallet's history grows. notifyNewIncomingTxs
- // is the decider (hash-based, net-receipt only, respects the notifications
- // toggle); the count is a cheap gate so unrelated notifications (connectivity,
- // balance) don't hit the keystore.
- void _announceNewTxsOnGrowth() {
- final wallet = _announceWallet;
- if (wallet == null) return;
- final count = wallet.txHistory.length;
- if (count <= _lastAnnouncedTxCount) return;
- _lastAnnouncedTxCount = count;
- unawaited(wallet.notifyNewIncomingTxs());
- }
+ void onMobilePaused() => markIncomingTxsSeen();
Future<List<Object>> _runStartup() {
// Wallet existence drives the initial route; done quickly without a full load.
@@ -340,8 +331,6 @@ class _AppRootState extends State<_AppRoot>
return Consumer2<LanguageModel, ThemeModel>(
builder: (context, languageProvider, themeProvider, child) {
- final fiatRate = Provider.of<FiatRateModel>(context, listen: false);
-
return FutureBuilder(
future: _startup,
builder: (context, snapshot) {
@@ -355,33 +344,8 @@ class _AppRootState extends State<_AppRoot>
// Linux and Windows). With security keys on, a key comes next.
final initialRoute = walletExists ? '/unlock' : '/welcome';
- if (!_startedServices) {
- _startedServices = true;
- // Only the built-in Tor is ours to start; external/disabled must
- // not spin up an embedded Tor, whose status would then misreport
- // the external proxy.
- unawaited(() async {
- await TorSettingsService.sharedInstance.loadSettings();
- if (TorSettingsService.sharedInstance.torMode == TorMode.builtIn) {
- await TorService.sharedInstance.start();
- }
- }());
-
- // Attach the manager once so the (multicoin) fiat model knows to
- // fetch XMR; every startService() afterwards can stay argless.
- attachFiatWalletManager(context);
- if (walletExists) {
- fiatRate.startService();
- }
-
- // Desktop has no background isolate to announce incoming txs, so
- // the foreground announces on tx-history growth. Mobile announces
- // from its background isolates.
- if (isDesktopOS) {
- _announceWallet = appWalletOf(context, listen: false)
- ..addListener(_announceNewTxsOnGrowth);
- }
- }
+ // Tor, fiat rates and desktop announcements, once (WalletAppServices).
+ startWalletServices(walletExists: walletExists);
return MaterialApp(
navigatorKey: _navigatorKey,
### lib/models/fiat_rate_model.dart
@@ -1,7 +1,7 @@
// FiatRateModel lives in wallet-core (`wallet_fiat`, multicoin — skylight uses
// the XMR result via rateFor('XMR')). Kept under the same import path so call
-// sites are unchanged; the app supplies the Tor proxy via FiatRates.install and
-// attaches the WalletManager via attachFiatWalletManager in wallet_core_glue.dart.
+// sites are unchanged; the app supplies the Tor proxy via FiatRates.install in
+// wallet_core_glue.dart, and WalletAppServices attaches the WalletManager at launch.
// The fiatAutoDisabledByTor auto-disable/restore stays app-side (tor_settings_form).
export 'package:wallet_fiat/wallet_fiat.dart'
show FiatRateModel, FiatApiMode, FiatCurrency, FiatQuote;
### lib/route_policy.dart
@@ -36,4 +36,5 @@ const routePolicy = RoutePolicy({
'/advanced_security': RouteAccess.unlocked,
'/metadata_backup': RouteAccess.unlocked,
'/verify_seed': RouteAccess.unlocked,
+ '/open_source_licenses': RouteAccess.unlocked,
});
### lib/screens/desktop/home_shell.dart
@@ -9,56 +9,15 @@ import 'package:skylight_wallet/widgets/ui/ui.dart';
/// The top-level desktop destinations, mirroring the mobile navigation bar.
enum DesktopNav { home, history, addressBook, settings }
-/// Shared style for a desktop screen's large title (Settings, Contacts, …).
-TextStyle get desktopTitleStyle => TextStyle(
- fontFamily: 'Ubuntu',
- fontSize: 26,
- height: 1.2,
- fontWeight: FontWeight.w700,
- color: BrandColors.ink,
-);
-
-/// The "‹ label" back link at the top of a desktop sub-screen (receive, send,
-/// ToS, …) — the shared back affordance in place of a mobile app bar.
-class DesktopBackLink extends StatelessWidget {
- final String label;
- final VoidCallback onTap;
-
- const DesktopBackLink({super.key, required this.label, required this.onTap});
-
- @override
- Widget build(BuildContext context) {
- // Sized to its content (left-aligned) so the hover/ripple doesn't span the
- // full parent width; a little right padding keeps the ripple off the label.
- return Align(
- alignment: Alignment.centerLeft,
- child: InkWell(
- mouseCursor: WidgetStateMouseCursor.clickable,
- onTap: onTap,
- borderRadius: BorderRadius.circular(8),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(0, 4, 4, 4),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- Icon(Icons.chevron_left, size: 18, color: BrandColors.primary),
- const SizedBox(width: 2),
- Text(
- label,
- style: TextStyle(
- fontFamily: 'Ubuntu',
- fontSize: 12.5,
- height: 1,
- fontWeight: FontWeight.w500,
- color: BrandColors.primary,
- ),
- ),
- ],
- ),
- ),
- ),
- );
- }
+/// The chrome for wallet_ui's shared sub-pages (the legal pages): the back
+/// links' strings, and Settings' place in the sidebar when opened from there.
+SubPageChrome subPageChrome(BuildContext context) {
+ final i18n = AppLocalizations.of(context)!;
+ return SubPageChrome(
+ back: i18n.back,
+ parent: i18n.navigationBarSettings,
+ desktopShell: (page) => DesktopShell(active: DesktopNav.settings, child: page),
+ );
}
/// Two-pane desktop chrome: a fixed left sidebar (brand, nav, Tor status,
### lib/screens/privacy_policy.dart
@@ -1,177 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:skylight_wallet/l10n/app_localizations.dart';
-import 'package:skylight_wallet/screens/desktop/home_shell.dart';
-import 'package:skylight_wallet/util/platform.dart';
-import 'package:skylight_wallet/widgets/ui/ui.dart';
-
-class BulletList extends StatelessWidget {
- final List<String> items;
- const BulletList({super.key, required this.items});
-
- Widget _buildBullet(String text) {
- return Padding(
- padding: EdgeInsets.symmetric(vertical: 4.0),
- child: Row(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Padding(
- padding: EdgeInsets.only(top: 6.0, right: 8.0),
- child: Icon(Icons.circle, size: 8),
- ),
- Expanded(child: Text(text, style: TextStyle(fontSize: 14))),
- ],
- ),
- );
- }
-
- @override
- Widget build(BuildContext context) {
- return Padding(
- padding: EdgeInsets.only(bottom: 10.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: items.map(_buildBullet).toList(),
- ),
- );
- }
-}
-
-class PrivacyPolicy extends StatelessWidget {
- const PrivacyPolicy({super.key});
-
- TextStyle get headingStyle => TextStyle(fontSize: 20, fontWeight: FontWeight.bold);
-
- TextStyle get subheadingStyle => TextStyle(fontSize: 16, fontWeight: FontWeight.w600);
-
- TextStyle get bodyStyle => TextStyle(fontSize: 14, height: 1.4);
-
- TextStyle get monospaceStyle => TextStyle(fontSize: 13, fontFamily: 'Ubuntu Mono', height: 1.4);
-
- Widget sectionHeading(String text) => Padding(
- padding: EdgeInsets.only(top: 18.0, bottom: 6.0),
- child: Text(text, style: subheadingStyle),
- );
-
- Widget paragraph(String text) => Padding(
- padding: EdgeInsets.only(bottom: 10.0),
- child: Text(text, style: bodyStyle),
- );
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
- final scroll = SingleChildScrollView(
- padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('Updated 2026-09-03', style: bodyStyle),
- SizedBox(height: 32),
-
- paragraph(
- 'MAGIC Grants (“we”) respect your privacy and are committed to protecting it through our compliance with this policy.',
- ),
- paragraph(
- 'This policy applies to information we collect through your direct use of the Skylight Wallet and/or Spice Wallet app (the "App"). It does not apply to information we collect by any other means. This policy is subject to change, so make sure to periodically review this policy.',
- ),
-
- sectionHeading('Information We Do Not Collect'),
- paragraph(
- 'We do not collect any usage data. The App does not send any private keys, including private spend keys, mnemonic seeds, and private view keys to MAGIC Grants. The App does not connect to any servers run by MAGIC Grants.',
- ),
- paragraph('You do not need to make an account with MAGIC Grants to use the app.'),
- paragraph(
- 'MAGIC Grants may be able to review information provided by the App Store that you are using, if you download this app from an App Store.',
- ),
-
- sectionHeading('Information You May Share with Third Parties'),
- paragraph(
- 'When using the App, you need to specify a server (or servers) to connect to. The information shared with a server will depend on the cryptocurrency network that you are configuring and connecting to, but it could include sensitive information including your cryptocurrency address(es), your private view key(s), and your transaction data. This is necessary for the core functionality of the App.',
- ),
- paragraph(
- 'You can choose to only connect to the cryptocurrency networks that you choose. It is not necessary to connect to any particular cryptocurrency network to use the App.',
- ),
- paragraph(
- 'MAGIC Grants does not provide default servers. You must research the servers that you want to use and any terms of service or privacy policies associated with those servers before you connect to those servers.',
- ),
- paragraph(
- 'In many cases, you may choose to avoid using a third party by connecting to servers that you operate. For example, instead of connecting to a node operated by a third party, you can connect to a node operated by you.',
- ),
-
- sectionHeading('Other Connections to Third Parties'),
- paragraph(
- 'The App optionally connects to services provided by third parties for your convenience. These include:',
- ),
- BulletList(
- items: [
- 'Block explorers, to display network and transaction information.',
- 'Nodes, to display network and transaction information.',
- 'Price quotes, to display richer information about your transactions.',
- ],
- ),
- paragraph(
- 'Within the App, connections to these services can be configured to be routed over the Tor network, which helps improve your privacy. However, MAGIC Grants does not warrant that these connections are bug-free, or that these protections are fit for a particular purpose. Please be mindful of the third party connections that you make when using the App. The App may contain links to websites that, when clicked, open outside of Tor in your default web browser.',
- ),
- paragraph(
- 'Some third party connections, such as the price quotes, can be disabled in App settings.',
- ),
- paragraph(
- 'When you connect to third parties, you must abide by their terms of service and privacy policies.',
- ),
-
- sectionHeading('When You Contact Us'),
- paragraph(
- 'There is no mechanism for contacting us within the App. If you contact us through a different means, then we may learn and retain information about you, such as your email address, account identifier, and the contents of your communications.',
- ),
- paragraph(
- 'Before sending any app diagnostic logs, make sure to review their contents for any potentially sensitive information. Remove this information before sending any information to us.',
- ),
- ],
- ),
- );
-
- final inShell = ModalRoute.of(context)?.settings.arguments == true;
- final header = isDesktop
- ? Padding(
- padding: const EdgeInsets.fromLTRB(16, 10, 16, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- DesktopBackLink(
- label: inShell ? i18n.navigationBarSettings : i18n.back,
- onTap: () => Navigator.pop(context),
- ),
- const SizedBox(height: 12),
- Text(i18n.welcomePrivacyLink, style: desktopTitleStyle),
- ],
- ),
- )
- : Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
- child: BrandScreenHeader(
- onBack: () => Navigator.pop(context),
- center: Text(i18n.welcomePrivacyLink, style: BrandText.appBar.copyWith(fontSize: 16)),
- ),
- );
- final body = SafeArea(
- child: Center(
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 520),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- header,
- Expanded(child: scroll),
- ],
- ),
- ),
- ),
- );
-
- if (isDesktop && inShell) {
- return DesktopShell(active: DesktopNav.settings, child: body);
- }
- return Scaffold(backgroundColor: BrandColors.paper, body: body);
- }
-}
### lib/screens/settings.dart
@@ -587,11 +587,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
SettingsNavTile(
title: i18n.settingsLicensesLabel,
- onTap: () => showLicensePage(
- context: context,
- applicationName: 'Skylight Wallet',
- applicationVersion: _appVersion,
- ),
+ onTap: () => Navigator.pushNamed(context, '/open_source_licenses', arguments: true),
),
],
),
### lib/screens/terms_of_service.dart
@@ -1,196 +0,0 @@
-import 'package:flutter/material.dart';
-
-import 'package:skylight_wallet/l10n/app_localizations.dart';
-import 'package:skylight_wallet/screens/desktop/home_shell.dart';
-import 'package:skylight_wallet/util/platform.dart';
-import 'package:skylight_wallet/widgets/ui/ui.dart';
-
-class TermsOfService extends StatelessWidget {
- const TermsOfService({super.key});
-
- TextStyle get headingStyle => TextStyle(fontSize: 20, fontWeight: FontWeight.bold);
-
- TextStyle get subheadingStyle => TextStyle(fontSize: 16, fontWeight: FontWeight.w600);
-
- TextStyle get bodyStyle => TextStyle(fontSize: 14, height: 1.4);
-
- TextStyle get monospaceStyle => TextStyle(fontSize: 13, fontFamily: 'Ubuntu Mono', height: 1.4);
-
- Widget sectionHeading(String text) => Padding(
- padding: EdgeInsets.only(top: 18.0, bottom: 6.0),
- child: Text(text, style: subheadingStyle),
- );
-
- Widget paragraph(String text) => Padding(
- padding: EdgeInsets.only(bottom: 10.0),
- child: Text(text, style: bodyStyle),
- );
-
- @override
- Widget build(BuildContext context) {
- final i18n = AppLocalizations.of(context)!;
- final scroll = SingleChildScrollView(
- padding: const EdgeInsets.symmetric(horizontal: 16.0, vertical: 20.0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- Text('Updated 2026-09-03', style: bodyStyle),
- SizedBox(height: 12),
-
- sectionHeading('Acceptance'),
- paragraph(
- 'These Terms of Service (ToS) are entered into by and between You and MAGIC Grants, a Colorado nonprofit corporation (“we” or “us”). These terms govern your access to and use of Skylight Wallet and Spice Wallet (the “App”).',
- ),
- paragraph(
- 'Please read the Terms of Service carefully before you start to use the App. By using the App you accept and agree to be bound and abide by these Terms of Service and our Privacy Policy. If you do not agree to these Terms of Service or the Privacy Policy, then you must not access or use the App.',
- ),
-
- sectionHeading('Updates to the Terms of Service'),
- paragraph(
- 'We may revise and update these Terms of Service from time to time in our sole discretion. All changes are effective immediately when we post them, and apply to all access to and use of the App thereafter.',
- ),
- paragraph(
- 'Your continued use of the App following the posting of revised Terms of Service means that you accept and agree to the changes. You are expected to check this page from time to time so you are aware of any changes, as they are binding on you.',
- ),
-
- sectionHeading('All MIT License Terms Apply'),
- paragraph(
- 'The App is released under the MIT open source license permission notice, incorporated below:',
- ),
-
- Container(
- width: double.infinity,
- margin: EdgeInsets.only(bottom: 10.0),
- decoration: BoxDecoration(borderRadius: BorderRadius.circular(6.0)),
- child: Text(
- 'THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.',
- style: monospaceStyle,
- ),
- ),
-
- sectionHeading('No Financial or Legal Advice'),
- paragraph(
- 'MAGIC Grants does not provide any financial or legal advice in connection with the App. You are responsible for all of your actions when using the App.',
- ),
-
- sectionHeading('Security and Network Risks'),
- paragraph(
- 'You are fully responsible for the security of your funds when using the App. You agree that MAGIC Grants is not liable for your loss of funds, including due to any bugs that are present in the application. You agree that MAGIC Grants has not warranted that the App is secure for any particular purpose, including your desired purpose. You acknowledge that MAGIC Grants has not claimed that the App is bug-free.',
- ),
- paragraph(
- 'You acknowledge that MAGIC Grants is not responsible for any loss of funds or other harms that could arise from related networks and software, including but not limited to the cryptocurrency networks that you connect to. These networks may have bugs (including severe ones which could lead to loss of funds or dilution of value), and infrastructure that you connect to can be malicious. Cryptocurrency networks may charge you fees, and you can lose value through value fluctuations and volatility, impermanent loss, slippage, and other market factors which may be very complex. You agree that MAGIC Grants is not liable for any of these issues. By interacting with these cryptocurrency networks, you agree that you are accepting all of the risks of these networks and accepting full responsibility for understanding them.',
- ),
- paragraph(
- 'You acknowledge that MAGIC Grants offers no warranty of any kind, without limitation, for performance or security of the App or these cryptocurrency networks, even cryptocurrency networks that MAGIC Grants has commissioned security reviews for and cryptocurrency networks that MAGIC Grants runs our own nodes for.',
- ),
-
- sectionHeading('No Custody by MAGIC Grants'),
- paragraph(
- 'MAGIC Grants does not have custody of your funds while you are using the App. The App is software that intends to allow you to manage your self-custody wallets. MAGIC Grants does not transmit funds for you. MAGIC Grants is not an exchange or money services business (MSB).',
- ),
- paragraph(
- 'If you use any feature in the App named swap, trade, exchange, add liquidity, remove liquidity, bridge, or similar, you acknowledge that MAGIC Grants is not involved with nor performing these activities/actions whatsoever. The App may include features that you may use to interact with decentralized exchanges; however, MAGIC Grants is not a party nor counterparty to these transactions. The App is solely software that allows you to connect to relevant cryptocurrency networks through mechanisms that you specify, and you have full, independent control over how you decide to connect.',
- ),
- paragraph(
- 'MAGIC Grants may run our own nodes for various cryptocurrency networks, but MAGIC Grants does not include our nodes or any default nodes in the App. Even in cases where you create transactions in the App that are processed or reviewed in any way by MAGIC Grants nodes (which is a standard function of nodes on a cryptocurrency network), you agree that MAGIC Grants is not a party to your transaction, this action does not create any binding liability for MAGIC Grants, and MAGIC Grants is not responsible for performing any service to you.',
- ),
- paragraph(
- 'Cryptocurrencies exist only by virtue of the ownership record maintained in their respective networks. Any transfer of title in cryptocurrency occurs within a decentralized cryptocurrency network.',
- ),
-
- sectionHeading('Restricted Use'),
- paragraph(
- 'You may not use the App if it is prohibited in your jurisdiction. You may not use the App in connection with an illegal purpose. You are responsible for compliance with local laws and regulations.',
- ),
-
- sectionHeading('Third Party Services'),
- paragraph(
- 'The App includes links to other sites and resources provided by third parties, and the App incorporates information provided by third parties for convenience. MAGIC Grants does not guarantee that these sites, resources, and information are accurate or fit for Your desired purpose. We have no control over the contents of those sites or resources, and you agree that we have no responsibility for them or for any loss or damage that may arise from your use of them. If you decide to access any of the third-party services linked in this App, you do so entirely at your own risk and subject to the terms and conditions of use for such Apps.',
- ),
-
- sectionHeading('Tax Matters'),
- paragraph(
- 'The users of the App are solely responsible in determining what, if any, taxes apply to their cryptocurrency transactions. We are not responsible for determining any taxes that apply to such transactions.',
- ),
- paragraph(
- 'If you donate to MAGIC Grants, a 501(c)(3) public charity, your donation may qualify for a tax deduction. Additional paperwork, especially for cryptocurrency donations, may be required. If you choose to donate to MAGIC Grants as a part of any other activity in the App, such as any transaction you make that includes a donation to MAGIC Grants, you acknowledge that the sole involvement by MAGIC Grants for such transactions is to receive your donation, and that MAGIC Grants is not otherwise party to nor responsible for your transaction in any other way.',
- ),
-
- sectionHeading('Indemnification'),
- paragraph(
- "You agree to defend, indemnify, and hold harmless MAGIC Grants, its affiliates, licensors, and service providers, and its and their respective officers, directors, employees, contractors, agents, licensors, suppliers, successors, and assigns from and against any claims, liabilities, damages, judgments, awards, losses, costs, expenses, or fees (including reasonable attorneys' fees) arising out of or relating to your violation of these Terms of Service or your use of the App, including, but not limited to, any use of the App's content, services, and products other than as expressly authorized in these Terms of Service, or your use of any information obtained from the App.",
- ),
-
- sectionHeading('Governing Law and Jurisdiction'),
- paragraph(
- 'All matters relating to the App and these Terms of Service, and any dispute or claim arising therefrom or related thereto (in each case, including non-contractual disputes or claims), shall be governed by and construed in accordance with the internal laws of the State of Colorado without giving effect to any choice or conflict of law provision or rule (whether of the State of Colorado or any other jurisdiction).',
- ),
- paragraph(
- 'Any legal suit, action, or proceeding arising out of, or related to, these Terms of Service or the App shall be instituted exclusively in the federal courts of the United States or the courts of the State of Colorado, although we retain the right to bring any suit, action, or proceeding against you for breach of these Terms of Service in your country of residence or any other relevant country. You waive any and all objections to the exercise of jurisdiction over you by such courts and to venue in such courts.',
- ),
-
- sectionHeading('Arbitration'),
- paragraph(
- 'At our sole discretion, we may require You to submit any disputes arising from these Terms of Service or use of the App, including disputes arising from or concerning their interpretation, violation, invalidity, non-performance, or termination, to final and binding arbitration under the Rules of Arbitration of the American Arbitration Association applying Colorado law.',
- ),
-
- sectionHeading('Waiver and Severability'),
- paragraph(
- 'No waiver by MAGIC Grants of any term or condition set out in these Terms of Service shall be deemed a further or continuing waiver of such term or condition or a waiver of any other term or condition, and any failure of MAGIC Grants to assert a right or provision under these Terms of Service shall not constitute a waiver of such right or provision.',
- ),
- paragraph(
- 'If any provision of these Terms of Service is held by a court or other tribunal of competent jurisdiction to be invalid, illegal, or unenforceable for any reason, such provision shall be eliminated or limited to the minimum extent such that the remaining provisions of the Terms of Service will continue in full force and effect.',
- ),
-
- sectionHeading('Entire Agreement'),
- paragraph(
- 'The Terms of Service and our Privacy Policy constitute the sole and entire agreement between You and MAGIC Grants regarding the App and supersede all prior and contemporaneous understandings, agreements, representations, and warranties, both written and oral, regarding the App.',
- ),
- ],
- ),
- );
-
- final inShell = ModalRoute.of(context)?.settings.arguments == true;
- final header = isDesktop
- ? Padding(
- padding: const EdgeInsets.fromLTRB(16, 10, 16, 0),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- DesktopBackLink(
- label: inShell ? i18n.navigationBarSettings : i18n.back,
- onTap: () => Navigator.pop(context),
- ),
- const SizedBox(height: 12),
- Text(i18n.welcomeTermsLink, style: desktopTitleStyle),
- ],
- ),
- )
- : Padding(
- padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 6),
- child: BrandScreenHeader(
- onBack: () => Navigator.pop(context),
- center: Text(i18n.welcomeTermsLink, style: BrandText.appBar.copyWith(fontSize: 16)),
- ),
- );
- final body = SafeArea(
- child: Center(
- child: ConstrainedBox(
- constraints: const BoxConstraints(maxWidth: 520),
- child: Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: [
- header,
- Expanded(child: scroll),
- ],
- ),
- ),
- ),
- );
-
- if (isDesktop && inShell) {
- return DesktopShell(active: DesktopNav.settings, child: body);
- }
- return Scaffold(backgroundColor: BrandColors.paper, body: body);
- }
-}
### lib/screens/wallet_home.dart
@@ -40,9 +40,10 @@ typedef _HomeValues = ({
_HomeValues _deriveHome(AppWallet wallet, FiatRateModel fiatRate) {
final unlockedBalance = wallet.unlockedBalance ?? 0;
- final unlockedBalanceFiat = fiatRate.rateFor('XMR') is double && wallet.unlockedBalance is double
- ? wallet.unlockedBalance! * fiatRate.rateFor('XMR')!
- : null;
+ // Priced as soon as the rate is in, like the coin amount: $0 while the
+ // balance is still syncing, not the placeholder.
+ final rate = fiatRate.rateFor('XMR');
+ final unlockedBalanceFiat = rate != null ? unlockedBalance * rate : null;
var status = StatusIconStatus.fail;
if (wallet.isFullySynced) {
### lib/wallet_core_glue.dart
@@ -6,7 +6,6 @@ import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
import 'package:skylight_wallet/models/app_wallet.dart';
-import 'package:skylight_wallet/models/fiat_rate_model.dart';
import 'package:skylight_wallet/models/monero_wallet_adapter.dart';
import 'package:skylight_wallet/widgets/tx_details.dart' show TxDetailsDialog;
import 'package:skylight_wallet/periodic_tasks.dart'
@@ -15,7 +14,6 @@ import 'package:skylight_wallet/services/foreground_sync_service.dart'
show foregroundSyncCallback, stopSyncAndDeleteWallets, restartForegroundSyncIfRunning;
import 'package:skylight_wallet/services/notifications_service.dart';
import 'package:skylight_wallet/services/shared_preferences_service.dart';
-import 'package:skylight_wallet/services/tor_service.dart';
import 'package:skylight_wallet/services/tor_settings_service.dart';
import 'package:wallet_infra/wallet_infra.dart' as wcore;
@@ -78,7 +76,7 @@ void installWalletCore() {
coins: () => [MoneroWallet()],
workmanagerCallback: backgroundDispatcher,
foregroundCallback: foregroundSyncCallback,
- ensureTorConnected: _ensureTorConnected,
+ ensureTorConnected: TorSettingsService.sharedInstance.ensureConnected,
iosBundleId: 'org.magicgrants.skylightwallet',
foregroundTitle: 'Skylight Wallet',
foregroundIcon: const NotificationIcon(
@@ -120,37 +118,10 @@ void installWalletCore() {
};
}
-/// Brings skylight's Tor up and reports whether it connected — the seam
-/// `wallet_background` uses so a background isolate starts the *same* Tor the
-/// wallet connects through. (Background open + the node/Tor gate now live inside
-/// `wallet_background`.)
-Future<bool> _ensureTorConnected() async {
- final settings = TorSettingsService.sharedInstance;
- await settings.ensureLoaded();
- if (settings.torMode != TorMode.builtIn) {
- // External: the proxy is the user's, and `getProxy` fails closed if it is
- // not usable. Disabled: there is no Tor to report.
- return settings.torMode == TorMode.external;
- }
-
- await TorService.sharedInstance.start();
- return TorService.sharedInstance.waitUntilConnected(timeout: const Duration(minutes: 2));
-}
-
/// The wallet-core [WalletManager] provider.
ChangeNotifierProvider<WalletManager> walletManagerProvider() =>
ChangeNotifierProvider(create: (_) => WalletManager(coins: () => [MoneroWallet()]));
-/// Attaches the [WalletManager] to the fiat model so it fetches rates for the
-/// active coins (XMR). Call once at startup; the model stays attached, so every
-/// `FiatRateModel.startService()` afterwards needs no manager argument.
-void attachFiatWalletManager(BuildContext context) {
- Provider.of<FiatRateModel>(
- context,
- listen: false,
- ).attachWalletManager(Provider.of<WalletManager>(context, listen: false));
-}
-
/// Startup for the wallet-core stack: whether a wallet exists (for the initial
/// route) and, on mobile, opening + starting its sync.
Future<bool> startupWalletManager(BuildContext context) =>
### lib/widgets/sync_frequency_sheet.dart
@@ -14,7 +14,6 @@ import 'package:skylight_wallet/widgets/ui/ui.dart';
SyncFrequencyLabels syncFrequencyLabels(AppLocalizations i18n) => SyncFrequencyLabels(
title: i18n.settingsSyncFrequencyLabel,
subtitle: i18n.syncFrequencySheetSubtitle,
- modeLabel: i18n.syncFrequencyModeLabel,
continuous: i18n.syncFrequencyContinuous,
continuousDesc: i18n.syncFrequencyContinuousDesc,
periodic: i18n.syncFrequencyPeriodic,
### test/route_policy_test.dart
@@ -48,6 +48,7 @@ void main() {
'/secret_keys',
'/advanced_security',
'/metadata_backup',
+ '/open_source_licenses',
]) {
expect(routePolicy.requiresUnlock(name), isTrue, reason: name);
expect(routePolicy.allows(name, unlocked: false), isFalse, reason: name);Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.