mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-12-01 12:04:21 +01:00
Filters out TRC10 spam transactions and modifies Solana error messages (#1587)
* fix: Tron and solana fixes * fix: Disable send all for solana wallets * fix: Add localization and add tostring to get more info on error * fix: Fix spelling for comment --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
b412d45f0e
commit
96baf460f3
@@ -216,7 +216,7 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
|
||||
onTapPicker: () => _presentPicker(context),
|
||||
isPickerEnable: sendViewModel.hasMultipleTokens,
|
||||
tag: sendViewModel.selectedCryptoCurrency.tag,
|
||||
allAmountButton: !sendViewModel.isBatchSending,
|
||||
allAmountButton: !sendViewModel.isBatchSending && sendViewModel.shouldDisplaySendALL,
|
||||
currencyValueValidator: output.sendAll
|
||||
? sendViewModel.allAmountValidator
|
||||
: sendViewModel.amountValidator,
|
||||
|
||||
@@ -118,7 +118,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
@computed
|
||||
bool get isBatchSending => outputs.length > 1;
|
||||
|
||||
bool get shouldDisplaySendALL => walletType != WalletType.solana || walletType != WalletType.tron;
|
||||
bool get shouldDisplaySendALL => walletType != WalletType.solana;
|
||||
|
||||
@computed
|
||||
String get pendingTransactionFiatAmount {
|
||||
@@ -582,9 +582,15 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
) {
|
||||
String errorMessage = error.toString();
|
||||
|
||||
if (walletType == WalletType.solana) {
|
||||
if (errorMessage.contains('insufficient funds for rent')) {
|
||||
return S.current.insufficientFundsForRentError;
|
||||
}
|
||||
|
||||
return errorMessage;
|
||||
}
|
||||
if (walletType == WalletType.ethereum ||
|
||||
walletType == WalletType.polygon ||
|
||||
walletType == WalletType.solana ||
|
||||
walletType == WalletType.haven) {
|
||||
if (errorMessage.contains('gas required exceeds allowance') ||
|
||||
errorMessage.contains('insufficient funds')) {
|
||||
|
||||
Reference in New Issue
Block a user