general-fixes (#2912)
* Handle tokens bottomsheet triggering on non-evm wallets * fix:Swith to the right fee currency when sending in bsc wallets
David Adegoke committed
Feb 17, 2026 at 23:35 UTC
4838da68ec55dca248697b542105ae99a0f5db04
3 files changed
+24
-16
cw_evm/lib/evm_chain_wallet.dart
+2
-1
@@ -1020,7 +1020,7 @@ abstract class EVMChainWalletBase
1020
gasFee: estimatedFeesForTransaction,
1021
priority: _credentials.priority,
1022
currency: transactionCurrency,
1023
- feeCurrency: switch (selectedChainId) { 137 => "POL", _ => "ETH" },
1023
+ feeCurrency: EVMChainUtils.getFeeCurrency(selectedChainId),
1024
maxFeePerGas: maxFeePerGasForTransaction,
1025
exponent: exponent,
1026
contractAddress:
@@ -1051,6 +1051,7 @@ abstract class EVMChainWalletBase
1051
1052
final nativeCurrency = switch (selectedChainId) {
1053
137 => CryptoCurrency.maticpoly,
1054
+ 56 => CryptoCurrency.bnb,
1055
8453 => CryptoCurrency.baseEth,
1056
42161 => CryptoCurrency.arbEth,
1057
_ => CryptoCurrency.eth,
lib/src/screens/send/widgets/send_card.dart
+21
-14
@@ -275,22 +275,29 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
275
paymentRequest: paymentRequest,
276
fixedNetwork: fixedNetwork,
277
onNext: (PaymentFlowResult newResult) {
278
- final selectedChainId = newResult.chainId;
279
- final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
278
+ final canCheckCompatibility = evm != null &&
279
+ isEVMCompatibleChain(sendViewModel.wallet.type) &&
280
+ newResult.chainId != null;
281
281
- if (isCompatible) {
282
- sendViewModel.setSelectedCryptoCurrency(
283
- newResult.addressDetectionResult!.detectedCurrency!.title,
284
- );
285
- _applyPaymentRequest(paymentRequest);
286
- } else {
287
- _showPaymentConfirmation(
288
- paymentViewModel,
289
- walletSwitcherViewModel,
290
- paymentRequest,
291
- newResult,
292
- );
282
+ if (canCheckCompatibility) {
283
+ final selectedChainId = newResult.chainId!;
284
+ final isCompatible = selectedChainId == evm!.getSelectedChainId(sendViewModel.wallet);
285
+
286
+ if (isCompatible) {
287
+ sendViewModel.setSelectedCryptoCurrency(
288
+ newResult.addressDetectionResult!.detectedCurrency!.title,
289
+ );
290
+ _applyPaymentRequest(paymentRequest);
291
+ return;
292
+ }
293
}
294
+
295
+ _showPaymentConfirmation(
296
+ paymentViewModel,
297
+ walletSwitcherViewModel,
298
+ paymentRequest,
299
+ newResult,
300
+ );
301
},
302
);
303
},
lib/src/widgets/bottom_sheet/swap_confirmation_bottom_sheet.dart
+1
-1
@@ -163,7 +163,7 @@ class SwapConfirmationContentState extends State<SwapConfirmationContent> {
163
clipBehavior: Clip.none,
164
children: [
165
CakeImageWidget(
166
- imageUrl: detectedCurrency.iconPath!,
166
+ imageUrl: detectedCurrency.iconPath ?? '',
167
width: 32,
168
height: 32,
169
),