| 1 | import 'package:cw_core/crypto_currency.dart'; |
| 2 | import 'package:cw_core/exceptions.dart'; |
| 3 | |
| 4 | class SolanaTransactionCreationException implements Exception { |
| 5 | final String exceptionMessage; |
| 6 | |
| 7 | SolanaTransactionCreationException(CryptoCurrency currency) |
| 8 | : exceptionMessage = 'Error creating ${currency.title} transaction.'; |
| 9 | |
| 10 | @override |
| 11 | String toString() => exceptionMessage; |
| 12 | } |
| 13 | |
| 14 | class SolanaTransactionWrongBalanceException implements Exception { |
| 15 | final String exceptionMessage; |
| 16 | |
| 17 | SolanaTransactionWrongBalanceException(CryptoCurrency currency) |
| 18 | : exceptionMessage = 'Wrong balance. Not enough ${currency.title} on your balance.'; |
| 19 | |
| 20 | @override |
| 21 | String toString() => exceptionMessage; |
| 22 | } |
| 23 | |
| 24 | class SolanaSignNativeTokenTransactionRentException |
| 25 | extends SignNativeTokenTransactionRentException {} |
| 26 | |
| 27 | class SolanaCreateAssociatedTokenAccountException extends CreateAssociatedTokenAccountException { |
| 28 | SolanaCreateAssociatedTokenAccountException(super.errorMessage); |
| 29 | } |
| 30 | |
| 31 | class SolanaSignSPLTokenTransactionRentException extends SignSPLTokenTransactionRentException {} |
| 32 | |
| 33 | class SolanaNoAssociatedTokenAccountException extends NoAssociatedTokenAccountException { |
| 34 | SolanaNoAssociatedTokenAccountException(this.account, this.mint); |
| 35 | |
| 36 | final String account; |
| 37 | final String mint; |
| 38 | } |
| 39 | |
| 40 | class SolanaAmbiguousTokenSymbolException extends AmbiguousTokenSymbolException { |
| 41 | SolanaAmbiguousTokenSymbolException(super.symbol); |
| 42 | } |