Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5264eed
new buy/sell flow (wip)
malik1004x Jun 30, 2026
0c469f2
wip
malik1004x Jun 30, 2026
a2a0500
wip
malik1004x Jul 1, 2026
afbc6db
wip
malik1004x Jul 1, 2026
72c2899
new buy/sell
malik1004x Jul 3, 2026
1f4054d
reformat
malik1004x Jul 3, 2026
72b0844
fix decimals exception
malik1004x Jul 3, 2026
8405aa9
hide currency picker for single-currency wallets
malik1004x Jul 3, 2026
2c3ef1c
hide "more options" if no more options
malik1004x Jul 3, 2026
c3545b1
better error msg
malik1004x Jul 3, 2026
4b40365
add viewpadding for virtual keyboard
malik1004x Jul 3, 2026
5665e0e
merge
malik1004x Jul 14, 2026
4427a05
auto-reformat
malik1004x Jul 14, 2026
59eb3d7
wrap in popScope to prevent error on back button press
malik1004x Jul 17, 2026
fa9229e
dart fix
malik1004x Jul 17, 2026
c0830e7
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Jul 17, 2026
108363c
merge
malik1004x Jul 17, 2026
07d78b0
add space
malik1004x Jul 17, 2026
8616824
fix context passed to navigator
malik1004x Jul 17, 2026
0c34372
Merge branch 'refs/heads/dev' into cw-1440-new-buy-sell-flow
malik1004x Aug 6, 2026
399dabe
add if(mounted) guards
malik1004x Aug 11, 2026
1cf9787
add emojis to FiatCurrency
malik1004x Aug 11, 2026
a6abf1b
add new currency selection
malik1004x Aug 11, 2026
a56dab5
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Aug 11, 2026
694b8ea
move chain icon
malik1004x Aug 12, 2026
1089efe
ci
malik1004x Aug 17, 2026
78c1e77
fix text on fiat selector
malik1004x Aug 20, 2026
775041e
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Aug 20, 2026
b6c6f75
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Aug 20, 2026
5a15d56
Error: Not a constant expression.
malik1004x Aug 20, 2026
d3a2966
switch to safeParse
malik1004x Aug 21, 2026
bf3e2e1
guard for fiat amount being null
malik1004x Aug 21, 2026
6d28883
light mode fixes
malik1004x Aug 21, 2026
2a1b738
remove computed
malik1004x Aug 21, 2026
7cd5881
fix nano decimals
malik1004x Aug 21, 2026
f45db86
fix empty payment methods
malik1004x Aug 21, 2026
20ac39e
fix fallback icon for payment methods
malik1004x Aug 21, 2026
c1366a4
nullable amountForQuote
malik1004x Aug 22, 2026
e4b62b3
replace , with .
malik1004x Aug 22, 2026
0260f3d
tryParse
malik1004x Aug 23, 2026
08978a0
parentheses
malik1004x Aug 23, 2026
185ee4b
parse -> tryParse in fiat
malik1004x Aug 23, 2026
58579c1
Update lib/entities/fiat_currency.dart
malik1004x Aug 24, 2026
a8727d2
Update lib/entities/fiat_currency.dart
malik1004x Aug 24, 2026
91330b0
fix
malik1004x Aug 24, 2026
7eeb9c1
revert unrelated change
malik1004x Aug 24, 2026
cba928b
revert unrelated change
malik1004x Aug 24, 2026
c2441b1
showSymbol: false,
malik1004x Aug 26, 2026
09a3428
address review comments
malik1004x Aug 27, 2026
d286192
Merge branch 'refs/heads/dev' into cw-1440-new-buy-sell-flow
malik1004x Aug 27, 2026
7b5ffe8
import
malik1004x Aug 27, 2026
5474cfa
update translations
malik1004x Aug 31, 2026
9d4d122
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Sep 1, 2026
85b79a3
Merge branch 'dev' into cw-1440-new-buy-sell-flow
malik1004x Sep 11, 2026
8bbaa3f
tiny review fixes
malik1004x Sep 11, 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
4 changes: 2 additions & 2 deletions assets/images/skrill.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions cw_core/lib/amount/money.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import "dart:math";

import "package:cw_core/amount/utils.dart";
import "package:cw_core/crypto_amount_format.dart";
import "package:cw_core/crypto_currency.dart";
import "package:cw_core/currency.dart";
import "package:cw_core/format_fixed.dart";
Expand Down Expand Up @@ -58,6 +59,14 @@ class Money implements Comparable<Money> {
}
}

static Money? trySafeParse(source, Currency currency, {bool isBaseUnit = false}) {
final amount = isBaseUnit
? BigInt.tryParse(source.toString())
: tryParseFixed(source.toString().withDecimals(currency.decimals), currency.decimals);

return amount != null ? Money(amount, currency) : null;
}

final BigInt amount;
final Currency currency;

Expand Down
7 changes: 4 additions & 3 deletions lib/buy/buy_quote.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import 'package:cake_wallet/entities/calculate_fiat_amount.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/entities/provider_types.dart';
import 'package:cake_wallet/exchange/limits.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cw_core/crypto_currency.dart';

enum ProviderRecommendation { bestRate, lowKyc, successRate }
Expand All @@ -13,11 +14,11 @@ extension RecommendationTitle on ProviderRecommendation {
String get title {
switch (this) {
case ProviderRecommendation.bestRate:
return 'BEST RATE';
return S.current.best_rate;
case ProviderRecommendation.lowKyc:
return 'LOW KYC';
return S.current.low_kyc;
case ProviderRecommendation.successRate:
return 'HIGHEST SUCCESS RATE';
return S.current.highest_success_rate;
}
}
}
Expand Down
32 changes: 21 additions & 11 deletions lib/buy/payment_method.dart
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ extension PaymentTypeTitle on PaymentType {
case PaymentType.creditCard:
case PaymentType.debitCard:
case PaymentType.yellowCardBankTransfer:
return 'assets/images/card.svg';
return 'assets/new-ui/buy_payment_methods/debit_card.svg';
case PaymentType.bankTransfer:
return 'assets/images/bank_light.svg';
case PaymentType.skrill:
Expand All @@ -132,24 +132,34 @@ extension PaymentTypeTitle on PaymentType {
String? get darkIconPath {
switch (this) {
case PaymentType.all:
return 'assets/images/usd_round_dark.svg';
return 'assets/new-ui/buy_payment_methods/all_methods.svg';
case PaymentType.creditCard:
case PaymentType.debitCard:
case PaymentType.yellowCardBankTransfer:
return 'assets/images/card_dark.svg';
return 'assets/new-ui/buy_payment_methods/debit_card.svg';
case PaymentType.bankTransfer:
return 'assets/images/bank_dark.svg';
return 'assets/new-ui/buy_payment_methods/bank_transfer.svg';
case PaymentType.skrill:
return 'assets/images/skrill.svg';
case PaymentType.applePay:
return 'assets/images/apple_pay_round_dark.svg';
return 'assets/new-ui/buy_payment_methods/apple_pay.svg';
case PaymentType.googlePay:
return "assets/new-ui/buy_payment_methods/google_pay.svg";
case PaymentType.paypal:
return "assets/new-ui/buy_payment_methods/paypal.svg";
case PaymentType.revolutPay:
return 'assets/images/revolut_dark.svg';
default:
return null;
}
}

bool get isMonochromeIcon => [
"assets/new-ui/buy_payment_methods/all_methods.svg",
"assets/new-ui/buy_payment_methods/debit_card.svg",
"assets/new-ui/buy_payment_methods/bank_transfer.svg"
].contains(darkIconPath);

String? get description {
switch (this) {
default:
Expand Down Expand Up @@ -190,7 +200,7 @@ class PaymentMethod extends SelectableOption {
return PaymentMethod(
paymentMethodType: PaymentType.all,
customTitle: 'All Payment Methods',
customIconPath: 'assets/images/dollar_coin.svg');
customIconPath: 'assets/new-ui/buy_payment_methods/all_methods.svg');
}

factory PaymentMethod.fromOnramperJson(Map<String, dynamic> json) {
Expand All @@ -199,22 +209,22 @@ class PaymentMethod extends SelectableOption {
paymentMethodType: type ?? PaymentType.unknown,
customPaymentMethodType: json['paymentTypeId'] as String?,
customTitle: json['name'] as String? ?? 'Unknown',
customIconPath: json['icon'] as String? ?? 'assets/images/card.png',
customIconPath: json['icon'] as String? ?? 'assets/new-ui/buy_payment_methods/debit_card.svg',
customDescription: json['description'] as String?);
}

factory PaymentMethod.fromDFX(String paymentMethod, PaymentType paymentType) {
return PaymentMethod(
paymentMethodType: paymentType,
customTitle: paymentMethod,
customIconPath: 'assets/images/card.png');
customIconPath: 'assets/new-ui/buy_payment_methods/debit_card.svg');
}

factory PaymentMethod.fromMoonPayJson(Map<String, dynamic> json, PaymentType paymentType) {
return PaymentMethod(
paymentMethodType: paymentType,
customTitle: json['paymentMethod'] as String,
customIconPath: 'assets/images/card.png');
customIconPath: 'assets/new-ui/buy_payment_methods/debit_card.svg');
}

factory PaymentMethod.fromMeldJson(Map<String, dynamic> json) {
Expand All @@ -223,7 +233,7 @@ class PaymentMethod extends SelectableOption {
return PaymentMethod(
paymentMethodType: type ?? PaymentType.unknown,
customTitle: json['name'] as String? ?? 'Unknown',
customIconPath: logos['dark'] as String? ?? 'assets/images/card.png',
customIconPath: logos['dark'] as String? ?? 'assets/new-ui/buy_payment_methods/debit_card.svg',
customDescription: json['description'] as String?);
}

Expand All @@ -232,7 +242,7 @@ class PaymentMethod extends SelectableOption {
return PaymentMethod(
paymentMethodType: type ?? PaymentType.unknown,
customTitle: json['payment_method'] as String? ?? 'Unknown',
customIconPath: 'assets/images/card.png',
customIconPath: 'assets/new-ui/buy_payment_methods/debit_card.svg',
);
}

Expand Down
10 changes: 9 additions & 1 deletion lib/di.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ import 'package:cake_wallet/new-ui/new_dashboard.dart';
import 'package:cake_wallet/new-ui/pages/about_page.dart';
import 'package:cake_wallet/new-ui/pages/account_customizer.dart';
import 'package:cake_wallet/new-ui/pages/bridge/bridge_amount_page.dart';
import 'package:cake_wallet/new-ui/pages/bridge/bridge_network_page.dart';
import 'package:cake_wallet/new-ui/pages/bridge/bridge_receiving_wallet_page.dart';
import 'package:cake_wallet/new-ui/pages/buy_sell/buy_sell_amount_page.dart';
import 'package:cake_wallet/new-ui/pages/coin_control_page.dart';
import 'package:cake_wallet/new-ui/pages/addresses_page.dart';
import 'package:cake_wallet/new-ui/pages/home_page.dart';
Expand All @@ -65,6 +68,7 @@ import 'package:cake_wallet/new-ui/pages/lightning_username_page.dart';
import 'package:cake_wallet/new-ui/pages/receive_page.dart';
import 'package:cake_wallet/new-ui/viewmodels/lightning_username/lightning_username_bloc.dart';
import 'package:cake_wallet/new-ui/widgets/addresses_page/address_label_input.dart';
import 'package:cake_wallet/new-ui/widgets/buy_sell/buy_sell_selector_modal.dart';
import 'package:cake_wallet/new-ui/widgets/coins_page/assets_history/transaction_details_modal.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_label_modal.dart';
import 'package:cake_wallet/new-ui/pages/swap_page.dart';
Expand Down Expand Up @@ -1489,7 +1493,11 @@ Future<void> setup({

getIt.registerFactory(() => BuyAmountViewModel());

getIt.registerFactory(() => BuySellViewModel(getIt.get<AppStore>()));
getIt.registerFactoryParam<BuySellViewModel, BuySellPageMode, void>((mode, _) => BuySellViewModel(
mode: mode, getIt.get<AppStore>(), fiatConversionStore: getIt.get<FiatConversionStore>()));

getIt.registerFactoryParam<NewBuySellAmountPage, BuySellPageMode, void>((mode, _) =>
NewBuySellAmountPage(buySellViewModel: getIt.get<BuySellViewModel>(param1: mode)));

getIt.registerFactory(
() => BuySellPage(getIt.get<BuySellViewModel>(), getIt.get<AddressResolverService>()));
Comment thread
Blazebrain marked this conversation as resolved.
Expand Down
Loading
Loading