mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-23 10:45:27 +01:00
* fix android CI * fix: duplicate outgoing tx for jup swaps and stuck pending state * fix solana security risk by handling duplicate token symbols in wallet transactions * feat: implement additional cost handling for pending transactions in Solana wallet. * fix: Items on security audit list for solana wallet * refactor: streamline fee payer index handling and improve error logging * fix: verifySignature for solana and handle wrong mint on default token * fix: token decimals defaulting to zero and breaking amount parsing in solana * fix: use token mask in tx history * refactor: apply lint to modified code * fix: merge conflicts * fix: use Money and mint decimals when parsing sol swaps * test: add unit tests for SPL token amount handling and parsing * test: add more tests * fix: update decimal handling for fetched token and remove unused fields
43 lines
1.4 KiB
Dart
43 lines
1.4 KiB
Dart
import 'package:cw_core/crypto_currency.dart';
|
|
import 'package:cw_core/exceptions.dart';
|
|
|
|
class SolanaTransactionCreationException implements Exception {
|
|
final String exceptionMessage;
|
|
|
|
SolanaTransactionCreationException(CryptoCurrency currency)
|
|
: exceptionMessage = 'Error creating ${currency.title} transaction.';
|
|
|
|
@override
|
|
String toString() => exceptionMessage;
|
|
}
|
|
|
|
class SolanaTransactionWrongBalanceException implements Exception {
|
|
final String exceptionMessage;
|
|
|
|
SolanaTransactionWrongBalanceException(CryptoCurrency currency)
|
|
: exceptionMessage = 'Wrong balance. Not enough ${currency.title} on your balance.';
|
|
|
|
@override
|
|
String toString() => exceptionMessage;
|
|
}
|
|
|
|
class SolanaSignNativeTokenTransactionRentException
|
|
extends SignNativeTokenTransactionRentException {}
|
|
|
|
class SolanaCreateAssociatedTokenAccountException extends CreateAssociatedTokenAccountException {
|
|
SolanaCreateAssociatedTokenAccountException(super.errorMessage);
|
|
}
|
|
|
|
class SolanaSignSPLTokenTransactionRentException extends SignSPLTokenTransactionRentException {}
|
|
|
|
class SolanaNoAssociatedTokenAccountException extends NoAssociatedTokenAccountException {
|
|
SolanaNoAssociatedTokenAccountException(this.account, this.mint);
|
|
|
|
final String account;
|
|
final String mint;
|
|
}
|
|
|
|
class SolanaAmbiguousTokenSymbolException extends AmbiguousTokenSymbolException {
|
|
SolanaAmbiguousTokenSymbolException(super.symbol);
|
|
}
|