mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-17 05:41:29 +02:00
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:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user