mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
CW-1084: Solana Issues (#2305)
* fix(solana-issues): Fix missing solana transaction history entries * fix(solana-issues): Fixes issues relating to Solana Transaction History This change: - Modifies transaction parsing logic to handle more scenarios and better parse Solana transaction data. - Adds partial filter for spam transactions * fix(solana-issues): Enhance transaction parsing for Associated Token Account (ATA) programs This change: - Adds logic to differentiate between create account and token transfer transactions for the ATA program. - Introduces a check to skip transactions that only create accounts without associated token transfers. * fix(solana-issues): Improve transaction update logic and enhance error handling This change: - Updates the transaction update callback to only trigger when new valid transactions are present. - Enhances error handling for insufficient funds by distinguishing between errors for sender and receiver.
This commit is contained in:
@@ -767,8 +767,15 @@ abstract class SendViewModelBase extends WalletChangeListenerViewModel with Stor
|
||||
return S.current.solana_no_associated_token_account_exception;
|
||||
}
|
||||
|
||||
if (errorMessage.contains('insufficient funds for rent')) {
|
||||
return S.current.insufficientFundsForRentError;
|
||||
if (errorMessage.contains('insufficient funds for rent') &&
|
||||
errorMessage.contains('Transaction simulation failed') &&
|
||||
errorMessage.contains('account_index')) {
|
||||
final accountIndexMatch = RegExp(r'account_index: (\d+)').firstMatch(errorMessage);
|
||||
if (accountIndexMatch != null) {
|
||||
return int.parse(accountIndexMatch.group(1)!) == 0
|
||||
? S.current.insufficientFundsForRentError
|
||||
: S.current.insufficientFundsForRentErrorReceiver;
|
||||
}
|
||||
}
|
||||
|
||||
return errorMessage;
|
||||
|
||||
Reference in New Issue
Block a user