feat: extend coin picker to select other assets to send for swap (#3591)
What changed, and why it matters
This commit is a feature update for the Cake Wallet app that improves the currency/asset picker used when sending funds or swapping crypto. It lets users choose a different asset to send during a swap, shows which wallet the funds come from, refreshes balances when wallets change, and prevents hardware wallets from being used for Lightning deposits. The changes are mostly UI/UX and wallet-selection logic, with added unit tests. There is no indication of a security vulnerability in the diff.
No security action required. Treat as a normal feature/UX review. If auditing, verify that the new wallet-switching and refund-address fallback paths handle edge cases correctly and that balance matching by title+tag does not omit legitimate tokens.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch extends the currency picker to support selecting other assets for swap deposits, adds a nested ‘send another asset’ flow, updates balance display formatting, and synchronizes deposit state after wallet switches. Key logic changes include: depositWalletType/canFundDeposit helpers to resolve wallet type and exclude hardware wallets for Lightning; balanceForAsset now matches by both title and tag to avoid cross-chain balance confusion; swap page reacts to wallet/sync changes to refresh available amounts; switchToDepositWallet now awaits wallet switching, reports failures, and falls back to a refund address when the wallet cannot send the chosen asset. The commit also includes localization updates and new widget tests.
Changed components
lib/exchange/utils/deposit_wallet_utils.dartlib/new-ui/pages/send_page.dartlib/new-ui/pages/swap_page.dartlib/new-ui/widgets/currency_picker/*lib/new-ui/widgets/swap_page/swap_amount_box.dartlib/new-ui/widgets/swap_page/swap_address_selection_modal.dartlib/view_model/exchange/exchange_view_model.dartInspect captured patch +1127 / −437
### lib/exchange/utils/deposit_wallet_utils.dart
@@ -0,0 +1,20 @@
+import "package:cw_core/crypto_currency.dart";
+import "package:cw_core/wallet_info.dart";
+import "package:cw_core/wallet_type.dart";
+
+WalletType? depositWalletType(CryptoCurrency currency) {
+ final type = cryptoCurrencyOrTokenToWalletType(currency);
+ if (type != null) {
+ return type;
+ }
+
+ try {
+ return cryptoCurrencyOrTokenToWalletType(CryptoCurrency.fromString(currency.tag ?? ""));
+ } catch (_) {
+ return null;
+ }
+}
+
+// Same rule as ExchangeViewModelBase.useSameWalletAddress: only software wallets send Lightning.
+bool canFundDeposit(WalletInfo wallet, CryptoCurrency currency) =>
+ currency != CryptoCurrency.btcln || wallet.hardwareWalletType == null;
### lib/new-ui/pages/send_page.dart
@@ -993,7 +993,7 @@ class _NewSendPageState extends State<NewSendPage> {
final balanceByAsset = <CryptoCurrency, CurrencyPickerBalance>{
for (final r in widget.sendViewModel.balanceViewModel.formattedBalances)
r.asset: CurrencyPickerBalance(
- amount: "${r.availableBalance} ${r.asset.title}",
+ amount: "${r.availableBalance} ${r.formattedAssetTitle}",
fiat: isFiatDisabled ? null : "${r.fiatAvailableBalanceRaw} ${r.fiatCurrency?.symbol}",
fiatValue: isFiatDisabled ? null : double.tryParse(r.fiatAvailableBalanceRaw),
),
### lib/new-ui/pages/swap_page.dart
@@ -1,3 +1,5 @@
+import "dart:async";
+
import "package:cake_wallet/core/address_resolver/address_resolver_service.dart";
import "package:cake_wallet/core/address_validator.dart";
import "package:cake_wallet/core/amount_validator.dart";
@@ -28,7 +30,6 @@ import "package:cake_wallet/src/widgets/primary_button.dart";
import "package:cake_wallet/utils/debounce.dart";
import "package:cake_wallet/utils/payment_request.dart";
import "package:cake_wallet/utils/show_pop_up.dart";
-import "package:cake_wallet/view_model/dashboard/balance_view_model.dart";
import "package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart";
import "package:cake_wallet/view_model/exchange/exchange_view_model.dart";
import "package:cake_wallet/view_model/wallet_switcher_view_model.dart";
@@ -53,7 +54,6 @@ class NewSwapPage extends StatefulWidget {
required this.walletSwitcherViewModel,
CryptoCurrency? initialCurrency,
this.fromSend,
- this.balanceViewModel,
}) {
depositWalletName = exchangeViewModel.depositCurrency == CryptoCurrency.xmr
? exchangeViewModel.wallet.name
@@ -72,7 +72,6 @@ class NewSwapPage extends StatefulWidget {
final AddressResolverService adrResService;
final PaymentRequest? initialPaymentRequest;
final SwapFromSendArgs? fromSend;
- final BalanceViewModel? balanceViewModel;
late final String? depositWalletName;
late final String? receiveWalletName;
@@ -97,16 +96,12 @@ class _NewSwapPageState extends State<NewSwapPage> {
.contains(widget.exchangeViewModel.depositCurrency) &&
!(widget.exchangeViewModel.status is SyncedSyncStatus);
- Map<CryptoCurrency, CurrencyPickerBalance>? _depositBalanceByAsset() {
- final balanceViewModel = widget.balanceViewModel;
- if (balanceViewModel == null) {
- return null;
- }
-
+ Map<CryptoCurrency, CurrencyPickerBalance> _depositBalanceByAsset() {
+ final balanceViewModel = widget.exchangeViewModel.feesViewModel.balanceViewModel;
return {
for (final r in balanceViewModel.formattedBalances)
r.asset: CurrencyPickerBalance(
- amount: "${r.availableBalance} ${r.asset.title}",
+ amount: "${r.availableBalance} ${r.formattedAssetTitle}",
fiat: balanceViewModel.isFiatDisabled
? null
: "${r.fiatAvailableBalanceRaw} ${r.fiatCurrency?.symbol}",
@@ -245,6 +240,27 @@ class _NewSwapPageState extends State<NewSwapPage> {
),
));
+ _disposers.add(
+ reaction(
+ (_) => widget.exchangeViewModel.wallet,
+ (wallet) {
+ widget.exchangeViewModel.unspentCoinsListViewModel.updateWallet(wallet);
+ _refreshDepositAvailableAmount();
+ },
+ ),
+ );
+
+ _disposers.add(
+ reaction(
+ (_) => widget.exchangeViewModel.status is SyncedSyncStatus,
+ (isSynced) {
+ if (isSynced) {
+ _refreshDepositAvailableAmount();
+ }
+ },
+ ),
+ );
+
_disposers.add(reaction(
(_) => widget.exchangeViewModel.receiveCurrency,
(currency) => _onCurrencyChange(currency, widget.exchangeViewModel, receiveKey),
@@ -517,6 +533,13 @@ class _NewSwapPageState extends State<NewSwapPage> {
}
}
+ // Only while the amount is shown: for Lightning the refresh keeps polling for a balance.
+ void _refreshDepositAvailableAmount() {
+ if (widget.exchangeViewModel.hasAllAmount) {
+ unawaited(widget.exchangeViewModel.updateDepositAvailableAmount());
+ }
+ }
+
void _onWalletNameChange(
ExchangeViewModel exchangeViewModel,
CryptoCurrency currency,
@@ -653,15 +676,10 @@ class _NewSwapPageState extends State<NewSwapPage> {
key: depositKey,
title: fromSend != null ? "" : S.of(context).send,
sourceSelectorMode: fromSend != null,
- walletName: fromSend != null
- ? widget.exchangeViewModel.wallet.name
- : null,
- balanceByAsset:
- fromSend != null ? _depositBalanceByAsset() : null,
- useSingleNetworkLayout: fromSend != null,
- filteredNetwork: fromSend != null
- ? widget.exchangeViewModel.wallet.type
- : null,
+ walletName: widget.exchangeViewModel.wallet.name,
+ balanceByAsset: _depositBalanceByAsset(),
+ useSingleNetworkLayout: true,
+ filteredNetwork: widget.exchangeViewModel.wallet.type,
currency: widget.exchangeViewModel.depositCurrency,
useBaseUnit: widget.exchangeViewModel.useDepositBaseUnit,
hasRefundAddress: true,
@@ -758,6 +776,7 @@ class _NewSwapPageState extends State<NewSwapPage> {
svgPath: "assets/new-ui/swap_amounts.svg",
onPressed:
widget.exchangeViewModel.reverseSwapDirection,
+ semanticLabel: S.of(context).swap_reverse_direction,
),
],
),
### lib/new-ui/widgets/anypay/anypay_flow.dart
@@ -351,7 +351,6 @@ class AnyPayFlow {
null,
walletSwitcherViewModel: walletSwitcherViewModel,
fromSend: SwapFromSendArgs.fromIntent(intent),
- balanceViewModel: sendViewModel.balanceViewModel,
);
await Navigator.of(presentContext).push<void>(
CupertinoPageRoute(
### lib/new-ui/widgets/currency_picker/chain_chip_strip.dart
@@ -55,7 +55,7 @@ class _ChainChip extends StatelessWidget {
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
return Padding(
- padding: const EdgeInsetsDirectional.only(end: 8),
+ padding: const EdgeInsetsDirectional.only(end: 4),
child: MergeSemantics(
child: Semantics(
button: true,
@@ -65,18 +65,18 @@ class _ChainChip extends StatelessWidget {
onTap: onTap,
borderRadius: BorderRadius.circular(80),
child: Container(
- padding: const EdgeInsets.symmetric(horizontal: 10),
+ padding: EdgeInsets.symmetric(horizontal: isSelected ? 12 : 10),
decoration: BoxDecoration(
color: isSelected ? colors.primary : colors.surfaceContainer,
- borderRadius: BorderRadius.circular(20),
+ borderRadius: BorderRadius.circular(80),
),
child: Center(
child: Text(
label,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w500,
fontSize: isSelected ? 14 : 12,
- letterSpacing: -0.07,
+ letterSpacing: isSelected ? -0.07 : -0.06,
color: isSelected ? colors.onPrimary : colors.primary,
),
),
### lib/new-ui/widgets/currency_picker/currency_picker_args.dart
@@ -15,6 +15,10 @@ String chainNameForCurrency(CryptoCurrency c) {
return wt != null ? walletTypeToString(wt) : (c.tag ?? "");
}
+String assetNameForCurrency(CryptoCurrency c) => c == CryptoCurrency.btcln
+ ? (CryptoCurrency.btc.fullName ?? CryptoCurrency.btc.title)
+ : (c.fullName ?? c.title);
+
final Set<String> _stablecoinSymbols = {
for (final c in CryptoCurrency.all)
if (c.groups.contains(CurrencyGroups.stablecoin)) c.title.toUpperCase(),
@@ -103,9 +107,10 @@ CurrencyPickerBalance? balanceForAsset(
}
final title = asset.title.toUpperCase();
+ final tag = asset.tag?.toUpperCase();
CurrencyPickerBalance? byTitle;
for (final entry in balances.entries) {
- if (entry.key.title.toUpperCase() == title) {
+ if (entry.key.title.toUpperCase() == title && entry.key.tag?.toUpperCase() == tag) {
if (byTitle != null) {
return null;
}
@@ -128,6 +133,8 @@ class CurrencyPickerArgs {
required this.symbolResolver,
this.recentsSource = RecentsSource.none,
this.useSingleNetworkLayout = false,
+ this.walletName,
+ this.otherAssets,
});
final CryptoCurrency? selected;
@@ -139,4 +146,6 @@ class CurrencyPickerArgs {
final Map<CryptoCurrency, CurrencyPickerBalance>? balanceByAsset;
final RecentsSource recentsSource;
final bool useSingleNetworkLayout;
+ final String? walletName;
+ final CurrencyPickerArgs? otherAssets;
}
### lib/new-ui/widgets/currency_picker/currency_picker_footer.dart
@@ -0,0 +1,74 @@
+import "package:cake_wallet/generated/i18n.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_search_field.dart";
+import "package:flutter/material.dart";
+
+class CurrencyPickerFooter extends StatelessWidget {
+ const CurrencyPickerFooter({
+ required this.searchController,
+ this.action,
+ super.key,
+ });
+
+ final TextEditingController searchController;
+ final Widget? action;
+
+ static const double _actionHeight = 55;
+ static const double _actionGap = 16;
+
+ static const double _searchHeight = 60;
+ static const double _bottomMargin = 24;
+
+ static const double _fadeHeightWithAction = 200;
+ static const double _fadeHeight = 125;
+
+ static double heightFor({required bool hasAction}) =>
+ (hasAction ? _actionHeight + _actionGap : 0) + _searchHeight + _bottomMargin;
+
+ @override
+ Widget build(BuildContext context) {
+ final action = this.action;
+ return Positioned(
+ left: 0,
+ right: 0,
+ bottom: 0,
+ child: Stack(
+ alignment: Alignment.bottomCenter,
+ children: [
+ IgnorePointer(
+ child: Container(
+ height: action == null ? _fadeHeight : _fadeHeightWithAction,
+ decoration: BoxDecoration(
+ gradient: LinearGradient(
+ begin: Alignment.topCenter,
+ end: Alignment.bottomCenter,
+ colors: [
+ Theme.of(context).colorScheme.surface.withAlpha(0),
+ Theme.of(context).colorScheme.surface,
+ ],
+ ),
+ ),
+ ),
+ ),
+ Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.stretch,
+ children: [
+ if (action != null) ...[
+ Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 16),
+ child: SizedBox(height: _actionHeight, child: action),
+ ),
+ const SizedBox(height: _actionGap),
+ ],
+ CurrencyPickerSearchField(
+ controller: searchController,
+ hintText: S.of(context).search,
+ ),
+ const SizedBox(height: _bottomMargin),
+ ],
+ ),
+ ],
+ ),
+ );
+ }
+}
### lib/new-ui/widgets/currency_picker/currency_picker_list_container.dart
@@ -16,8 +16,8 @@ class CurrencyPickerListContainer extends StatelessWidget {
height: 1,
thickness: 1,
color: colors.surfaceContainerHigh,
- indent: 56,
- endIndent: 24,
+ indent: 52,
+ endIndent: 12,
));
}
}
### lib/new-ui/widgets/currency_picker/currency_picker_row.dart
@@ -1,4 +1,5 @@
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart";
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:flutter/material.dart';
@@ -10,6 +11,7 @@ class CurrencyPickerRow extends StatelessWidget {
required this.isSelected,
required this.trailing,
required this.onTap,
+ this.subtitle,
this.chainPillLabel,
this.chainBadgePath,
});
@@ -18,6 +20,7 @@ class CurrencyPickerRow extends StatelessWidget {
final bool isSelected;
final Widget trailing;
final VoidCallback onTap;
+ final String? subtitle;
final String? chainPillLabel;
final String? chainBadgePath;
@@ -30,54 +33,83 @@ class CurrencyPickerRow extends StatelessWidget {
selected: isSelected,
child: InkWell(
onTap: onTap,
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 12),
+ child: Container(
+ height: subtitle == null ? 48 : 56,
+ padding: const EdgeInsets.symmetric(horizontal: 12),
child: Row(
children: [
ExcludeSemantics(
child: _IconWithBadge(currency: currency, badgePath: chainBadgePath),
),
const SizedBox(width: 12),
Expanded(
- child: Row(
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.center,
+ crossAxisAlignment: CrossAxisAlignment.start,
children: [
- Flexible(
- child: Text(
- currency.fullName ?? currency.title,
- overflow: TextOverflow.ellipsis,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w500,
+ Row(
+ children: [
+ Flexible(
+ child: Text(
+ assetNameForCurrency(currency),
+ overflow: TextOverflow.ellipsis,
+ style: Theme.of(context)
+ .textTheme
+ .bodyMedium
+ ?.copyWith(letterSpacing: -0.07),
+ ),
+ ),
+ if (chainPillLabel != null) ...[
+ const SizedBox(width: 6),
+ Container(
+ padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
+ decoration: BoxDecoration(
+ color: colors.surfaceContainerHigh,
+ borderRadius: BorderRadius.circular(20),
),
- ),
+ child: Text(
+ chainPillLabel!,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ fontWeight: FontWeight.w500,
+ letterSpacing: -0.06,
+ color: colors.primary,
+ ),
+ ),
+ ),
+ ],
+ ],
),
- if (chainPillLabel != null) ...[
- const SizedBox(width: 8),
- Container(
- padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2),
- decoration: BoxDecoration(
- color: colors.surfaceContainerHigh,
- borderRadius: BorderRadius.circular(10),
- ),
- child: Text(
- chainPillLabel!,
- style: Theme.of(context).textTheme.bodySmall?.copyWith(
- fontWeight: FontWeight.w500,
- color: colors.onSecondaryContainer,
- ),
- ),
+ if (subtitle != null) ...[
+ const SizedBox(height: 4),
+ Text(
+ subtitle!,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ letterSpacing: -0.06,
+ color: colors.onSurfaceVariant,
+ ),
),
],
],
),
),
const SizedBox(width: 8),
trailing,
- const SizedBox(width: 8),
+ const SizedBox(width: 4),
ExcludeSemantics(
- child: Icon(
- Icons.chevron_right,
- size: 20,
- color: isSelected ? colors.primary : colors.onSurfaceVariant,
+ child: SizedBox(
+ width: 16,
+ height: 16,
+ child: Center(
+ child: CakeImageWidget(
+ imageUrl: "assets/new-ui/arrow_right.svg",
+ width: 7,
+ height: 12,
+ colorFilter: ColorFilter.mode(
+ isSelected ? colors.primary : colors.onSurfaceVariant,
+ BlendMode.srcIn,
+ ),
+ ),
+ ),
),
),
],
@@ -99,45 +131,42 @@ class _IconWithBadge extends StatelessWidget {
Widget build(BuildContext context) {
final icon = TokenImageWidget(
imageUrl: currency.iconPath ?? '',
- size: 32,
- errorWidget: Container(
- width: 32,
- height: 32,
+ size: 28,
+ errorWidget: SizedBox(
+ width: 28,
+ height: 28,
child: Center(
child: Text(
currency.title.length >= 2 ? currency.title.substring(0, 2) : currency.title,
),
),
),
);
- if (badgePath == null) return icon;
+ if (badgePath == null) {
+ return icon;
+ }
return SizedBox(
- width: 36,
- height: 36,
+ width: 28,
+ height: 28,
child: Stack(
- clipBehavior: Clip.none,
children: [
icon,
Positioned(
- right: -2,
- bottom: -2,
+ right: 0,
+ bottom: 0,
child: Container(
- width: 18,
- height: 18,
+ width: 12,
+ height: 12,
+ padding: const EdgeInsets.all(3),
decoration: BoxDecoration(
- borderRadius: BorderRadius.circular(6),
- border: Border.all(
- color: Theme.of(context).colorScheme.surfaceContainerHigh,
- width: 2,
- ),
+ borderRadius: BorderRadius.circular(4),
color: Theme.of(context).colorScheme.onSurface,
),
- padding: const EdgeInsets.all(2),
child: CakeImageWidget(
imageUrl: badgePath,
color: Theme.of(context).colorScheme.surface,
- width: 13,
- height: 13,
+ width: 6,
+ height: 6,
fit: BoxFit.cover,
),
),
### lib/new-ui/widgets/currency_picker/currency_picker_search_field.dart
@@ -16,20 +16,25 @@ class CurrencyPickerSearchField extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
+
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 8),
child: Container(
- height: 48,
- padding: const EdgeInsets.symmetric(horizontal: 14),
+ height: 44,
+ padding: const EdgeInsets.only(right: 16),
decoration: BoxDecoration(
color: colors.surfaceContainer,
border: Border.all(color: colors.surfaceContainer, width: 1),
borderRadius: BorderRadius.circular(28),
),
child: Row(
children: [
- ExcludeSemantics(child: Icon(Icons.search, size: 20, color: colors.primary)),
- const SizedBox(width: 10),
+ ExcludeSemantics(
+ child: SizedBox(
+ width: 44,
+ child: Center(child: Icon(Icons.search, size: 20, color: colors.primary)),
+ ),
+ ),
Expanded(
// The hint names the field only while it is empty, so the label is
// supplied once there is text to keep exactly one announcement.
@@ -38,13 +43,14 @@ class CurrencyPickerSearchField extends StatelessWidget {
label: controller.text.isEmpty ? null : hintText,
child: TextFormField(
controller: controller,
- style: Theme.of(context).textTheme.bodyMedium,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(fontSize: 12.8),
decoration: InputDecoration(
isCollapsed: true,
border: InputBorder.none,
focusedBorder: InputBorder.none,
hintText: hintText,
- hintStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
+ hintStyle: Theme.of(context).textTheme.bodySmall?.copyWith(
+ fontSize: 12.8,
color: colors.onSurfaceVariant,
),
),
### lib/new-ui/widgets/currency_picker/currency_picker_sheet.dart
@@ -1,33 +1,56 @@
import 'package:cake_wallet/generated/i18n.dart';
+import "package:cake_wallet/new-ui/modal_navigator.dart";
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/multi_network_currency_picker.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/single_network_currency_picker.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
+import "package:cw_core/crypto_currency.dart";
+import "package:flutter/cupertino.dart";
import 'package:flutter/material.dart';
class CurrencyPickerSheet extends StatelessWidget {
- const CurrencyPickerSheet({super.key, required this.args});
+ const CurrencyPickerSheet({super.key, required this.args}) : _isOtherAssetsPage = false;
+
+ const CurrencyPickerSheet._otherAssetsPage({required this.args}) : _isOtherAssetsPage = true;
final CurrencyPickerArgs args;
+ final bool _isOtherAssetsPage;
static Future<void> show({
required BuildContext context,
required CurrencyPickerArgs args,
- }) {
- return showModalBottomSheet<void>(
+ }) => showModalBottomSheet<CryptoCurrency>(
context: context,
isScrollControlled: true,
useSafeArea: true,
enableDrag: false,
isDismissible: false,
backgroundColor: Colors.transparent,
- builder: (_) => CurrencyPickerSheet(args: args),
+ builder: (sheetContext) => args.otherAssets != null && args.useSingleNetworkLayout
+ ? ModalNavigator(
+ parentContext: sheetContext,
+ rootPage: CurrencyPickerSheet(args: args),
+ )
+ : CurrencyPickerSheet(args: args),
);
+
+ Future<void> _showOtherAssets(BuildContext context, CurrencyPickerArgs otherAssets) async {
+ FocusManager.instance.primaryFocus?.unfocus();
+ final picked = await Navigator.of(context).push(
+ CupertinoPageRoute<CryptoCurrency>(
+ builder: (_) => CurrencyPickerSheet._otherAssetsPage(args: otherAssets),
+ ),
+ );
+
+ if (picked != null && context.mounted) {
+ await Navigator.of(context).maybePop();
+ }
}
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
+ final otherAssets = args.otherAssets;
return Padding(
padding: EdgeInsets.only(bottom: MediaQuery.of(context).viewInsets.bottom),
child: Container(
@@ -42,13 +65,19 @@ class CurrencyPickerSheet extends StatelessWidget {
children: [
ModalTopBar(
title: S.of(context).select_asset,
- leadingIcon: const Icon(Icons.close),
- leadingSemanticLabel: S.of(context).close,
+ leadingIcon: Icon(_isOtherAssetsPage ? Icons.arrow_back_ios_new : Icons.close),
+ leadingSemanticLabel:
+ _isOtherAssetsPage ? S.of(context).seed_alert_back : S.of(context).close,
onLeadingPressed: () => Navigator.of(context).maybePop(),
),
Expanded(
child: args.useSingleNetworkLayout
- ? SingleNetworkCurrencyPicker(args: args)
+ ? SingleNetworkCurrencyPicker(
+ args: args,
+ onSendAnotherAsset: otherAssets == null
+ ? null
+ : () => _showOtherAssets(context, otherAssets),
+ )
: MultiNetworkCurrencyPicker(args: args),
),
],
### lib/new-ui/widgets/currency_picker/multi_network_currency_picker.dart
@@ -2,6 +2,7 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/widgets/coins_page/token_image_widget.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/chain_chip_strip.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart';
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_footer.dart";
import 'package:cake_wallet/new-ui/widgets/currency_picker/picker_recents_loader.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_list_container.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_row.dart';
@@ -100,7 +101,7 @@ class _MultiNetworkCurrencyPickerState extends State<MultiNetworkCurrencyPicker>
void _selectCurrency(CryptoCurrency currency) {
widget.args.onSelected(currency);
- Navigator.of(context).maybePop();
+ Navigator.of(context).pop(currency);
}
void _onStablecoinPillTapped(CryptoCurrency tapped) {
@@ -148,6 +149,7 @@ class _MultiNetworkCurrencyPickerState extends State<MultiNetworkCurrencyPicker>
@override
Widget build(BuildContext context) {
+ final footerHeight = CurrencyPickerFooter.heightFor(hasAction: false);
return Column(
mainAxisSize: MainAxisSize.max,
children: [
@@ -158,23 +160,25 @@ class _MultiNetworkCurrencyPickerState extends State<MultiNetworkCurrencyPicker>
onSelected: (network) => setState(() => _selectedNetwork = network),
),
Expanded(
- child: _MultiNetworkPickerBody(
- items: _visibleItems,
- isSearching: _isSearching,
- recents: _recents,
- recentsLoaded: _recentsLoaded,
- natives: _natives,
- selected: widget.args.selected,
- symbolResolver: widget.args.symbolResolver,
- showStablesHeader: widget.args.showStablesHeader,
- onSelect: _selectCurrency,
- onStablecoinTap: _onStablecoinPillTapped,
+ child: Stack(
+ children: [
+ _MultiNetworkPickerBody(
+ items: _visibleItems,
+ isSearching: _isSearching,
+ recents: _recents,
+ recentsLoaded: _recentsLoaded,
+ natives: _natives,
+ selected: widget.args.selected,
+ symbolResolver: widget.args.symbolResolver,
+ showStablesHeader: widget.args.showStablesHeader,
+ onSelect: _selectCurrency,
+ onStablecoinTap: _onStablecoinPillTapped,
+ footerHeight: footerHeight,
+ ),
+ CurrencyPickerFooter(searchController: _searchController),
+ ],
),
),
- CurrencyPickerSearchField(
- controller: _searchController,
- hintText: S.of(context).search,
- ),
],
);
}
@@ -192,11 +196,13 @@ class _MultiNetworkPickerBody extends StatefulWidget {
required this.onSelect,
required this.onStablecoinTap,
required this.showStablesHeader,
+ required this.footerHeight,
});
final bool isSearching;
final bool recentsLoaded;
final bool showStablesHeader;
+ final double footerHeight;
final CryptoCurrency? selected;
final List<CryptoCurrency> items;
final List<CryptoCurrency> recents;
@@ -278,7 +284,7 @@ class _MultiNetworkPickerBodyState extends State<_MultiNetworkPickerBody> {
if (items.isEmpty) {
return Center(
child: Padding(
- padding: const EdgeInsets.all(24),
+ padding: EdgeInsets.fromLTRB(24, 24, 24, widget.footerHeight),
child: Text(
S.of(context).picker_no_matches,
textAlign: TextAlign.center,
@@ -297,7 +303,7 @@ class _MultiNetworkPickerBodyState extends State<_MultiNetworkPickerBody> {
controller: _scrollController,
primary: false,
physics: const ClampingScrollPhysics(),
- padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
+ padding: EdgeInsets.fromLTRB(16, 8, 16, widget.footerHeight),
children: [
CurrencyPickerListContainer(
rows: [
@@ -358,7 +364,7 @@ class _MultiNetworkPickerBodyState extends State<_MultiNetworkPickerBody> {
controller: _scrollController,
primary: false,
physics: const ClampingScrollPhysics(),
- padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
+ padding: EdgeInsets.fromLTRB(16, 8, 16, widget.footerHeight),
children: [
if (recentsLoaded && visibleRecents.isNotEmpty)
_PickerSection(
@@ -533,7 +539,7 @@ class _PickerSection extends StatelessWidget {
children: [
PickerSectionHeader(title: title),
child,
- const SizedBox(height: 16),
+ const SizedBox(height: 20),
],
);
}
@@ -549,15 +555,13 @@ class _SymbolTrailing extends StatelessWidget {
final String Function(CryptoCurrency) symbolResolver;
@override
- Widget build(BuildContext context) {
- return Text(
+ Widget build(BuildContext context) => Text(
symbolResolver(currency),
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w500,
+ letterSpacing: -0.07,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
);
- }
}
class _SeeAllRow extends StatelessWidget {
@@ -609,13 +613,12 @@ class _RecentsRow extends StatelessWidget {
final void Function(CryptoCurrency) onTap;
@override
- Widget build(BuildContext context) {
- return SizedBox(
- height: 44,
+ Widget build(BuildContext context) => SizedBox(
+ height: 36,
child: ListView.separated(
scrollDirection: Axis.horizontal,
itemCount: items.length,
- separatorBuilder: (_, __) => const SizedBox(width: 8),
+ separatorBuilder: (_, __) => const SizedBox(width: 4),
itemBuilder: (_, i) {
final item = items[i];
return _RecentPill(
@@ -627,7 +630,6 @@ class _RecentsRow extends StatelessWidget {
},
),
);
- }
}
class _RecentPill extends StatelessWidget {
@@ -650,7 +652,8 @@ class _RecentPill extends StatelessWidget {
onTap: onTap,
borderRadius: BorderRadius.circular(80),
child: Container(
- padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 6),
+ height: 36,
+ padding: const EdgeInsets.only(left: 6, right: 10),
decoration: BoxDecoration(
color: colors.surfaceContainer,
borderRadius: BorderRadius.circular(80),
@@ -666,8 +669,9 @@ class _RecentPill extends StatelessWidget {
const SizedBox(width: 8),
Text(
label,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w600,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ fontWeight: FontWeight.w500,
+ letterSpacing: -0.06,
),
),
],
### lib/new-ui/widgets/currency_picker/picker_section_header.dart
@@ -6,16 +6,14 @@ class PickerSectionHeader extends StatelessWidget {
final String title;
@override
- Widget build(BuildContext context) {
- return Padding(
- padding: const EdgeInsets.fromLTRB(4, 12, 4, 8),
+ Widget build(BuildContext context) => Padding(
+ padding: const EdgeInsets.only(bottom: 12),
child: Text(
title,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w500,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ letterSpacing: -0.06,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
);
- }
}
### lib/new-ui/widgets/currency_picker/pill_grid.dart
@@ -18,8 +18,7 @@ class PillGrid extends StatelessWidget {
final String Function(CryptoCurrency c) symbolResolver;
@override
- Widget build(BuildContext context) {
- return LayoutBuilder(
+ Widget build(BuildContext context) => LayoutBuilder(
builder: (context, constraints) {
const gap = 8.0;
final cardWidth = (constraints.maxWidth - gap) / 2;
@@ -41,7 +40,6 @@ class PillGrid extends StatelessWidget {
);
},
);
- }
}
class _PillCard extends StatelessWidget {
@@ -62,12 +60,13 @@ class _PillCard extends StatelessWidget {
final colors = Theme.of(context).colorScheme;
return InkWell(
onTap: onTap,
- borderRadius: BorderRadius.circular(80),
+ borderRadius: BorderRadius.circular(20),
child: Container(
- padding: const EdgeInsets.symmetric(horizontal: 10, vertical: 10),
+ height: 36,
+ padding: const EdgeInsets.only(left: 6, right: 8),
decoration: BoxDecoration(
color: colors.surfaceContainer,
- borderRadius: BorderRadius.circular(80),
+ borderRadius: BorderRadius.circular(20),
border: isSelected ? Border.all(color: colors.primary, width: 1.5) : null,
),
child: Row(
@@ -81,15 +80,23 @@ class _PillCard extends StatelessWidget {
child: Text(
label,
overflow: TextOverflow.ellipsis,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w600,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ fontWeight: FontWeight.w500,
+ letterSpacing: -0.06,
),
),
),
- Icon(
- Icons.chevron_right,
- size: 18,
- color: colors.onSurfaceVariant,
+ SizedBox(
+ width: 12,
+ height: 12,
+ child: Center(
+ child: CakeImageWidget(
+ imageUrl: "assets/new-ui/arrow_right.svg",
+ width: 5,
+ height: 9,
+ colorFilter: ColorFilter.mode(colors.onSurfaceVariant, BlendMode.srcIn),
+ ),
+ ),
),
],
),
### lib/new-ui/widgets/currency_picker/select_network_page.dart
@@ -81,8 +81,12 @@ class SelectNetworkPage extends StatelessWidget {
onTap: () {
final nav = Navigator.of(context);
onSelected(variant);
- if (nav.canPop()) nav.pop();
- if (nav.canPop()) nav.pop();
+ if (nav.canPop()) {
+ nav.pop();
+ }
+ if (nav.canPop()) {
+ nav.pop(variant);
+ }
},
),
],
### lib/new-ui/widgets/currency_picker/single_network_currency_picker.dart
@@ -1,10 +1,12 @@
import "package:cake_wallet/generated/i18n.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_footer.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_list_container.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_row.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_search_field.dart";
import "package:cake_wallet/new-ui/widgets/currency_picker/picker_section_header.dart";
import "package:cake_wallet/reactions/wallet_utils.dart";
+import "package:cake_wallet/src/widgets/cake_image_widget.dart";
import "package:cw_core/crypto_currency.dart";
import "package:cw_core/currency_for_wallet_type.dart";
import "package:cw_core/wallet_type.dart";
@@ -13,10 +15,12 @@ import "package:flutter/material.dart";
class SingleNetworkCurrencyPicker extends StatefulWidget {
const SingleNetworkCurrencyPicker({
required this.args,
+ this.onSendAnotherAsset,
super.key,
});
final CurrencyPickerArgs args;
+ final VoidCallback? onSendAnotherAsset;
@override
State<SingleNetworkCurrencyPicker> createState() => _SingleNetworkCurrencyPickerState();
@@ -44,9 +48,8 @@ class _SingleNetworkCurrencyPickerState extends State<SingleNetworkCurrencyPicke
Navigator.of(context).maybePop();
}
- CurrencyPickerBalance? _balanceFor(CryptoCurrency c) => balanceForAsset(_args.balanceByAsset, c);
-
- double _fiatValueFor(CryptoCurrency c) => _balanceFor(c)?.fiatValue ?? 0;
+ double _fiatValueFor(CryptoCurrency c) =>
+ balanceForAsset(_args.balanceByAsset, c)?.fiatValue ?? 0;
@override
Widget build(BuildContext context) {
@@ -72,93 +75,144 @@ class _SingleNetworkCurrencyPickerState extends State<SingleNetworkCurrencyPicke
});
final nativeMatches = currencyMatchesQuery(native, query);
- final showSectionHeaders = _network != WalletType.bitcoin;
+ final walletName = _args.walletName;
+ final onSendAnotherAsset = widget.onSendAnotherAsset;
+ final footerHeight = CurrencyPickerFooter.heightFor(hasAction: onSendAnotherAsset != null);
- return Column(
- mainAxisSize: MainAxisSize.max,
+ return Stack(
children: [
- Expanded(
- child: (nativeMatches || tokens.isNotEmpty)
- ? ListView(
- padding: const EdgeInsets.fromLTRB(16, 8, 16, 16),
- children: showSectionHeaders
- ? [
- if (nativeMatches) ...[
- PickerSectionHeader(title: S.of(context).picker_section_gas_token),
- CurrencyPickerListContainer(
- rows: [
- CurrencyPickerRow(
- currency: native,
- isSelected: _args.selected == native,
- trailing: _BalanceTrailing(balance: _balanceFor(native)),
- onTap: () => _selectCurrency(native),
- ),
- ],
- ),
- const SizedBox(height: 16),
- ],
- if (tokens.isNotEmpty) ...[
- PickerSectionHeader(
- title: S
- .of(context)
- .picker_section_tokens_standard(tokenStandardFor(_network)),
- ),
- CurrencyPickerListContainer(
- rows: [
- for (final t in tokens)
- CurrencyPickerRow(
- currency: t,
- isSelected: _args.selected == t,
- trailing: _BalanceTrailing(balance: _balanceFor(t)),
- onTap: () => _selectCurrency(t),
- ),
- ],
- ),
- ],
- ]
- : [
- CurrencyPickerListContainer(
- rows: [
- if (nativeMatches)
- CurrencyPickerRow(
- currency: native,
- isSelected: _args.selected == native,
- trailing: _BalanceTrailing(balance: _balanceFor(native)),
- onTap: () => _selectCurrency(native),
- ),
- for (final t in tokens)
- CurrencyPickerRow(
- currency: t,
- isSelected: _args.selected == t,
- trailing: _BalanceTrailing(balance: _balanceFor(t)),
- onTap: () => _selectCurrency(t),
- ),
- ],
- ),
+ (nativeMatches || tokens.isNotEmpty)
+ ? ListView(
+ padding: EdgeInsets.fromLTRB(16, 8, 16, footerHeight),
+ children: [
+ if (walletName != null) ...[
+ _FromWalletHeader(walletName: walletName),
+ const SizedBox(height: 24),
+ ],
+ if (hasTokens(_network)) ...[
+ if (nativeMatches) ...[
+ PickerSectionHeader(title: S.of(context).picker_section_gas_token),
+ CurrencyPickerListContainer(
+ rows: [
+ _WalletAssetRow(args: _args, currency: native, onTap: _selectCurrency),
+ ],
+ ),
+ const SizedBox(height: 24),
+ ],
+ if (tokens.isNotEmpty) ...[
+ PickerSectionHeader(
+ title: S
+ .of(context)
+ .picker_section_tokens_standard(tokenStandardFor(_network)),
+ ),
+ CurrencyPickerListContainer(
+ rows: [
+ for (final t in tokens)
+ _WalletAssetRow(args: _args, currency: t, onTap: _selectCurrency),
],
- )
- : Center(
- child: Padding(
- padding: const EdgeInsets.all(24),
- child: Text(
- S.of(context).picker_no_matches,
- textAlign: TextAlign.center,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- color: Theme.of(context).colorScheme.onSurfaceVariant,
- ),
+ ),
+ ],
+ ] else
+ CurrencyPickerListContainer(
+ rows: [
+ if (nativeMatches)
+ _WalletAssetRow(args: _args, currency: native, onTap: _selectCurrency),
+ for (final t in tokens)
+ _WalletAssetRow(args: _args, currency: t, onTap: _selectCurrency),
+ ],
),
+ ],
+ )
+ : Padding(
+ padding: EdgeInsets.fromLTRB(24, 24, 24, footerHeight),
+ child: Center(
+ child: Text(
+ S.of(context).picker_no_matches,
+ textAlign: TextAlign.center,
+ style: Theme.of(context).textTheme.bodyMedium?.copyWith(
+ color: Theme.of(context).colorScheme.onSurfaceVariant,
+ ),
),
),
- ),
- CurrencyPickerSearchField(
- controller: _searchController,
- hintText: S.of(context).search,
+ ),
+ CurrencyPickerFooter(
+ searchController: _searchController,
+ action: onSendAnotherAsset == null
+ ? null
+ : _SendAnotherAssetButton(onTap: onSendAnotherAsset),
),
],
);
}
}
+class _FromWalletHeader extends StatelessWidget {
+ const _FromWalletHeader({required this.walletName});
+
+ final String walletName;
+
+ @override
+ Widget build(BuildContext context) => MergeSemantics(
+ child: Row(
+ children: [
+ Text(
+ S.of(context).from,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(letterSpacing: -0.06),
+ ),
+ const SizedBox(width: 8),
+ ExcludeSemantics(
+ child: CakeImageWidget(
+ imageUrl: "assets/new-ui/wallet_filled.svg",
+ width: 16,
+ height: 16,
+ colorFilter: ColorFilter.mode(
+ Theme.of(context).colorScheme.onSurfaceVariant, BlendMode.srcIn),
+ ),
+ ),
+ const SizedBox(width: 8),
+ Flexible(
+ child: Text(
+ walletName,
+ overflow: TextOverflow.ellipsis,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ fontWeight: FontWeight.w500,
+ letterSpacing: -0.06,
+ color: Theme.of(context).colorScheme.onSurfaceVariant,
+ ),
+ ),
+ ),
+ ],
+ ),
+ );
+}
+
+class _WalletAssetRow extends StatelessWidget {
+ const _WalletAssetRow({
+ required this.args,
+ required this.currency,
+ required this.onTap,
+ });
+
+ final CurrencyPickerArgs args;
+ final CryptoCurrency currency;
+ final void Function(CryptoCurrency) onTap;
+
+ @override
+ Widget build(BuildContext context) {
+ final network = args.filterByNetwork!;
+ final chainName = chainNameForCurrency(currency);
+ return CurrencyPickerRow(
+ currency: currency,
+ isSelected: args.selected == currency,
+ subtitle: args.symbolResolver(currency),
+ chainPillLabel: chainName == walletTypeToString(network) ? null : chainName,
+ chainBadgePath: currency.chainIconPath ?? walletTypeToCryptoCurrency(network).chainIconPath,
+ trailing: _BalanceTrailing(balance: balanceForAsset(args.balanceByAsset, currency)),
+ onTap: () => onTap(currency),
+ );
+ }
+}
+
class _BalanceTrailing extends StatelessWidget {
const _BalanceTrailing({required this.balance});
@@ -167,30 +221,69 @@ class _BalanceTrailing extends StatelessWidget {
@override
Widget build(BuildContext context) {
final colors = Theme.of(context).colorScheme;
- final amount = balance?.amount ?? "—";
final fiat = balance?.fiat;
return Column(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisSize: MainAxisSize.min,
children: [
Text(
- amount,
- style: Theme.of(context).textTheme.bodyMedium?.copyWith(
- fontWeight: FontWeight.w500,
- ),
+ balance?.amount ?? "—",
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(letterSpacing: -0.06),
),
- if (fiat != null && fiat.isNotEmpty)
- Padding(
- padding: const EdgeInsets.only(top: 2),
- child: Text(
- fiat,
- style: Theme.of(context).textTheme.bodySmall?.copyWith(
- fontWeight: FontWeight.w400,
- color: colors.onSurfaceVariant,
- ),
- ),
+ if (fiat != null && fiat.isNotEmpty) ...[
+ const SizedBox(height: 4),
+ Text(
+ fiat,
+ style: Theme.of(context).textTheme.bodySmall?.copyWith(
+ letterSpacing: -0.06,
+ color: colors.onSurfaceVariant,
+ ),
),
+ ],
],
);
}
}
+
+class _SendAnotherAssetButton extends StatelessWidget {
+ const _SendAnotherAssetButton({required this.onTap});
+
+ final VoidCallback onTap;
+
+ @override
+ Widget build(BuildContext context) => MergeSemantics(
+ child: Semantics(
+ button: true,
+ child: Material(
+ color: Theme.of(context).colorScheme.surfaceContainer,
+ borderRadius: BorderRadius.circular(16),
+ child: InkWell(
+ onTap: onTap,
+ borderRadius: BorderRadius.circular(16),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ ExcludeSemantics(
+ child: CakeImageWidget(
+ imageUrl: "assets/new-ui/send_another_asset.svg",
+ width: 24,
+ height: 24,
+ colorFilter:
+ ColorFilter.mode(Theme.of(context).colorScheme.primary, BlendMode.srcIn),
+ ),
+ ),
+ const SizedBox(width: 10),
+ Text(
+ S.of(context).send_another_asset,
+ style: Theme.of(context).textTheme.bodyMedium?.copyWith(
+ letterSpacing: -0.07,
+ color: Theme.of(context).colorScheme.primary,
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ );
+}
### lib/new-ui/widgets/send_page/l2_action_wallet_selector.dart
@@ -354,8 +354,7 @@ class WalletRow extends StatelessWidget {
final bool? isSelected;
@override
- Widget build(BuildContext context) {
- return Container(
+ Widget build(BuildContext context) => Container(
height: isCurrent ? 64 : 48,
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
@@ -397,15 +396,25 @@ class WalletRow extends StatelessWidget {
),
isSelected != null
? NewSimpleCheckbox(value: isSelected!, onChanged: (val) {})
- : Icon(
- Icons.chevron_right,
- color: Theme.of(context).colorScheme.onSurfaceVariant,
+ : SizedBox(
+ width: 16,
+ height: 16,
+ child: Center(
+ child: CakeImageWidget(
+ imageUrl: "assets/new-ui/arrow_right.svg",
+ width: 7,
+ height: 12,
+ colorFilter: ColorFilter.mode(
+ Theme.of(context).colorScheme.onSurfaceVariant,
+ BlendMode.srcIn,
+ ),
+ ),
+ ),
)
],
),
),
),
),
);
- }
}
### lib/new-ui/widgets/swap_page/swap_address_selection_modal.dart
@@ -1,5 +1,6 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/widgets/receive_page/receive_top_bar.dart';
+import "package:cake_wallet/new-ui/widgets/send_page/l2_action_wallet_selector.dart";
import 'package:cake_wallet/new-ui/widgets/send_page/send_address_input.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/src/widgets/new_list_row/new_simple_checkbox.dart';
@@ -70,155 +71,185 @@ class _SwapAddressSelectionModalState extends State<SwapAddressSelectionModal> {
if (!_itemsLoaded) return SizedBox.shrink();
return Container(
- decoration: BoxDecoration(
- color: Theme.of(context).colorScheme.surface,
- borderRadius: BorderRadius.vertical(top: Radius.circular(16))),
- child: SafeArea(
- child: Column(
- mainAxisSize: MainAxisSize.min,
- children: [
- ModalTopBar(
- title: widget.isSelectingReceiver
- ? "${S.of(context).receive_to}..."
- : "${S.of(context).send_from}...",
- leadingIcon: Icon(Icons.close),
- leadingSemanticLabel: S.of(context).close,
- onLeadingPressed: Navigator.of(context).pop,
+ decoration: BoxDecoration(
+ color: Theme.of(context).colorScheme.surface,
+ borderRadius: BorderRadius.vertical(top: Radius.circular(24))),
+ child: SafeArea(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ ModalTopBar(
+ title: widget.isSelectingReceiver
+ ? "${S.of(context).receive_to}..."
+ : "${S.of(context).send_from}...",
+ leadingIcon: Icon(Icons.close),
+ leadingSemanticLabel: S.of(context).close,
+ onLeadingPressed: Navigator.of(context).pop,
+ ),
+ if (!widget.isSelectingReceiver && items.isNotEmpty)
+ Padding(
+ padding: const EdgeInsets.fromLTRB(18, 0, 18, 6),
+ child: Align(
+ alignment: AlignmentDirectional.centerStart,
+ child: Text(
+ S.of(context).available_wallets,
+ style: Theme.of(context).textTheme.bodyMedium?.copyWith(
+ letterSpacing: -0.07,
+ color: Theme.of(context).colorScheme.onSurfaceVariant,
+ ),
+ ),
+ ),
),
- Flexible(
- child: Padding(
- padding: const EdgeInsets.symmetric(horizontal: 18.0),
- child: items.isEmpty
- ? Center(
- child: Text(
- "${S.of(context).no_wallets_for} ${widget.isSelectingReceiver ? currency.fullName : currency.fullName}.",
- style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
- ))
- : ListView.builder(
- padding: EdgeInsets.only(bottom: 12),
- shrinkWrap: true,
- controller: ModalScrollController.of(context),
- itemCount: items.length,
- itemBuilder: (context, index) {
- final item = items[index];
+ Flexible(
+ child: Padding(
+ padding: const EdgeInsets.symmetric(horizontal: 18.0),
+ child: items.isEmpty
+ ? Center(
+ child: Text(
+ "${S.of(context).no_wallets_for} ${currency.fullName}.",
+ style: TextStyle(color: Theme.of(context).colorScheme.onSurfaceVariant),
+ ))
+ : ListView.builder(
+ padding: EdgeInsets.only(bottom: 12),
+ shrinkWrap: true,
+ controller: ModalScrollController.of(context),
+ itemCount: items.length,
+ itemBuilder: (context, index) {
+ final item = items[index];
- late final bool selected;
- if (widget.isSelectingReceiver) {
- selected = widget.exchangeViewModel.receiveAddress == item.address;
- } else {
- selected = widget.exchangeViewModel.wallet.name == item.name &&
- !widget.exchangeViewModel.isSendFromExternal;
- }
-
- final String currencyIconPath =
- getCryptoCurrencyIconForWalletListItem(item.type);
-
- final bool hasAccounts =
- item.type == WalletType.monero && widget.isSelectingReceiver;
-
- List<WalletInfoAddressInfo>? accounts =
- hasAccounts ? this.accounts[item.id] : null;
+ final String currencyIconPath =
+ getCryptoCurrencyIconForWalletListItem(item.type);
+ if (!widget.isSelectingReceiver) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 6.0),
- child: SwapAddressSelectionModalRow(
- wallet: item,
- iconPath: currencyIconPath,
- isSelected: selected,
- accounts: accounts,
- onAddressChosen: (address, accountName) {
- Navigator.of(context).pop(SwapAddressSelectionResult(
- address: address,
+ child: WalletRow(
+ currencyIconPath: currencyIconPath,
+ walletName: item.name,
+ onTap: () {
+ Navigator.of(context).pop(
+ SwapAddressSelectionResult(
+ address: item.address,
walletInfo: item,
- accountName: accountName));
+ accountName: null,
+ ),
+ );
},
),
);
- },
- ),
- ),
- ),
- Container(
- height: 1,
- color: Theme.of(context).colorScheme.surfaceContainerHigh,
- ),
- Padding(
- padding: const EdgeInsets.symmetric(horizontal: 24.0, vertical: 18),
- child: !widget.isSelectingReceiver
- ? GestureDetector(
- behavior: HitTestBehavior.opaque,
- onTap: () {
- Navigator.of(context).pop(SwapAddressSelectionResult());
+ }
+
+ final bool hasAccounts = item.type == WalletType.monero;
+
+ List<WalletInfoAddressInfo>? accounts =
+ hasAccounts ? this.accounts[item.id] : null;
+
+ return Padding(
+ padding: const EdgeInsets.symmetric(vertical: 6),
+ child: SwapAddressSelectionModalRow(
+ wallet: item,
+ iconPath: currencyIconPath,
+ isSelected: widget.exchangeViewModel.receiveAddress == item.address,
+ accounts: accounts,
+ onAddressChosen: (address, accountName) {
+ Navigator.of(context).pop(
+ SwapAddressSelectionResult(
+ address: address,
+ walletInfo: item,
+ accountName: accountName,
+ ),
+ );
+ },
+ ),
+ );
},
- child: Container(
- height: 64,
- decoration: BoxDecoration(
- color: Theme.of(context).colorScheme.surfaceContainer,
- borderRadius: BorderRadius.circular(16)),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- spacing: 10,
- children: [
- CakeImageWidget(
- imageUrl: "assets/new-ui/send_from_external.svg",
- colorFilter: ColorFilter.mode(
- Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
- Text(S.of(context).send_from_external,
- style: TextStyle(
- fontSize: 15,
- fontWeight: FontWeight.w500,
- color: Theme.of(context).colorScheme.primary))
- ],
- ),
+ ),
+ ),
+ ),
+ Container(
+ height: 1,
+ color: Theme.of(context).colorScheme.surfaceContainerHigh,
+ ),
+ Padding(
+ padding: !widget.isSelectingReceiver
+ ? const EdgeInsets.fromLTRB(18, 24, 18, 32)
+ : const EdgeInsets.symmetric(horizontal: 24.0, vertical: 18),
+ child: !widget.isSelectingReceiver
+ ? GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onTap: () {
+ Navigator.of(context).pop(SwapAddressSelectionResult());
+ },
+ child: Container(
+ height: 55,
+ decoration: BoxDecoration(
+ color: Theme.of(context).colorScheme.surfaceContainer,
+ borderRadius: BorderRadius.circular(16)),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ spacing: 10,
+ children: [
+ CakeImageWidget(
+ imageUrl: "assets/new-ui/send_from_external.svg",
+ colorFilter: ColorFilter.mode(
+ Theme.of(context).colorScheme.primary, BlendMode.srcIn)),
+ Text(S.of(context).send_from_external,
+ style: TextStyle(
+ fontSize: 15,
+ fontWeight: FontWeight.w500,
+ color: Theme.of(context).colorScheme.primary))
+ ],
),
- )
- : Row(
- children: [
- Flexible(
- child: NewSendAddressInput(
- addressController: addressController,
- selectedCurrency: widget.exchangeViewModel.receiveCurrency,
- onEditingComplete: () {},
- bottomPadding: true,
- ),
+ ),
+ )
+ : Row(
+ children: [
+ Flexible(
+ child: NewSendAddressInput(
+ addressController: addressController,
+ selectedCurrency: widget.exchangeViewModel.receiveCurrency,
+ onEditingComplete: () {},
+ bottomPadding: true,
),
- AnimatedScale(
- alignment: Alignment.centerLeft,
- scale: textEntered ? 1.0 : 0.0,
- duration: const Duration(milliseconds: 200),
- curve: Curves.easeOutCubic,
- child: Row(
- children: [
- SizedBox(width: textEntered ? 8 : 0),
- GestureDetector(
- onTap: () {
- Navigator.of(context).pop(SwapAddressSelectionResult(
- address: addressController.text));
- },
- child: AnimatedContainer(
- duration: const Duration(milliseconds: 200),
- curve: Curves.easeOutCubic,
- width: textEntered ? 48 : 0,
- height: 48,
- decoration: BoxDecoration(
- color: Theme.of(context).colorScheme.primary,
- shape: BoxShape.circle,
- ),
- child: Icon(
- Icons.arrow_forward_ios,
- color: Theme.of(context).colorScheme.onPrimary,
- ),
+ ),
+ AnimatedScale(
+ alignment: Alignment.centerLeft,
+ scale: textEntered ? 1.0 : 0.0,
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.easeOutCubic,
+ child: Row(
+ children: [
+ SizedBox(width: textEntered ? 8 : 0),
+ GestureDetector(
+ onTap: () {
+ Navigator.of(context).pop(
+ SwapAddressSelectionResult(address: addressController.text));
+ },
+ child: AnimatedContainer(
+ duration: const Duration(milliseconds: 200),
+ curve: Curves.easeOutCubic,
+ width: textEntered ? 48 : 0,
+ height: 48,
+ decoration: BoxDecoration(
+ color: Theme.of(context).colorScheme.primary,
+ shape: BoxShape.circle,
+ ),
+ child: Icon(
+ Icons.arrow_forward_ios,
+ color: Theme.of(context).colorScheme.onPrimary,
),
),
- ],
- ),
- )
- ],
- ),
- )
- ],
- ),
- ));
+ ),
+ ],
+ ),
+ )
+ ],
+ ),
+ )
+ ],
+ ),
+ ),
+ );
}
}
### lib/new-ui/widgets/swap_page/swap_amount_box.dart
@@ -1,3 +1,5 @@
+import "dart:async";
+
import "package:cake_wallet/core/amount_validator.dart";
import "package:cake_wallet/entities/qr_scanner.dart";
import "package:cake_wallet/generated/i18n.dart";
@@ -13,6 +15,7 @@ import "package:cake_wallet/src/widgets/cake_image_widget.dart";
import "package:cake_wallet/utils/decimal_input_formatter.dart";
import "package:cake_wallet/utils/payment_request.dart";
import "package:cake_wallet/utils/permission_handler.dart";
+import "package:cake_wallet/utils/show_bar.dart";
import "package:cake_wallet/view_model/exchange/exchange_view_model.dart";
import "package:cake_wallet/view_model/wallet_switcher_view_model.dart";
import "package:cw_core/crypto_currency.dart";
@@ -148,8 +151,6 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
? _getCurrencyChainIconPath(widget.currency as CryptoCurrency)
: null;
- final colors = Theme.of(context).colorScheme;
-
if (widget.sourceSelectorMode) {
return SwapSourceSelector(
currencyIconPath: widget.currency.iconPath ?? "",
@@ -560,28 +561,15 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
return address;
}
- void _presentCurrencyPicker() {
- final rawCurrencies = widget.isReceiverCard
- ? widget.exchangeViewModel.receiveCurrencies
- : widget.exchangeViewModel.depositCurrencies;
- final currencies = rawCurrencies.whereType<CryptoCurrency>().toList();
+ Future<void> _presentCurrencyPicker() async {
+ final currencies = _pickableAssets(
+ widget.isReceiverCard
+ ? widget.exchangeViewModel.receiveCurrencies
+ : widget.exchangeViewModel.depositCurrencies,
+ );
final restrictToCurrentBalances = !widget.isReceiverCard &&
widget.balanceByAsset != null &&
widget.balanceByAsset!.isNotEmpty;
- if (!restrictToCurrentBalances) {
- appendEvmDefaultTokens(currencies);
- }
- if (widget.exchangeViewModel.wallet.type == WalletType.bitcoin) {
- currencies.sort((a, b) {
- if (a == CryptoCurrency.btcln) {
- return -1;
- }
- if (b == CryptoCurrency.btcln) {
- return 1;
- }
- return 0;
- });
- }
List<CryptoCurrency> items = currencies;
if (restrictToCurrentBalances) {
@@ -596,27 +584,77 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
items = items.where((c) => cryptoCurrencyOrTokenToWalletType(c) == network).toList();
}
- if (items.length <= 1) {
- return;
- }
-
final selected = widget.isReceiverCard
? widget.exchangeViewModel.receiveCurrency
: widget.exchangeViewModel.depositCurrency;
- CurrencyPickerSheet.show(
+ CryptoCurrency? otherAsset;
+ final otherAssets = _canSendFromOtherSource
+ ? CurrencyPickerArgs(
+ items: _pickableAssets(widget.exchangeViewModel.depositCurrencies),
+ selected: selected,
+ recentsSource: RecentsSource.trades,
+ onSelected: (currency) {
+ widget.onCurrencySelected(currency);
+ otherAsset = currency;
+ },
+ symbolResolver: widget.exchangeViewModel.amountParsingProxy.getCryptoSymbol,
+ )
+ : null;
+
+ if (items.length <= 1 && otherAssets == null) {
+ return;
+ }
+
+ await CurrencyPickerSheet.show(
context: context,
- args: CurrencyPickerArgs(
- items: items,
- selected: selected,
- filterByNetwork: widget.filteredNetwork,
- balanceByAsset: widget.balanceByAsset,
- useSingleNetworkLayout: widget.useSingleNetworkLayout,
- recentsSource: RecentsSource.trades,
- onSelected: widget.onCurrencySelected,
- symbolResolver: widget.exchangeViewModel.amountParsingProxy.getCryptoSymbol,
- ),
+ args: otherAssets != null && widget.exchangeViewModel.isSendFromExternal
+ ? otherAssets
+ : CurrencyPickerArgs(
+ items: items,
+ selected: selected,
+ filterByNetwork: widget.filteredNetwork,
+ balanceByAsset: widget.balanceByAsset,
+ useSingleNetworkLayout: widget.useSingleNetworkLayout,
+ recentsSource: RecentsSource.trades,
+ onSelected: widget.onCurrencySelected,
+ symbolResolver: widget.exchangeViewModel.amountParsingProxy.getCryptoSymbol,
+ walletName: widget.walletName,
+ otherAssets: otherAssets,
+ ),
);
+
+ if (otherAsset == null || !mounted) {
+ return;
+ }
+ await _promptSourceWallet();
+ }
+
+ bool get _canSendFromOtherSource => !widget.isReceiverCard && !widget.sourceSelectorMode;
+
+ List<CryptoCurrency> _pickableAssets(List<Currency> currencies) {
+ final assets = currencies.whereType<CryptoCurrency>().toList();
+ appendEvmDefaultTokens(assets);
+ if (widget.exchangeViewModel.wallet.type == WalletType.bitcoin) {
+ assets.sort((a, b) {
+ if (a == CryptoCurrency.btcln) {
+ return -1;
+ }
+ if (b == CryptoCurrency.btcln) {
+ return 1;
+ }
+ return 0;
+ });
+ }
+ return assets;
+ }
+
+ Future<void> _promptSourceWallet() async {
+ final wallets = await widget.exchangeViewModel.depositWallets;
+ if (!mounted || wallets.isEmpty) {
+ return;
+ }
+ await _presentWalletPicker();
}
Future<void> _presentQRScanner(BuildContext context) async {
@@ -639,7 +677,7 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
} catch (_) {}
}
- void _presentWalletPicker() async {
+ Future<void> _presentWalletPicker() async {
final res = await showMaterialModalBottomSheet(
context: context,
backgroundColor: Colors.transparent,
@@ -669,25 +707,46 @@ class SwapAmountBoxState extends State<SwapAmountBox> {
widget.exchangeViewModel.isSendFromExternal = true;
askForRefundAddress();
} else {
- widget.exchangeViewModel.isSendFromExternal = false;
- switchToDepositWallet(res.walletInfo!.name);
+ await switchToDepositWallet(res.walletInfo!);
}
}
}
- void switchToDepositWallet(String walletName) async {
- final walletType = cryptoCurrencyOrTokenToWalletType(widget.exchangeViewModel.depositCurrency);
- if (walletType == null) {
- return;
+ Future<void> switchToDepositWallet(WalletInfo wallet) async {
+ final isLoadedWallet = wallet.name == widget.exchangeViewModel.wallet.name &&
+ wallet.type == widget.exchangeViewModel.wallet.type;
+ if (!isLoadedWallet) {
+ if (widget.walletSwitcherViewModel.isProcessing) {
+ return;
+ }
+
+ widget.walletSwitcherViewModel.selectWallet(wallet);
+ final switched = await widget.walletSwitcherViewModel.switchToSelectedWallet();
+ if (!switched) {
+ if (mounted) {
+ unawaited(
+ showBar<void>(context, S.of(context).wallet_list_failed_to_load(wallet.name, "")),
+ );
+ }
+ return;
+ }
}
- final wallet = await WalletInfo.get(walletName, walletType);
- if (wallet == null) {
+
+ if (!mounted) {
return;
}
- widget.exchangeViewModel.depositAddress = wallet.address;
- addressController.text = _normalizeAddressFormat(wallet.address);
- widget.walletSwitcherViewModel.selectWallet(wallet);
- await widget.walletSwitcherViewModel.switchToSelectedWallet();
+
+ final canSendDeposit = widget.exchangeViewModel.useSameWalletAddress(
+ widget.exchangeViewModel.depositCurrency,
+ );
+ final address =
+ canSendDeposit ? widget.exchangeViewModel.wallet.walletAddresses.addressForExchange : "";
+ widget.exchangeViewModel.isSendFromExternal = !canSendDeposit;
+ widget.exchangeViewModel.depositAddress = address;
+ addressController.text = _normalizeAddressFormat(address);
+ if (!canSendDeposit) {
+ askForRefundAddress();
+ }
}
void askForRefundAddress() async {
### lib/view_model/exchange/exchange_view_model.dart
@@ -37,6 +37,7 @@ import 'package:cake_wallet/exchange/provider/trocador_exchange_provider.dart';
import 'package:cake_wallet/exchange/provider/xoswap_exchange_provider.dart';
import 'package:cake_wallet/exchange/trade.dart';
import 'package:cake_wallet/exchange/trade_request.dart';
+import "package:cake_wallet/exchange/utils/deposit_wallet_utils.dart";
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/new-ui/widgets/currency_picker/fiat_currency_picker_sheet.dart';
import 'package:cake_wallet/store/app_store.dart';
@@ -459,20 +460,14 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
@computed
Future<List<WalletInfo>> get depositWallets async {
- WalletType? type;
- type = cryptoCurrencyOrTokenToWalletType(depositCurrency);
+ final currency = depositCurrency;
+ final type = depositWalletType(currency);
if (type == null) {
- try {
- type =
- cryptoCurrencyOrTokenToWalletType(CryptoCurrency.fromString(depositCurrency.tag ?? ""));
- } catch (_) {}
- }
-
- if (type != null) {
- return await WalletInfo.selectList("type = ?", [type.index]);
+ return [];
}
- return await WalletInfo.getAll();
+ final wallets = await WalletInfo.selectList("type = ?", [type.index]);
+ return wallets.where((wallet) => canFundDeposit(wallet, currency)).toList();
}
@action
### res/pictures/send_another_asset.svg
@@ -0,0 +1,3 @@
+<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
+ <path d="M8.9 16.1443L14.25 10.7943V13.4H15.75V8.25H10.6V9.75H13.1807L7.85575 15.075L8.9 16.1443ZM12.0018 21.5C10.6878 21.5 9.45267 21.2507 8.2965 20.752C7.14033 20.2533 6.13467 19.5766 5.2795 18.7217C4.42433 17.8669 3.74725 16.8617 3.24825 15.706C2.74942 14.5503 2.5 13.3156 2.5 12.0018C2.5 10.6878 2.74933 9.45267 3.248 8.2965C3.74667 7.14033 4.42342 6.13467 5.27825 5.2795C6.13308 4.42433 7.13833 3.74725 8.294 3.24825C9.44967 2.74942 10.6844 2.5 11.9982 2.5C13.3122 2.5 14.5473 2.74933 15.7035 3.248C16.8597 3.74667 17.8653 4.42342 18.7205 5.27825C19.5757 6.13308 20.2528 7.13833 20.7518 8.294C21.2506 9.44967 21.5 10.6844 21.5 11.9982C21.5 13.3122 21.2507 14.5473 20.752 15.7035C20.2533 16.8597 19.5766 17.8653 18.7217 18.7205C17.8669 19.5757 16.8617 20.2528 15.706 20.7518C14.5503 21.2506 13.3156 21.5 12.0018 21.5ZM12 20C14.2333 20 16.125 19.225 17.675 17.675C19.225 16.125 20 14.2333 20 12C20 9.76667 19.225 7.875 17.675 6.325C16.125 4.775 14.2333 4 12 4C9.76667 4 7.875 4.775 6.325 6.325C4.775 7.875 4 9.76667 4 12C4 14.2333 4.775 16.125 6.325 17.675C7.875 19.225 9.76667 20 12 20Z" fill="white"/>
+</svg>
### res/values/strings_ar.arb
@@ -102,6 +102,7 @@
"available_balance_description": "يشير “Available Balance” أو “Confirmed Balance” إلى الأموال التي يمكن إنفاقها فورًا. إذا ظهرت الأموال في الرصيد السفلي ولكن ليس في الرصيد العلوي، فعليك الانتظار بضع دقائق حتى تحصل الأموال الواردة على المزيد من تأكيدات الشبكة. بعد حصولها على المزيد من التأكيدات، ستصبح قابلة للإنفاق.",
"available_balance_short": "المبلغ الإجمالي: ${amount}",
"available_providers": "مقدمي الخدمة المتاحين",
+ "available_wallets": "المحافظ المتاحة",
"avg_savings": "متوسط التوفير",
"avl": "AVL",
"awaitDAppProcessing": "يرجى الانتظار حتى ينتهي الـ dApp من المعالجة.",
@@ -1090,6 +1091,7 @@
"send": "إرسال",
"send_address": "عنوان ${cryptoCurrency}",
"send_amount": "المبلغ:",
+ "send_another_asset": "إرسال أصل آخر",
"send_change_to_you": "الفكة، إليك:",
"send_creating_transaction": "جارٍ إنشاء المعاملة",
"send_error_currency": "لا يمكن أن تحتوي العملة إلا على أرقام",
### res/values/strings_bg.arb
@@ -102,6 +102,7 @@
"available_balance_description": "„Наличният баланс“ или „Потвърденият баланс“ са средства, които могат да бъдат изразходвани веднага. Ако средствата се появяват в долния баланс, но не и в горния, трябва да изчакате няколко минути, докато входящите средства получат повече мрежови потвърждения. След като получат повече потвърждения, те ще могат да бъдат изразходвани.",
"available_balance_short": "Ср.: ${amount}",
"available_providers": "Налични доставчици",
+ "available_wallets": "Налични портфейли",
"avg_savings": "Средни спестявания",
"avl": "Avl",
"awaitDAppProcessing": "Моля, изчакайте dApp да завърши обработката.",
@@ -1090,6 +1091,7 @@
"send": "Изпрати",
"send_address": "${cryptoCurrency} адрес",
"send_amount": "Сума:",
+ "send_another_asset": "Изпратете друг актив",
"send_change_to_you": "Ресто, към вас:",
"send_creating_transaction": "Създаване на транзакция",
"send_error_currency": "Валутата може да съдържа само цифри",
### res/values/strings_cs.arb
@@ -102,6 +102,7 @@
"available_balance_description": "„Dostupný zůstatek“ nebo „Potvrzený zůstatek“ jsou prostředky, které lze okamžitě utratit. Pokud se prostředky zobrazují ve spodním zůstatku, ale ne v horním, musíte několik minut počkat, než příchozí prostředky získají více síťových potvrzení. Jakmile získají více potvrzení, bude možné je utratit.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Dostupní poskytovatelé",
+ "available_wallets": "Dostupné peněženky",
"avg_savings": "Prům. úspora",
"avl": "Avl",
"awaitDAppProcessing": "Počkejte prosím, až dApp dokončí zpracování.",
@@ -1090,6 +1091,7 @@
"send": "Odeslat",
"send_address": "${cryptoCurrency} adresa",
"send_amount": "Částka:",
+ "send_another_asset": "Pošlete další aktivum",
"send_change_to_you": "Drobné, vám:",
"send_creating_transaction": "Vytváření transakce",
"send_error_currency": "Měna může obsahovat pouze číslice",
### res/values/strings_de.arb
@@ -130,6 +130,7 @@
"available_balance_description": "Das „verfügbare Guthaben“ beziehungsweise „bestätigte Guthaben“ bezeichnet Beträge, die sofort ausgegeben werden können. Wenn Guthaben im unteren, aber nicht im oberen Kontostand angezeigt wird, warten Sie einige Minuten, bis die eingehenden Beträge weitere Netzwerkbestätigungen erhalten haben. Anschließend können sie ausgegeben werden.",
"available_balance_short": "Verf.: ${amount}",
"available_providers": "Verfügbare Anbieter",
+ "available_wallets": "Verfügbare Geldbörsen",
"avg_savings": "Durchschn. Ersparnis",
"avl": "Verf.",
"awaitDAppProcessing": "Bitte warten Sie, bis die dApp die Verarbeitung abgeschlossen hat.",
@@ -1137,6 +1138,7 @@
"send": "Senden",
"send_address": "${cryptoCurrency}-Adresse",
"send_amount": "Betrag:",
+ "send_another_asset": "Senden Sie ein weiteres Asset",
"send_change_to_you": "Wechselgeld, an Sie:",
"send_creating_transaction": "Transaktion wird erstellt",
"send_error_currency": "Die Währung darf nur Zahlen enthalten",
### res/values/strings_en.arb
@@ -130,6 +130,7 @@
"available_balance_description": "The “Available Balance” or “Confirmed Balance” are funds that can be spent immediately. If funds appear in the lower balance but not the top balance, then you must wait a few minutes for the incoming funds to get more network confirmations. After they get more confirmations, they will be spendable.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Available Providers",
+ "available_wallets": "Available Wallets",
"avg_savings": "Avg. Savings",
"avl": "Avl",
"awaitDAppProcessing": "Kindly wait for the dApp to finish processing.",
@@ -1137,6 +1138,7 @@
"send": "Send",
"send_address": "${cryptoCurrency} address",
"send_amount": "Amount:",
+ "send_another_asset": "Send another asset",
"send_change_to_you": "Change, to you:",
"send_creating_transaction": "Creating transaction",
"send_error_currency": "Currency can only contain numbers",
### res/values/strings_es.arb
@@ -102,6 +102,7 @@
"available_balance_description": "El “Saldo Disponible” o “Saldo Confirmado” son fondos que pueden gastarse de inmediato. Si los fondos aparecen en el saldo inferior pero no en el saldo superior, deberás esperar unos minutos a que los fondos entrantes obtengan más confirmaciones de la red. Una vez que tengan más confirmaciones, podrás gastarlos.",
"available_balance_short": "Valor medio: ${amount}",
"available_providers": "Proveedores disponibles",
+ "available_wallets": "Carteras disponibles",
"avg_savings": "Ahorro prom.",
"avl": "Avl",
"awaitDAppProcessing": "Espere a que la dApp termine de procesar.",
@@ -1091,6 +1092,7 @@
"send": "Enviar",
"send_address": "Dirección de ${cryptoCurrency}",
"send_amount": "Cantidad:",
+ "send_another_asset": "Enviar otro activo",
"send_change_to_you": "Cambio, para ti:",
"send_creating_transaction": "Creando transacción",
"send_error_currency": "La moneda solo puede contener números",
### res/values/strings_fa.arb
@@ -102,6 +102,7 @@
"available_balance_description": "«موجودی قابلدسترس» یا «موجودی تأییدشده» وجوهی هستند که میتوان بلافاصله خرج کرد.\nاگر وجوه در موجودی پایینتر ظاهر شوند اما در موجودی بالا نباشند، باید چند دقیقه صبر کنید تا وجوه ورودی تأییدهای شبکه بیشتری دریافت کنند.\nپس از دریافت تأییدهای بیشتر، قابل خرج کردن خواهند بود.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "ارائه دهندگان در دسترس",
+ "available_wallets": "کیف پول های موجود",
"avg_savings": "میانگین صرفهجویی",
"avl": "Avl",
"awaitDAppProcessing": "لطفاً منتظر بمانید تا پردازش dApp به پایان برسد.",
@@ -1090,6 +1091,7 @@
"send": "ارسال",
"send_address": "آدرس ${cryptoCurrency}",
"send_amount": "مقدار:",
+ "send_another_asset": "یک دارایی دیگر ارسال کنید",
"send_change_to_you": "باقیمانده، به شما:",
"send_creating_transaction": "در حال ایجاد تراکنش",
"send_error_currency": "واحد پول فقط میتواند شامل اعداد باشد",
### res/values/strings_fr.arb
@@ -102,6 +102,7 @@
"available_balance_description": "Le « Solde disponible » ou le « Solde confirmé » correspond aux fonds que vous pouvez dépenser immédiatement. Si des fonds apparaissent dans le solde inférieur mais pas dans le solde supérieur, vous devez attendre quelques minutes pour que les fonds entrants obtiennent davantage de confirmations sur le réseau. Une fois qu’ils auront reçu plus de confirmations, ils pourront être dépensés.",
"available_balance_short": "Valeur moyenne : ${amount}",
"available_providers": "Fournisseurs disponibles",
+ "available_wallets": "Portefeuilles disponibles",
"avg_savings": "Économies moy.",
"avl": "Avl",
"awaitDAppProcessing": "Veuillez patienter pendant que la dApp termine le traitement.",
@@ -1090,6 +1091,7 @@
"send": "Envoyer",
"send_address": "Adresse ${cryptoCurrency}",
"send_amount": "Montant :",
+ "send_another_asset": "Envoyer un autre élément",
"send_change_to_you": "Monnaie rendue, pour vous :",
"send_creating_transaction": "Création de la transaction",
"send_error_currency": "Le montant ne peut contenir que des chiffres",
### res/values/strings_gn.arb
@@ -102,6 +102,7 @@
"available_balance_description": "Pe “Available Balance” térã “Confirmed Balance” ha'e umi fondo ikatúva reipuru pya'e. Umi fondo ojehecháramo pe saldo yvýpe ha ndaha'éi pe saldo yvate gotyo, upéicharõ eha'arõ sapy'ami hag̃ua umi fondo og̃uahẽva ohupytyve hag̃ua confirmación de red. Oguerekóvo hetave confirmación, ikatúta reipuru.",
"available_balance_short": "Avl: ${amount}.",
"available_providers": "Umi Proveedor ojeguerekóva",
+ "available_wallets": "Carteras ojeguerekóva",
"avg_savings": "Ñongatu mbytegua",
"avl": "Avl",
"awaitDAppProcessing": "Eha'arõmi pe dApp omohu'ã hag̃ua hembiapo.",
@@ -1092,6 +1093,7 @@
"send": "Emondo",
"send_address": "Dirección ${cryptoCurrency} rehegua",
"send_amount": "Hetakue:",
+ "send_another_asset": "Omondo ambue bien",
"send_change_to_you": "Ñemoambue, ndéve:",
"send_creating_transaction": "Ojejapo hag̃ua ñembohasa",
"send_error_currency": "Pe moneda ikatu oguereko papapy añoite.",
### res/values/strings_ha.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Ma'aunin da ake da shi” ko “Tabbataccen Ma'auni” su ne kuɗaɗen da za a iya kashewa nan take. Idan kuɗaɗe sun bayyana a ƙananan ma'auni amma ba a babban ma'auni ba, to dole ne ku jira 'yan mintoci kaɗan domin kuɗaɗen da ke shigowa su sami ƙarin tabbaci daga hanyar sadarwa. Bayan sun sami ƙarin tabbaci, za a iya kashe su.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Akwai Masu Bayarwa",
+ "available_wallets": "Akwai Wallets",
"avg_savings": "Matsakaitan Ajiya",
"avl": "Avl",
"awaitDAppProcessing": "Da fatan za a jira dApp ya kammala sarrafawa.",
@@ -1092,6 +1093,7 @@
"send": "Aika",
"send_address": "Adireshin ${cryptoCurrency}",
"send_amount": "Adadi:",
+ "send_another_asset": "Aika wani kadari",
"send_change_to_you": "Ragowa, zuwa gare ku:",
"send_creating_transaction": "Ana ƙirƙirar ma'amala",
"send_error_currency": "Kuɗi na iya ƙunsar lambobi kawai",
### res/values/strings_hi.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Available Balance” या “Confirmed Balance” वे धनराशि हैं जिन्हें तुरंत खर्च किया जा सकता है। यदि फंड नीचे वाले बैलेंस में दिखाई देते हैं, लेकिन ऊपर वाले बैलेंस में नहीं, तो आने वाले फंड को नेटवर्क पर और अधिक पुष्टिकरण मिलने के लिए आपको कुछ मिनट इंतज़ार करना होगा। अधिक पुष्टिकरण मिलने के बाद, वे खर्च करने योग्य हो जाएंगे।",
"available_balance_short": "एवीएल: ${amount}",
"available_providers": "उपलब्ध प्रदाता",
+ "available_wallets": "उपलब्ध वॉलेट",
"avg_savings": "औसत बचत",
"avl": "अवल",
"awaitDAppProcessing": "कृपया dApp की प्रोसेसिंग पूरी होने तक प्रतीक्षा करें।",
@@ -1092,6 +1093,7 @@
"send": "भेजें",
"send_address": "${cryptoCurrency} पता",
"send_amount": "राशि:",
+ "send_another_asset": "दूसरी संपत्ति भेजें",
"send_change_to_you": "चेंज, आपको:",
"send_creating_transaction": "लेनदेन बनाया जा रहा है",
"send_error_currency": "मुद्रा में केवल संख्याएँ हो सकती हैं",
### res/values/strings_hr.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Dostupno stanje” ili “Potvrđeno stanje” su sredstva koja možete odmah potrošiti. Ako se sredstva prikazuju u donjem stanju, ali ne i u gornjem, morate pričekati nekoliko minuta da dolazna sredstva dobiju više mrežnih potvrda. Nakon što dobiju više potvrda, moći ćete ih potrošiti.",
"available_balance_short": "Prosjek: ${amount}",
"available_providers": "Dostupni pružatelji usluga",
+ "available_wallets": "Dostupni novčanici",
"avg_savings": "Prosj. ušteda",
"avl": "Avl",
"awaitDAppProcessing": "Molimo pričekajte da dApp završi s obradom.",
@@ -1090,6 +1091,7 @@
"send": "Pošalji",
"send_address": "${cryptoCurrency} adresa",
"send_amount": "Iznos:",
+ "send_another_asset": "Pošalji drugo sredstvo",
"send_change_to_you": "Kusur, vama:",
"send_creating_transaction": "Stvaranje transakcije",
"send_error_currency": "Valuta može sadržavati samo brojeve",
### res/values/strings_hy.arb
@@ -102,6 +102,7 @@
"available_balance_description": "«Հասանելի մնացորդը» կամ «Հաստատված մնացորդը» միջոցներ են, որոնք կարելի է անմիջապես ծախսել։ Եթե միջոցները երևում են ստորին մնացորդում, բայց ոչ վերևի մնացորդում, ապա պետք է մի քանի րոպե սպասեք, մինչև մուտքագրվող միջոցները ստանան ավելի շատ ցանցային հաստատումներ։ Ավելի շատ հաստատումներ ստանալուց հետո դրանք հնարավոր կլինի ծախսել։",
"available_balance_short": "Ավլ՝ ${amount}",
"available_providers": "Հասանելի մատակարարներ",
+ "available_wallets": "Հասանելի դրամապանակներ",
"avg_savings": "Միջին խնայողություն",
"avl": "Ավլ",
"awaitDAppProcessing": "Խնդրում ենք սպասել, մինչև dApp-ը ավարտի մշակումը։",
@@ -1090,6 +1091,7 @@
"send": "Ուղարկել",
"send_address": "${cryptoCurrency} հասցե",
"send_amount": "Գումար՝",
+ "send_another_asset": "Ուղարկեք մեկ այլ ակտիվ",
"send_change_to_you": "Մանրադրամ, ձեզ:",
"send_creating_transaction": "Գործարքի ստեղծում",
"send_error_currency": "Արժույթը կարող է պարունակել միայն թվեր",
### res/values/strings_id.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Saldo Tersedia” atau “Saldo Terkonfirmasi” adalah dana yang dapat langsung dibelanjakan. Jika dana muncul di saldo bawah tetapi tidak di saldo atas, maka Anda harus menunggu beberapa menit agar dana masuk mendapatkan konfirmasi jaringan tambahan. Setelah mendapatkan lebih banyak konfirmasi, dana tersebut akan dapat dibelanjakan.",
"available_balance_short": "Rata-rata: ${amount}",
"available_providers": "Penyedia yang Tersedia",
+ "available_wallets": "Dompet yang Tersedia",
"avg_savings": "Rata-rata Penghematan",
"avl": "Rata-rata",
"awaitDAppProcessing": "Mohon tunggu hingga dApp selesai memproses.",
@@ -1093,6 +1094,7 @@
"send": "Kirim",
"send_address": "Alamat ${cryptoCurrency}",
"send_amount": "Jumlah:",
+ "send_another_asset": "Kirim aset lain",
"send_change_to_you": "Kembalian, untuk Anda:",
"send_creating_transaction": "Membuat transaksi",
"send_error_currency": "Mata uang hanya boleh berisi angka",
### res/values/strings_it.arb
@@ -102,6 +102,7 @@
"available_balance_description": "Il “Saldo disponibile” o “Saldo confermato” sono fondi che possono essere spesi immediatamente. Se i fondi compaiono nel saldo in basso ma non in quello in alto, devi attendere qualche minuto affinché i fondi in arrivo ottengano ulteriori conferme di rete. Dopo aver ricevuto più conferme, saranno spendibili.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Fornitori disponibili",
+ "available_wallets": "Portafogli disponibili",
"avg_savings": "Risparmio medio",
"avl": "Avl",
"awaitDAppProcessing": "Attendi che la dApp completi l'elaborazione.",
@@ -1091,6 +1092,7 @@
"send": "Invia",
"send_address": "Indirizzo ${cryptoCurrency}",
"send_amount": "Importo:",
+ "send_another_asset": "Invia un'altra risorsa",
"send_change_to_you": "Resto, a te:",
"send_creating_transaction": "Creazione della transazione",
"send_error_currency": "La valuta può contenere solo numeri",
### res/values/strings_ja.arb
@@ -102,6 +102,7 @@
"available_balance_description": "「利用可能な残高」または「承認済み残高」は、すぐに使用できる資金です。下の残高には表示されているのに上の残高に表示されない場合は、受信した資金がネットワークでさらに承認(確認)されるまで数分待つ必要があります。承認数が増えると、使用できるようになります。",
"available_balance_short": "平均: ${amount}",
"available_providers": "利用可能なプロバイダー",
+ "available_wallets": "利用可能なウォレット",
"avg_savings": "平均節約額",
"avl": "アヴル",
"awaitDAppProcessing": "dAppの処理が完了するまでお待ちください。",
@@ -1091,6 +1092,7 @@
"send": "送信",
"send_address": "${cryptoCurrency} アドレス",
"send_amount": "金額:",
+ "send_another_asset": "別のアセットを送信する",
"send_change_to_you": "お釣り(自分宛て):",
"send_creating_transaction": "トランザクションを作成しています",
"send_error_currency": "通貨には数字のみを含めることができます",
### res/values/strings_ko.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“사용 가능 잔액” 또는 “확정 잔액”은 즉시 사용할 수 있는 자금입니다. 자금이 아래 잔액에는 표시되지만 위 잔액에는 표시되지 않는 경우, 입금된 자금이 네트워크에서 더 많은 컨펌(확인)을 받을 때까지 몇 분 정도 기다려야 합니다. 더 많은 컨펌을 받은 후에는 사용할 수 있습니다.",
"available_balance_short": "평균: ${amount}",
"available_providers": "이용 가능한 제공업체",
+ "available_wallets": "사용 가능한 지갑",
"avg_savings": "평균 절감액",
"avl": "Avl",
"awaitDAppProcessing": "dApp의 처리가 완료될 때까지 잠시 기다려 주세요.",
@@ -1090,6 +1091,7 @@
"send": "보내기",
"send_address": "${cryptoCurrency} 주소",
"send_amount": "수량:",
+ "send_another_asset": "다른 자산 보내기",
"send_change_to_you": "거스름돈, 나에게:",
"send_creating_transaction": "트랜잭션 생성 중",
"send_error_currency": "통화는 숫자만 포함할 수 있습니다",
### res/values/strings_my.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Available Balance” သို့မဟုတ် “Confirmed Balance” သည် ချက်ချင်းသုံးစွဲနိုင်သော လက်ကျန်ငွေဖြစ်သည်။ လက်ကျန်အောက်ပိုင်းတွင်သာ ဝင်လာသော်လည်း အပေါ်ပိုင်းလက်ကျန်တွင် မပေါ်သေးပါက ကွန်ယက်အတည်ပြုချက် (network confirmations) ပိုမိုရရှိရန် မိနစ်အနည်းငယ် စောင့်ရပါမည်။ အတည်ပြုချက်များ ပိုမိုရရှိပြီးနောက် ထိုငွေများကို သုံးစွဲနိုင်ပါလိမ့်မည်။",
"available_balance_short": "Avl- ${amount}",
"available_providers": "ရရှိနိုင်သော ဝန်ဆောင်မှုပေးသူများ",
+ "available_wallets": "ရနိုင်သော ပိုက်ဆံအိတ်များ",
"avg_savings": "ပျမ်းမျှ ချွေတာမှု",
"avl": "Avl",
"awaitDAppProcessing": "ကျေးဇူးပြု၍ dApp ၏ စီမံဆောင်ရွက်မှု ပြီးဆုံးသည်အထိ စောင့်ပါ။",
@@ -1090,6 +1091,7 @@
"send": "ပို့ရန်",
"send_address": "${cryptoCurrency} လိပ်စာ",
"send_amount": "ပမာဏ:",
+ "send_another_asset": "အခြားပစ္စည်းကို ပို့ပါ။",
"send_change_to_you": "အပြန်ငွေ (Change), သင့်ထံသို့:",
"send_creating_transaction": "ငွေလွှဲလုပ်ငန်းစဉ်ကို ဖန်တီးနေသည်",
"send_error_currency": "ငွေကြေးပမာဏတွင် နံပါတ်များသာ ထည့်နိုင်သည်။",
### res/values/strings_nl.arb
@@ -102,6 +102,7 @@
"available_balance_description": "Het “Beschikbare saldo” of “Bevestigde saldo” zijn fondsen die direct kunnen worden uitgegeven. Als fondsen in het lagere saldo verschijnen maar niet in het bovenste saldo, dan moet je een paar minuten wachten tot de inkomende fondsen meer netwerkbevestigingen krijgen. Daarna kan het worden uitgegeven.",
"available_balance_short": "Gem.: ${amount}",
"available_providers": "Beschikbare aanbieders",
+ "available_wallets": "Beschikbare portemonnees",
"avg_savings": "Gem. besparingen",
"avl": "Gem",
"awaitDAppProcessing": "Wacht tot de dApp klaar is met verwerken.",
@@ -1090,6 +1091,7 @@
"send": "Verzenden",
"send_address": "${cryptoCurrency}-adres",
"send_amount": "Bedrag:",
+ "send_another_asset": "Stuur nog een item",
"send_change_to_you": "Wisselgeld, aan jou:",
"send_creating_transaction": "Transactie maken",
"send_error_currency": "Valuta kan alleen cijfers bevatten",
### res/values/strings_pl.arb
@@ -102,6 +102,7 @@
"available_balance_description": "„Dostępne saldo” lub „Potwierdzone saldo” to środki, które można wydać od razu. Jeśli środki pojawiają się w dolnym saldzie, ale nie w górnym, musisz poczekać kilka minut, aż przychodzące środki uzyskają więcej potwierdzeń sieci. Gdy uzyskają więcej potwierdzeń, będzie można je wydać.",
"available_balance_short": "Średnia: ${amount}",
"available_providers": "Dostępni dostawcy",
+ "available_wallets": "Dostępne portfele",
"avg_savings": "Śr. oszczędności",
"avl": "Avl",
"awaitDAppProcessing": "Proszę poczekać, aż dApp zakończy przetwarzanie.",
@@ -1090,6 +1091,7 @@
"send": "Wyślij",
"send_address": "Adres ${cryptoCurrency}",
"send_amount": "Kwota:",
+ "send_another_asset": "Wyślij kolejny zasób",
"send_change_to_you": "Reszta, do Ciebie:",
"send_creating_transaction": "Tworzenie transakcji",
"send_error_currency": "Waluta może zawierać tylko liczby",
### res/values/strings_pt.arb
@@ -102,6 +102,7 @@
"available_balance_description": "O “Saldo Disponível” ou “Saldo Confirmado” são fundos que podem ser gastos imediatamente. Se os fundos aparecerem no saldo inferior, mas não no saldo superior, você deve aguardar alguns minutos para que os fundos recebidos obtenham mais confirmações na rede. Depois que tiverem mais confirmações, eles poderão ser gastos.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Provedores disponíveis",
+ "available_wallets": "Carteiras disponíveis",
"avg_savings": "Poupança média",
"avl": "Avl",
"awaitDAppProcessing": "Por favor, aguarde o dApp concluir o processamento.",
@@ -1092,6 +1093,7 @@
"send": "Enviar",
"send_address": "Endereço de ${cryptoCurrency}",
"send_amount": "Valor:",
+ "send_another_asset": "Enviar outro ativo",
"send_change_to_you": "Troco, para você:",
"send_creating_transaction": "Criando transação",
"send_error_currency": "A moeda só pode conter números",
### res/values/strings_pt_BR.arb
@@ -100,6 +100,7 @@
"available_balance_description": "O “Saldo disponível” ou “Saldo confirmado” são fundos que podem ser gastos imediatamente. Se os fundos aparecerem no saldo inferior, mas não no saldo superior, você deve aguardar alguns minutos para que os fundos recebidos obtenham mais confirmações na rede. Depois que tiverem mais confirmações, eles poderão ser gastos.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Provedores disponíveis",
+ "available_wallets": "Carteiras disponíveis",
"avg_savings": "Economia média",
"avl": "Avl",
"awaitDAppProcessing": "Aguarde até que o dApp termine de processar.",
@@ -1089,6 +1090,7 @@
"send": "Enviar",
"send_address": "Endereço ${cryptoCurrency}",
"send_amount": "Valor:",
+ "send_another_asset": "Enviar outro ativo",
"send_change_to_you": "Troco, para você:",
"send_creating_transaction": "Criando transação",
"send_error_currency": "A moeda só pode conter números",
### res/values/strings_ru.arb
@@ -102,6 +102,7 @@
"available_balance_description": "«Доступный баланс» или «Подтверждённый баланс» — это средства, которые можно потратить сразу. Если средства отображаются в нижнем балансе, но не в верхнем, значит, нужно подождать несколько минут, пока входящие средства получат больше подтверждений сети. После получения дополнительных подтверждений их можно будет потратить.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Доступные провайдеры",
+ "available_wallets": "Доступные кошельки",
"avg_savings": "Средняя экономия",
"avl": "Авл",
"awaitDAppProcessing": "Пожалуйста, подождите, пока dApp завершит обработку.",
@@ -1091,6 +1092,7 @@
"send": "Отправить",
"send_address": "${cryptoCurrency} адрес",
"send_amount": "Сумма:",
+ "send_another_asset": "Отправить еще один актив",
"send_change_to_you": "Сдача вам:",
"send_creating_transaction": "Создание транзакции",
"send_error_currency": "Валюта может содержать только цифры",
### res/values/strings_th.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“ยอดคงเหลือที่ใช้ได้” หรือ “ยอดคงเหลือที่ยืนยันแล้ว” คือเงินที่สามารถใช้จ่ายได้ทันที หากเงินปรากฏในยอดคงเหลือด้านล่างแต่ไม่ปรากฏในยอดคงเหลือด้านบน คุณต้องรอสักครู่เพื่อให้เงินที่เข้ามาได้รับการยืนยันจากเครือข่ายเพิ่มขึ้น เมื่อได้รับการยืนยันมากขึ้นแล้ว เงินนั้นจะสามารถใช้จ่ายได้",
"available_balance_short": "จำนวน: ${amount}",
"available_providers": "ผู้ให้บริการที่มีอยู่",
+ "available_wallets": "กระเป๋าเงินที่มีจำหน่าย",
"avg_savings": "การประหยัดเฉลี่ย",
"avl": "เฉลี่ย",
"awaitDAppProcessing": "โปรดรอให้ dApp ประมวลผลให้เสร็จสิ้น",
@@ -1090,6 +1091,7 @@
"send": "ส่ง",
"send_address": "ที่อยู่ ${cryptoCurrency}",
"send_amount": "จำนวน:",
+ "send_another_asset": "ส่งทรัพย์สินอีก",
"send_change_to_you": "เงินทอน ส่งกลับให้คุณ:",
"send_creating_transaction": "กำลังสร้างธุรกรรม",
"send_error_currency": "สกุลเงินต้องมีเฉพาะตัวเลขเท่านั้น",
### res/values/strings_tl.arb
@@ -102,6 +102,7 @@
"available_balance_description": "Ang “Magagamit na Balanse” o “Nakumpirmang Balanse” ay mga pondong maaari nang gastusin kaagad. Kung lumalabas ang mga pondo sa mas mababang balanse ngunit wala sa itaas na balanse, kailangan mong maghintay ng ilang minuto para makakuha ng mas maraming kumpirmasyon sa network ang mga papasok na pondo. Kapag nakakuha na sila ng mas maraming kumpirmasyon, maaari na silang gastusin.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Mga Available na Provider",
+ "available_wallets": "Magagamit na mga Wallet",
"avg_savings": "Avg. Matitipid",
"avl": "Avl",
"awaitDAppProcessing": "Mangyaring maghintay hanggang matapos ang pagproseso ng dApp.",
@@ -1090,6 +1091,7 @@
"send": "Ipadala",
"send_address": "${cryptoCurrency} address",
"send_amount": "Halaga:",
+ "send_another_asset": "Magpadala ng isa pang asset",
"send_change_to_you": "Sukli, sa iyo:",
"send_creating_transaction": "Ginagawa ang transaksyon",
"send_error_currency": "Ang currency ay maaari lamang maglaman ng mga numero",
### res/values/strings_tr.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Kullanılabilir Bakiye” veya “Onaylanmış Bakiye”, hemen harcanabilen fonlardır. Fonlar alt bakiyede görünüp üst bakiyede görünmüyorsa, gelen fonların ağda daha fazla onay alması için birkaç dakika beklemeniz gerekir. Daha fazla onay aldıktan sonra harcanabilir olacaktır.",
"available_balance_short": "Ortalama: ${amount}",
"available_providers": "Mevcut Sağlayıcılar",
+ "available_wallets": "Mevcut Cüzdanlar",
"avg_savings": "Ort. Tasarruf",
"avl": "Avl",
"awaitDAppProcessing": "Lütfen dApp'in işlemi tamamlamasını bekleyin.",
@@ -1090,6 +1091,7 @@
"send": "Gönder",
"send_address": "${cryptoCurrency} adresi",
"send_amount": "Miktar:",
+ "send_another_asset": "Başka bir varlık gönder",
"send_change_to_you": "Para üstü, size:",
"send_creating_transaction": "İşlem oluşturuluyor",
"send_error_currency": "Para birimi yalnızca sayılardan oluşabilir",
### res/values/strings_uk.arb
@@ -102,6 +102,7 @@
"available_balance_description": "«Доступний баланс» або «Підтверджений баланс» — це кошти, які можна витратити негайно. Якщо кошти відображаються в нижньому балансі, але не у верхньому, потрібно зачекати кілька хвилин, доки вхідні кошти отримають більше підтверджень мережі. Після отримання додаткових підтверджень їх можна буде витратити.",
"available_balance_short": "Середня сума: ${amount}",
"available_providers": "Доступні постачальники",
+ "available_wallets": "Доступні гаманці",
"avg_savings": "Сер. заощадження",
"avl": "Avl",
"awaitDAppProcessing": "Будь ласка, зачекайте, доки dApp завершить обробку.",
@@ -1091,6 +1092,7 @@
"send": "Надіслати",
"send_address": "${cryptoCurrency} адреса",
"send_amount": "Сума:",
+ "send_another_asset": "Надіслати інший актив",
"send_change_to_you": "Решта, вам:",
"send_creating_transaction": "Створення транзакції",
"send_error_currency": "Валюта може містити лише цифри",
### res/values/strings_ur.arb
@@ -102,6 +102,7 @@
"available_balance_description": "”دستیاب بیلنس” یا ”تصدیق شدہ بیلنس” وہ فنڈز ہیں جنہیں فوراً خرچ کیا جا سکتا ہے۔ اگر فنڈز نیچے والے بیلنس میں نظر آئیں لیکن اوپر والے بیلنس میں نہیں، تو آپ کو آنے والے فنڈز کے مزید نیٹ ورک کنفرمیشنز حاصل ہونے کے لیے چند منٹ انتظار کرنا ہوگا۔ جب انہیں مزید کنفرمیشنز مل جائیں گی تو وہ خرچ کے قابل ہو جائیں گے۔",
"available_balance_short": "Avl: ${amount}",
"available_providers": "دستیاب فراہم کنندگان",
+ "available_wallets": "دستیاب بٹوے",
"avg_savings": "اوسط بچت",
"avl": "Avl",
"awaitDAppProcessing": "براہِ کرم dApp کی پروسیسنگ مکمل ہونے تک انتظار کریں۔",
@@ -1092,6 +1093,7 @@
"send": "بھیجیں",
"send_address": "${cryptoCurrency} ایڈریس",
"send_amount": "رقم:",
+ "send_another_asset": "دوسرا اثاثہ بھیجیں۔",
"send_change_to_you": "بقایا، آپ کو:",
"send_creating_transaction": "ٹرانزیکشن بنائی جا رہی ہے",
"send_error_currency": "کرنسی میں صرف اعداد شامل ہو سکتے ہیں۔",
### res/values/strings_vi.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Số dư khả dụng” hoặc “Số dư đã xác nhận” là số tiền có thể chi tiêu ngay lập tức. Nếu tiền xuất hiện ở số dư phía dưới nhưng không xuất hiện ở số dư phía trên, thì bạn phải đợi vài phút để khoản tiền đến có thêm xác nhận từ mạng. Sau khi có thêm xác nhận, chúng sẽ có thể chi tiêu.",
"available_balance_short": "Trung bình: ${amount}",
"available_providers": "Nhà cung cấp có sẵn",
+ "available_wallets": "Ví có sẵn",
"avg_savings": "Tiết kiệm TB",
"avl": "trung bình",
"awaitDAppProcessing": "Vui lòng đợi dApp xử lý xong.",
@@ -1091,6 +1092,7 @@
"send": "Gửi",
"send_address": "Địa chỉ ${cryptoCurrency}",
"send_amount": "Số lượng:",
+ "send_another_asset": "Gửi nội dung khác",
"send_change_to_you": "Tiền thừa, gửi về bạn:",
"send_creating_transaction": "Đang tạo giao dịch",
"send_error_currency": "Trường tiền tệ chỉ được chứa số",
### res/values/strings_yo.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“Iwọntunwọnsi Wa” tabi “Iwọntunwọnsi Ti a Jẹ́rìí” jẹ́ àwọn owó tí o lè na lẹ́sẹ̀kẹsẹ. Bí àwọn owó bá hàn ní iwọntunwọnsi ìsàlẹ̀ ṣùgbọ́n kì í hàn ní iwọntunwọnsi òkè, nígbà náà o gbọdọ̀ dúró fún ìṣẹ́jú díẹ̀ kí àwọn owó tí ń wọlé lè gba ìjẹ́rìí nẹ́tíwọ́ọ̀kì púpọ̀ síi. Lẹ́yìn tí wọ́n bá ti gba ìjẹ́rìí púpọ̀ síi, o lè na wọ́n.",
"available_balance_short": "Avl: ${amount}",
"available_providers": "Awọn olupese ti o wa",
+ "available_wallets": "Awọn Woleti ti o wa",
"avg_savings": "Ìpamọ́ àpapọ̀",
"avl": "Avl",
"awaitDAppProcessing": "Jọ̀wọ́, dúró kí dApp parí ìṣiṣẹ́.",
@@ -1091,6 +1092,7 @@
"send": "Fìránṣẹ́",
"send_address": "Àdírẹ́sì ${cryptoCurrency}",
"send_amount": "Iye:",
+ "send_another_asset": "Fi ohun-ini miiran ranṣẹ",
"send_change_to_you": "Iyokù, sí ọ:",
"send_creating_transaction": "Ń dá ìdúnàdúrà sílẹ̀",
"send_error_currency": "Owo gbọdọ̀ ní àwọn nọ́mbà nìkan",
### res/values/strings_zh.arb
@@ -102,6 +102,7 @@
"available_balance_description": "“可用余额”或“确认余额”是指可立即花费的资金。如果资金显示在下方余额中但未显示在上方余额中,则需要等待几分钟,让转入资金获得更多网络确认。获得更多确认后,这些资金即可花费。",
"available_balance_short": "平均价值:${amount}",
"available_providers": "可用的提供商",
+ "available_wallets": "可用钱包",
"avg_savings": "平均节省",
"avl": "平均",
"awaitDAppProcessing": "请稍候,等待 dApp 完成处理。",
@@ -1090,6 +1091,7 @@
"send": "发送",
"send_address": "${cryptoCurrency} 地址",
"send_amount": "数量:",
+ "send_another_asset": "发送另一个资产",
"send_change_to_you": "找零(返回给您):",
"send_creating_transaction": "正在创建交易",
"send_error_currency": "币种只能包含数字",
### test/exchange/utils/deposit_wallet_utils_test.dart
@@ -0,0 +1,55 @@
+import "package:cake_wallet/exchange/utils/deposit_wallet_utils.dart";
+import "package:cw_core/crypto_currency.dart";
+import "package:cw_core/wallet_info.dart";
+import "package:cw_core/wallet_type.dart";
+import "package:flutter_test/flutter_test.dart";
+
+void main() {
+ WalletInfo bitcoinWallet({HardwareWalletType? hardwareWalletType}) => WalletInfo.external(
+ id: "id",
+ name: "wallet",
+ type: WalletType.bitcoin,
+ isRecovery: false,
+ restoreHeight: 0,
+ date: DateTime(2026),
+ dirPath: "",
+ path: "",
+ address: "",
+ hardwareWalletType: hardwareWalletType,
+ );
+
+ group("depositWalletType", () {
+ test("is null for a chain without wallets, so no source wallets are offered", () {
+ expect(depositWalletType(CryptoCurrency.ada), isNull);
+ });
+
+ test("resolves coins, tokens and Lightning to the wallet type that holds them", () {
+ expect(depositWalletType(CryptoCurrency.xmr), WalletType.monero);
+ expect(depositWalletType(CryptoCurrency.usdttrc20), WalletType.tron);
+ expect(depositWalletType(CryptoCurrency.btcln), WalletType.bitcoin);
+ });
+ });
+
+ group("canFundDeposit", () {
+ test("keeps hardware wallets out of Lightning deposits", () {
+ expect(
+ canFundDeposit(
+ bitcoinWallet(hardwareWalletType: HardwareWalletType.ledger),
+ CryptoCurrency.btcln,
+ ),
+ isFalse,
+ );
+ expect(canFundDeposit(bitcoinWallet(), CryptoCurrency.btcln), isTrue);
+ });
+
+ test("allows hardware wallets for on-chain deposits", () {
+ expect(
+ canFundDeposit(
+ bitcoinWallet(hardwareWalletType: HardwareWalletType.ledger),
+ CryptoCurrency.btc,
+ ),
+ isTrue,
+ );
+ });
+ });
+}
### test/new-ui/widgets/currency_picker/currency_picker_args_test.dart
@@ -0,0 +1,55 @@
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart";
+import "package:cw_core/crypto_currency.dart";
+import "package:cw_core/erc20_token.dart";
+import "package:flutter_test/flutter_test.dart";
+
+void main() {
+ const btcBalance = CurrencyPickerBalance(amount: "0.5 BTC");
+ const usdcBalance = CurrencyPickerBalance(amount: "100 USDC");
+
+ Erc20Token usdcToken({required String contractAddress, required String tag}) => Erc20Token(
+ name: "USD Coin",
+ symbol: "USDC",
+ contractAddress: contractAddress,
+ decimal: 6,
+ tag: tag,
+ );
+
+ group("balanceForAsset", () {
+ test("finds the balance stored under the same currency", () {
+ expect(balanceForAsset({CryptoCurrency.btc: btcBalance}, CryptoCurrency.btc), btcBalance);
+ });
+
+ test("matches a listed currency to the wallet token with the same title and tag", () {
+ final token = usdcToken(contractAddress: "0xa0b8", tag: "ETH");
+
+ expect(balanceForAsset({token: usdcBalance}, CryptoCurrency.usdc), usdcBalance);
+ });
+
+ test("does not show the on-chain BTC balance for Lightning", () {
+ expect(balanceForAsset({CryptoCurrency.btc: btcBalance}, CryptoCurrency.btcln), isNull);
+ });
+
+ test("does not match the same token on another chain", () {
+ final token = usdcToken(contractAddress: "0x8335", tag: "BASE");
+
+ expect(balanceForAsset({token: usdcBalance}, CryptoCurrency.usdc), isNull);
+ });
+
+ test("returns nothing when two balances share the title and tag", () {
+ final balances = {
+ usdcToken(contractAddress: "0xa0b8", tag: "ETH"): usdcBalance,
+ usdcToken(contractAddress: "0xdead", tag: "ETH"): btcBalance,
+ };
+
+ expect(balanceForAsset(balances, CryptoCurrency.usdc), isNull);
+ });
+
+ test("matches tokens by contract address regardless of case", () {
+ final stored = usdcToken(contractAddress: "0xA0B8", tag: "ETH");
+ final picked = usdcToken(contractAddress: "0xa0b8", tag: "ETH");
+
+ expect(balanceForAsset({stored: usdcBalance}, picked), usdcBalance);
+ });
+ });
+}
### test/new-ui/widgets/currency_picker/currency_picker_sheet_test.dart
@@ -0,0 +1,130 @@
+import "package:cake_wallet/generated/i18n.dart";
+import "package:cake_wallet/locales/locale.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_args.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_row.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/currency_picker_sheet.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/multi_network_currency_picker.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/pill_grid.dart";
+import "package:cake_wallet/new-ui/widgets/currency_picker/single_network_currency_picker.dart";
+import "package:cw_core/crypto_currency.dart";
+import "package:cw_core/wallet_type.dart";
+import "package:flutter/material.dart";
+import "package:flutter_test/flutter_test.dart";
+
+void main() {
+ late List<CryptoCurrency> walletPicks;
+ late List<CryptoCurrency> otherPicks;
+ late bool sheetClosed;
+
+ setUp(() {
+ walletPicks = [];
+ otherPicks = [];
+ sheetClosed = false;
+ });
+
+ CurrencyPickerArgs pickerArgs() => CurrencyPickerArgs(
+ items: const [CryptoCurrency.xmr],
+ selected: CryptoCurrency.xmr,
+ filterByNetwork: WalletType.monero,
+ useSingleNetworkLayout: true,
+ walletName: "Main",
+ onSelected: walletPicks.add,
+ symbolResolver: (currency) => currency.title,
+ otherAssets: CurrencyPickerArgs(
+ items: const [
+ CryptoCurrency.btc,
+ CryptoCurrency.usdterc20,
+ CryptoCurrency.usdttrc20,
+ ],
+ onSelected: otherPicks.add,
+ symbolResolver: (currency) => currency.title,
+ ),
+ );
+
+ Future<void> openPicker(WidgetTester tester) async {
+ await tester.pumpWidget(
+ MaterialApp(
+ localizationsDelegates: localizationDelegates,
+ supportedLocales: S.delegate.supportedLocales,
+ home: Scaffold(
+ body: Builder(
+ builder: (context) => TextButton(
+ onPressed: () async {
+ await CurrencyPickerSheet.show(context: context, args: pickerArgs());
+ sheetClosed = true;
+ },
+ child: const Text("open"),
+ ),
+ ),
+ ),
+ ),
+ );
+ await tester.tap(find.text("open"));
+ await tester.pumpAndSettle();
+ expect(find.byType(SingleNetworkCurrencyPicker), findsOneWidget);
+ }
+
+ Future<void> openOtherAssets(WidgetTester tester) async {
+ await tester.tap(find.text(S.current.send_another_asset));
+ await tester.pumpAndSettle();
+ expect(find.byType(MultiNetworkCurrencyPicker), findsOneWidget);
+ }
+
+ Finder rowFor(CryptoCurrency currency) => find
+ .byWidgetPredicate((widget) => widget is CurrencyPickerRow && widget.currency == currency)
+ .first;
+
+ testWidgets("picking from the wallet list closes the sheet", (tester) async {
+ await openPicker(tester);
+
+ await tester.tap(rowFor(CryptoCurrency.xmr));
+ await tester.pumpAndSettle();
+
+ expect(walletPicks, [CryptoCurrency.xmr]);
+ expect(otherPicks, isEmpty);
+ expect(find.byType(CurrencyPickerSheet), findsNothing);
+ expect(sheetClosed, isTrue);
+ });
+
+ testWidgets("picking another asset closes the whole sheet", (tester) async {
+ await openPicker(tester);
+ await openOtherAssets(tester);
+
+ await tester.ensureVisible(rowFor(CryptoCurrency.btc));
+ await tester.pumpAndSettle();
+ await tester.tap(rowFor(CryptoCurrency.btc));
+ await tester.pumpAndSettle();
+
+ expect(otherPicks, [CryptoCurrency.btc]);
+ expect(walletPicks, isEmpty);
+ expect(find.byType(CurrencyPickerSheet), findsNothing);
+ expect(sheetClosed, isTrue);
+ });
+
+ testWidgets("picking a stablecoin network closes the whole sheet", (tester) async {
+ await openPicker(tester);
+ await openOtherAssets(tester);
+
+ await tester.tap(find.descendant(of: find.byType(PillGrid), matching: find.text("USDT")));
+ await tester.pumpAndSettle();
+ await tester.tap(find.text(walletTypeToString(WalletType.tron)));
+ await tester.pumpAndSettle();
+
+ expect(otherPicks, [CryptoCurrency.usdttrc20]);
+ expect(find.byType(CurrencyPickerSheet), findsNothing);
+ expect(sheetClosed, isTrue);
+ });
+
+ testWidgets("going back from other assets keeps the wallet list open", (tester) async {
+ await openPicker(tester);
+ await openOtherAssets(tester);
+
+ await tester.tap(find.byIcon(Icons.arrow_back_ios_new));
+ await tester.pumpAndSettle();
+
+ expect(find.byType(SingleNetworkCurrencyPicker), findsOneWidget);
+ expect(find.byType(MultiNetworkCurrencyPicker), findsNothing);
+ expect(otherPicks, isEmpty);
+ expect(sheetClosed, isFalse);
+ });
+}Why this scored 12/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.