mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
CW-1238-Solana-Fixes (#2620)
* refactor: optimize SPL token transaction and balance fetching with batch processing * fix: SPL tokens not populating all fields * fix:Solana Fixes - Optimize SPL token transactions and balance fetching - Auto Populate all fields when fetching SPL tokens - Gracefully handle errors when sending Solana tokens * fix: update wallet compatibility check in LinkViewModel * feat: add Moralis API key to secrets * Update * feat: Add error handling for invalid associated token accounts in Solana transactions * fix: Add cleaning for reown to linux ci * refactor: Update transactions after eveey batch fetch * fix: make error messages more readable --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
co-authored by
Omar Hatem
parent
9fa4584d97
commit
edcf6ffe6c
@@ -28,7 +28,7 @@ class LinkViewModel {
|
||||
|
||||
String? getRouteToGo() {
|
||||
if (isWalletConnectLink) {
|
||||
if (!isEVMCompatibleChain(appStore.wallet!.type)) {
|
||||
if (!isWalletConnectCompatibleChain(appStore.wallet!.type)) {
|
||||
_errorToast(S.current.switchToEVMCompatibleWallet);
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -1022,7 +1022,7 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
}
|
||||
|
||||
if (error is CreateAssociatedTokenAccountException) {
|
||||
return "${S.current.solana_create_associated_token_account_exception} ${S.current.added_message_for_ata_error}\n\n${error.errorMessage}";
|
||||
return "${S.current.solana_create_associated_token_account_exception} ${S.current.added_message_for_ata_error}";
|
||||
}
|
||||
|
||||
if (error is SignSPLTokenTransactionRentException) {
|
||||
@@ -1033,6 +1033,10 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
return S.current.solana_no_associated_token_account_exception;
|
||||
}
|
||||
|
||||
if (errorMessage.contains('found no record of a prior credit')) {
|
||||
return S.current.insufficient_funds_for_tx;
|
||||
}
|
||||
|
||||
if (errorMessage.contains('insufficient funds for rent') &&
|
||||
errorMessage.contains('Transaction simulation failed') &&
|
||||
errorMessage.contains('account_index')) {
|
||||
@@ -1044,6 +1048,10 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
}
|
||||
}
|
||||
|
||||
if (errorMessage.contains('invalid account data')) {
|
||||
return S.current.solana_invalid_data_message;
|
||||
}
|
||||
|
||||
return errorMessage;
|
||||
}
|
||||
if (walletType == WalletType.ethereum ||
|
||||
|
||||
Reference in New Issue
Block a user