mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
c620d7f486
* feat: Solana enhancements with rent handling for accounts * fix: Add exception classes with handled error messages to ensure proper error handling process --------- Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
38 lines
1.2 KiB
Dart
38 lines
1.2 KiB
Dart
import 'package:cw_core/crypto_currency.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 implements Exception {}
|
|
|
|
class SolanaCreateAssociatedTokenAccountException implements Exception {
|
|
final String exceptionMessage;
|
|
|
|
SolanaCreateAssociatedTokenAccountException(this.exceptionMessage);
|
|
}
|
|
|
|
class SolanaSignSPLTokenTransactionRentException implements Exception {}
|
|
|
|
class SolanaNoAssociatedTokenAccountException implements Exception {
|
|
const SolanaNoAssociatedTokenAccountException(this.account, this.mint);
|
|
|
|
final String account;
|
|
final String mint;
|
|
}
|