mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-06-28 12:29:51 +00: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:
parent
e5d0194f11
commit
fe0c9ecc0e
30 changed files with 263 additions and 157 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue