general-fixes (#2912)

* Handle tokens bottomsheet triggering on non-evm wallets

* fix:Swith to the right fee currency when sending in bsc wallets
This commit is contained in:
David Adegoke
2026-02-17 23:35:53 +01:00
committed by GitHub
parent d96370ad90
commit 4838da68ec
3 changed files with 24 additions and 16 deletions
+2 -1
View File
@@ -1020,7 +1020,7 @@ abstract class EVMChainWalletBase
gasFee: estimatedFeesForTransaction,
priority: _credentials.priority,
currency: transactionCurrency,
feeCurrency: switch (selectedChainId) { 137 => "POL", _ => "ETH" },
feeCurrency: EVMChainUtils.getFeeCurrency(selectedChainId),
maxFeePerGas: maxFeePerGasForTransaction,
exponent: exponent,
contractAddress:
@@ -1051,6 +1051,7 @@ abstract class EVMChainWalletBase
final nativeCurrency = switch (selectedChainId) {
137 => CryptoCurrency.maticpoly,
56 => CryptoCurrency.bnb,
8453 => CryptoCurrency.baseEth,
42161 => CryptoCurrency.arbEth,
_ => CryptoCurrency.eth,
+21 -14
View File
@@ -275,22 +275,29 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
paymentRequest: paymentRequest,
fixedNetwork: fixedNetwork,
onNext: (PaymentFlowResult newResult) {
final selectedChainId = newResult.chainId;
final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
final canCheckCompatibility = evm != null &&
isEVMCompatibleChain(sendViewModel.wallet.type) &&
newResult.chainId != null;
if (isCompatible) {
sendViewModel.setSelectedCryptoCurrency(
newResult.addressDetectionResult!.detectedCurrency!.title,
);
_applyPaymentRequest(paymentRequest);
} else {
_showPaymentConfirmation(
paymentViewModel,
walletSwitcherViewModel,
paymentRequest,
newResult,
);
if (canCheckCompatibility) {
final selectedChainId = newResult.chainId!;
final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
if (isCompatible) {
sendViewModel.setSelectedCryptoCurrency(
newResult.addressDetectionResult!.detectedCurrency!.title,
);
_applyPaymentRequest(paymentRequest);
return;
}
}
_showPaymentConfirmation(
paymentViewModel,
walletSwitcherViewModel,
paymentRequest,
newResult,
);
},
);
},
@@ -163,7 +163,7 @@ class SwapConfirmationContentState extends State<SwapConfirmationContent> {
clipBehavior: Clip.none,
children: [
CakeImageWidget(
imageUrl: detectedCurrency.iconPath!,
imageUrl: detectedCurrency.iconPath ?? '',
width: 32,
height: 32,
),