| 1 | import 'package:cw_core/crypto_currency.dart'; |
| 2 | |
| 3 | class TransactionWrongBalanceException implements Exception { |
| 4 | TransactionWrongBalanceException(this.currency, {this.amount}); |
| 5 | |
| 6 | final CryptoCurrency currency; |
| 7 | final int? amount; |
| 8 | } |
| 9 | |
| 10 | class TransactionNoInputsException implements Exception {} |
| 11 | |
| 12 | class TransactionNoFeeException implements Exception {} |
| 13 | |
| 14 | class TransactionNoDustException implements Exception {} |
| 15 | |
| 16 | class TransactionNoDustOnChangeException implements Exception { |
| 17 | TransactionNoDustOnChangeException(this.max, this.min); |
| 18 | |
| 19 | final String max; |
| 20 | final String min; |
| 21 | } |
| 22 | |
| 23 | class TransactionCommitFailed implements Exception { |
| 24 | final String? errorMessage; |
| 25 | |
| 26 | TransactionCommitFailed({this.errorMessage}); |
| 27 | |
| 28 | @override |
| 29 | String toString() => errorMessage ?? "unknown error"; |
| 30 | } |
| 31 | |
| 32 | class TransactionCommitFailedDustChange implements Exception {} |
| 33 | |
| 34 | class TransactionCommitFailedDustOutput implements Exception {} |
| 35 | |
| 36 | class TransactionCommitFailedDustOutputSendAll implements Exception {} |
| 37 | |
| 38 | class TransactionCommitFailedVoutNegative implements Exception {} |
| 39 | |
| 40 | class TransactionCommitFailedBIP68Final implements Exception {} |
| 41 | |
| 42 | class TransactionCommitFailedLessThanMin implements Exception {} |
| 43 | |
| 44 | class TransactionInputNotSupported implements Exception {} |
| 45 | |
| 46 | class SignNativeTokenTransactionRentException implements Exception {} |
| 47 | |
| 48 | class CreateAssociatedTokenAccountException implements Exception { |
| 49 | final String errorMessage; |
| 50 | |
| 51 | CreateAssociatedTokenAccountException(this.errorMessage); |
| 52 | } |
| 53 | |
| 54 | class SignSPLTokenTransactionRentException implements Exception {} |
| 55 | |
| 56 | class NoAssociatedTokenAccountException implements Exception {} |
| 57 | |
| 58 | class AmbiguousTokenSymbolException implements Exception { |
| 59 | AmbiguousTokenSymbolException(this.symbol); |
| 60 | |
| 61 | final String symbol; |
| 62 | } |
| 63 | |
| 64 | class RestoreFromSeedException implements Exception { |
| 65 | final String message; |
| 66 | |
| 67 | RestoreFromSeedException(this.message); |
| 68 | } |
| 69 | |
| 70 | class WalletDeprecationException implements Exception { |
| 71 | final String seed; |
| 72 | final CryptoCurrency curr; |
| 73 | |
| 74 | @override |
| 75 | String toString() => "Wallet type no longer supported"; |
| 76 | |
| 77 | WalletDeprecationException({required this.seed, required this.curr}); |
| 78 | } |
| 79 | |
| 80 | class WalletSwitchException implements Exception { |
| 81 | WalletSwitchException(this.message); |
| 82 | |
| 83 | final String message; |
| 84 | |
| 85 | @override |
| 86 | String toString() => message; |
| 87 | } |