Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
3155dab
feat: add new font families
dewabisma Apr 10, 2026
6c5b673
feat: remove accentPink, add accentOrange, update checksum color
dewabisma Apr 10, 2026
89192a4
feat: update background color
dewabisma Apr 10, 2026
f734185
feat: updated icon button
dewabisma Apr 10, 2026
c57b838
feat: update standard button
dewabisma Apr 10, 2026
e005f88
feat: update send and receive
dewabisma Apr 12, 2026
cb71838
feat: finish updating activity section
dewabisma Apr 12, 2026
f1cba5b
chore: formatting
dewabisma Apr 12, 2026
6642684
chore: ignore linter for secondary font family yet used
dewabisma Apr 12, 2026
01d2e21
feat: revert number format to trailing
dewabisma Apr 12, 2026
4b51e4c
feat: improve balance loading
dewabisma Apr 13, 2026
9bd0554
Merge branch 'main' of https://github.com/Quantus-Network/quantus-app…
dewabisma Apr 15, 2026
a9f2870
fix: migration dialog button
dewabisma Apr 15, 2026
aeb7e29
feat: address reviews
dewabisma Apr 15, 2026
836d97c
feat: add geist font license
dewabisma Apr 15, 2026
6af5a54
WIP: currency system
dewabisma Apr 15, 2026
7effe0f
feat: finish updating currency display
dewabisma Apr 15, 2026
60e7353
chore: formatting
dewabisma Apr 15, 2026
53238bf
Merge branch 'feat/v3' of https://github.com/Quantus-Network/quantus-…
dewabisma Apr 20, 2026
71a1999
feat: resolved PR review issues
dewabisma Apr 20, 2026
9601a80
feat: remove asset declaration
dewabisma Apr 20, 2026
4cb2b5e
feat: add myr to fiat currency
dewabisma Apr 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added mobile-app/assets/fonts/Geist-Bold.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/Geist-Light.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/Geist-Medium.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/Geist-Regular.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/Geist-SemiBold.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/GeistMono-Bold.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/GeistMono-Light.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/GeistMono-Medium.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/GeistMono-Regular.ttf
Binary file not shown.
Binary file added mobile-app/assets/fonts/GeistMono-SemiBold.ttf
Binary file not shown.
92 changes: 92 additions & 0 deletions mobile-app/assets/fonts/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Copyright (c) 2023 Vercel, in collaboration with basement.studio

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL

-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------

PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.

The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.

DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.

"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).

"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).

"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.

"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.

PERMISSION AND CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:

1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.

2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.

3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.

4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.

5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.

TERMINATION
This license becomes null and void if any of the above conditions are
not met.

DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.
3 changes: 1 addition & 2 deletions mobile-app/assets/v2/action_receive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 1 addition & 2 deletions mobile-app/assets/v2/action_send.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed mobile-app/assets/v2/glass_button_wide_340_bg.png
Binary file not shown.
Binary file removed mobile-app/assets/v2/glass_circle_icon_button_bg.png
Binary file not shown.
6 changes: 3 additions & 3 deletions mobile-app/lib/features/components/migration_dialog.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flutter/material.dart';
import 'package:quantus_sdk/quantus_sdk.dart';
import 'package:resonance_network_wallet/v2/components/glass_button.dart';
import 'package:resonance_network_wallet/v2/components/quantus_button.dart';
import 'package:resonance_network_wallet/v2/theme/app_colors.dart';
import 'package:resonance_network_wallet/v2/theme/app_text_styles.dart';

Expand Down Expand Up @@ -76,7 +76,7 @@ class _MigrationDialogState extends State<MigrationDialog> {
decoration: BoxDecoration(color: colors.error.useOpacity(0.15), borderRadius: BorderRadius.circular(8)),
child: Text(_errorMessage!, style: text.smallParagraph?.copyWith(color: colors.textError)),
),
GlassButton.simple(
QuantusButton.simple(
label: _errorMessage != null ? 'Retry' : 'Migrate Accounts',
isLoading: _isMigrating,
onTap: () async {
Expand All @@ -96,7 +96,7 @@ class _MigrationDialogState extends State<MigrationDialog> {
),
if (_errorMessage != null) ...[
const SizedBox(height: 12),
GlassButton.simple(
QuantusButton.simple(
label: 'Try later',
variant: ButtonVariant.transparent,
onTap: () async {
Expand Down
54 changes: 54 additions & 0 deletions mobile-app/lib/models/fiat_currency.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/// Fiat currencies the app can convert QUAN amounts into.
///
/// QUAN itself is not listed here — it is always the native side.
/// Adding a new currency only requires a new enum case here and a matching
/// rate in [ExchangeRateService]. No widget or provider changes are needed.
Comment thread
dewabisma marked this conversation as resolved.
enum FiatCurrency {
usd(code: 'USD', symbol: '\$', symbolPosition: SymbolPosition.prefix),
myr(code: 'MYR', symbol: 'RM', symbolPosition: SymbolPosition.prefix),
idr(code: 'IDR', symbol: 'Rp', symbolPosition: SymbolPosition.prefix),
jpy(code: 'JPY', symbol: '¥', symbolPosition: SymbolPosition.prefix),
eur(code: 'EUR', symbol: '€', symbolPosition: SymbolPosition.prefix),
gbp(code: 'GBP', symbol: '£', symbolPosition: SymbolPosition.prefix);

const FiatCurrency({required this.code, required this.symbol, required this.symbolPosition});

/// ISO 4217 code, e.g. "USD", "IDR". Used for persistence and display.
final String code;

/// The display symbol, e.g. "$", "Rp", "¥".
final String symbol;

final SymbolPosition symbolPosition;

/// Wraps a pre-formatted numeric [amount] string with this currency's symbol.
///
/// Example:
/// FiatCurrency.usd.format('1,250.00') → '$1,250.00'
/// FiatCurrency.idr.format('1,250') → 'Rp1,250'
String format(String amount) => switch (symbolPosition) {
SymbolPosition.prefix => '$symbol$amount',
SymbolPosition.suffix => '$amount $symbol',
};

/// Same as [format] but prepends a `+` or `-` sign. Used for transaction
/// list items where direction matters.
///
/// Example:
/// FiatCurrency.usd.formatSigned('1,250.00', isSend: true) → '-$1,250.00'
/// FiatCurrency.usd.formatSigned('1,250.00', isSend: false) → '+$1,250.00'
String formatSigned(String amount, {required bool isSend}) {
final sign = isSend ? '-' : '+';
return switch (symbolPosition) {
SymbolPosition.prefix => '$sign$symbol$amount',
SymbolPosition.suffix => '$sign$amount $symbol',
};
}

/// Looks up a [FiatCurrency] by its [code], returning [fallback] if not found.
static FiatCurrency fromCode(String code, {FiatCurrency fallback = FiatCurrency.usd}) {
return FiatCurrency.values.firstWhere((c) => c.code == code, orElse: () => fallback);
}
}

enum SymbolPosition { prefix, suffix }
193 changes: 193 additions & 0 deletions mobile-app/lib/providers/currency_display_provider.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
import 'package:decimal/decimal.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:quantus_sdk/quantus_sdk.dart';
import 'package:resonance_network_wallet/models/fiat_currency.dart';
import 'package:resonance_network_wallet/providers/wallet_providers.dart';
import 'package:resonance_network_wallet/services/exchange_rate_service.dart';

// ---------------------------------------------------------------------------
// Exchange rate service provider
// ---------------------------------------------------------------------------

final exchangeRateServiceProvider = Provider<ExchangeRateService>((ref) {
return ExchangeRateService();
});

// ---------------------------------------------------------------------------
// Selected fiat currency provider
// ---------------------------------------------------------------------------

/// Persists and exposes the user's chosen fiat currency for conversions.
/// Defaults to [FiatCurrency.usd] when no preference has been saved.
///
/// To change the active fiat currency (e.g. from a settings screen):
/// ref.read(selectedFiatCurrencyProvider.notifier).select(FiatCurrency.idr);
final selectedFiatCurrencyProvider = StateNotifierProvider<SelectedFiatCurrencyNotifier, FiatCurrency>((ref) {
final settings = ref.watch(settingsServiceProvider);
return SelectedFiatCurrencyNotifier(settings);
});

class SelectedFiatCurrencyNotifier extends StateNotifier<FiatCurrency> {
final SettingsService _settings;

SelectedFiatCurrencyNotifier(this._settings) : super(_load(_settings));

/// Persists and applies [currency] as the active fiat currency.
Future<void> select(FiatCurrency currency) async {
await _settings.setSelectedFiatCurrency(currency.code);
state = currency;
}

static FiatCurrency _load(SettingsService settings) {
final code = settings.getSelectedFiatCurrency();
if (code == null) return FiatCurrency.usd;
return FiatCurrency.fromCode(code);
}
}

// ---------------------------------------------------------------------------
// Currency flip provider
// ---------------------------------------------------------------------------

/// Whether fiat is shown as the primary (large) display and QUAN secondary.
///
/// false → primary = QUAN, secondary = fiat (default)
/// true → primary = fiat, secondary = QUAN
///
/// To toggle from the swap button:
/// ref.read(isCurrencyFlippedProvider.notifier).toggle();
final isCurrencyFlippedProvider = StateNotifierProvider<IsCurrencyFlippedNotifier, bool>((ref) {
final settings = ref.watch(settingsServiceProvider);
return IsCurrencyFlippedNotifier(settings);
});

class IsCurrencyFlippedNotifier extends StateNotifier<bool> {
final SettingsService _settings;

IsCurrencyFlippedNotifier(this._settings) : super(_settings.isCurrencyFlipped());

Future<void> toggle() async {
final next = !state;
await _settings.setCurrencyFlipped(next);
state = next;
}

Future<void> setFlipped(bool value) async {
await _settings.setCurrencyFlipped(value);
state = value;
}
}

// ---------------------------------------------------------------------------
// Display state
// ---------------------------------------------------------------------------

/// The fully-resolved display state for the active account's balance.
///
/// Widgets render [primaryAmount] and [secondaryAmount] directly.
/// No conversion math belongs in widgets.
class CurrencyDisplayState {
final String primaryAmount;
final String secondaryAmount;
final bool isFlipped;
final FiatCurrency selectedFiat;

const CurrencyDisplayState({
required this.primaryAmount,
required this.secondaryAmount,
required this.isFlipped,
required this.selectedFiat,
});

CurrencyDisplayState copyWith({
String? primaryAmount,
String? secondaryAmount,
bool? isFlipped,
FiatCurrency? selectedFiat,
}) => CurrencyDisplayState(
primaryAmount: primaryAmount ?? this.primaryAmount,
secondaryAmount: secondaryAmount ?? this.secondaryAmount,
isFlipped: isFlipped ?? this.isFlipped,
selectedFiat: selectedFiat ?? this.selectedFiat,
);
}

// ---------------------------------------------------------------------------
// Balance display provider
// ---------------------------------------------------------------------------

final _hiddenAmountText = '- - - - -';

/// Combines balance, hidden state, flip state, selected fiat, and exchange
/// rate into [CurrencyDisplayState] ready for widgets to render.
final currencyDisplayProvider = Provider<AsyncValue<CurrencyDisplayState>>((ref) {
final balanceAsync = ref.watch(balanceProvider);
final isHidden = ref.watch(isBalanceHiddenProvider);
final isFlipped = ref.watch(isCurrencyFlippedProvider);
final selectedFiat = ref.watch(selectedFiatCurrencyProvider);
final fmt = ref.watch(numberFormattingServiceProvider);
final xRate = ref.watch(exchangeRateServiceProvider);

return balanceAsync.when(
loading: () => const AsyncValue.loading(),
error: (err, stack) => AsyncValue.error(err, stack),
data: (balance) {
final quanFormatted = fmt.formatBalance(balance, addSymbol: isFlipped);
final fiatFormatted = selectedFiat.format(_toFiatNumeric(balance, selectedFiat, xRate));

CurrencyDisplayState data = CurrencyDisplayState(
primaryAmount: isFlipped ? fiatFormatted : quanFormatted,
secondaryAmount: isFlipped ? quanFormatted : fiatFormatted,
isFlipped: isFlipped,
selectedFiat: selectedFiat,
);

if (isHidden) {
data = data.copyWith(primaryAmount: _hiddenAmountText, secondaryAmount: _hiddenAmountText);
}

return AsyncValue.data(data);
},
);
});

// ---------------------------------------------------------------------------
// Per-amount formatter (for transaction items)
// ---------------------------------------------------------------------------

/// Formats a single transaction [amount] (raw BigInt) as a signed string
/// respecting the current hidden state, flip state, and selected fiat.
///
/// Usage:
/// final formatted = ref.watch(txAmountFormatterProvider)(amount, isSend: true);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure we ever want to show transaction items as fiat currency?!

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works the same purpose as the blance toggling between fiat and quan. I think it's reasonable to display it as fiat when they toggle the balance, it make it easier for some people to know how much they send or spend in fiat term.

It is also how the design in figma.

final txAmountFormatterProvider = Provider<String Function(BigInt, {required bool isSend})>((ref) {
final isHidden = ref.watch(isBalanceHiddenProvider);
final isFlipped = ref.watch(isCurrencyFlippedProvider);
final selectedFiat = ref.watch(selectedFiatCurrencyProvider);
final fmt = ref.watch(numberFormattingServiceProvider);
final xRate = ref.watch(exchangeRateServiceProvider);

return (BigInt amount, {required bool isSend}) {
if (isHidden) return _hiddenAmountText;

if (isFlipped) {
final numeric = _toFiatNumeric(amount, selectedFiat, xRate);
return selectedFiat.formatSigned(numeric, isSend: isSend);
}

final sign = isSend ? '-' : '+';
return '$sign${fmt.formatBalance(amount)} ${AppConstants.tokenSymbol}';
};
});

// ---------------------------------------------------------------------------
// Internal helpers
// ---------------------------------------------------------------------------

String _toFiatNumeric(BigInt rawBalance, FiatCurrency fiat, ExchangeRateService xRate) {
final scaleFactor = BigInt.from(10).pow(AppConstants.decimals);
final quantity = (Decimal.fromBigInt(rawBalance) / Decimal.fromBigInt(scaleFactor)).toDecimal();
final fiatValue = xRate.convert(quantity, fiat);

return fiatValue.toStringAsFixed(2);
}
Loading